:root {
  --ink: #1b1533;
  --muted: #6c6788;
  --card: rgba(255, 255, 255, 0.93);
  --line: rgba(27, 21, 51, 0.1);
  --pink: #ff4fa8;
  --violet: #8b5cff;
  --blue: #3d8bff;
  --cyan: #19c3e6;
  --ok: #2fd27a;
  --warn: #ffb020;
  --bad: #ff4d5d;
  --t-basic: #9aa3b5;
  --t-mainstream: #3d8bff;
  --t-underrated: #9b5cff;
  --t-gem: #12b5d8;
  --t-unicorn: #ff4fa8;
  --t-miss: #ff5d5d;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Outfit", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 16px/1.45 var(--body); color: var(--ink); overflow-x: hidden; background: #0b1030; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

/* =================================================================== the journey (behind everything) */
#scene { position: fixed; inset: 0; overflow: hidden; pointer-events: none; background: #0b1030;
  --rw: clamp(60px, 11.5vmin, 96px); --ground: 11%; --mground: 12.6%; --fly: 1.5s;
  --mz: clamp(150px, 36vmin, 320px); --sz: clamp(200px, 52vmin, 440px); }
#world { position: absolute; inset: 0; }
.stage { position: absolute; inset: 0; display: none; overflow: hidden; transition: transform var(--fly) cubic-bezier(.55, 0, .35, 1); }
.stage.vis { display: block; }
.snap .stage, .snap .rocket, .snap #mars, .snap .planet { transition: none !important; }
.obj { position: absolute; }
.obj > svg, .tower > svg { display: block; width: 100%; height: auto; }

