/* ============================================================
   Olive & Finch — Menu Trainer
   Design system. Colors centralized as custom properties;
   components use semantic class names.
   ============================================================ */

:root {
  /* Brand palette (sampled from the Uptown menu) */
  --teal-900: #112b34;
  --teal-800: #163a47;
  --teal-700: #1c4a5a;
  --teal-500: #2b6477;
  --teal-300: #7fa9b6;
  --teal-100: #dcebef;
  --teal-050: #eef5f7;

  --yellow:      #f5c518;
  --yellow-deep: #e0a900;
  --yellow-soft: #fdf3cf;

  --cream:  #faf6ee;
  --paper:  #ffffff;
  --ink:    #112b34;
  --muted:  #5d7178;
  --line:   #e7e0d2;

  --correct:     #2e8b57;
  --correct-bg:  #e4f4ea;
  --wrong:       #c0392b;
  --wrong-bg:    #fbe6e3;

  /* Roles */
  --bg: var(--cream);
  --accent: var(--yellow);
  --accent-ink: var(--teal-900);

  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow:    0 6px 22px rgba(17, 43, 52, 0.10);
  --shadow-sm: 0 2px 8px rgba(17, 43, 52, 0.08);
  --shadow-lg: 0 16px 40px rgba(17, 43, 52, 0.18);

  --font-display: "Anton", "Oswald", "Impact", "Haettenschweiler", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --header-h: 60px;
  --nav-h: 64px;
  --maxw: 560px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

/* Subtle brand texture behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(245, 197, 24, 0.10), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(27, 74, 90, 0.08), transparent 55%);
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- Layout scaffolding ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-h) + env(safe-area-inset-top));
  background: var(--teal-900);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.app-header .brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.app-header .brand-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--yellow);
}
.app-header .brand-mark svg { width: 24px; height: 24px; display: block; }

.app-header .brand-text { display: flex; flex-direction: column; line-height: 1; }
.app-header .brand-text .wordmark {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  font-size: 18px;
  text-transform: uppercase;
}
.app-header .brand-text .subline {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal-300);
  margin-top: 2px;
}

.header-stat {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
}
.header-stat .stat {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px;
}
.header-stat .stat .ico { font-size: 15px; }
.header-stat .stat.streak { color: var(--yellow); }

.app-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}

/* ---------- Bottom navigation ---------- */

.app-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--line);
}
.app-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.app-nav a .ico { font-size: 21px; line-height: 1; }
.app-nav a.active { color: var(--teal-700); }
.app-nav a.active .ico { transform: translateY(-1px); }
.app-nav a.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 34px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--yellow);
}

/* ---------- Typography helpers ---------- */

.screen-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 30px;
  line-height: 1.04;
  margin: 4px 0 2px;
}
.screen-sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

.section-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal-700);
  font-size: 15px;
  margin: 22px 2px 10px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- Cards ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Home hero / progress */
.hero {
  background: linear-gradient(155deg, var(--teal-800), var(--teal-900));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(245,197,24,0.22), transparent 70%);
}
.hero .greeting { font-size: 13px; color: var(--teal-300); letter-spacing: 0.04em; }
.hero .level-name { font-family: var(--font-display); font-size: 24px; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }
.hero .level-line { font-size: 12.5px; color: var(--teal-100); margin-top: 6px; }

.xpbar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.18);
  margin-top: 9px;
  overflow: hidden;
}
.xpbar > span { display: block; height: 100%; border-radius: 99px; background: var(--yellow); transition: width .5s ease; }

/* Progress ring */
.ring { flex: 0 0 auto; position: relative; width: 86px; height: 86px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
}
.ring .ring-num { font-family: var(--font-display); font-size: 22px; }
.ring .ring-cap { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-300); margin-top: 3px; }

/* Mode grid */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 120px;
  color: var(--ink);
}
.mode-card:active { transform: scale(0.98); }
.mode-card .mode-ico {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--teal-050);
}
.mode-card.feature { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; background: linear-gradient(120deg, var(--yellow-soft), var(--paper)); border-color: var(--yellow); }
.mode-card.feature .mode-ico { background: var(--yellow); }
.mode-card .mode-name { font-weight: 800; font-size: 16px; }
.mode-card .mode-desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.mode-card .mode-tag { font-size: 11px; color: var(--teal-700); font-weight: 700; }

/* ---------- Buttons ---------- */

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--teal-700); color: #fff; }
.btn-primary:hover { background: var(--teal-800); }
.btn-accent { background: var(--yellow); color: var(--teal-900); }
.btn-accent:hover { background: var(--yellow-deep); }
.btn-ghost { background: transparent; color: var(--teal-700); border: 1.5px solid var(--line); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 16px; }
.btn-sm { padding: 9px 14px; font-size: 13px; }

