@font-face { font-family: 'Silkscreen'; font-weight: 400; font-display: swap; src: url(/fonts/silkscreen-400.woff2) format('woff2'); }
@font-face { font-family: 'Silkscreen'; font-weight: 700; font-display: swap; src: url(/fonts/silkscreen-700.woff2) format('woff2'); }
@font-face { font-family: 'VT323'; font-weight: 400; font-display: swap; src: url(/fonts/vt323-400.woff2) format('woff2'); }
:root {
  --ink: #eef4ff; --dim: #93a0c4; --panel: rgba(13, 17, 38, .86);
  --cyan: #56e6ff; --pink: #ff4f7b; --gold: #ffd76a; --green: #5fe39a; --violet: #b78bff;
  --pixel: 'Silkscreen', ui-monospace, monospace; --term: 'VT323', ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #05040f; color: var(--ink); font: 21px/1.35 var(--term); }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#scan { position: fixed; inset: 0; pointer-events: none; z-index: 20;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px),
              radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.42)); }
button { font-family: var(--pixel); color: var(--ink); background: var(--panel); border: 2px solid #323c66;
  padding: 9px 14px; font-size: 12px; cursor: pointer; letter-spacing: .08em; transition: border-color .2s, box-shadow .2s, transform .15s; }
button:hover, button:focus-visible { border-color: var(--cyan); box-shadow: 0 0 18px rgba(86,230,255,.35); outline: none; }
button:active { transform: translateY(1px); }
small { font-family: var(--pixel); font-size: 11px; letter-spacing: .14em; color: var(--dim); }

/* screens fade and rise */
.screen { position: fixed; z-index: 5; opacity: 0; visibility: hidden; transition: opacity .38s ease, translate .55s cubic-bezier(.2,.8,.2,1), visibility 0s .38s; translate: 0 22px; }
.screen.on { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; }

