: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); }
.guess-step { color: var(--ink); }

.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; }
.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; }

.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; }
}