.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }

/* ---------- Chips / badges ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal-050);
  color: var(--teal-800);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--teal-100);
}
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }

.badge {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px;
}
.badge-diet { background: var(--correct-bg); color: var(--correct); }
.badge-hot { background: var(--wrong-bg); color: var(--wrong); }
.badge-cold { background: var(--teal-050); color: var(--teal-700); }
.badge-cat { background: var(--yellow-soft); color: var(--yellow-deep); }

.price-tag {
  font-family: var(--font-display);
  color: var(--teal-700);
  font-size: 18px;
  letter-spacing: 0.02em;
}

/* ---------- Flashcards ---------- */

.deck-area { display: flex; flex-direction: column; align-items: center; }

.flashcard {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  max-height: 62vh;
  perspective: 1400px;
  margin: 6px auto 18px;
}
.flashcard .inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .55s cubic-bezier(.2,.7,.2,1);
  transform-style: preserve-3d;
}
.flashcard.flipped .inner { transform: rotateY(180deg); }
.flashcard .face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.flashcard .front {
  background: linear-gradient(160deg, var(--teal-800), var(--teal-900));
  color: #fff;
  align-items: center; justify-content: center; text-align: center;
}
.flashcard .front .cat-eyebrow { color: var(--yellow); letter-spacing: 0.18em; text-transform: uppercase; font-size: 12px; font-weight: 700; }
.flashcard .front .dish-name { font-family: var(--font-display); text-transform: uppercase; font-size: 38px; line-height: 1.02; letter-spacing: 0.02em; margin: 12px 0; }
.flashcard .front .tap-hint { position: absolute; bottom: 18px; font-size: 12px; color: var(--teal-300); }
.flashcard .back {
  background: var(--paper);
  transform: rotateY(180deg);
  color: var(--ink);
}
.flashcard .back .back-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.flashcard .back .back-name { font-weight: 800; font-size: 19px; }
.flashcard .back .back-body { overflow-y: auto; }
.flashcard .back .field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 12px 0 6px; }

