:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #16171a;
  --ink-2: #4b4e55;
  --ink-3: #9a9da5;
  --line: #e4e1da;
  --accent: #ff5a4e;
  --good: #1fa463;
  --bad: #e5484d;
  --sky: #dcecff;
  --ground: #cfc8b8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --card: #1b1c20;
    --ink: #f3f3f4;
    --ink-2: #b8bac0;
    --ink-3: #6b6e76;
    --line: #2a2c31;
    --sky: #17202c;
    --ground: #3a3730;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Rubik', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.logo span { font-weight: 600; font-size: 14px; color: var(--ink-3); margin-left: 8px; letter-spacing: 0; }

.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.cur { background: var(--ink-3); }
.dots i.good { background: var(--good); }
.dots i.bad { background: var(--bad); }

.play { flex: 1; display: flex; flex-direction: column; }

.question {
  margin: 6px 0 4px;
  font-size: clamp(21px, 6vw, 25px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 500;
  text-align: center;
  text-wrap: balance;
  color: var(--ink-2);
}
.question b { color: var(--ink); font-weight: 800; }

.assume { margin: 0 0 8px; text-align: center; font-size: 13.5px; color: var(--ink-3); line-height: 1.35; }

.stage {
  position: relative;
  flex: 1;
  min-height: 250px;
  border-radius: 24px;
  background: var(--sky);
  overflow: hidden;
}
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.counter {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--ink-2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}
.counter b { font-size: 18px; color: var(--ink); margin-right: 6px; font-variant-numeric: tabular-nums; }

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.opt {
  height: 58px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.2s ease, background 0.2s ease;
}
.opt:active { transform: scale(0.97); }
.opt:disabled { cursor: default; }
.opt.picked { border-color: var(--ink); }
.opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--card)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--card)); }
.opt.fade { opacity: 0.45; }

.reveal { text-align: center; margin-top: 12px; }
.verdict { margin: 0; font-size: 20px; font-weight: 800; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.fact { margin: 4px 0 12px; font-size: 15px; color: var(--ink-2); line-height: 1.4; }

.btn {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary { background: var(--ink); color: var(--bg); }

.done { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 8px; }
.done .kicker { margin: 0; color: var(--ink-3); font-weight: 600; }
.done .big { margin: 0; font-size: 64px; font-weight: 800; letter-spacing: -0.04em; }
.done .grid { margin: 0 0 16px; font-size: 28px; letter-spacing: 4px; }
.done .small { color: var(--ink-3); font-size: 14px; }

.balloon { transform-box: fill-box; transform-origin: 50% 100%; animation: pop-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes pop-in { from { transform: scale(0); } to { transform: scale(1); } }

.kind { margin: 2px 0 0; text-align: center; font-size: 30px; line-height: 1; }
.done .grid { line-height: 1.5; }
.drop { animation: drop-in 0.4s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-60px); } to { opacity: 1; } }
.target { transform-box: fill-box; transform-origin: 50% 100%; }
.target.hit { animation: hit 0.6s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes hit { 0% { transform: scale(1); } 40% { transform: scale(1.15, 0.9); } 100% { transform: scale(1); } }
.done-label { font: 700 18px 'Rubik', sans-serif; fill: var(--ink); animation: pop-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both; transform-box: fill-box; transform-origin: 50% 50%; }

/* ads: one small banner under the results, one tall ad beside the game on wide screens.
   Both stay invisible until Google fills them. */
.ad-slot { width: 100%; margin: 12px 0 0; text-align: center; }
.res-banner { display: inline-block; width: 320px; height: 100px; }
.ad-rail { position: fixed; top: 50%; left: calc(50% + 278px); transform: translateY(-50%); z-index: 1; }
.rail-ins { display: inline-block; width: 160px; height: 600px; }
@media (min-width: 1240px) { .rail-ins { width: 300px; } }
@media (max-width: 959px), (max-height: 659px) { .ad-rail { display: none !important; } }
.ad-slot ins, .ad-rail ins { opacity: 0; transition: opacity 0.3s ease; }
.ad-slot ins[data-ad-status='filled'], .ad-rail ins[data-ad-status='filled'] { opacity: 1; }
.ad-slot ins[data-ad-status='unfilled'], .ad-rail ins[data-ad-status='unfilled'] { display: none !important; }
.links { margin: 16px 0 0; font-size: 14px; }
.links a { color: var(--ink-3); }
