/* =========================================================
   CHEF SNACK — evening palette, mobile-first
   ========================================================= */

:root {
  --bg-deep: #0b1530;
  --bg-mid: #1a2950;
  --bg-card: #2a3960;
  --accent-warm: #ffb547;
  --accent-glow: #ffd28a;
  --text-cream: #f6efe1;
  --text-muted: #b8c0d8;
  --safe: #6dd3a0;
  --stretch: #f7c365;
  --new: #f78cb5;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, "SF Pro Rounded", "Segoe UI", system-ui, "Helvetica Neue", sans-serif;
  background: linear-gradient(180deg, #0b1530 0%, #1a2950 70%, #2a3960 100%);
  background-attachment: fixed;
  color: var(--text-cream);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* starry background dots */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 20%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 60% 30%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 80% 70%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 30% 80%, rgba(255,210,138,0.7), transparent),
    radial-gradient(1px 1px at 12% 60%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 90% 15%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 45% 50%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 70% 88%, rgba(255,255,255,0.5), transparent);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 100px;
}

/* =========================================================
   CLAWD HEADER
   ========================================================= */

.clawd-header {
  text-align: center;
  margin-bottom: 8px;
}

.clawd-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, #87ceeb 0%, #b0e0f0 100%);
  display: inline-block;
  position: relative;
  border: 5px solid var(--accent-warm);
  box-shadow: 0 6px 24px rgba(255,181,71,0.35), inset 0 -8px 16px rgba(0,0,0,0.05);
  overflow: hidden;
}

.clawd-img.greeting {
  animation: clawd-wave 3.4s ease-in-out infinite;
}

.clawd-img.dancing {
  animation: clawd-dance 0.55s ease-in-out infinite;
}