/* HUD */
#hud, #rail { position: fixed; z-index: 4; opacity: 0; pointer-events: none; transition: opacity .4s; }
.playing #hud, .playing #rail { opacity: 1; }
#hud { top: 14px; left: 0; right: 0; display: flex; justify-content: center; align-items: flex-start; gap: clamp(10px, 7vw, 120px); }
.stat { background: var(--panel); border: 2px solid #28315a; padding: 6px 16px; min-width: 150px; display: flex; flex-direction: column; }
.stat span { font-size: 22px; color: var(--cyan); } .stat b { font: 400 34px var(--term); font-variant-numeric: tabular-nums; }
.stat.right { align-items: flex-end; } .stat.right span { color: var(--pink); }
.mid { display: flex; flex-direction: column; align-items: center; gap: 5px; padding-top: 6px; min-width: 190px; text-align: center; }
#pips { display: flex; gap: 6px; }
#pips i { width: 13px; height: 13px; background: #232a4b; }
#pips .now { background: var(--cyan); animation: blink 1s steps(2) infinite; }
#pips .bad { background: var(--pink); } #pips .ok { background: var(--gold); } #pips .great { background: var(--green); }
#zone { font-size: 13px; text-shadow: 0 0 12px currentColor; }
@keyframes blink { 50% { opacity: .35; } }

#rail { left: 50%; bottom: 12px; width: min(620px, 82vw); translate: -50% 0; height: 22px; }
#railTicks { position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: linear-gradient(90deg, #ffb13b, #3a4478 30%, #3a4478); }
#railTicks i { position: absolute; width: 8px; height: 8px; border-radius: 50%; top: -3px; margin-left: -4px; }
#railShip { position: absolute; top: 8px; margin-left: -6px; font-size: 14px; color: var(--cyan); }
#rail small { position: absolute; top: 0; right: calc(100% + 12px); font-size: 9px; }
#rail small:last-child { right: auto; left: calc(100% + 12px); white-space: nowrap; }

nav { position: fixed; z-index: 21; right: 14px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
nav button { font-size: 9px; padding: 6px 9px; }
body:not(.playing) #home { display: none; }

/* title */
#title { inset: 0; display: flex; flex-direction: column; align-items: center; padding: 6vh 16px 22px; text-align: center; }
h1 { font: 700 clamp(34px, 6.4vw, 84px)/1.08 var(--pixel); text-shadow: -4px 0 var(--cyan), 4px 0 var(--pink), 0 0 40px rgba(0,0,0,.8); animation: drift 6s ease-in-out infinite; }
h1 span { display: block; font-size: .56em; }
@keyframes drift { 50% { transform: translateY(-9px); } }
.sub { font: 400 clamp(14px, 1.8vw, 22px) var(--pixel); letter-spacing: .5em; color: var(--gold); margin-top: 18px; text-shadow: 0 2px 10px #000; }
.rules { color: var(--ink); margin-top: 10px; text-shadow: 0 2px 8px #000, 0 0 4px #000; font-size: 23px; }
.bottom { margin-top: auto; width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; }
details { background: var(--panel); border: 2px solid #28315a; text-align: left; padding: 9px 16px; max-height: 38vh; overflow: auto; }
summary { font: 400 12px var(--pixel); letter-spacing: .14em; cursor: pointer; color: var(--dim); }
ol { padding: 10px 0 2px 20px; display: grid; gap: 6px; } ol b { color: var(--gold); font-weight: 400; }
.big { font-size: 20px; padding: 21px; border-color: var(--cyan); letter-spacing: .24em; box-shadow: 0 0 26px rgba(86,230,255,.22); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.row span { display: flex; gap: 8px; }

/* question card */
#card { left: 50%; top: 112px; width: min(600px, calc(100vw - 32px)); margin-left: calc(min(600px, 100vw - 32px) / -2);
  background: var(--panel); border: 2px solid #343f70; padding: 22px 28px 18px; box-shadow: 0 18px 60px rgba(0,0,0,.55); backdrop-filter: blur(5px); }
#card small { color: var(--pink); }
#card h2 { font: 400 clamp(28px, 3.5vw, 42px)/1.15 var(--term); margin: 8px 0 10px; }
#qWindow { color: var(--dim); margin-bottom: 10px; } #qWindow b { color: var(--cyan); font-weight: 400; white-space: nowrap; }
#card p { font: 400 10px var(--pixel); letter-spacing: .18em; color: var(--dim); }
#card em { color: var(--gold); font-style: normal; }
#countdown { position: fixed; z-index: 5; bottom: 56px; width: 100%; text-align: center; color: var(--cyan); pointer-events: none; }
#countdown:empty { display: none; }

/* answer bar */
#answerBar { left: 50%; bottom: 50px; width: min(660px, calc(100vw - 24px)); margin-left: calc(min(660px, 100vw - 24px) / -2); display: flex; gap: 10px; align-items: stretch; }
#answer { flex: 1; min-width: 0; font: 400 28px var(--term); color: var(--ink); background: rgba(6,9,24,.94); border: 2px solid var(--cyan); padding: 8px 16px; outline: none; caret-color: var(--pink); box-shadow: 0 0 24px rgba(86,230,255,.2); }
#answer::placeholder { color: #626e96; font-size: 21px; }
#answerBar button { background: var(--pink); border-color: var(--pink); font-weight: 700; padding: 0 22px; }
#dial { --p: 1; width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, #0b1029 57%, transparent 59%), conic-gradient(var(--cyan) calc(var(--p) * 1turn), #232a4b 0); }
#dial.low { background: radial-gradient(circle, #0b1029 57%, transparent 59%), conic-gradient(var(--pink) calc(var(--p) * 1turn), #232a4b 0); animation: blink .6s steps(2) infinite; }
#time { font-size: 25px; }
#hint { position: absolute; bottom: calc(100% + 10px); left: 0; right: 0; text-align: center; color: var(--gold); text-shadow: 0 1px 6px #000, 0 0 3px #000; }
#hint b { color: var(--cyan); font-weight: 400; }
.shake { animation: shake .36s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

/* in flight */
#bubble { position: fixed; z-index: 3; left: 0; top: 0; font: 700 clamp(18px, 2.4vw, 28px) var(--pixel); color: var(--violet); background: var(--panel); border: 2px solid #4a3c80; padding: 8px 16px; white-space: nowrap; opacity: 0; transition: opacity .35s; pointer-events: none; text-shadow: 0 0 14px rgba(183,139,255,.8); }
#bubble.on { opacity: 1; }
#flightInfo { position: fixed; z-index: 4; bottom: 56px; width: 100%; display: flex; flex-direction: column; align-items: center; opacity: 0; transition: opacity .3s; pointer-events: none; }
.flying #flightInfo { opacity: 1; }
#gain { font: 400 56px/1 var(--term); color: var(--gold); text-shadow: 0 0 20px rgba(255,215,106,.6); font-variant-numeric: tabular-nums; }
#banner { position: fixed; z-index: 4; top: 21%; width: 100%; text-align: center; font: 700 clamp(26px, 4.6vw, 58px) var(--pixel); opacity: 0; pointer-events: none; text-shadow: 0 0 26px currentColor, 0 3px 8px #000; }
#banner small { display: block; color: var(--ink); text-shadow: 0 2px 6px #000; }
#banner.pop { animation: zonePop 1.5s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes zonePop { 0% { opacity: 0; transform: scale(.82); letter-spacing: 0; } 18% { opacity: 1; transform: scale(1); } 70% { opacity: 1; letter-spacing: .07em; } 100% { opacity: 0; transform: scale(1.06); letter-spacing: .1em; } }

/* verdict */
#verdict { --tone: var(--pink); left: 50%; top: 96px; bottom: 130px; width: min(640px, calc(100vw - 32px)); margin-left: calc(min(640px, 100vw - 32px) / -2); display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none; text-shadow: 0 2px 8px #000, 0 0 4px #000; }
#verdict::before { content: ''; position: absolute; z-index: -1; inset: -40px -90px; background: radial-gradient(closest-side, rgba(5,6,18,.72), rgba(5,6,18,0)); }
#verdict[data-tier=meh],#verdict[data-tier=ok] { --tone: var(--gold); }
#verdict[data-tier=great] { --tone: var(--green); }
#verdict[data-tier=legend] { --tone: var(--violet); }
#vTitle { font: 700 clamp(24px, 3.8vw, 46px)/1.15 var(--pixel); color: var(--tone); text-shadow: 0 0 24px var(--tone), 0 3px 8px #000; }
#vAnswer { font-size: 30px; margin-top: 4px; }
#vPoints { font: 700 26px var(--pixel); color: var(--tone); }
#vFacts { display: flex; gap: 10px; margin-top: auto; flex-wrap: wrap; justify-content: center; }
#vFacts span { background: var(--panel); border: 2px solid #343f70; padding: 5px 14px; } #vFacts b { color: var(--cyan); font-weight: 400; font-size: 28px; }
#vQuip { margin-top: 8px; }
#next { left: 50%; bottom: 46px; width: min(360px, calc(100vw - 32px)); margin-left: calc(min(360px, 100vw - 32px) / -2); font-size: 15px; padding: 17px; }

/* results */
#results { inset: 0; overflow-y: auto; background: rgba(4,5,16,.5); padding: 104px 16px 70px; }
.sheet { width: min(700px, 100%); margin: 0 auto; background: rgba(13, 17, 38, .92); border: 2px solid #28315a; padding: 24px 26px; }
.head { color: var(--pink); }
.total b { font: 400 92px/1 var(--term); } .total span { color: var(--dim); font-size: 30px; margin-left: 8px; }
.sheet h2 { font: 700 30px var(--pixel); text-shadow: 0 0 18px currentColor; }
#rAu { color: var(--cyan); }
h3 { font: 400 12px var(--pixel); letter-spacing: .18em; color: var(--dim); border-bottom: 1px solid #2c355e; padding-bottom: 6px; margin: 22px 0 10px; }
.hop { display: grid; grid-template-columns: 18px minmax(90px, 150px) 1fr 52px; gap: 10px; align-items: center; }
.hop > span { color: var(--dim); } .hop label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .hop b { text-align: right; font-weight: 400; color: var(--gold); }
.track { height: 10px; background: #171d3b; position: relative; }
.track i { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, var(--pink), var(--gold)); transform-origin: left; transform: scaleX(0); animation: grow .6s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes grow { to { transform: scaleX(1); } }
.actions { display: flex; gap: 10px; margin-top: 18px; } .actions button { flex: 1; padding: 14px; }
.q { margin-bottom: 12px; }
.q ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 5px 0 0; }
.q li { background: #171d3b; padding: 1px 10px; border: 1px solid transparent; }
.q li em { color: var(--violet); font-style: normal; margin-left: 4px; }
.q li.you { border-color: var(--cyan); }
#zones { list-style: none; }
#zones li { display: grid; grid-template-columns: 10px 76px 170px 1fr; gap: 10px; align-items: center; padding: 3px 6px; color: var(--dim); font-size: 18px; }
#zones i { width: 8px; height: 8px; border-radius: 50%; } #zones b { font: 400 11px var(--pixel); color: var(--ink); }
#zones .you { background: rgba(86,230,255,.13); outline: 1px solid var(--cyan); color: var(--ink); }

@media (max-width: 620px) {
  .stat { min-width: 0; padding: 4px 9px; } .stat small { font-size: 8px; } .mid { min-width: 0; } #count { display: none; }
  #rail small { display: none; } nav { top: 82px; bottom: auto; right: 8px; }
  #zones li { grid-template-columns: 10px 70px 1fr; } #zones small { display: none; }
  #answerBar button { padding: 0 10px; } #answer::placeholder { font-size: 17px; }
}
@media (max-height: 640px) { #card { top: 92px; } #verdict { top: 82px; bottom: 112px; } }

/* where you stand */
[hidden] { display: none !important; }
button:disabled { opacity: .6; cursor: default; }
.dim { color: var(--dim); }
.verdictLine { font-size: 27px; } .verdictLine b { color: var(--gold); font-weight: 400; font-size: 40px; }
.tierName { font: 700 clamp(18px, 3.4vw, 26px)/1.25 var(--pixel); color: var(--violet); text-shadow: 0 0 18px rgba(183,139,255,.7); margin: 6px 0 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 14px; }
.tiles div { background: #171d3b; padding: 6px 10px; display: flex; flex-direction: column; } .tiles small { font-size: 9px; } .tiles b { font-weight: 400; font-size: 30px; color: var(--cyan); }
.bins { display: flex; align-items: flex-end; gap: 3px; height: 100px; }
.bins div { flex: 1; height: 100%; display: flex; align-items: flex-end; } .bins i { width: 100%; background: #3a4478; } .bins .you i { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.axis { display: flex; justify-content: space-between; color: var(--dim); font-size: 16px; gap: 8px; }
.tiers, .perq { list-style: none; }
.tiers li { display: grid; grid-template-columns: 1fr 56px 90px; gap: 10px; align-items: center; padding: 3px 6px; color: var(--dim); }
.tiers b { font: 400 11px var(--pixel); color: var(--ink); } .tiers span { text-align: right; } .tiers i { height: 8px; background: linear-gradient(90deg, var(--pink), var(--violet)); }
.tiers .you { background: rgba(86,230,255,.13); outline: 1px solid var(--cyan); color: var(--ink); }
.perq li { display: grid; grid-template-columns: 18px minmax(90px, 150px) 1fr; gap: 10px; padding: 2px 0; }
.perq span { color: var(--dim); } .perq label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .perq em { font-style: normal; color: var(--dim); }
@media (max-width: 620px) { .tiers li { grid-template-columns: 1fr 50px; } .tiers i { display: none; } .perq li { grid-template-columns: 18px 1fr; } .perq em { grid-column: 2; font-size: 17px; } }
