:root {
  --bg: #FBF7F1;
  --card: #FFFFFF;
  --ink: #1B1712;
  --soft: #6F655A;
  --line: #EAE2D6;
  --accent: #E4572E;
  --yes: #E0457B;
  --no: #8A7F74;
  --oops: #C0392B;
  --food-ink: #2B1D14;
  --shadow: 0 1px 2px rgba(40, 25, 10, .06), 0 10px 30px rgba(40, 25, 10, .10);
  --display: "Baloo 2", ui-rounded, ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, -apple-system, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141110; --card: #1F1B19; --ink: #F5EFE8; --soft: #A69B90; --line: #2E2825;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141110; --card: #1F1B19; --ink: #F5EFE8; --soft: #A69B90; --line: #2E2825;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }
header.top { display: flex; align-items: center; justify-content: space-between; height: 64px; padding-top: env(safe-area-inset-top); }
.brand { font: 800 24px/1 var(--display); letter-spacing: -.01em; text-decoration: none; color: var(--accent); }
footer { padding: 48px 0 32px; font-size: 14px; color: var(--soft); }
footer a { text-underline-offset: 3px; }

/* ---------- home ---------- */
.home h1 { font: 800 clamp(48px, 14vw, 76px)/.95 var(--display); letter-spacing: -.02em; margin: 40px 0 32px; }
.game-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.game-list a { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.game-list .mark { width: 56px; height: 56px; border-radius: 16px; flex: none; display: grid; place-items: center; background: var(--accent); color: #fff; font: 800 22px/1 var(--display); }
.game-list b { display: block; font: 700 21px/1.2 var(--display); letter-spacing: -.01em; }
.game-list span { color: var(--soft); font-size: 15px; }
.game-list a:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- game screens ---------- */
.game { min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip; }
.intro { min-height: calc(100dvh - 84px); }
.more { padding-top: 8px; }
.more h2 { margin-top: 0; }
.game main { flex: 1; display: flex; flex-direction: column; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.screen { flex: 1; display: flex; flex-direction: column; }
.screen:not([hidden]) { animation: enter .3s cubic-bezier(.2,.8,.2,1); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.game h1 { font: 800 clamp(44px, 13vw, 68px)/.95 var(--display); letter-spacing: -.02em; margin: 0; }
.game h2 { font: 800 clamp(30px, 9vw, 44px)/1 var(--display); letter-spacing: -.015em; margin: 8px 0 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 58px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 650; font-size: 18px; text-decoration: none;
  transition: transform .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.quiet { background: transparent; color: var(--ink); border: 1px solid var(--line); }

/* start */
.intro { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding-bottom: 10vh; }
.intro p { margin: 0; font-size: 19px; color: var(--soft); max-width: 30ch; }

/* deck */
.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 4px 0 18px; }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .25s ease; }
.deck { position: relative; flex: 1; min-height: 340px; max-height: 560px; touch-action: none; user-select: none; -webkit-user-select: none; }
.food {
  position: absolute; inset: 0;
  border-radius: 36px; padding: 28px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--tint); color: var(--food-ink); box-shadow: var(--shadow);
  will-change: transform;
}
.food.next { transform: scale(.94) translateY(14px); }
.food.top { animation: rise .28s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: scale(.94) translateY(14px); } }
.food.top { cursor: grab; }
.food.top.dragging { cursor: grabbing; }
.food.flying { transition: transform .32s ease-in, opacity .32s ease-in; }
.food.settling { transition: transform .25s cubic-bezier(.2,.8,.2,1); }
/* Names shrink to fit their card: --len is the name's length, set in game.js. */
.food, .choice, .pick .plate { container-type: inline-size; }
.food b { font: 800 min(84px, calc(160cqi / var(--len, 6)))/.95 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.food span { font-size: 18px; font-weight: 600; margin-top: 4px; opacity: .75; }
.face { width: 46%; max-width: 190px; height: auto; margin: auto; fill: var(--food-ink); stroke: none; }
.face path { fill: none; stroke: var(--food-ink); stroke-width: 6; }
.face ellipse { fill: #FF7A93; opacity: .45; }
.choice .face { width: 34%; max-width: 120px; margin: 0 0 auto; }
.pick .plate .face { margin-bottom: auto; margin-top: 10%; }
.food .stamp {
  position: absolute; top: 26px; padding: 4px 14px 0; border: 3px solid currentColor; border-radius: 14px; background: #fff;
  font: 800 22px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; opacity: 0; white-space: nowrap;
}
.food .stamp.yes { color: var(--yes); left: 24px; transform: rotate(-10deg); }
.food .stamp.no { color: var(--no); right: 24px; transform: rotate(10deg); }

.controls { display: flex; justify-content: center; align-items: center; gap: 22px; padding-top: 22px; }
.round {
  width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .15s ease;
}
.round:active { transform: scale(.94); }
.round.no { color: var(--no); }
.round.yes { color: var(--yes); }
.round.small { width: 52px; height: 52px; color: var(--soft); box-shadow: none; }
.round.small svg { width: 22px; height: 22px; }
.round:disabled { opacity: .35; cursor: default; }

/* face-off and pick-one */
.choices { flex: 1; display: grid; gap: 14px; grid-auto-rows: 1fr; max-height: 600px; }
.choice {
  border: 0; border-radius: 24px; padding: 22px 24px; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--tint); color: var(--food-ink); box-shadow: var(--shadow); transition: transform .15s ease;
}
.choice:active { transform: scale(.98); }
.choice b { font: 800 min(54px, calc(160cqi / var(--len, 6)))/.95 var(--display); white-space: nowrap; letter-spacing: -.02em; }
.choice span { margin-top: 4px; font-weight: 600; opacity: .75; }
.meta { color: var(--soft); font-size: 15px; margin: 14px 0 0; text-align: center; }

/* the pick */
.pick { flex: 1; display: flex; flex-direction: column; }
.pick .plate {
  flex: 1; min-height: 300px; border-radius: 36px; padding: 28px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--tint); color: var(--food-ink); box-shadow: var(--shadow);
}
.pick .plate b { font: 800 min(100px, calc(160cqi / var(--len, 6)))/.92 var(--display); letter-spacing: -.025em; white-space: nowrap; }
.pick .plate span { font-size: 18px; font-weight: 600; margin-top: 4px; opacity: .75; }
.pick .actions { display: grid; gap: 10px; padding-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  .screen:not([hidden]) { animation: none; }
  .food.flying, .food.settling { transition-duration: .01s; }
}
@media (min-width: 700px) {
  .game h1 { margin-top: 0; }
  .choices { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; min-height: 360px; }
  .choices.three { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- group play on a phone ---------- */
.stack { display: grid; gap: 10px; }
.field { display: grid; gap: 6px; font-weight: 600; }
.field input {
  height: 58px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 0 18px; font: 600 20px/1 var(--body);
}
#code { font: 800 28px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; }
.oops { margin: 0; min-height: 1.5em; color: var(--oops); font-weight: 600; }
.oops:empty { min-height: 0; }
.code-tag { font: 800 18px/1 var(--display); letter-spacing: .14em; color: var(--soft); }
.share { display: grid; gap: 6px; }
.share p { margin: 0; color: var(--soft); }
.share b { color: var(--ink); }
.intro .big-code { font: 800 64px/1 var(--display); letter-spacing: .1em; color: var(--ink); margin: 4px 0 8px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people li { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.people li i { width: 36px; height: 36px; border-radius: 50%; background: var(--tint); flex: none; }
.people li b { flex: 1; }
.people li span { color: var(--soft); font-size: 15px; }
.people li.away, .tv-people li.away { opacity: .4; }
.join-line { margin: 20px 0 0; font-weight: 600; }
.join-line a { text-underline-offset: 3px; }
.round.yes svg { fill: currentColor; }

/* ---------- guide pages and the footer ---------- */
.guide h1 { font: 800 clamp(40px, 11vw, 60px)/1 var(--display); letter-spacing: -.02em; margin: 32px 0 18px; }
.guide h2 { font: 800 28px/1.1 var(--display); margin: 40px 0 12px; }
.guide p { margin: 0 0 14px; }
.answer { border-left: 4px solid var(--accent); padding: 2px 0 2px 16px; font-size: 19px; }
.cta { display: grid; gap: 10px; margin: 24px 0 8px; }
ol.how { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
ul.foods { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
ul.foods li { display: flex; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
ul.foods li i { width: 14px; height: 14px; border-radius: 50%; background: var(--tint); flex: none; transform: translateY(2px); }
ul.foods a { font: 700 20px/1.2 var(--display); text-underline-offset: 3px; white-space: nowrap; }
ul.foods span { color: var(--soft); }
.faq dt { font-weight: 700; margin-top: 18px; }
.faq dd { margin: 4px 0 0; color: var(--soft); }
.spin { display: grid; gap: 12px; margin: 8px 0 20px; }
.spin .plate {
  min-height: 320px; border-radius: 32px; padding: 28px; container-type: inline-size;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--tint); color: var(--food-ink); box-shadow: var(--shadow);
}
.spin .plate b { font: 800 min(84px, calc(160cqi / var(--len, 6)))/.95 var(--display); white-space: nowrap; }
.spin .plate span { font-size: 18px; font-weight: 600; opacity: .75; }
.spin .plate .face { margin: auto; }
.spin .plate.pop { animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.94); } }
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 40px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 14px; }
.site-foot nav a { color: var(--ink); text-underline-offset: 3px; }