.deck-progress { width: 100%; max-width: 420px; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.deck-progress .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.deck-progress .bar > span { display: block; height: 100%; background: var(--teal-500); border-radius: 99px; transition: width .35s ease; }

.rate-row { display: flex; gap: 10px; width: 100%; max-width: 420px; }
.rate-row .btn { flex: 1; }
.btn-again { background: var(--wrong-bg); color: var(--wrong); }
.btn-good { background: var(--correct-bg); color: var(--correct); }

/* ---------- Quiz ---------- */

.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.quiz-top .qcount { font-weight: 800; font-size: 14px; white-space: nowrap; }
.quiz-top .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.quiz-top .bar > span { display: block; height: 100%; background: var(--yellow); transition: width .35s ease; }

.q-type { text-align: center; }
.q-prompt {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 18px;
  text-align: center;
  margin-bottom: 16px;
}
.q-prompt .q-kicker { color: var(--teal-700); font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }
.q-prompt .q-text { font-size: 21px; font-weight: 800; margin-top: 8px; line-height: 1.25; }
.q-prompt .q-sub { color: var(--muted); font-size: 14px; margin-top: 8px; line-height: 1.4; }

.choices { display: grid; gap: 10px; }
.choice {
  text-align: left;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
  transition: border-color .12s ease, background .12s ease, transform .1s ease;
}
.choice:active { transform: scale(0.99); }
.choice .pick { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; border: 2px solid var(--teal-100); display: grid; place-items: center; font-size: 14px; font-weight: 800; color: var(--teal-700); }
.choice.correct { border-color: var(--correct); background: var(--correct-bg); }
.choice.correct .pick { border-color: var(--correct); background: var(--correct); color: #fff; }
.choice.wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.choice.wrong .pick { border-color: var(--wrong); background: var(--wrong); color: #fff; }
.choice.dim { opacity: 0.5; }
.choice[disabled] { cursor: default; }

.q-feedback {
  margin-top: 16px;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  display: none;
  /* keep the action button clear of the fixed bottom nav after scrollIntoView */
  scroll-margin-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
.q-feedback.show { display: block; }
.q-feedback.good { background: var(--correct-bg); color: #1d5f3a; }
.q-feedback.bad { background: var(--wrong-bg); color: #8e2b20; }
.q-feedback b { font-weight: 800; }
.q-feedback .bd-line { margin-top: 8px; line-height: 1.45; }
.q-feedback .bd-label { font-weight: 800; }

/* Item image with a provenance badge (confirmed Photo vs AI Illustration) */
.img-wrap { position: relative; }
.img-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
}
.img-badge.photo { background: rgba(28, 74, 90, 0.9); }
.img-badge.illustration { background: rgba(17, 43, 52, 0.66); }

/* Ingredient icon tiles (full-bleed macro swatch + label) */
.ing-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.ing { width: 64px; text-align: center; }
.ing-swatch {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.ing-swatch.placeholder { background: var(--teal-050); border: 1px solid var(--line); box-shadow: none; }
.ing-label { font-size: 11px; color: var(--ink); margin-top: 5px; line-height: 1.15; }

/* Learn walk chrome: breadcrumb + fixed Back/progress/Next row */
.crumb { display: flex; align-items: center; gap: 7px; font-size: 14px; margin-bottom: 10px; }
.crumb-link { color: var(--ink); font-weight: 400; font-family: inherit; font-size: inherit; background: none; border: 0; padding: 6px 4px; margin: -6px -4px; cursor: pointer; }
.crumb-sep { color: var(--muted); }
.crumb-cur { color: var(--ink); font-weight: 800; }
.walk-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.walk-arrows { display: flex; gap: 6px; }
.walk-arrow {
  width: 44px; height: 44px; border-radius: 10px;
  border: 1.5px solid var(--line); background: transparent;
  color: var(--teal-700); font-size: 20px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.walk-arrow:disabled { opacity: 0.35; }
.walk-progress { flex: 1; margin: 0; }
.walk-btn { white-space: nowrap; border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700; border: 1.5px solid var(--line); }
.walk-btn.accent { background: var(--yellow); color: var(--teal-900); border-color: var(--yellow); }

/* card title spacing under the category eyebrow */
.card-title { margin-top: 6px; }
.card-photo { margin: 14px 0 1em; background: var(--teal-050); border-radius: 14px; }

/* price overlaid on the photo, top-right */
.price-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  text-align: right;
  background: rgba(17, 43, 52, 0.82);
  color: #fff;
  border-radius: 12px;
  padding: 7px 12px;
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.01em;
}
.price-overlay .po-line { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; line-height: 1.15; }
.price-overlay .po-size { font-family: inherit; font-size: 11px; opacity: 0.85; font-weight: 400; letter-spacing: 0.04em; }
.price-overlay .po-amt { font-size: 22px; }

/* attribute pills under the photo */
.attr-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0.75em; }
.attr-pill {
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: var(--teal-050); color: var(--teal-800); border: 1px solid var(--teal-100);
}

/* grouped ingredients — two columns since most groups have 1–2 items */
.ing-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; align-items: start; }
.ing-group { margin-bottom: 6px; }
.ing-group.span2 { grid-column: 1 / -1; }
.ing-group-label { font-size: 12px; font-weight: 800; color: var(--teal-700); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.sides-label { margin-top: 14px; }
.ing-note { font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.1; }
.ing-price { font-size: 10px; color: var(--teal-700); font-weight: 700; margin-top: 2px; }

/* sides row with and/or connectors (OR sized small, centered on the swatch) */
.sides-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.side-conn { align-self: flex-start; height: 48px; line-height: 48px; font-size: 13px; font-weight: 800; color: var(--muted); margin: 0 -1px; }

/* clue ingredient tiles inside a quiz question frame */
.q-clues { justify-content: center; margin-top: 12px; }

/* "what it is" explainer bullets (coffee drinks) */
.about-list { margin: 4px 0 2px; padding-left: 18px; }
.about-list li { font-size: 14px; line-height: 1.45; margin-bottom: 3px; color: var(--ink); }

/* customization rows */
.mod-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); }
.mod-row .mod-price { font-weight: 700; color: var(--teal-700); }

/* ---------- Expo Rush ---------- */

.expo-hud { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.expo-hud .hud-item { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; }
.expo-hud .lives { color: var(--wrong); letter-spacing: 2px; }
.expo-hud .score { margin-left: auto; }
.timer-bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 16px; }
.timer-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--correct), var(--yellow)); border-radius: 99px; transition: width .25s linear; }
.timer-bar.danger > span { background: var(--wrong); }

