/* Sol Sprint: full-screen game page. Always dark neon (the game world is a night city). */
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-wght-v6.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #0B0420; --panel: rgba(16, 8, 36, .78); --line: rgba(255, 255, 255, .14); --text: #F4F0FF; --muted: #B3A8D6;
  --purple: #9945FF; --green: #14F195; --pink: #FF3EA5; --cyan: #2EE6FF; --gold: #FFC93A;
  --grad: linear-gradient(90deg, #9945FF, #14F195);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; overscroll-behavior: none; }
body { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; z-index: 10; padding: calc(14px + var(--sat)) calc(14px + var(--sar)) calc(14px + var(--sab)) calc(14px + var(--sal)); }
.modal { display: grid; place-items: center; background: rgba(5, 2, 15, .62); z-index: 30; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.card { width: min(420px, 100%); max-height: calc(100dvh - 28px - var(--sat) - var(--sab)); overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); display: grid; gap: 10px; text-align: center; }
.card.wide { width: min(480px, 100%); }
.card h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.btn { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-weight: 700; font-size: 16px; text-decoration: none; color: var(--text); transition: transform .12s ease, background .15s ease, border-color .15s ease; }
.btn:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .26); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); border: 0; color: #0B0420; font-weight: 900; font-size: 18px; letter-spacing: .04em; box-shadow: 0 8px 30px rgba(153, 69, 255, .35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.icon { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; font-size: 18px; font-weight: 800; position: relative; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.icon[aria-pressed="false"] { opacity: .5; }
.icon i { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip { display: inline-flex; align-items: center; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ---------- loading ---------- */
#loading { display: grid; place-content: center; gap: 18px; text-align: center; background: radial-gradient(ellipse at 50% 80%, #3B1166 0%, var(--bg) 70%); z-index: 50; }
.logo, .home-title h1 { font-weight: 900; font-size: clamp(34px, 8vw, 64px); letter-spacing: .06em; line-height: 1; margin: 0; text-shadow: 0 0 24px rgba(153, 69, 255, .6); }
.logo b, .home-title h1 b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bar { width: min(260px, 70vw); height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 0 auto; }
.bar i { display: block; height: 100%; width: 40%; background: var(--grad); border-radius: 6px; animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
#loading p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- home ---------- */
#home { display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
#home > * { pointer-events: auto; }
.home-top { display: flex; justify-content: space-between; gap: 8px; }
.home-tools { display: flex; gap: 8px; }
.home-title { text-align: center; margin-top: 2vh; pointer-events: none !important; }
.tag { margin: 8px 0 0; color: var(--muted); font-size: 15px; font-weight: 600; }
.home-stats { margin: 10px 0 0; font-size: 14px; color: var(--muted); display: flex; gap: 8px; justify-content: center; }
.home-stats b { color: var(--text); }
.home-bottom { margin: auto auto 0; width: min(440px, 100%); display: grid; gap: 12px; }
.picker { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.arrow { width: 52px; height: 52px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-size: 30px; line-height: 1; display: grid; place-items: center; padding-bottom: 4px; }
.arrow:active { transform: scale(.94); }
.who { text-align: center; min-width: 0; }
.who span { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .08em; }
.who h2 { margin: 2px 0; font-size: 24px; font-weight: 900; }
.who p { margin: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.actions .btn { min-height: 58px; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; padding: calc(10px + var(--sat)) calc(12px + var(--sar)) 0 calc(12px + var(--sal)); display: flex; justify-content: space-between; align-items: flex-start; }
#hud button { pointer-events: auto; }
.score { font-size: clamp(28px, 7vw, 42px); font-weight: 900; letter-spacing: .02em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); line-height: 1; }
.chain { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.chain span { min-width: 40px; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .45); font-weight: 900; font-size: 15px; text-align: center; color: var(--gold); }
.chain span.hot { background: var(--gold); color: #1B0A2E; }
.chain i { width: 84px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.chain b { display: block; height: 100%; width: 0; background: var(--gold); transition: width .15s linear; }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 5; }
#slowmo { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; transition: opacity 0.35s; background: radial-gradient(ellipse at center, rgba(92, 124, 255, 0) 45%, rgba(92, 124, 255, 0.32) 100%); }
#slowmo.on { opacity: 1; }
.od { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.od span { min-width: 40px; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, .45); font-weight: 900; font-size: 11px; letter-spacing: .06em; text-align: center; color: #FF9F1C; }
.od i { width: 84px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.od b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #FF9F1C, #FF4F6D); transition: width .15s linear; }
.od.full span { background: #FF9F1C; color: #1B0A2E; }
.pw.heart { background: #FF3B6B; clip-path: path('M11 20 C2 13 0 8 3 4 C6 1 10 2 11 6 C12 2 16 1 19 4 C22 8 20 13 11 20 Z'); }
.pill.heart { padding: 4px 8px; } .pill.heart i { width: 22px; height: 22px; display: block; animation: beat 1.2s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pill.heart i { animation: none; } }
.hud-right { display: flex; gap: 8px; align-items: center; }
.pill { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; background: rgba(0, 0, 0, .45); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.coin-ic { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFF2B0, var(--gold) 55%, #B07800); box-shadow: 0 0 8px rgba(255, 201, 58, .6); }
#powers { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; justify-items: start; }   /* under the score stack, so it never covers the OD meter or the word */
#powers li { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 6px; border-radius: 10px; background: rgba(0, 0, 0, .45); font-weight: 800; font-size: 13px; }
#powers li i { width: 22px; height: 22px; }
#powers li em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 26px; }
.pw { display: inline-block; width: 22px; height: 22px; border-radius: 6px; flex: none; }
.pw.shield { background: var(--cyan); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.pw.magnet { border: 5px solid #FF4F6D; border-top-color: transparent; border-radius: 50%; }
.pw.sprint { background: linear-gradient(90deg, #FF3B30, #FFD23A); clip-path: polygon(0 20%, 60% 20%, 60% 0, 100% 50%, 60% 100%, 60% 80%, 0 80%); }
.pw.boost { background: #FF9F1C; clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); }
.pw.double { background: var(--gold); border-radius: 50%; }
.pw.mystery { background: #C47DFF; }
.pw.jetpack { background: linear-gradient(135deg, #2EE6FF, #9945FF); border-radius: 2px; clip-path: polygon(50% 38%, 100% 8%, 82% 62%, 50% 100%, 18% 62%, 0 8%); }   /* Ion Wings: a wing chevron */
.pw.sneakers { background: #7CFF4F; border-radius: 4px 12px 4px 4px; height: 14px; margin-top: 4px; }
.pw.pogo { background: linear-gradient(90deg, transparent 40%, #4FC3FF 40%, #4FC3FF 60%, transparent 60%); border-bottom: 5px solid #4FC3FF; border-radius: 2px; }
.pw.board { background: linear-gradient(90deg, #9945FF, #14F195); border-radius: 0; height: 14px; margin-top: 4px;   /* the Hover Drone: body, rotor arms, glow underneath */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 18'%3E%3Cellipse cx='18' cy='9' rx='9' ry='4.5'/%3E%3Crect x='5' y='7.6' width='26' height='2.8' rx='1.4'/%3E%3Cellipse cx='5.5' cy='8' rx='5' ry='2.4'/%3E%3Cellipse cx='30.5' cy='8' rx='5' ry='2.4'/%3E%3Crect x='14' y='13.5' width='8' height='2.5' rx='1.2'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 18'%3E%3Cellipse cx='18' cy='9' rx='9' ry='4.5'/%3E%3Crect x='5' y='7.6' width='26' height='2.8' rx='1.4'/%3E%3Cellipse cx='5.5' cy='8' rx='5' ry='2.4'/%3E%3Cellipse cx='30.5' cy='8' rx='5' ry='2.4'/%3E%3Crect x='14' y='13.5' width='8' height='2.5' rx='1.2'/%3E%3C/svg%3E") center / contain no-repeat; }
.boardbtn { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 14px; border: 0; background: rgba(0, 0, 0, .45); color: #fff; font: 900 16px Inter, system-ui, sans-serif; pointer-events: auto; cursor: pointer; }
.boardbtn .pw.board { width: 30px; margin-top: 0; }
.boardbtn.on { box-shadow: 0 0 0 2px #14F195 inset; }
.boardbtn:disabled { opacity: .45; }
#prerun { position: absolute; left: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 70px)); transform: translateX(-50%); display: flex; gap: 10px; pointer-events: auto; }
.getbtn { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 112px; padding: 10px 12px; border: 0; border-radius: 16px; background: rgba(20, 14, 40, .78); color: #fff; font: 800 13px Inter, system-ui, sans-serif; cursor: pointer; box-shadow: 0 0 0 2px rgba(20, 241, 149, .55) inset; }
.getbtn em { font-style: normal; color: var(--gold); display: flex; align-items: center; gap: 4px; }
.getbtn:disabled { opacity: .4; box-shadow: none; }
.getbtn.used { box-shadow: 0 0 0 2px var(--gold) inset; }
.pw.glider { background: #6BFFB8; clip-path: polygon(0 60%, 50% 20%, 100% 60%, 50% 45%); height: 12px; margin-top: 5px; }
.pw.slowmo { background: #5C7CFF; clip-path: polygon(10% 0, 90% 0, 55% 50%, 90% 100%, 10% 100%, 45% 50%); }
.pw.djump { background: #9FF4FF; clip-path: polygon(50% 0, 100% 45%, 70% 45%, 70% 100%, 30% 100%, 30% 45%, 0 45%); }
.pw.drink { background: linear-gradient(#FF7A1A, #FFD23A); border-radius: 3px 3px 8px 8px; width: 14px; }
.pw.bjump.board { background: linear-gradient(90deg, #4fb82f, #7CFF4F); } .pw.blow.board { background: linear-gradient(90deg, #c96a0a, #FF9F1C); }
.pw.bspeed.board { background: linear-gradient(90deg, #b8203b, #FF3B6B); } .pw.bzap.board { background: linear-gradient(90deg, #1a9ab8, #2EE6FF); } .pw.bglide.board { background: linear-gradient(90deg, #8a4ac8, #C47DFF); }
.pw.head { background: linear-gradient(#ff6b3d, #ffc93a); clip-path: polygon(50% 0, 85% 45%, 70% 100%, 30% 100%, 15% 45%); }
.pw.booster { background: #2ee6ff; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
#prize-row { margin: 10px 0 4px; text-align: center; }
#prize-row p { margin: 0 0 8px; font-weight: 800; }
.btn.gold { background: linear-gradient(90deg, #9945FF, #14F195); color: #0b0716; }
#awards-dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
#btn-awards { position: relative; }
.alist { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; max-height: 46vh; overflow: auto; }
.alist li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.alist li b { font-size: 14px; } .alist li small { opacity: .75; }
.alist li .mbar { grid-column: 1 / -1; }
.alist li.done { opacity: .6; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.days div { padding: 8px 2px; border-radius: 10px; background: rgba(255, 255, 255, .06); text-align: center; font: 800 11px Inter, system-ui, sans-serif; }
.days div.got { background: rgba(20, 241, 149, .25); } .days div.today { box-shadow: 0 0 0 2px var(--gold) inset; }
.days div em { display: block; font-style: normal; color: var(--gold); margin-top: 3px; }
.tier { font: 800 11px Inter, system-ui, sans-serif; padding: 3px 8px; border-radius: 8px; background: rgba(255, 255, 255, .1); }
.tier.b { color: #e0a36a; } .tier.s { color: #d8dee9; } .tier.g { color: #ffd23a; }
.beat { color: var(--gold); font-weight: 800; }
.word { margin-top: 6px; font: 900 15px Inter, system-ui, sans-serif; letter-spacing: .28em; color: rgba(255, 255, 255, .55); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.word b { color: #FFD23A; }
.word.done b { color: #14F195; }

/* toasts + centre messages */
#toasts { position: absolute; left: 50%; top: calc(18% + var(--sat)); transform: translateX(-50%); z-index: 6; pointer-events: none; display: grid; gap: 6px; justify-items: center; }
.toast { padding: 6px 14px; border-radius: 10px; background: rgba(0, 0, 0, .5); font-weight: 900; font-size: 16px; letter-spacing: .03em; animation: toast 1.2s ease-out forwards; white-space: nowrap; }
.toast.gold { color: var(--gold); } .toast.green { color: var(--green); } .toast.cyan { color: var(--cyan); } .toast.pink { color: var(--pink); }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px) scale(.9); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
#center-msg { position: absolute; inset: 0; display: grid; place-items: center; z-index: 7; pointer-events: none; font-weight: 900; font-size: clamp(40px, 12vw, 84px); letter-spacing: .06em; text-shadow: 0 0 30px rgba(153, 69, 255, .8); }
#center-msg .pop { animation: pop .7s ease-out forwards; }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; transform: scale(1.08); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
#hint { position: absolute; left: 50%; bottom: calc(22% + var(--sab)); transform: translateX(-50%); z-index: 6; pointer-events: none; padding: 10px 16px; border-radius: 12px; background: rgba(0, 0, 0, .55); font-weight: 700; font-size: 15px; text-align: center; line-height: 1.5; max-width: 92vw; animation: fadeout 5s ease forwards; }
@keyframes fadeout { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* optional on-screen buttons */
#touchpad { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); }
#touchpad button { height: 72px; border-radius: 16px; border: 1px solid var(--line); background: rgba(16, 8, 36, .55); font-size: 26px; touch-action: none; }
#touchpad button:active, #touchpad button.on { background: rgba(153, 69, 255, .45); }

/* ---------- end of run ---------- */
#over { display: grid; place-items: center; background: linear-gradient(to bottom, rgba(5, 2, 15, .1), rgba(5, 2, 15, .7)); }
#over .card { gap: 12px; }
@media (min-aspect-ratio: 6/5) { #over { place-items: center end; padding-right: calc(5vw + var(--sar)); } }
@media (max-aspect-ratio: 6/5) { #over { place-items: end center; } }
.overline { margin: 0; text-transform: uppercase; letter-spacing: .14em; font-size: 12px !important; font-weight: 800; }
.final { font-size: clamp(46px, 12vw, 66px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.newbest { color: var(--gold) !important; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; font-size: 14px !important; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.grid div { padding: 10px 4px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.grid dt { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.grid dd { margin: 4px 0 0; font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* missions */
#missions, #over-missions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
#missions li, #over-missions li { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid transparent; font-size: 14px; font-weight: 600; }
#missions li.done, #over-missions li.done { border-color: rgba(20, 241, 149, .5); background: rgba(20, 241, 149, .08); }
.mbar { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .1); margin-top: 7px; overflow: hidden; }
.mbar b { display: block; height: 100%; background: var(--grad); }
.mtext { display: flex; justify-content: space-between; gap: 10px; }
.mtext em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
#missions li .where, #over-missions li .where { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.mlevel { margin: 4px 0 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); text-align: left; }
.mlevel b#m-level { font-size: 16px; }
.mlevel em { font-size: 13px; }

/* help + settings */
.howto, .legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; font-size: 14px; color: var(--muted); line-height: 1.45; }
.howto b, .legend b { color: var(--text); margin-right: 4px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.field { display: grid; gap: 6px; text-align: left; font-weight: 700; font-size: 14px; }
.field select { height: 46px; border-radius: 10px; border: 1px solid var(--line); background: #160B30; padding: 0 10px; }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; text-align: left; font-weight: 600; font-size: 15px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.timer { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: left; }

/* landscape phones: tighter */
@media (max-height: 520px) {
  .home-title { margin-top: 0; } .home-title h1 { font-size: 32px; } .tag { display: none; }
  .home-bottom { width: min(560px, 100%); grid-template-columns: 1.1fr 1fr; align-items: center; }
  .actions .btn { min-height: 52px; } .actions .btn small { display: none; }
  .card { padding: 16px; gap: 8px; }
  .grid dd { font-size: 16px; }
  #touchpad button { height: 58px; }
}
@media (min-width: 900px) and (min-height: 600px) {
  .home-bottom { margin-bottom: 4vh; }
}
@media (prefers-reduced-motion: reduce) {
  .toast, #center-msg .pop, .newbest, .bar i { animation-duration: .01s; animation-iteration-count: 1; }
  .toast { animation: none; opacity: 1; }
}

/* ---------- leaderboard ---------- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.tabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 800; font-size: 14px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: rgba(153, 69, 255, .35); color: var(--text); }
#board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; text-align: left; max-height: min(46vh, 420px); overflow: auto; }
#board-list li { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); font-size: 14px; }
#board-list li.me { background: rgba(20, 241, 149, .12); outline: 1px solid rgba(20, 241, 149, .45); }
#board-list .rk { font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; }
#board-list li:nth-child(1) .rk { color: var(--gold); } #board-list li:nth-child(2) .rk { color: #D7DDF0; } #board-list li:nth-child(3) .rk { color: #E7A266; }
#board-list .nm { min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#board-list .nm small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); }
#board-list .sc { font-weight: 900; font-variant-numeric: tabular-nums; }
.board-me { margin: 0; font-weight: 800; color: var(--green) !important; font-size: 14px !important; }
#board-status { font-size: 14px; font-weight: 700; color: var(--muted); min-height: 0; }
#board-status b { color: var(--green); }
#board-status .warn { color: var(--gold); }
#board-status button { margin-left: 6px; }
#join-form { display: grid; gap: 8px; text-align: left; padding: 12px; border-radius: 12px; background: rgba(153, 69, 255, .12); border: 1px solid rgba(153, 69, 255, .35); }
#join-form label { font-size: 14px; font-weight: 800; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.join-row input { min-width: 0; height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #160B30; font-size: 16px; -webkit-user-select: text; user-select: text; }
.join-row .btn { min-height: 46px; padding: 0 16px; font-size: 15px; }
.join-err { margin: 0; color: var(--pink) !important; font-size: 13px !important; font-weight: 700; }
.linkbtn { justify-self: start; border: 0; background: none; padding: 4px 0; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: underline; }
#awards-modal .tabs { grid-template-columns: repeat(4, 1fr); display: grid; }
#board-modal .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#board-modal .tabs button { min-width: 0; min-height: 44px; font-size: 13px; padding: 6px 8px; white-space: normal; overflow-wrap: anywhere; }
#board-modal .card > p { overflow-wrap: anywhere; line-height: 1.45; }
@media (prefers-color-scheme: light) {
  #board-modal .card { --text: #241638; --muted: #5b4c70; --gold: #8a5800; --green: #08774b; color: var(--text); background: rgba(250, 247, 255, .97); border-color: #d6cbe3; }
  #board-modal .tabs { background: #ebe4f3; }
  #board-modal .tabs button[aria-selected="true"] { color: #241638; background: #fff; }
  #board-modal #board-list li { background: #eee8f5; }
}
#awards-modal .tabs button { font-size: 13px; padding: 0 2px; }
#awards-body > .btn { width: 100%; }
.char-start { margin: 2px 0 0; font-weight: 800; font-size: 12px; letter-spacing: .04em; color: #14F195; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }   /* each runner's home district */
/* game modes: the picker and the in-run panel */
.modes-list { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 8px; max-height: 58vh; overflow: auto; }
.modes-list button { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); color: inherit; font: inherit; cursor: pointer; }
.modes-list button:hover, .modes-list button:focus-visible { background: rgba(153, 69, 255, .22); border-color: rgba(153, 69, 255, .6); }
.modes-list b { font-size: 15px; font-weight: 900; }
.modes-list em { font-style: normal; font-size: 12px; font-weight: 800; color: #14F195; text-align: right; }
.modes-list span { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.modehud { position: absolute; left: 50%; top: calc(64px + var(--sat)); transform: translateX(-50%); padding: 6px 14px; border-radius: 12px; background: rgba(0, 0, 0, .5); font-weight: 900; font-size: 15px; white-space: nowrap; text-align: center; }
.modehud small { display: block; font-size: 11px; font-weight: 800; color: var(--muted); }
.modehud .ahead { color: #14F195; } .modehud .behind { color: #FF4F6D; }
.rbar { position: relative; width: min(56vw, 240px); height: 8px; margin: 4px auto 6px; border-radius: 4px; background: rgba(255, 255, 255, .18); }
.rb-fin { position: absolute; right: -2px; top: -4px; width: 4px; height: 16px; background: repeating-linear-gradient(#fff 0 4px, #111 4px 8px); }
.rb { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid #0b0d12; transition: left .1s linear; }
.rb-you { background: #FFD23A; width: 14px; height: 14px; margin: -7px 0 0 -7px; z-index: 2; }
.rb-pace { background: #9FF4FF; opacity: .9; } .rb-best { background: #14F195; opacity: .9; }


/* share button (home screen) and the share pop-up */
.share-chip { gap: 8px; border: 0; border-radius: 8px; background: linear-gradient(90deg, #9945FF, #14F195); color: #0b0420; font-weight: 800; cursor: pointer; }
.share-chip svg { flex: none; }

/* Share sits at the far right end of the top bar; on a narrow phone the bar wraps so nothing is squeezed */
.home-top { flex-wrap: wrap; align-items: flex-start; }
.home-tools { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.home-tools .share-chip { margin-left: 4px; }
@media (max-width: 520px) {
  .home-top { justify-content: flex-end; }
  .home-top > .chip { margin-right: auto; }
  .home-tools { display: contents; }
  .home-tools .share-chip { order: 1; margin-left: 0; }
  .home-top::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .home-tools .icon { order: 2; }
}
