/* One Small Fact. Dark, bronze-to-blue like pastforward.games; big friendly type.
   All motion is skipped under prefers-reduced-motion (bottom of the file). */
:root {
  --bg: #070a12; --bg2: #0c1120; --panel: #111a2d; --panel2: #17223a; --line: #2a3756;
  --text: #eef1f6; --dim: #aab4c8; --faint: #7d89a3;
  --bronze: #e0a565; --bronze2: #c8864a; --blue: #4aa3ff; --blue2: #2b7fd9; --teal: #3fd0c0;
  --solo: #4aa3ff; --helped: #3ecf8e; --second: #f2c94c; --third: #f2994a; --wrong: #ff7a7a;
  --radius: 16px; --gutter: 16px;
  --head: "Antonio", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 500 18px/1.5 var(--body);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(74,163,255,.14), transparent 60%),
              radial-gradient(900px 500px at -10% 10%, rgba(224,165,101,.12), transparent 60%), var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
/* A slow star field behind the cards. Reduced motion holds it still. */
body::before {
  content: ""; position: fixed; inset: -12%; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 7% 18%, rgba(238,241,246,.8), transparent),
    radial-gradient(1px 1px at 18% 72%, rgba(224,165,101,.85), transparent),
    radial-gradient(1.2px 1.2px at 31% 28%, rgba(238,241,246,.55), transparent),
    radial-gradient(1px 1px at 44% 84%, rgba(74,163,255,.8), transparent),
    radial-gradient(1.6px 1.6px at 57% 14%, rgba(238,241,246,.7), transparent),
    radial-gradient(1px 1px at 63% 46%, rgba(224,165,101,.6), transparent),
    radial-gradient(1.2px 1.2px at 74% 78%, rgba(238,241,246,.55), transparent),
    radial-gradient(1px 1px at 86% 22%, rgba(74,163,255,.75), transparent),
    radial-gradient(1.3px 1.3px at 92% 58%, rgba(238,241,246,.65), transparent),
    radial-gradient(1px 1px at 12% 40%, rgba(238,241,246,.4), transparent),
    radial-gradient(1px 1px at 49% 56%, rgba(238,241,246,.45), transparent),
    radial-gradient(1.2px 1.2px at 78% 36%, rgba(224,165,101,.45), transparent);
  animation: starpan 80s linear infinite;
}
@keyframes starpan { to { transform: translate3d(-3%, -4%, 0); } }
.top, main, .foot { position: relative; z-index: 1; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; letter-spacing: .01em; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
p { margin: 0 0 .7em; }
a { color: #8cc6ff; }
a:hover { color: #b9dcff; }
:focus-visible { outline: 3px solid var(--bronze); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bronze); color: #1a1208; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.ic { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.ic.big { width: 32px; height: 32px; }
kbd { font: 600 .7rem/1 var(--body); color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; margin-right: 10px; }
.fine { color: var(--dim); font-size: .88rem; }
.lead { color: var(--dim); font-size: 1.05rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--bronze); font-weight: 600; margin-bottom: .3em; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px var(--gutter);
  max-width: 1180px; margin: 0 auto; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 1.35rem var(--head); letter-spacing: .02em; }
.brand .mark { width: 32px; height: 32px; }
.hud { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: .9rem; color: var(--dim); }
.chip b { color: var(--text); }
.chip.rank { color: var(--bronze); font-weight: 600; }
.chip.streak .ic { color: #ffa24a; }
button.chip { cursor: pointer; font: inherit; min-height: 34px; }
button.chip[aria-pressed="true"] { color: var(--teal); border-color: var(--teal); }

main { max-width: 1180px; margin: 0 auto; padding: 4px var(--gutter) 32px; }
.card { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px;
  font: 600 1.05rem var(--body); color: #0b1020; background: linear-gradient(135deg, var(--bronze), #f0c08a 45%, var(--blue));
  border: 0; border-radius: 12px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.big { min-height: 58px; font-size: 1.2rem; padding: 12px 26px; box-shadow: 0 8px 22px rgba(43, 127, 217, .22); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--dim); }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: .95rem; }
.btn kbd { color: rgba(11,16,32,.65); border-color: rgba(11,16,32,.3); margin: 0 0 0 6px; }

/* ---------- Glim ---------- */
.host { margin: 6px 0 14px; }
.glim-slot { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
.glim-slot.small { margin-bottom: 8px; }
.glim-figure { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.glim { width: 92px; height: auto; overflow: visible; cursor: pointer; display: block; }
.glim-slot.small .glim { width: 72px; }
.glim-mute { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 4px 10px; white-space: nowrap;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  font: 700 .82rem var(--body); cursor: pointer; }
.glim-mute[aria-pressed="false"] { color: #1a1208; background: var(--bronze); border-color: var(--bronze); }
.g-say { position: relative; margin: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 16px; font-size: 1.02rem; color: var(--text); min-height: 48px; box-shadow: 0 8px 22px rgba(0, 0, 0, .22); }
.g-say:empty { display: none; }
.g-say::before { content: ""; position: absolute; left: -9px; top: 50%; margin-top: -8px; border: 8px solid transparent;
  border-right-color: var(--line); border-left: 0; }
.g-say::after { content: ""; position: absolute; left: -7px; top: 50%; margin-top: -7px; border: 7px solid transparent;
  border-right-color: var(--panel2); border-left: 0; }
.g-say.pop { animation: pop .28s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: .4; } to { transform: none; opacity: 1; } }

.g-shadow { fill: rgba(0,0,0,.4); }
.g-jelly { fill: url(#glim-jelly); stroke: #9ff5ea; stroke-width: 1.5; }
.g-arm { fill: #2bb3a6; stroke: #9ff5ea; stroke-width: 1; }
.g-bub { fill: rgba(255,255,255,.16); stroke: rgba(255,255,255,.75); stroke-width: .8; }
.g-shine { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 3; stroke-linecap: round; }
.g-mouth { fill: none; stroke: #0b4a4e; stroke-width: 2.4; stroke-linecap: round; transform-box: view-box; transform-origin: 60px 119px; }
.g-stalk { fill: none; stroke: #2bb3a6; stroke-width: 6; stroke-linecap: round; }
.g-sclera { fill: #f5fbfb; stroke: #2bb3a6; stroke-width: 3; }
.g-iris { fill: #1d8f95; }
.g-pupil { fill: #061316; }
.g-glint { fill: #fff; }
.g-lid { fill: #33c5b7; stroke: #2bb3a6; stroke-width: 2; transform-box: view-box; transform-origin: 60px 7px; transform: scaleY(0); }
.g-look { transform-box: view-box; transition: transform .25s ease-out; }
.g-stalk-rig { transform-box: view-box; transform-origin: 60px 78px; transition: transform .4s ease-out; }
.g-eye { transform-box: view-box; transform-origin: 60px 78px; animation: sway 4.5s ease-in-out infinite; }
.g-body { transform-box: view-box; transform-origin: 60px 140px; animation: jelly 3.2s ease-in-out infinite; }
.g-all { transform-box: view-box; transform-origin: 60px 140px; }
.g-bub { animation: rise 4.2s linear infinite; }
.g-bub.b2 { animation-delay: -1.1s; animation-duration: 5s; }
.g-bub.b3 { animation-delay: -2.3s; animation-duration: 3.8s; }
.g-bub.b4 { animation-delay: -3.1s; animation-duration: 4.6s; }
.glim.slow .g-look, .glim.slow .g-stalk-rig { transition-duration: 1.1s; transition-timing-function: ease-in-out; }
.glim.blink .g-lid { animation: lid .16s ease-in-out; }
.glim.talking .g-mouth { animation: talk .16s ease-in-out infinite alternate; }
.glim.cheer .g-all { animation: squash 1s ease-out; }
.glim.sad .g-all { animation: sadwob 1s ease-in-out; }
@keyframes lid { 50% { transform: scaleY(1); } }
@keyframes talk { to { transform: scale(1.15, 2); } }
@keyframes jelly { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.035, .965); } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes rise { 0% { transform: translateY(6px); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-46px); opacity: 0; } }
@keyframes squash { 0% { transform: none; } 15% { transform: scale(1.16, .82); } 40% { transform: translateY(-16px) scale(.9, 1.12); }
  65% { transform: translateY(0) scale(1.1, .9); } 82% { transform: scale(.97, 1.03); } 100% { transform: none; } }
@keyframes sadwob { 0%, 100% { transform: none; } 20% { transform: rotate(-6deg) scale(1.02, .98); } 45% { transform: rotate(5deg); } 70% { transform: rotate(-3deg); } }

/* ---------- home ---------- */
.daily { margin-bottom: 16px; padding: 26px 26px 22px; border-color: rgba(224,165,101,.42);
  box-shadow: inset 4px 0 0 var(--bronze), 0 18px 40px rgba(0,0,0,.28);
  background:
  radial-gradient(500px 220px at 100% 0%, rgba(74,163,255,.2), transparent 70%),
  radial-gradient(420px 220px at 0% 100%, rgba(224,165,101,.18), transparent 70%), linear-gradient(180deg, var(--panel2), var(--panel)); }
.daily .eyebrow { display: inline-block; margin-bottom: 10px; padding: 3px 10px; border-radius: 999px;
  background: rgba(224,165,101,.12); border: 1px solid rgba(224,165,101,.4); }
.daily h1 { max-width: 16ch; font-size: clamp(2rem, 4.4vw, 2.75rem); }
.daily #d-go { width: 100%; margin-top: 6px; }
.score { font-size: 1.15rem; }
.score b { color: var(--bronze); }
.grid-row { font-size: 1.9rem; letter-spacing: .12em; margin: .2em 0 .5em; }
.goal { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: .95rem; margin: 14px 0 0; }
.goal .ic { color: var(--faint); }
.goal.met { color: var(--helped); }
.goal.met .ic { color: var(--helped); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; text-align: left; position: relative; min-height: 108px; padding: 18px 16px 16px 18px;
  border-radius: var(--radius); color: var(--text); text-decoration: none; font: inherit; cursor: pointer;
  background: linear-gradient(165deg, rgba(74,163,255,.1), transparent 48%), var(--panel);
  border: 1px solid var(--line); box-shadow: inset 3px 0 0 rgba(224,165,101,.85), inset 0 1px 0 rgba(255,255,255,.04); }
.tile b { font: 600 1.35rem var(--head); }
.tile span { color: var(--dim); font-size: .92rem; }
.tile small { color: var(--bronze); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 600; }
.tile:hover:not(:disabled) { border-color: var(--blue); background: linear-gradient(165deg, rgba(74,163,255,.16), transparent 52%), var(--panel2); transform: translateY(-2px); }
.tile:disabled { opacity: .6; cursor: default; }
.tile .ic { color: var(--bronze); }
.sync { margin-top: 18px; color: var(--dim); font-size: .95rem; }

/* ---------- quiz ---------- */
.qbar { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 8px; }
.qtitle { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.qtitle b { font: 600 1.1rem var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qtitle span { color: var(--dim); font-size: .85rem; }
.pips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 46vw; }
.pip { width: 14px; height: 14px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); }
.pips.many { gap: 3px; flex-wrap: nowrap; }
.pips.many .pip { width: 9px; height: 12px; border-radius: 3px; }
.pip.now { border-color: var(--bronze); background: rgba(224,165,101,.25); }
.pip.solo { background: var(--solo); border-color: var(--solo); }
.pip.helped { background: var(--helped); border-color: var(--helped); }
.pip.second { background: var(--second); border-color: var(--second); }
.pip.third { background: var(--third); border-color: var(--third); }
.pip.wrong { background: var(--wrong); border-color: var(--wrong); }
.pip.fresh { animation: pippop .35s ease; }
@keyframes pippop { from { transform: scale(.35); } to { transform: none; } }
.speed { height: 4px; background: var(--panel2); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.speed i { display: block; height: 100%; background: linear-gradient(90deg, var(--bronze), var(--blue)); transform-origin: left; }
.qlayout { display: grid; gap: 12px; }
.host.side { margin: 0; }
.qcard { position: relative; box-shadow: 0 16px 36px rgba(0,0,0,.22); }
.qmeta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--dim); margin-bottom: 8px; }
.cat { color: var(--bronze); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.diff { display: inline-flex; gap: 3px; }
.diff i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.diff i.on { background: var(--blue); }
.mult { color: var(--helped); font-weight: 600; }
.tip { font-size: .92rem; color: var(--dim); background: rgba(74,163,255,.08); border-left: 3px solid var(--blue); padding: 6px 10px; border-radius: 0 8px 8px 0; }
#q-prompt { font: 600 clamp(1.5rem, 4.2vw, 2.15rem)/1.22 var(--head); margin: 6px 0 18px; outline: none; }
/* The story's sentences stay up while you guess. Pictures already played; this is the case. */
.evidence { margin: 0 0 12px; padding: 10px 12px 12px; border-radius: 12px;
  background: rgba(224,165,101,.08); border: 1px solid rgba(224,165,101,.38); }
.evidence .eyebrow { margin: 0 0 2px; }
.evidence .fine { margin: 0 0 8px; }
.evidence ol { margin: 0; padding-left: 1.15em; display: grid; gap: 6px; }
.evidence li { font-size: .98rem; line-height: 1.35; }
.answers { display: grid; gap: 10px; }
.answers.t-tf, .answers.t-pick { grid-template-columns: 1fr 1fr; }
.ans { display: flex; align-items: center; flex-wrap: wrap; text-align: left; min-height: 60px; padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(180deg, #121a2e, var(--bg2)); border: 2px solid var(--line); color: var(--text);
  font: 600 1.12rem/1.25 var(--body); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.ans:hover:not(:disabled) { border-color: var(--blue); background: #101a30; }
.ans:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.ans:disabled { cursor: default; }
.ans .val { display: block; width: 100%; font-weight: 500; font-size: .95rem; color: var(--dim); padding-left: 32px; }
.ans .val:empty { display: none; }
.ans.right { border-color: var(--solo); background: rgba(74,163,255,.16); animation: ansyes .45s ease; }
.ans.wrong, .ans.tried { border-color: var(--wrong); background: rgba(255,122,122,.13); }
.ans.tried { animation: ansno .32s ease; }
.ans.wrong { animation: ansno .32s ease; }
@keyframes ansyes { 0% { transform: scale(.97); } 45% { transform: scale(1.035); } 100% { transform: none; } }
@keyframes ansno { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.ans.trimmed { opacity: .3; text-decoration: line-through; }
.answers.t-pick .ans { min-height: 84px; font-size: 1.25rem; }
.slots { list-style: none; counter-reset: slot; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.slots li { counter-increment: slot; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 6px 12px 6px 6px;
  background: var(--bg2); border: 2px dashed var(--line); border-radius: 12px; }
.slots li::before { content: counter(slot); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); color: var(--bronze); font-weight: 700; flex: none; }
.slots li.on { border-style: solid; }
.slots li.right { border-color: var(--solo); }
.slots li.wrong { border-color: var(--wrong); }
.slots .empty { color: var(--faint); font-size: .95rem; }
.slots .slot { background: none; border: 0; color: var(--text); font: 600 1.08rem var(--body); text-align: left; cursor: pointer; padding: 4px; }
.slots .slot .val { color: var(--dim); font-weight: 500; font-size: .92rem; margin-left: 6px; }
.pool { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.pool .ans:disabled { opacity: .35; }

.help-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.help { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(63,208,192,.08); border: 1px solid rgba(63,208,192,.45); color: #c9f5ef; font: 600 .95rem var(--body); }
.help:hover:not(:disabled) { background: rgba(63,208,192,.18); }
.help:disabled { opacity: .4; cursor: not-allowed; }
.help .cost { color: var(--bronze); font-weight: 600; }
.help-left { color: var(--dim); font-size: .85rem; }
.voice-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.mic { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 20px; border-radius: 999px; cursor: pointer;
  background: rgba(74,163,255,.12); border: 2px solid var(--blue); color: var(--text); font: 600 1.05rem var(--body); touch-action: none; user-select: none; -webkit-user-select: none; }
.mic .ic { width: 22px; height: 22px; color: var(--blue); }
.mic.live { background: rgba(255,122,122,.16); border-color: var(--wrong); }
.mic.live .ic { color: var(--wrong); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }
.heard { margin: 0 0 12px; padding: 14px 18px; border-color: var(--blue2); }
.heard p { margin: 0; }
.heard .row { margin-top: 10px; }
.glim.listening .g-sclera { stroke: var(--blue); }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.switch span { display: flex; flex-direction: column; font-weight: 600; }
.switch small { color: var(--dim); font-weight: 500; font-size: .9rem; }
.switch input:disabled + span { opacity: .6; }
#set-voice-delete { margin-top: 12px; }
/* Glim's clues, inside the card above the answers: his free clue first, then any more */
.clues { display: grid; gap: 8px; margin: 0 0 14px; }
.clue { display: flex; gap: 10px; align-items: flex-start; background: rgba(63,208,192,.08); border: 1px solid rgba(63,208,192,.35);
  border-radius: 12px; padding: 9px 12px; font-size: .98rem; line-height: 1.4; }
.clue p { margin: 0; }
.clue b { color: var(--teal); font-weight: 600; margin-right: 4px; }
.clue .ic { color: var(--teal); flex: none; margin-top: 2px; }
.clue .src { font-size: .82rem; color: var(--dim); }
.clue + .clue { animation: pop .28s ease-out; }
.ans.tried { opacity: .45; text-decoration: line-through; border-style: dashed; }
.slots li.lock { border-style: solid; border-color: var(--helped); }
.slots li.lock .slot { cursor: default; display: inline-flex; align-items: center; gap: 6px; }
.slots li.lock .ic { color: var(--helped); width: 18px; height: 18px; }
.verdict.ok.later .ic { background: var(--second); color: #1f1604; }
#q-pic.support .pic img { max-height: min(26vh, 240px); }
.src { font-size: .88rem; color: var(--dim); }
.feedback { margin-top: 4px; }
.verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.verdict .ic { width: 34px; height: 34px; padding: 6px; border-radius: 50%; }
.verdict.ok .ic { background: var(--solo); color: #04101f; }
.verdict.no .ic { background: var(--wrong); color: #2a0606; }
.verdict h3 { margin: 0; font-size: 1.6rem; outline: none; }
.verdict .pts { color: var(--bronze); font-weight: 600; font-size: .95rem; }
.expl { font-size: 1.1rem; }
.dyk { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.dyk h4 { font-size: 1rem; color: var(--bronze); margin-bottom: .2em; }
.dyk p { margin-bottom: .2em; }
.note { color: var(--dim); font-size: .92rem; }
#q-next { margin-top: 10px; width: 100%; }

/* ---------- results ---------- */
.result { text-align: center; max-width: 640px; margin: 0 auto; }
.result .row { justify-content: center; }
.big-score { font: 600 1.4rem var(--head); color: var(--dim); }
.big-score b { font-size: 3.6rem; color: var(--text); background: linear-gradient(90deg, var(--bronze), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars { font-size: 2.6rem; color: var(--bronze); letter-spacing: .1em; margin: 0; }
.board { color: var(--teal); }

/* ---------- Hotter Than Venus ---------- */
.metrics .tile { align-items: flex-start; }
.htv-score { text-align: center; color: var(--dim); font-size: 1.1rem; }
.htv-score b { color: var(--text); font-size: 1.4rem; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vs .card { text-align: center; min-height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.vs .lbl { font: 600 1.25rem/1.2 var(--head); }
.vs .val { font: 600 1.6rem var(--head); color: var(--bronze); }
.vs .side-b .val { color: var(--blue); }
.vs .card.right { animation: ansyes .45s ease; }
.vs .card.wrong { animation: ansno .32s ease; }
.vs .side-b.right { border-color: var(--solo); }
.vs .side-b.wrong { border-color: var(--wrong); }
.htv-q { text-align: center; font: 600 1.4rem var(--head); margin: 16px 0 4px; }
.big-choices { justify-content: center; }
.big-choices .btn { min-width: 150px; }
#htv-src { text-align: center; }

/* ---------- Mission Map ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tab { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--dim); font: 600 1rem var(--body); cursor: pointer; }
.tab small { color: var(--faint); font-weight: 500; }
.tab[aria-selected="true"] { color: var(--text); border-color: var(--bronze); background: rgba(224,165,101,.12); }
.path { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; display: grid; gap: 10px; max-width: 720px; }
.path::before { content: ""; position: absolute; left: 30px; top: 20px; bottom: 20px; width: 3px; background: linear-gradient(var(--bronze), var(--blue)); opacity: .5; border-radius: 3px; }
.lvl { position: relative; display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 10px 14px 10px 0; background: transparent; border: 0; color: var(--text); font: inherit; cursor: pointer; border-radius: 14px; }
.lvl .n { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--panel2); border: 3px solid var(--blue); font: 700 1.3rem var(--head); }
.lvl .n { position: relative; }
.lvl .rider { position: absolute; width: 34px; height: 39px; right: -20px; top: -24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.lvl .txt { display: flex; flex-direction: column; }
.lvl .txt b { font: 600 1.25rem var(--head); }
.lvl .txt span { color: var(--dim); font-size: .92rem; }
.lvl .stars { color: var(--bronze); font-size: 1.25rem; letter-spacing: .08em; white-space: nowrap; }
.lvl:hover:not(:disabled) { background: rgba(74,163,255,.07); }
.node.locked .lvl { cursor: not-allowed; }
.node.locked .n { border-color: var(--line); color: var(--faint); }
.node.locked .txt b { color: var(--faint); }
.node.played .n { border-color: var(--bronze); }

/* ---------- Fact Cards ---------- */
.deck { margin-bottom: 26px; }
.deck h3 small { color: var(--dim); font-family: var(--body); font-size: .95rem; font-weight: 500; }
.bar { height: 8px; background: var(--panel2); border-radius: 8px; overflow: hidden; margin: 6px 0 12px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bronze), var(--blue)); }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fc { display: flex; flex-direction: column; gap: 4px; width: 100%; height: 100%; min-height: 92px; padding: 10px; border-radius: 12px;
  border: 1px dashed var(--line); background: transparent; color: var(--faint); font: 500 .85rem/1.3 var(--body); text-align: left; align-items: center; justify-content: center; }
.fc.have { border-style: solid; background: var(--panel); color: var(--text); cursor: pointer; align-items: flex-start; justify-content: flex-start; }
.fc.have:hover { border-color: var(--blue2); }
.fc small { color: var(--bronze); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- progress ---------- */
.rankcard { margin-bottom: 16px; }
.rankcard h2 { font-size: 2.4rem; color: var(--bronze); }
.nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 22px; }
.nums div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.nums dt { color: var(--dim); font-size: .85rem; }
.nums dd { margin: 0; font: 600 1.3rem var(--head); }
.cats { width: 100%; border-collapse: collapse; margin-bottom: 22px; font-size: .98rem; }
.cats th, .cats td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cats thead th { color: var(--dim); font-weight: 600; font-size: .85rem; }
.cats tbody th { font-weight: 500; }
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.badges li { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--faint); }
.badges li .ic { color: var(--line); }
.badges li b { font: 600 1.1rem var(--head); }
.badges li span { font-size: .85rem; }
.badges li.have { color: var(--text); border-color: rgba(224,165,101,.6); }
.badges li.have .ic { color: var(--bronze); }
.badges li.have span { color: var(--dim); }
.badges li small { color: var(--helped); font-size: .78rem; }

/* ---------- dialogs, toast, footer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3,6,12,.72); display: grid; place-items: center; padding: var(--gutter); z-index: 40; }
.dialog { max-width: 480px; width: 100%; max-height: 90vh; overflow: auto; }
.dialog textarea { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 500 1rem var(--body); margin-top: 6px; }
.factcard .ans { display: block; min-height: 0; border: 0; padding: 0; background: none; font-size: 1.2rem; color: var(--solo); cursor: default; }
.factcard small { color: var(--bronze); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--bronze); color: var(--text);
  padding: 10px 18px; border-radius: 12px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }
.toast .ic { color: var(--bronze); }
.foot { max-width: 1180px; margin: 0 auto; padding: 20px var(--gutter) 40px; color: var(--dim); font-size: .9rem; border-top: 1px solid var(--line); }
.foot p { margin: 0 0 .4em; }

/* ---------- pictures: "What am I looking at?", Fact Card art, credits ---------- */
.pic { margin: 0 0 14px; display: flex; flex-direction: column; align-items: center; }
/* The frame hugs the bitmap. A full-width black matte read as a broken image
   whenever the photo was narrower than the card. */
.pic .frame { display: block; width: max-content; max-width: 100%; background: transparent; border: 0; border-radius: 12px;
  overflow: hidden; min-height: 0; line-height: 0;
  box-shadow: 0 0 0 1px rgba(186,198,224,.28), 0 10px 26px rgba(0,0,0,.28); }
.pic .frame:has(.nopic) { width: 100%; min-height: 120px; line-height: 1.4; background: var(--bg2); box-shadow: none; }
.pic img { display: block; max-width: 100%; width: auto; height: auto; max-height: min(44vh, 420px); }
.pic figcaption { align-self: stretch; width: 100%; color: var(--dim); font-size: .78rem; line-height: 1.35; margin-top: 6px; overflow-wrap: anywhere; }
.pic figcaption b { color: var(--text); font-weight: 600; }
/* a long credit line: all of it is there, in a ~3-line box that scrolls, or opened out */
.pic figcaption.long .crtext { display: block; max-height: 4.05em; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 6px; border-left: 2px solid var(--line); }
.pic figcaption.long.open .crtext { max-height: none; overflow: visible; }
.pic figcaption.long .crtext:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.pic .crmore { margin-top: 4px; padding: 6px 10px; min-height: 32px; font: inherit; font-size: .78rem; color: var(--teal); background: none;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.pic .nopic { color: var(--dim); font-size: .95rem; padding: 24px 16px; margin: 0; text-align: center; }
.factcard .pic { margin: 8px 0 12px; }
.factcard .pic img { max-height: 36vh; }
.picline { overflow-wrap: anywhere; }
.fc.art small { color: var(--teal); }
.credits { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.credits li { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.credits li b { font: 600 1.05rem var(--head); }
.credits li span { color: var(--dim); font-size: .88rem; overflow-wrap: anywhere; }

/* ---------- feedback motion: a little rocket lift-off, a gentle wobble ---------- */
.rocket-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.rocket { position: absolute; left: auto; right: 18px; top: 70px; width: 28px; height: 56px; opacity: 0; }
.rocket.fly { animation: lift 1.15s ease-in forwards; }
.rocket .flame { animation: flick .09s infinite alternate; transform-origin: 14px 37px; }
@keyframes lift { 0% { opacity: 0; transform: translateY(18px) scale(.8); } 20% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-110px) rotate(8deg); } }
@keyframes flick { to { transform: scaleY(1.35); } }
.wobble { animation: wob .5s ease-in-out; }
@keyframes wob { 20% { transform: translateX(-8px) rotate(-.6deg); } 40% { transform: translateX(7px) rotate(.5deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.glow { animation: glow 1s ease-out; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(74,163,255,.55); } 100% { box-shadow: 0 0 0 18px rgba(74,163,255,0); } }

/* ---------- stories: Glim's evidence, one panel at a time, before the question ---------- */
.st-head { display: flex; justify-content: space-between; align-items: baseline; line-height: 1.2; margin-bottom: 2px; }
.st-head .eyebrow { margin: 0; }
.st-step { color: var(--dim); font-size: .85rem; font-variant-numeric: tabular-nums; }
#st-title { font-size: clamp(1.3rem, 3.6vw, 1.8rem); margin: 0 0 4px; outline: none; }
.st-panel { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.st-panel a { user-select: auto; }
.st-panel .pic { margin: 0 0 4px; }
/* The stage is the picture. The frame hugs the bitmap (max-width and a height
   cap), so nothing sits in an empty matte. A landscape photo (.wide) may be
   taller; a square stays only as wide as its cap and the card shows beside it.
   object-fit stays contain. The drift eases in; reduced motion holds it still. */
.st-panel .pic:not(.dia) .frame { height: auto; width: max-content; max-width: 100%; min-height: 0; background: transparent;
  border-radius: 14px; box-shadow: 0 0 0 1px rgba(186,198,224,.34), 0 14px 32px rgba(0,0,0,.35); }
/* Hug the bitmap. width:100% plus a max-height made a full-width frame with
   empty sides whenever the photo was taller than the cap. */
.st-panel .pic:not(.dia) img { width: auto; height: auto; max-width: 100%; max-height: min(46vh, 440px);
  object-fit: contain; object-position: center; transform-origin: center; }
.st-panel .pic.wide img { max-height: min(64vh, 580px); }
.st-panel .pic img.drift { animation: storydrift 8s ease-out forwards; }
@keyframes storydrift { from { transform: scale(1.04); } to { transform: scale(1); } }
.st-panel .pic.dia { align-items: stretch; }
.st-panel .pic.dia .frame { width: 100%; background: #0c1120; padding: 0; min-height: 0; height: auto;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.st-panel .pic.dia svg { display: block; width: 100%; height: auto; max-height: min(42vh, 400px); }
.st-panel .frame { cursor: pointer; }
.st-text { font-size: 1.12rem; line-height: 1.35; margin: 0 0 2px; outline: none; }
.st-panel .src { font-size: .8rem; margin: 0 0 2px; overflow-wrap: anywhere; }
.st-panel.slide { animation: slidein .26s ease-out; }
.st-panel.slide .frame { animation: framelight .55s ease; }
@keyframes framelight {
  0% { box-shadow: 0 0 0 2px rgba(224,165,101,.75), 0 14px 32px rgba(0,0,0,.35); }
  100% { box-shadow: 0 0 0 1px rgba(186,198,224,.34), 0 14px 32px rgba(0,0,0,.35); }
}
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
/* Skip sits on the Next row on a wide story so a full-width photo still leaves
   the credit and the button on screen. display:contents keeps the buttons in
   this grid without an extra wrapper. */
.story { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: 10px; align-items: center; }
.st-head, #st-title, #st-panel { grid-column: 1 / -1; }
.st-nav { display: contents; }
.st-nav #st-next { width: 100%; min-height: 48px; box-shadow: 0 8px 20px rgba(43, 127, 217, .2); }
.st-nav #st-next kbd { margin: 0 0 0 8px; color: #33405e; border-color: #33405e; }
.st-nav #st-back { min-width: 48px; min-height: 48px; font-size: 1.3rem; }
.st-nav #st-back:disabled { opacity: .35; }
.st-dots { display: inline-flex; gap: 6px; justify-self: center; }
.st-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.st-dots i.seen { background: var(--faint); }
.st-dots i.on { background: var(--bronze); }
.st-skip { justify-self: end; margin: 0; min-height: 44px; padding: 6px 10px; background: none; border: 0; color: #8cc6ff;
  font: 600 .95rem var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#quiz.storying .qmeta { display: none; }
#quiz.storying .speed { height: 0; margin: 0; overflow: hidden; }
#quiz.storying .qcard { padding-top: 10px; padding-bottom: 8px; }
@media (max-width: 640px) {
  .story { grid-template-columns: auto auto minmax(0, 1fr); }
  .st-skip { grid-column: 1 / -1; justify-self: center; margin-top: 2px; }
}

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .answers.t-mc, .answers.t-pic { grid-template-columns: 1fr 1fr; }
  .glim { width: 120px; }
  .glim-slot.small .glim { width: 72px; }
  .card { padding: 26px; }
  .card.daily { padding: 26px 26px 22px; }
}
@media (min-width: 960px) {
  .qlayout { grid-template-columns: 230px 1fr; align-items: start; }
  .host.side .glim-slot { grid-template-columns: 1fr; position: sticky; top: 16px; }
  .host.side .glim { width: 150px; max-width: 100%; margin: 0 auto; }
  .host.side .g-say::before, .host.side .g-say::after { left: 50%; top: -9px; margin: 0 0 0 -8px; border: 8px solid transparent; border-bottom-color: var(--line); border-top: 0; }
  .host.side .g-say::after { top: -7px; margin-left: -7px; border-width: 7px; border-bottom-color: var(--panel2); }
  #home { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 24px; align-items: start; }
  #home .host { grid-column: 1 / -1; }
  #home .tiles { align-content: start; }
  #home .sync { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  body { font-size: 17px; }
  .top { padding-top: 6px; padding-bottom: 6px; }
  .brand span { font-size: 1.15rem; }
  .glim { width: 74px; }
  .glim-slot { gap: 10px; }
  .g-say { font-size: .96rem; padding: 10px 12px; }
  .answers.t-tf, .answers.t-pick { gap: 8px; }
  .pool { grid-template-columns: 1fr; }
  .vs .card { min-height: 130px; padding: 14px; }
  .vs .lbl { font-size: 1.1rem; }
  .vs .val { font-size: 1.35rem; }
  .big-choices .btn { min-width: 0; flex: 1; }
  .pic img { max-height: 26vh; }
  #q-pic.support .pic img { max-height: 17vh; }
  #q-pic .pic { margin-bottom: 10px; }
  #q-prompt { margin: 4px 0 12px; }
  .ans { min-height: 52px; padding: 9px 14px; }
  .answers { gap: 8px; }
  .clue { font-size: .94rem; padding: 8px 10px; }
  body[data-view="quiz"] .host .glim { width: 64px; }
  body[data-view="quiz"] .g-say { font-size: .9rem; padding: 8px 10px; }
  .factcard .pic img { max-height: 28vh; }
  body[data-view="quiz"] .host { margin: 2px 0 6px; }
  body[data-view="quiz"] .qbar { margin-bottom: 4px; }
  #quiz.storying .qcard { padding: 10px 12px 8px; }
  /* Square photos stay about as tall as the column is wide. A fixed frame
     taller than a landscape photo was the black slot; don't bring it back. */
  .st-panel .pic:not(.dia):not(.wide) img { max-height: min(32vh, 272px); }
  .st-panel .pic.dia svg { max-height: min(34vh, 260px); }
  .st-text { font-size: 1.02rem; line-height: 1.3; }
  #st-title { margin-bottom: 2px; }
}

/* ---------- reduced motion: hold still ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rocket { display: none; }
  .tile:hover:not(:disabled) { transform: none; }
}