.st { position: absolute; border-radius: 50%; background: #fff; opacity: .85; transition: transform .4s, opacity .4s; }
.st.tw { animation: tw 2.6s ease-in-out infinite alternate; }
@keyframes tw { from { opacity: .25; } to { opacity: 1; } }
.warp .st { transform: scaleY(9); }
.blink { animation: blink 1.4s steps(1) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.bob { animation: bob 4s ease-in-out infinite alternate; }
.bob.slow { animation-duration: 6s; }
@keyframes bob { to { translate: 0 -10px; } }
.drift { animation: drift 18s ease-in-out infinite alternate; }
.drift.slow { animation-duration: 26s; }
@keyframes drift { to { translate: 34px 0; } }
.spin { animation: spin 40s linear infinite; }
.spin.slow { animation-duration: 70s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* stage 0: launch pad */
.sun { position: absolute; right: 9%; bottom: 72%; width: clamp(70px, 12vmin, 120px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff8cf 0 40%, #ffd75e 62%, rgba(255, 215, 94, 0) 72%); box-shadow: 0 0 90px 34px rgba(255, 232, 150, .5); }
.city { position: absolute; left: 0; bottom: 15%; width: 100%; height: 12%; }
.hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 24%; }
.tower { position: absolute; bottom: var(--ground); left: calc(50% - var(--rw) * .84); width: calc(var(--rw) * .55); }
.pad { position: absolute; left: 50%; bottom: calc(var(--ground) - 10px); width: calc(var(--rw) * 2); margin-left: calc(var(--rw) * -1); height: 12px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, #ffd23f 0 12px, #2b2f45 12px 24px) top / 100% 4px no-repeat, #8b91a8; box-shadow: 0 4px 0 #676c85; }
.steam { position: absolute; left: 50%; bottom: var(--ground); width: 0; }
.steam i { position: absolute; bottom: -8px; width: calc(var(--rw) * .75); aspect-ratio: 1.7; border-radius: 50%; background: rgba(255, 255, 255, .9);
  filter: blur(4px); animation: steam 3.2s ease-in-out infinite; }
.steam i:nth-child(1) { left: calc(var(--rw) * -1.15); }
.steam i:nth-child(2) { left: calc(var(--rw) * .4); animation-delay: -1.1s; }
.steam i:nth-child(3) { left: calc(var(--rw) * -.38); bottom: -14px; animation-delay: -2.2s; }
@keyframes steam { 0%, 100% { opacity: .45; transform: scale(.8); } 50% { opacity: .95; transform: scale(1.15) translateY(-4px); } }

/* stage 1: clouds */
.bank { position: absolute; left: 0; bottom: -2px; width: 100%; height: clamp(80px, 17%, 170px); }
.plane { animation: plane 34s linear infinite; }
@keyframes plane { from { translate: -30vw 0; } to { translate: 110vw 0; } }

/* stage 2: edge of space */
.aurora { position: absolute; left: -10%; width: 120%; height: 70px; border-radius: 50%; filter: blur(18px); opacity: .5;
  background: linear-gradient(90deg, transparent, #41f2b0 30%, #6aa8ff 62%, transparent); animation: aurora 7s ease-in-out infinite alternate; }
.a1 { bottom: 48%; rotate: -6deg; }
.a2 { bottom: 31%; opacity: .32; rotate: 4deg; animation-delay: -3s; }
@keyframes aurora { to { translate: 0 -12px; opacity: .28; } }
.karman { position: absolute; left: 0; right: 0; bottom: 17%; border-top: 2px dashed rgba(255, 255, 255, .5); }
.karman span { position: absolute; right: 12px; top: 6px; font: 700 11px var(--body); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.meteor { position: absolute; width: 90px; height: 2px; background: linear-gradient(90deg, #fff, transparent); rotate: -30deg; opacity: 0; animation: meteor 6s linear infinite; }
@keyframes meteor { 0%, 82% { opacity: 0; translate: 0 0; } 86% { opacity: 1; } 100% { opacity: 0; translate: -170px 98px; } }

/* stages 4-6 */
.moon > svg { filter: drop-shadow(0 0 30px rgba(220, 225, 255, .25)); }
.nebula { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .5; }
.n1 { left: -12%; bottom: 55%; width: 62vmin; height: 40vmin; background: radial-gradient(#b34cff, transparent 70%); }
.n2 { right: -16%; bottom: 8%; width: 56vmin; height: 46vmin; background: radial-gradient(#ff4fa8, transparent 70%); opacity: .32; }
.galaxy { position: absolute; width: 74px; height: 26px; border-radius: 50%; rotate: -25deg; opacity: .8;
  background: radial-gradient(#fff 0 8%, rgba(200, 170, 255, .7) 25%, rgba(140, 110, 255, 0) 70%); }
.comet { rotate: 18deg; animation: comet 9s ease-in-out infinite alternate; }
@keyframes comet { to { translate: -26px 10px; } }
.mglow { position: absolute; right: -24%; bottom: 18%; width: 90vmin; height: 90vmin; background: radial-gradient(rgba(255, 100, 60, .26), transparent 64%); }
.planet { right: calc(var(--sz) * -.3); bottom: 34%; width: var(--sz); transform-origin: 30% 60%;
  transition: transform 1.1s cubic-bezier(.5, 0, .8, .4), opacity .45s .7s; }
.planet > svg { filter: drop-shadow(0 0 40px rgba(255, 110, 60, .45)); }
.approach .planet { transform: scale(3.2); opacity: 0; }

/* the Mars landing scene */
#mars { position: absolute; inset: 0; z-index: 1; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity .7s, visibility 0s .7s;
  background: linear-gradient(180deg, #2a1631 0%, #6b2f44 28%, #c0644a 58%, #e9a774 80%); }
.mars-on #mars { opacity: 1; visibility: visible; transition: opacity .7s; }
.earthdot { position: absolute; left: 14%; bottom: 52%; display: flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .78); font: 600 11px var(--body); }
.earthdot i { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c4e8ff, #3d8bff); box-shadow: 0 0 10px 3px rgba(110, 180, 255, .6); }
.mfar { position: absolute; left: 0; bottom: 11%; width: 100%; height: 30%; }
.mnear { position: absolute; left: 0; bottom: 9%; width: 100%; height: 12%; }
.mground { position: absolute; left: 0; bottom: 0; width: 100%; height: 16%; }
.dust { position: absolute; left: 50%; bottom: var(--mground); width: 0; }
.dust i { position: absolute; left: calc(var(--rw) * -.45); bottom: -12px; width: calc(var(--rw) * .9); aspect-ratio: 2; border-radius: 50%;
  background: rgba(232, 160, 112, .9); filter: blur(5px); opacity: 0; }
.touch .dust i { animation: dust 1.3s ease-out both; }
@keyframes dust { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: translateX(var(--dx)) scale(1.9); } }
#astro { position: absolute; bottom: calc(var(--mground) - 2px); left: calc(50% + var(--rw) * .1); width: calc(var(--rw) * .56); z-index: 3; }
#astro .ai { opacity: 0; }
#astro svg { display: block; width: 100%; height: auto; }
.astro-out #astro { animation: walk 1.2s .35s ease-in-out both; }
.astro-out #astro .ai { animation: astroIn .4s both; }
.astro-out #astro svg { animation: step .3s .35s 4 alternate; }
@keyframes walk { to { transform: translateX(calc(var(--rw) * .82)); } }
@keyframes astroIn { from { opacity: 0; transform: scale(.6) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes step { to { transform: translateY(-4px); } }
#flag { position: absolute; bottom: calc(var(--mground) - 3px); left: calc(50% + var(--rw) * 1.42); width: calc(var(--rw) * .7); height: calc(var(--rw) * 1.32); z-index: 2; }
#flag .pole { position: absolute; left: 0; bottom: 0; width: 4px; height: 100%; border-radius: 2px; opacity: 0; background: linear-gradient(90deg, #fff, #aab0c8); }
#flag .pole::before { content: ""; position: absolute; left: -2px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: #ffd23f; }
#flag .cloth { position: absolute; left: 4px; top: 2px; width: calc(100% - 4px); transform: scaleX(0); transform-origin: 0 50%; }
#flag .wave { transform-origin: 0 50%; animation: wave 1.6s ease-in-out infinite; }
#flag svg { display: block; width: 100%; height: auto; }
.flag-up #flag .pole { animation: pole .4s cubic-bezier(.3, 1.4, .6, 1) both; }
.flag-up #flag .cloth { animation: unfurl .55s .35s ease-out both; }
@keyframes pole { from { opacity: 0; transform: translateY(-40%); } to { opacity: 1; transform: none; } }
@keyframes unfurl { to { transform: scaleX(1); } }
@keyframes wave { 0%, 100% { transform: none; } 50% { transform: skewY(-6deg) scaleX(.95); } }
.landed #astro, .landed #astro .ai, .landed #astro svg, .landed #flag .pole, .landed #flag .cloth { animation-duration: 0s !important; animation-delay: 0s !important; }

/* the rocket */
.rocket { position: absolute; left: 50%; bottom: var(--ground); width: var(--rw); margin-left: calc(var(--rw) / -2); z-index: 2;
  transition: bottom var(--fly) cubic-bezier(.55, 0, .35, 1); }
.rocket.up { bottom: 24%; }
.rocket.onmars { bottom: var(--mground); transition: none; }
.rbody svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.flame { position: absolute; left: 30%; width: 40%; top: 97%; z-index: -1; transform-origin: 50% 0; transform: scaleY(0); transition: transform .35s; }
.fi { transform-origin: 50% 0; animation: flick .08s linear infinite alternate; }
.fi svg { display: block; width: 100%; height: auto; }
@keyframes flick { to { transform: scale(.9, .84); } }
.rocket.cruise .flame { transform: scaleY(.6); }
.rocket.burn .flame { transform: scaleY(1.5); }
.rocket.burn .rbody { animation: rumble .06s linear infinite alternate; }
@keyframes rumble { from { transform: translateX(-1px); } to { transform: translateX(1px); } }
.rocket.t-mainstream .flame { filter: hue-rotate(190deg) saturate(1.4); }
.rocket.t-underrated .flame { filter: hue-rotate(245deg) saturate(1.3); }
.rocket.t-gem .flame { filter: hue-rotate(160deg) saturate(1.5); }
.rocket.t-unicorn .flame { animation: rainbow .5s linear infinite; }
@keyframes rainbow { from { filter: hue-rotate(0deg) saturate(1.4); } to { filter: hue-rotate(360deg) saturate(1.4); } }
.trail { position: absolute; left: 34%; width: 32%; top: 135%; height: 0; z-index: -2; border-radius: 40% 40% 50% 50%; opacity: 0; filter: blur(4px);
  background: linear-gradient(var(--tc, #ffd23f), transparent); transition: height .7s, opacity .7s; }
.rocket.burn .trail { height: 260%; opacity: .8; }
.rocket.t-unicorn .trail { background: linear-gradient(#ff4fa8, #ffb020, #2fd27a, #3d8bff, #9b5cff, transparent); }
.rocket.adrift { animation: adrift 4.5s ease-in-out infinite alternate; }
@keyframes adrift { from { transform: rotate(-6deg); } to { transform: translate(14px, 8px) rotate(24deg); } }
.rocket.descend { animation: descend 2.1s cubic-bezier(.15, .65, .3, 1) both; }
@keyframes descend { from { transform: translateY(-110vh); } to { transform: none; } }
.puff { position: absolute; left: 50%; top: 94%; width: 0; }
.puff i { position: absolute; left: calc(var(--rw) * -.18); width: calc(var(--rw) * .36); aspect-ratio: 1; border-radius: 50%; background: rgba(205, 210, 225, .9); filter: blur(2px); opacity: 0; }
.sputter .puff i { animation: puff 1.3s ease-out both; }
.sputter .puff i:nth-child(2) { animation-delay: .3s; --px: -18px; }
.sputter .puff i:nth-child(3) { animation-delay: .6s; --px: 16px; }
@keyframes puff { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: translate(var(--px, 0px), 44px) scale(1.7); } }

#banner { position: absolute; left: 50%; top: 32%; z-index: 3; transform: translate(-50%, 10px); opacity: 0; text-align: center; color: #fff;
  padding: 12px 22px; border-radius: 20px; background: rgba(12, 14, 40, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  white-space: nowrap; transition: opacity .35s, transform .35s; }
#banner.on { opacity: 1; transform: translate(-50%, 0); }
#banner b { display: block; font: 800 clamp(22px, 6vw, 34px)/1.1 var(--display); }
#banner small { display: block; margin-top: 4px; font-weight: 600; opacity: .85; }

/* =================================================================== top bar + HUD */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #fff;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: rgba(10, 12, 36, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand b { font: 800 20px var(--display); letter-spacing: 0.02em; }
.brand b span, .logo span { background: linear-gradient(90deg, var(--violet), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand b span { background: linear-gradient(90deg, #b18cff, #ff6fb9); -webkit-background-clip: text; background-clip: text; }
.brand em { font-style: normal; font-weight: 600; color: rgba(255, 255, 255, .7); font-size: 14px; }
.icon { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 18px; }
#hud { position: sticky; top: 61px; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 8px; width: min(560px, 100%); margin: 0 auto;
  padding: 7px 14px; border-radius: 0 0 16px 16px; font-weight: 600; font-size: 14px; color: #fff;
  background: rgba(10, 12, 36, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#hud[hidden] { display: none; }
#where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#dots { display: flex; gap: 4px; flex: 0 0 auto; }
#dots i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-style: normal; background: rgba(255, 255, 255, .14); border: 2px solid rgba(255, 255, 255, .35); }
#dots i.now { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 79, 168, .3); }
#dots i:not(:empty) { background: #fff; border-color: #fff; }
.sc { white-space: nowrap; }
@media (max-width: 480px) { #where span { display: none; } #dots i { width: 20px; height: 20px; font-size: 11px; } .sc small { display: none; } }

/* =================================================================== screens */
main { position: relative; z-index: 3; width: min(560px, 100% - 24px); margin: 14px auto 60px; transition: opacity .3s, transform .3s; }
main.away { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.card { background: var(--card); border-radius: 26px; padding: 22px 20px; box-shadow: 0 18px 50px rgba(5, 8, 30, .35); border: 1px solid rgba(255, 255, 255, .8); animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.logo { font: 800 clamp(32px, 9.6vw, 60px)/0.95 var(--display); margin: 2px 0 8px; letter-spacing: -0.01em; }
.tag { font-size: 18px; margin: 0 0 14px; color: var(--muted); }
.tag b { color: var(--ink); }
.how { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 7px; }
.how li { background: rgba(139, 92, 255, 0.08); border-radius: 14px; padding: 9px 13px; }
.pick { font-weight: 700; margin: 4px 0 8px; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.av { width: 42px; height: 42px; border-radius: 50%; border: 2px solid transparent; background: rgba(27, 21, 51, 0.05); font-size: 23px; }
@media (max-width: 600px) { .avatars { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 14px; padding: 2px 20px 4px; } .avatars::-webkit-scrollbar { display: none; } .av { flex: 0 0 auto; } .home .tag { font-size: 16px; } }
.av.sel { border-color: var(--pink); background: #fff; box-shadow: 0 4px 14px rgba(255, 79, 168, 0.35); }
.big { width: 100%; padding: 15px 18px; border-radius: 16px; border: 0; font: 800 18px var(--display); color: #fff;
  background: linear-gradient(90deg, var(--violet), var(--pink)); box-shadow: 0 10px 26px rgba(139, 92, 255, 0.35); }
.big.pink { background: linear-gradient(90deg, var(--pink), #ff8a3d); }
.row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 120px; }
.row button:not(.big) { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.mini, .next, .muted { color: var(--muted); font-size: 14px; text-align: center; margin: 12px 0 0; }
.next b { font-variant-numeric: tabular-nums; color: var(--ink); }

/* play */
.qhead { display: flex; justify-content: space-between; font: 700 12px var(--body); letter-spacing: 0.12em; color: var(--muted); }
.cat { text-transform: uppercase; color: var(--violet); }
.q { font: 800 clamp(24px, 6vw, 32px)/1.15 var(--display); margin: 10px 0 14px; }
.q.small { font-size: 18px; }
.fuel { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.fuel .fl { font-size: 18px; }
.cell { position: relative; flex: 1; height: 18px; border-radius: 9px; border: 2.5px solid var(--ink); padding: 2px; }
.cell i { display: block; height: 100%; width: 100%; border-radius: 6px; background: var(--ok); transition: width .1s linear, background .3s; }
.fuel b { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
#ans { display: flex; gap: 8px; }
#in { flex: 1; min-width: 0; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); font: 600 18px var(--body); color: var(--ink); background: #fff; }
#in:focus { border-color: var(--violet); outline: none; }
.send { width: 56px; border-radius: 16px; border: 0; color: #fff; font-size: 20px; background: linear-gradient(135deg, var(--violet), var(--pink)); }
.msg { min-height: 30px; margin-top: 12px; }
.msg .no { color: var(--bad); font-weight: 600; }
.msg button { margin-left: 6px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.posted { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #fff; border: 2px solid var(--tc); animation: pop .4s ease-out; }
.posted div { flex: 1; min-width: 0; }
.posted b { display: block; font-size: 18px; }
.posted small { color: var(--muted); }
.pav { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(27, 21, 51, 0.06); flex: 0 0 auto; }
.pav.big { width: 48px; height: 48px; font-size: 28px; background: rgba(255, 255, 255, .14); }
.badge { padding: 6px 10px; border-radius: 999px; background: var(--tc); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }
.badge em { font-style: normal; opacity: 0.9; margin-left: 2px; }
.t-basic { --tc: var(--t-basic); } .t-mainstream { --tc: var(--t-mainstream); } .t-underrated { --tc: var(--t-underrated); }
.t-gem { --tc: var(--t-gem); } .t-unicorn { --tc: var(--t-unicorn); } .t-miss { --tc: var(--t-miss); }
.loading p { margin: 0; text-align: center; color: var(--muted); font-weight: 600; }

/* game over */
.over { text-align: center; }
.boom { font-size: 50px; animation: pop .4s; }
.over h2 { font: 800 28px var(--display); margin: 4px 0; }
.lostline { margin: 0 0 8px; font-weight: 600; color: var(--bad); }
.reveal { display: grid; gap: 8px; margin: 10px 0 18px; }
.reveal span { padding: 10px; border-radius: 14px; background: color-mix(in oklab, var(--tc) 14%, #fff); }

/* results: the mission report */
.rpost { position: relative; overflow: hidden; border-radius: 20px; padding: 16px; color: #fff;
  background: radial-gradient(circle at 85% 15%, rgba(255, 110, 60, .35), transparent 45%), linear-gradient(160deg, #18205a, #2a1150 70%, #3a1440); }
.rpost.won { background: radial-gradient(circle at 85% 10%, rgba(255, 210, 120, .35), transparent 45%), linear-gradient(170deg, #3a1a3e, #8a3a3a 60%, #c4643f); }
.rpost::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image: radial-gradient(1.5px 1.5px at 12% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 58% 30%, #fff, transparent),
    radial-gradient(1px 1px at 76% 62%, #fff, transparent), radial-gradient(1px 1px at 90% 40%, #fff, transparent), radial-gradient(1.5px 1.5px at 44% 88%, #fff, transparent); }
.rpost > * { position: relative; }
.rhead { display: flex; align-items: center; gap: 10px; }
.rhead small { display: block; color: rgba(255, 255, 255, .7); }
.rstatus { font: 800 22px/1.2 var(--display); margin: 12px 0 2px; }
.rstatus em { font-style: normal; font-size: 16px; opacity: .75; margin-left: 4px; }
.map { display: flex; align-items: center; margin: 10px 0 4px; }
.map .pl { font-size: 22px; flex: 0 0 auto; }
.map .seg { flex: 1; min-width: 4px; height: 3px; margin: 0 2px; border-radius: 2px; background: var(--tc, #fff); }
.map .seg.none { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .35) 0 4px, transparent 4px 8px); }
.map .nd { flex: 0 0 auto; width: 20px; text-align: center; font-size: 15px; font-weight: 400; }
.map .nd.none::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.rscore { font: 800 52px/1 var(--display); margin: 12px 0 4px; }
.rscore span { font-size: 21px; margin-left: 6px; }
.rline { margin: 4px 0 0; color: rgba(255, 255, 255, .85); }
.rankline { text-align: center; margin: 14px 0 6px; font-weight: 600; }
.rankline b { color: var(--pink); }
.hist { display: flex; align-items: flex-end; gap: 3px; height: 64px; margin-bottom: 8px; }
.hist i { flex: 1; border-radius: 4px 4px 0 0; background: rgba(139, 92, 255, 0.3); }
.hist i.me { background: var(--pink); }
.results h3 { font: 800 18px var(--display); margin: 20px 0 8px; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.log li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; border-radius: 14px; background: #fff; border-left: 5px solid var(--tc, var(--line)); }
.log .lq { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.log .lp { font-weight: 700; white-space: nowrap; }
.log li.dim { opacity: 0.55; }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.legend li { display: grid; grid-template-columns: 1fr auto; padding: 8px 12px; border-radius: 12px; background: color-mix(in oklab, var(--tc, #8b5cff) 10%, #fff); }
.legend small { grid-column: 1 / -1; color: var(--muted); }
.legend em { font-style: normal; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 16px; text-align: center; }
.stats div { background: #fff; border-radius: 14px; padding: 10px; }
.stats b { display: block; font: 800 26px var(--display); }
.stats small { color: var(--muted); }
.rate { text-align: center; margin-top: 18px; }
.rate p { margin: 0 0 6px; font-weight: 600; }
.rate button { width: 44px; height: 44px; margin: 0 3px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 700; }
.suggest { margin-top: 18px; }
.suggest label { font-weight: 600; }
.suggest input { padding: 12px; border-radius: 12px; border: 1px solid var(--line); font: inherit; flex: 3 1 160px; }
.suggest button { flex: 1 1 70px; padding: 12px; border-radius: 12px; border: 0; background: var(--ink); color: #fff; font-weight: 700; }

/* emoji bursts */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
#fx span { position: absolute; animation: float 1.5s ease-out forwards; }
@keyframes float { to { transform: translate(var(--dx), -150px) rotate(20deg); opacity: 0; } }

/* modal sheets */
#modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 30, 0.55); }
#modal[hidden] { display: none; }
.sheet { position: relative; width: min(520px, 100%); max-height: 88vh; overflow-y: auto; background: #fff; border-radius: 24px; padding: 22px; animation: rise .25s ease-out; }
.sheet h2 { font: 800 26px var(--display); margin: 0 0 10px; }
.x { position: absolute; right: 12px; top: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(27, 21, 51, 0.06); font-size: 22px; }
.menu { display: grid; gap: 8px; }
.menu button, .menu a { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-weight: 600; text-align: left; text-decoration: none; color: var(--ink); font-size: 16px; }
.set { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set small { display: block; color: var(--muted); font-size: 13px; }
.set input { width: 22px; height: 22px; accent-color: var(--pink); flex: 0 0 auto; }
.alist { display: grid; gap: 6px; }
.arow { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); opacity: 0; z-index: 12; padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 600; transition: all .25s; pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* settings */
body.contrast { --muted: #3d3858; --t-basic: #5c6578; --t-mainstream: #0057ff; --t-underrated: #7a2dff; --t-gem: #0090b0; --t-unicorn: #e0006f; }
body.calm *, body.calm *::before, body.calm *::after { animation-duration: 0s !important; transition-duration: 0s !important; }

/* leaderboards + your astronaut */
.tabs { display: flex; gap: 6px; margin: 4px 0 10px; flex-wrap: wrap; }
.tabs button { flex: 1 1 auto; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 700; }
.tabs button.on { background: linear-gradient(90deg, var(--violet), var(--pink)); color: #fff; border-color: transparent; }
.lbnote { margin: 0 0 8px; text-align: left; }
.lb { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.lb li { display: grid; grid-template-columns: 30px 30px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(27, 21, 51, .04); }
.lb li:nth-child(1) .rk { color: #e0a400; } .lb li:nth-child(2) .rk { color: #8b93a8; } .lb li:nth-child(3) .rk { color: #c0703a; }
.lb li.me { background: rgba(255, 79, 168, .12); box-shadow: inset 0 0 0 2px rgba(255, 79, 168, .45); }
.lb li.gap { display: block; text-align: center; background: none; padding: 0; color: var(--muted); }
.lb .rk { font: 800 16px var(--display); text-align: center; }
.lb .lav { font-size: 22px; text-align: center; }
.lb .ln { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .ln em { font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: var(--pink); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.lb .ln small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.lb .ls { font: 800 17px var(--display); font-variant-numeric: tabular-nums; }
.lbmini { margin-top: 6px; }
.lbmini h3 { margin-top: 16px !important; }
.linkish { border: 0; background: none; padding: 6px 0; color: var(--violet); font-weight: 700; text-decoration: underline; }
.prof { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(139, 92, 255, .08); }
.prof div { flex: 1; min-width: 0; }
.prof b { display: block; font-size: 18px; }
.prof small { color: var(--muted); }
.prof .pav.big { background: #fff; }
.prof button, .code button { padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 700; white-space: nowrap; }
.code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; border: 2px dashed rgba(139, 92, 255, .45); }
.code b { font: 800 22px var(--display); letter-spacing: .08em; }
.muted.left { text-align: left; }
#restore input { flex: 3 1 170px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); font: inherit; text-transform: uppercase; }
#restore button { flex: 1 1 70px; padding: 12px; border-radius: 12px; border: 0; background: var(--ink); color: #fff; font-weight: 700; }
.sheet h3.first { margin-top: 4px; }
.sheet h3 { font: 800 18px var(--display); margin: 18px 0 8px; }

/* play again + your name */
.big.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); box-shadow: none; margin-top: 8px; }
.home .big + .big { margin-top: 8px; }
.big.again { margin-top: 12px; }
.over .big + .big { margin-top: 8px; }
.nameform { margin: 12px 0 4px; text-align: left; }
.nameform label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.nameform .row { margin-top: 0; }
.nameform input { flex: 3 1 160px; padding: 12px; border-radius: 12px; border: 2px solid var(--line); font: 600 16px var(--body); color: var(--ink); background: #fff; }
.nameform input:focus { border-color: var(--violet); outline: none; }
.nameform .row button { flex: 1 1 70px; padding: 12px; border-radius: 12px; border: 0; background: linear-gradient(90deg, var(--violet), var(--pink)); color: #fff; font-weight: 700; }
.nmsg { min-height: 18px; margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.nmsg.bad { color: var(--bad); } .nmsg.good { color: #16a34a; }
.prof button[data-go="newname"] { font-size: 20px; padding: 6px 10px; }
