:root {
  --bg: #FFF4E6;
  --card: #FFFFFF;
  --ink: #1B1524;
  --muted: #6E6479;
  --soft: #EFE6DA;
  --line: #1B1524;
  --accent: #FF5A36;
  --guess: #FFD23F;
  --good: #19C37D;
  --r: 24px;
  --lift: 0 5px 0 var(--line);
  font-family: "Bricolage Grotesque", Manrope, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16121C;
    --card: #221C2B;
    --ink: #F7F0E6;
    --muted: #A99FB4;
    --soft: #2E2639;
    --line: #000000;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
button, select { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.top, main, .foot { width: 100%; max-width: 480px; }
.top { display: flex; align-items: center; gap: 8px; padding: 4px 0 14px; }
.logo { font-size: 30px; font-weight: 800; letter-spacing: -1.5px; color: var(--ink); text-decoration: none; margin-right: auto; }
.dot { color: var(--accent); }
.chip {
  font-size: 14px; font-weight: 800; padding: 6px 12px; border-radius: 99px;
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
}
.chip[hidden] { display: none; }
.icon-chip { width: 36px; padding: 6px 0; }
.score-chip { background: var(--guess); color: #1B1524; font-variant-numeric: tabular-nums; }
.score-chip.bump { animation: bump .45s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes bump { 40% { transform: scale(1.3); } }
.lang-chip { padding: 0; }
.lang-chip select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-weight: 800; font-size: 14px; padding: 6px 12px; border-radius: 99px; }

main { flex: 1; display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--card); border: 3px solid var(--line); border-radius: var(--r);
  box-shadow: var(--lift); padding: 20px 18px;
  animation: pop .25s cubic-bezier(.2, 1.4, .4, 1);
}
/* Motion only, never opacity: content stays readable even if animations are paused. */
.card.still { animation: none; }
@keyframes pop { from { transform: scale(.96) translateY(6px); } }

.big {
  width: 100%; border: 3px solid var(--line); border-radius: 20px; padding: 17px;
  font-size: 20px; font-weight: 800; background: var(--ink); color: var(--bg);
  box-shadow: var(--lift); transition: transform .08s;
}
.big:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.big[disabled] { opacity: .5; }
.ghost { background: var(--card); color: var(--ink); }

/* ---- intro ---- */
.intro h1 { font-size: clamp(32px, 9vw, 44px); line-height: 1.02; letter-spacing: -1.5px; margin: 4px 0 18px; }
.how { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 14px; }
.how li { display: flex; gap: 12px; align-items: flex-start; font-size: 18px; font-weight: 600; line-height: 1.3; }
.how b { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--guess); color: #1B1524; border: 2px solid var(--line); font-size: 15px; }

/* ---- question ---- */
.meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 700; font-size: 14px; }
.progress { display: flex; gap: 5px; }
.progress i { width: 20px; height: 8px; border-radius: 8px; background: var(--soft); }
.progress i.on { background: var(--ink); }
.progress i.good { background: var(--good); }
.progress i.tie { background: var(--guess); }
.progress i.bad { background: var(--accent); }
.q { font-size: clamp(24px, 6.6vw, 31px); line-height: 1.12; letter-spacing: -.6px; font-weight: 800; margin: 12px 0 4px; }
.step { font-weight: 800; font-size: 16px; margin: 16px 0 10px; color: var(--muted); }
.stepno { margin: 16px 0 -8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
/* step 2: its own highlighted panel, so "guess the crowd" reads as a different task from "your answer" */
.guess-box { margin-top: 14px; padding: 4px 14px 16px; border-radius: 18px; border: 3px dashed var(--line); background: color-mix(in srgb, var(--guess) 22%, var(--card)); animation: wake .3s cubic-bezier(.2, 1.4, .4, 1); }
.guess-box .stepno { margin-top: 12px; }
.guess-title { font-size: 21px; font-weight: 800; margin: 12px 0 2px; line-height: 1.2; }
.guess-hint { margin: 0 0 12px; color: var(--muted); font-weight: 600; font-size: 15px; }
@keyframes wake { from { transform: translateY(10px) scale(.98); } }

.opts { display: grid; gap: 10px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; text-align: left; border: 3px solid var(--line); border-radius: 16px;
  padding: 15px 16px; font-size: 18px; font-weight: 800; box-shadow: 0 4px 0 var(--line);
  transition: transform .08s; background: var(--card); color: var(--ink);
}
.opts.two .opt { text-align: center; padding: 20px 10px; font-size: 22px; }
.opts.two .opt.call { font-size: 18px; padding: 18px 8px; }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt.call { background: var(--guess); color: #1B1524; }
.key { display: none; }
.said { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: var(--soft); font-weight: 600; }
.link { border: 0; background: none; font-weight: 800; text-decoration: underline; padding: 4px; }

/* ---- reveal ---- */
.verdict { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 800; margin: 14px 0 2px; }
.mark { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); flex: none; position: relative; }
.verdict.w .mark, .verdict.d .mark { background: var(--good); }
.verdict.d .mark { background: var(--guess); }
.verdict.l .mark { background: var(--accent); }
.mark::after { content: ""; position: absolute; inset: 0; margin: auto; }
.verdict.w .mark::after, .verdict.d .mark::after { width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: translate(0, -2px) rotate(45deg); }
.verdict.d .mark::after { border-color: #1B1524; }
.verdict.l .mark::after { width: 14px; height: 3px; background: #fff; box-shadow: none; transform: rotate(45deg); }
.verdict.l .mark::before { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 3px; background: #fff; transform: rotate(-45deg); }
.line { margin: 6px 0 0; font-size: 17px; font-weight: 500; }
.rows { display: grid; gap: 12px; margin-top: 16px; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.row-head b { font-size: 18px; font-variant-numeric: tabular-nums; }
.row-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.row.lead .row-head { font-weight: 800; }
.track { height: 14px; border-radius: 14px; background: var(--soft); margin-top: 5px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: 14px; background: var(--muted); transition: width .9s cubic-bezier(.2, .9, .2, 1); }
.row.lead .track i { background: var(--accent); }
.track i.go { width: var(--w); }
.tag-you, .tag-guess { font-style: normal; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; border: 2px solid var(--line); }
.tag-you { background: var(--card); color: var(--ink); }
.tag-guess { background: var(--guess); color: #1B1524; }
.src { margin: 16px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---- result ---- */
.result { text-align: center; }
.scored { margin: 0; font-weight: 800; color: var(--muted); }
.num { font-size: 92px; font-weight: 800; letter-spacing: -4px; line-height: 1; margin-top: 6px; }
.num small { font-size: 30px; letter-spacing: 0; color: var(--muted); }
.squares { display: flex; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.sq { width: 34px; height: 34px; border-radius: 9px; border: 3px solid var(--line); flex: none; }
.sq.w { background: var(--good); } .sq.d { background: var(--guess); } .sq.l { background: var(--accent); }
.title { font-size: 22px; font-weight: 800; margin: 10px 0 0; }
.rank { margin: 10px 0 0; font-weight: 700; }
.rank.muted { color: var(--muted); }
.meta-line { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 0; color: var(--muted); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
details summary { font-weight: 800; cursor: pointer; }
.answers { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.answers li { display: flex; gap: 12px; align-items: flex-start; }
.answers .sq { width: 18px; height: 18px; border-radius: 5px; border-width: 2px; margin-top: 2px; }
.answers p { margin: 0; font-weight: 600; }
.small { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---- keep playing ---- */
.sub-title { font-size: 18px; font-weight: 800; margin: 0 0 10px; }
.rare { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.rare p { margin: 0; font-weight: 600; }
.keep { display: grid; gap: 8px; }
.keep .step { margin: 10px 0 0; }
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip { font-size: 15px; padding: 8px 14px; }
.mode-tag { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 99px; background: var(--guess); color: #1B1524; border: 2px solid var(--line); font-weight: 800; font-size: 13px; }

/* ---- friends, reactions, sponsor ---- */
.friends { display: grid; gap: 10px; }
.friends .sub-title, .friends .small, .friends .step { margin: 0; }
.field { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 3px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); }
.code { margin: 0; font-size: 18px; font-weight: 700; }
.code b { font-size: 28px; letter-spacing: 3px; font-variant-numeric: tabular-nums; }
.scores, .league { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.league { counter-reset: n; }
.scores li, .league li { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--soft); font-weight: 700; }
.league li::before { counter-increment: n; content: counter(n) ". "; color: var(--muted); margin-right: 8px; }
.league li span { flex: 1; }
.scores li.me, .league li.me { background: var(--guess); color: #1B1524; }
.react-row { margin-top: 14px; }
.react-row .small { margin: 0 0 6px; }
.reacts { display: flex; gap: 8px; flex-wrap: wrap; }
.react { border: 2px solid var(--line); border-radius: 99px; padding: 7px 12px; font-size: 14px; font-weight: 800; background: var(--card); color: var(--ink); }
.react.on { background: var(--guess); color: #1B1524; }
.react[disabled]:not(.on) { opacity: .5; }
.react span { color: var(--muted); font-weight: 700; margin-left: 4px; }
.sponsor { margin: 0 0 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.src-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: 13px; font-weight: 700; }

/* ---- double down, badges ---- */
.dd { margin-top: 10px; width: 100%; border: 2px dashed var(--line); border-radius: 14px; padding: 10px 12px; background: var(--card); color: var(--ink); font-weight: 800; font-size: 15px; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dd span { font-size: 12px; color: var(--muted); font-weight: 700; }
.dd.on { background: var(--ink); color: var(--bg); border-style: solid; }
.dd.on span { color: var(--bg); opacity: .7; }
.bonus-line { margin: 4px 0 0; font-weight: 800; font-size: 15px; }
.bonus-line.good { color: var(--good); } .bonus-line.bad { color: var(--accent); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { padding: 10px 8px; border-radius: 14px; background: var(--soft); text-align: center; opacity: .45; }
.badge.on { opacity: 1; background: var(--guess); color: #1B1524; border: 2px solid var(--line); }
.badge b { display: block; font-size: 13px; line-height: 1.15; }
.badge span { display: block; font-size: 11px; font-weight: 600; margin-top: 3px; opacity: .8; }

/* ---- rating ---- */
.rate { text-align: center; }
.rate-title { font-size: 20px; font-weight: 800; margin: 0 0 2px; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 10px 0 4px; }
.star { border: 0; background: none; font-size: 42px; line-height: 1; padding: 2px 4px; color: var(--soft); -webkit-text-stroke: 2px var(--line); transition: transform .1s; }
.star.on { color: var(--guess); }
.star:active { transform: scale(1.25); }
@media (hover: hover) { .star:hover { transform: scale(1.15); } }
.stars.static { font-size: 32px; color: var(--guess); -webkit-text-stroke: 1.5px var(--line); letter-spacing: 4px; }
.stars.static span { color: var(--soft); }
.rate-thanks { font-weight: 700; margin: 6px 0 4px; }
.review { display: grid; gap: 10px; margin-top: 10px; text-align: left; }
.review.hidden { display: none; }
.review textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 3px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); resize: vertical; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 800; z-index: 9; }
.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 20px 0 0; }

/* ---- bigger screens: tablets and computers ---- */
@media (min-width: 720px) {
  body { padding-top: 28px; }
  .top, main, .foot { max-width: 600px; }
  .card { padding: 30px 32px; }
  .q { font-size: 36px; }
  .intro h1 { font-size: 50px; }
  .opt { font-size: 19px; }
  @media (hover: hover) {
    .opt:hover, .big:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); }
    .key { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 6px; border: 2px solid currentColor; font-size: 12px; opacity: .55; vertical-align: 2px; }
    .opts.two .key { display: none; }
  }
}
@media (min-width: 720px) and (min-height: 900px) {
  main { justify-content: center; padding-bottom: 8vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