.clawd-img img,
.clawd-img svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes clawd-wave {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

@keyframes clawd-dance {
  0%, 100% { transform: translateY(0) rotate(-6deg) scale(1); }
  50% { transform: translateY(-12px) rotate(6deg) scale(1.06); }
}

/* =========================================================
   SPEECH BUBBLE
   ========================================================= */

.speech-bubble {
  background: var(--text-cream);
  color: #2a2a2a;
  padding: 14px 20px;
  border-radius: 22px;
  margin: 16px auto 0;
  max-width: 320px;
  font-size: 17px;
  line-height: 1.4;
  position: relative;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  animation: bubble-in 0.5s ease-out;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 12px solid var(--text-cream);
}

@keyframes bubble-in {
  0% { opacity: 0; transform: translateY(8px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   TONIGHT TITLE
   ========================================================= */

.tonight-title {
  text-align: center;
  margin: 28px 0 18px;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-glow);
  letter-spacing: 0.3px;
}

/* =========================================================
   SNACK CARDS
   ========================================================= */

.snack-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.snack-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 110px;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.snack-card:active {
  transform: scale(0.97);
}

.snack-card.picked {
  border-color: var(--accent-warm);
  background: linear-gradient(135deg, #2a3960 0%, #3d4f7e 100%);
  box-shadow: 0 0 28px rgba(255,181,71,0.45);
}

.snack-card.picked::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 14px;
  background: var(--accent-warm);
  color: #1a1a1a;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 19px;
  animation: stamp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes stamp {
  0% { transform: scale(0) rotate(-30deg); }
  60% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}

.snack-emoji {
  font-size: 56px;
  line-height: 1;
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  background: rgba(255,255,255,0.06);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.snack-photo {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  object-fit: cover;
  flex-shrink: 0;
}

.snack-info {
  flex: 1;
  min-width: 0;
}

.snack-name {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.15;
}

.snack-tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.snack-tag.safe { background: var(--safe); color: #06301c; }
.snack-tag.stretch { background: var(--stretch); color: #4a2f00; }
.snack-tag.new { background: var(--new); color: #4a0d28; }

/* =========================================================
   COMBO HINT (after first pick)
   ========================================================= */

.combo-hint {
  text-align: center;
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(255,181,71,0.15);
  border: 2px dashed var(--accent-warm);
  border-radius: 16px;
  color: var(--accent-glow);
  font-size: 15px;
  font-weight: 700;
  animation: hint-pulse 1.4s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* =========================================================
   ALBUM
   ========================================================= */

.album-button {
  display: block;
  margin: 26px auto 0;
  background: rgba(255,255,255,0.08);
  color: var(--text-cream);
  border: 2px solid rgba(255,255,255,0.15);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}

.album-button:active { transform: scale(0.96); }

.album-count {
  display: inline-block;
  background: var(--accent-warm);
  color: #1a1a1a;
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 800;
}

.album-modal {
  position: fixed;
  inset: 0;
  background: rgba(11,21,48,0.97);
  z-index: 100;
  overflow-y: auto;
  display: none;
  padding: 28px 20px 40px;
}

.album-modal.open { display: block; }

.album-modal h2 {
  text-align: center;
  color: var(--accent-glow);
  margin: 8px 0 24px;
  font-size: 22px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.album-item {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 12px 8px;
  text-align: center;
}

.album-item .em {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 6px;
}

.album-item .nm {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-cream);
}

.album-item .ct {
  margin-top: 4px;
  font-size: 11px;
  color: var(--accent-glow);
  font-weight: 800;
}

.album-close {
  display: block;
  margin: 28px auto 0;
  background: var(--accent-warm);
  color: #1a1a1a;
  border: none;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* =========================================================
   SUPER COMBO
   ========================================================= */

.super-combo {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  pointer-events: none;
}

.super-combo.active { display: flex; }

.super-combo-text {
  font-size: 64px;
  font-weight: 900;
  color: var(--accent-warm);
  text-shadow: 0 0 28px var(--accent-glow), 0 4px 14px rgba(0,0,0,0.6);
  letter-spacing: -1px;
  text-align: center;
  animation: combo-burst 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 0.95;
}

@keyframes combo-burst {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.confetti {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 199;
  animation: confetti-fall 2s ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* =========================================================
   DONE STATE
   ========================================================= */

.done-state {
  text-align: center;
  margin-top: 24px;
  padding: 22px;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  animation: bubble-in 0.5s ease-out;
}

.done-state .moon {
  font-size: 38px;
  display: block;
  margin-bottom: 6px;
}

/* =========================================================
   DAD MODE TOGGLE (?dad=1)
   ========================================================= */

.dad-toggle {
  position: fixed;
  bottom: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 50;
  color: var(--text-cream);
}

/* =========================================================
   COMBO BUTTON — "pick both" for non-readers
   ========================================================= */

.combo-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin-top: 18px;
  padding: 18px 16px;
  border: 4px solid var(--accent-warm);
  border-radius: 24px;
  background: linear-gradient(135deg, #ffb547 0%, #ffd28a 50%, #ffb547 100%);
  background-size: 200% 200%;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(255, 181, 71, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-user-select: none;
  font-weight: 800;
  animation: combo-pulse 2.2s ease-in-out infinite, combo-shimmer 3.5s ease infinite;
  transition: transform 0.2s ease;
  min-height: 100px;
}

.combo-button[hidden] {
  display: none;
}

.combo-button:active {
  transform: scale(0.97);
  animation: none;
}

.combo-spark {
  font-size: 30px;
  line-height: 1;
  display: inline-block;
  animation: spark-spin 2s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

.combo-emoji {
  font-size: 50px;
  line-height: 1;
  display: inline-block;
}

.combo-snack-photo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.combo-plus {
  font-size: 38px;
  font-weight: 900;
  color: #4a2f00;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

@keyframes combo-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 24px rgba(255, 181, 71, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 40px rgba(255, 181, 71, 0.75), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

@keyframes combo-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes spark-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}
