@font-face { font-family: "Lilita One"; src: url("/fonts/LilitaOne-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/Nunito-Variable.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --night: #0b1828; --panel: rgba(12, 26, 40, 0.92); --ink: #f6f1e6; --muted: #b9c4cc;
  --red: #c5372d; --red-dark: #a42a21; --gold: #e3a93b; --green: #183f35; --line: rgba(255, 255, 255, 0.14);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); }
body { font: 16px/1.5 "Nunito", system-ui, sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
a { color: var(--gold); }
button, select { font: inherit; }

.g-scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.g-panel {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 22px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); -webkit-user-select: text; user-select: text; touch-action: auto;
}
.g-panel h1, .g-panel h2 { font-family: "Lilita One", system-ui, sans-serif; font-weight: 400; margin: 0 0 8px; line-height: 1.05; }
.g-panel h1 { font-size: 2.6rem; color: var(--gold); }
.g-panel h2 { font-size: 2rem; }
.g-panel p { margin: 0 0 12px; }
.g-kicker { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; margin: 0 0 4px !important; }
.g-muted { color: var(--muted); font-size: 0.9rem; }
body[data-screen="menu"] .g-scene, body[data-screen="paused"] .g-scene, body[data-screen="done"] .g-scene { filter: brightness(0.55); }

.g-field { display: grid; gap: 4px; margin: 14px 0 10px; font-weight: 800; font-size: 0.9rem; }
.g-field select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #13263a; color: var(--ink); }

.g-stages { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.g-stage {
  width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--ink);
}
.g-stage:hover, .g-stage:focus-visible { background: rgba(227, 169, 59, 0.16); border-color: var(--gold); outline: none; }
.g-stage strong { display: block; }
.g-stage small { color: var(--muted); }
.g-stage__no { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--red); font-weight: 900; }

.g-help { font-size: 0.9rem; color: var(--muted); }
.g-help summary { cursor: pointer; color: var(--ink); font-weight: 800; }
.g-help ul { padding-left: 1.1rem; margin: 8px 0 0; }

.g-buttons { display: grid; gap: 8px; margin: 14px 0; }
.g-btn { padding: 12px 16px; border-radius: 999px; border: 0; background: var(--red); color: #fff; font-weight: 900; cursor: pointer; }
.g-btn:hover { background: var(--red-dark); }
.g-btn--quiet { background: rgba(255, 255, 255, 0.08); }
.g-btn--quiet:hover { background: rgba(255, 255, 255, 0.16); }
.g-stars { font-size: 2.6rem; color: var(--gold); letter-spacing: 0.1em; margin: 0 0 6px !important; }
.g-result { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-result div { background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 8px 12px; }
.g-result span { display: block; color: var(--muted); font-size: 0.8rem; }
.g-result b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }

.g-hud { position: fixed; inset: 0; pointer-events: none; }
.g-top { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 10px; align-items: flex-start; }
.g-say { flex: 1; min-width: 0; background: var(--panel); border-radius: 14px; padding: 10px 14px; border-left: 5px solid var(--gold); }
.g-say strong { display: block; font-size: 1.15rem; line-height: 1.25; }
.g-say span { color: var(--muted); font-size: 0.95rem; }
.g-minimap { flex: none; margin-left: auto; width: 112px; height: 112px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.5); background: #16251d; }
.g-stats {
  position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 122px); left: 10px;
  display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 20px);
}
.g-stats span, .g-stats button { background: var(--panel); border-radius: 999px; padding: 3px 10px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.g-stats button { pointer-events: auto; border: 1px solid rgba(255, 255, 255, 0.3); color: var(--ink); font-weight: 800; cursor: pointer; }
.g-toast {
  position: absolute; left: 50%; top: 42%; transform: translateX(-50%); margin: 0; max-width: calc(100% - 40px);
  background: var(--red); color: #fff; font-weight: 900; padding: 8px 16px; border-radius: 999px; text-align: center;
}
.g-pads { position: absolute; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom)); padding: 0 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.g-pads button { pointer-events: auto; touch-action: none; border: 2px solid rgba(255, 255, 255, 0.35); color: #fff; font-weight: 900; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.g-steer, .g-pedals { display: flex; gap: 10px; }
.g-steer button { width: 72px; height: 72px; border-radius: 50%; background: rgba(12, 26, 40, 0.7); font-size: 1.5rem; }
.g-pedals button { width: 74px; height: 100px; border-radius: 18px; font-size: 1.05rem; }
.g-go { background: rgba(47, 125, 79, 0.85); }
.g-back { background: rgba(197, 55, 45, 0.85); }
.g-pads button.is-down { transform: scale(0.94); border-color: #fff; filter: brightness(1.25); }
@media (pointer: fine) and (min-width: 900px) {
  .g-steer, .g-pedals { opacity: 0.55; }
  .g-minimap { width: 150px; height: 150px; }
  .g-stats { top: calc(max(10px, env(safe-area-inset-top)) + 160px); }
  .g-say { max-width: 520px; }
}

.g-credit { position: fixed; right: 8px; bottom: 2px; margin: 0; font-size: 0.68rem; color: rgba(255, 255, 255, 0.55); }
body[data-screen="play"] .g-credit { right: 0; left: 0; text-align: center; }

/* iPhone: no website can go full screen, but a page that scrolls lets a swipe up fold Safari's bars away. */
html.g-ios, html.g-ios body { height: auto; overflow: visible; }
html.g-ios body { min-height: calc(100vh + 200px); }
html.g-ios .g-scene, html.g-ios .g-hud { height: 100dvh; bottom: auto; }
.g-swipe {
  position: fixed; inset: 0; z-index: 5; display: grid; place-content: center; gap: 14px; text-align: center;
  background: rgba(11, 24, 40, 0.72); touch-action: pan-y; -webkit-user-select: none; user-select: none;
}
.g-swipe[hidden] { display: none; }
.g-swipe p { margin: 0; font-weight: 900; font-size: 1.3rem; }
.g-swipe span { display: block; font-size: 3rem; line-height: 1; animation: g-up 1.2s ease-in-out infinite; }
.g-swipe button { justify-self: center; background: none; border: 1px solid rgba(255, 255, 255, 0.4); color: var(--ink); border-radius: 999px; padding: 6px 16px; }
@keyframes g-up { 0%, 100% { transform: translateY(8px); opacity: 0.6; } 50% { transform: translateY(-8px); opacity: 1; } }

/* Getting back to the site, and giving. */
.g-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: -6px 0 12px; }
.g-home { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 900; text-decoration: none; }
.g-home img { width: 28px; height: 28px; }
.g-home:hover { color: var(--gold); }
.g-btn { display: inline-block; text-align: center; text-decoration: none; }
.g-btn--small { padding: 7px 14px; font-size: 0.9rem; }
.g-real { margin: 12px 0 0 !important; }
.g-give { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.g-give p { margin: 0; color: var(--muted); }
.g-give strong { color: var(--ink); }
.g-link { color: var(--gold); font-weight: 800; text-align: center; }

/* The way back, always on screen while driving. */
.g-stats .g-backlink { pointer-events: auto; background: var(--red); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: 0.85rem; font-weight: 900; text-decoration: none; }

/* The real Santa, from the tracker: what he's up to, and a tap back to watch him. */
.g-santa {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; text-decoration: none; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; font-size: 0.85rem;
}
.g-santa[hidden] { display: none; }
.g-santa b { flex: none; color: var(--gold); }
.g-santa.is-out { background: var(--red); border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.g-santa.is-out b { color: #fff; }
.g-stats .g-santa { flex-basis: 100%; max-width: 520px; pointer-events: auto; }
.g-santa--menu { margin: 0 0 12px; }
.g-stats .g-santa span { background: none; padding: 0; border-radius: 0; }