.ticket {
  background: var(--paper);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
  border-top: 6px solid var(--teal-700);
  position: relative;
  background-image: repeating-linear-gradient(var(--paper), var(--paper) 26px, #f3eee3 27px);
}
.ticket .ticket-h { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-size: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.ticket .ticket-dish { font-family: var(--font-display); text-transform: uppercase; font-size: 26px; letter-spacing: 0.02em; }
.ticket .ticket-q { color: var(--muted); font-size: 13px; margin-top: 4px; }

.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile-grid.shake { animation: tile-shake .32s ease; }
@keyframes tile-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
/* Plate Check: armed two-tap quit + "how it works" intro list */
.back-link.arm { color: var(--wrong); font-weight: 700; }
.plate-how { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 5px; }
.plate-how li { font-size: 13px; color: var(--muted); line-height: 1.4; }
.plate-how li b { color: var(--ink); font-weight: 700; }
.tile {
  text-align: center;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, border-color .1s ease, background .1s ease, opacity .15s ease;
  min-height: 52px;
}
.tile:active { transform: scale(0.96); }
.tile.picked { border-color: var(--teal-500); background: var(--teal-050); }
.tile.right { border-color: var(--correct); background: var(--correct-bg); color: #1d5f3a; }
.tile.bad { border-color: var(--wrong); background: var(--wrong-bg); color: #8e2b20; }
/* After reveal, tiles that were neither correct nor wrongly picked recede so
   the right/bad signal reads clearly. */
.tile[disabled] { cursor: default; box-shadow: none; opacity: 0.5; }
.tile[disabled].right, .tile[disabled].bad { opacity: 1; }

.fire { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ---------- Browse / menu list ---------- */

.search {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 13px 18px;
  font-size: 15px;
  background: var(--paper);
  margin-bottom: 8px;
}
.search:focus { outline: none; border-color: var(--teal-500); }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 12px; -webkit-overflow-scrolling: touch; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  white-space: nowrap;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}
.filter-chip.active { background: var(--teal-700); color: #fff; border-color: var(--teal-700); }

/* Location picker (home) */
.loc-picker { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.loc-picker .loc-pin { font-size: 15px; }
.loc-select {
  flex: 1;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 38px 11px 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  /* chevron */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%231c4a5a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.loc-select:focus { outline: none; border-color: var(--teal-500); }

.menu-item {
  display: flex; align-items: baseline; gap: 12px;
  width: 100%; text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
  color: var(--ink);
}
.menu-item .mi-main { flex: 1; min-width: 0; }
.menu-item .mi-name { font-weight: 800; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu-item .mi-ing { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.35; }
.menu-item .mi-price { white-space: nowrap; }

/* Detail */
.detail-head { margin-bottom: 6px; }
.detail-name { font-family: var(--font-display); text-transform: uppercase; font-size: 30px; letter-spacing: 0.02em; line-height: 1.05; }
.detail-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; margin: 10px 0 4px; }
.price-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.price-pill { background: var(--teal-050); border: 1px solid var(--teal-100); border-radius: 10px; padding: 8px 12px; }
.price-pill .pp-size { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.price-pill .pp-amt { font-family: var(--font-display); color: var(--teal-700); font-size: 17px; }

/* ---------- Results ---------- */

.results { text-align: center; padding-top: 10px; }
.results .big-score { font-family: var(--font-display); font-size: 64px; color: var(--teal-700); line-height: 1; }
.results .big-score.low { color: var(--wrong); }
.results .verdict { font-size: 20px; font-weight: 800; margin: 8px 0 4px; }
.results .blurb { color: var(--muted); margin-bottom: 18px; }
.result-stats { display: flex; justify-content: center; gap: 26px; margin: 18px 0 24px; }
.result-stats .rs { display: flex; flex-direction: column; }
.result-stats .rs .n { font-family: var(--font-display); font-size: 26px; }
.result-stats .rs .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.miss-list { text-align: left; margin: 14px 0; }

/* ---------- Pickers / setup screens ---------- */
.option-list { display: grid; gap: 10px; margin: 4px 0 20px; }
.option-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 15px 16px; text-align: left; color: var(--ink);
}
.option-row .opt-ico { font-size: 24px; }
.option-row .opt-main { flex: 1; }
.option-row .opt-name { font-weight: 800; font-size: 15.5px; }
.option-row .opt-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.option-row .opt-meta { color: var(--teal-700); font-weight: 800; font-size: 13px; }
.option-row.selected { border-color: var(--teal-500); background: var(--teal-050); }

/* ---------- Misc ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 14px; background: none; border: none; padding: 12px 10px; margin: -12px -10px -2px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.center-col { display: flex; flex-direction: column; gap: 12px; }
.spacer { height: 12px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%) translateY(20px);
  background: var(--teal-900); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; transition: all .3s ease; z-index: 50; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.confetti-piece { position: fixed; width: 9px; height: 14px; top: -20px; z-index: 60; pointer-events: none; border-radius: 2px; }

@media (min-width: 480px) {
  .screen-title { font-size: 34px; }
  .flashcard .front .dish-name { font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.05ms !important; }
}
