/* Sledneckotron 26,000 (js/sledneck-app.js): the mountain full screen
   under the key bar, the HUD in the painted mockup's places (gates and
   rings top left beside the back and pause buttons, the run's banner top middle,
   the score top right, the speed bottom left), the touch halves under
   everything, Jump and Trick bottom right. Tokens only: the game draws
   its own picture. */
.sledneck-app {
  position: absolute;
  inset: var(--safe-top) 0 0;
  overflow: hidden;
  background: var(--bg);
  touch-action: none;
  user-select: none;
}
.sled-stage { position: absolute; inset: 0; }
.sled-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sled-touch { position: absolute; inset: 0; z-index: 1; }
/* The back button sits above every screen of the game (cover, keys card,
   menu, lodge, pause, finish card): 20, over their 1 to 10. */
.sledneck-app .game-back { position: absolute; top: var(--s2); left: var(--s2); z-index: 20; }
.sledneck-app .game-hint { z-index: 4; }
/* Pause: a round button beside the back button, in a ride only (no key
   pauses one: play and next are Jump and Trick). Its two bars are CSS. */
.sled-pausebtn {
  position: absolute; top: var(--s2); left: calc(var(--s2) + var(--control) + var(--s2)); z-index: 19;
  display: none; place-items: center;
}
.sledneck-app[data-screen="chair"] .sled-pausebtn, .sledneck-app[data-screen="ride"] .sled-pausebtn { display: grid; }
.sled-pausebars { display: block; width: 30px; height: 34px; border-inline: 10px solid currentColor; border-radius: 3px; }

.sled-hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; font-family: var(--font); color: var(--text); }
.sled-hud p { margin: 0; }
.sled-tally, .sled-score, .sled-speed, .sled-banner {
  position: absolute;
  background: var(--glass);
  border-radius: var(--r-m);
  padding: var(--s1) var(--s2);
}
.sled-tally { top: var(--s2); left: calc(var(--s2) + 2 * (var(--control) + var(--s2))); display: flex; gap: var(--s3); font-size: var(--fs-label); }
.sled-tally b, .sled-score b { font-size: var(--fs-body); font-weight: var(--fw-bold); }
.sled-tally span, .sled-score span, .sled-speed span { color: var(--text-2); }
.sled-banner {
  top: var(--s2); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--s1);
  font-size: var(--fs-body); font-weight: var(--fw-bold);
}
.sled-banner[hidden] { display: none; }
.sled-mark { font-style: normal; }
.sled-mark-circle { color: var(--art-green, var(--text)); }
.sled-mark-square { color: var(--art-blue, var(--text)); }
.sled-mark-diamond { color: var(--text); }
.sled-score { top: var(--s2); right: var(--s2); font-size: var(--fs-label); }
.sled-speed { bottom: var(--s2); left: var(--s2); display: flex; align-items: baseline; gap: var(--s1); }
.sled-speed b { font-size: var(--fs-title); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; min-width: 2.2ch; text-align: right; }
.sled-speed span { font-size: var(--fs-label); }
.sled-count {
  position: absolute; left: 0; right: 0; top: 30%; text-align: center;
  font-size: var(--fs-display); font-weight: var(--fw-bold); text-shadow: var(--shadow-text);
}
.sled-count[hidden], .sled-word[hidden] { display: none; }
.sled-count.pop { animation: sled-pop 240ms ease-out; }
@keyframes sled-pop { from { transform: scale(1.4); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
.sled-word {
  position: absolute; left: 0; right: 0; top: 22%; text-align: center;
  font-size: var(--fs-headline); font-weight: var(--fw-bold); text-shadow: var(--shadow-text);
}
.sled-word-crash { color: var(--accent); }

.sled-buttons { position: absolute; right: var(--s2); bottom: var(--s2); z-index: 3; display: flex; gap: var(--s2); }
.sled-btn {
  min-width: calc(var(--control) * 1.4); height: var(--control);
  border: 0; border-radius: var(--r-pill);
  background: var(--glass); color: var(--text);
  font: var(--fw-semibold) var(--fs-body) var(--font);
}
.sled-btn:active { background: var(--glass-press); }

.sled-card { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: var(--veil-game); }
.sled-card[hidden] { display: none; }
/* The card fits the 1280 x 664 frame in its tallest case (every row, the
   no-medal line, NEW BEST!, the Best line): tight margins, and the rows in
   two columns with the score across both. */
.sled-card-box { min-width: 520px; max-width: 920px; padding: var(--s2) var(--s4); border-radius: var(--r-xl); text-align: center; }
.sled-card-box h2 { margin: 0; font-size: var(--fs-title); line-height: 1.15; }
.sled-card-line { margin: 0 0 var(--s1); font-size: var(--fs-body); line-height: 1.2; color: var(--text-2); }
.sled-card-table { display: grid; grid-template-columns: auto auto; column-gap: var(--s5); row-gap: 2px; justify-content: center; margin: 0 auto var(--s1); font-size: var(--fs-label); line-height: 1.25; }
.sled-card-table tr { display: flex; justify-content: space-between; gap: var(--s3); text-align: left; }
.sled-card-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sled-card-table tr.total { grid-column: 1 / -1; justify-content: center; gap: var(--s4); margin-top: 2px; }
.sled-card-table tr.total td { font-weight: var(--fw-bold); font-size: var(--fs-body); }
.sled-card-best { margin: 0 0 var(--s1); font-size: var(--fs-label); line-height: 1.2; color: var(--accent); }
.sled-card-best:empty { display: none; }
.sled-card-box .sled-again, .sled-card-box .sled-tolodge { height: 72px; }
.sled-card-buttons { display: flex; gap: var(--s2, 12px); justify-content: center; }
.sled-card-buttons > .btn { flex: 1 1 0; }
.sled-tolodge[hidden] { display: none; }
.sled-credit { margin: var(--s1) 0 0; font-size: var(--fs-micro); color: var(--text-3); }

.sled-fps { position: absolute; bottom: var(--s2); left: 50%; transform: translateX(-50%); z-index: 7; background: var(--glass); color: var(--text); padding: 4px var(--s1); font-size: var(--fs-micro); border-radius: var(--r-s); }
.sled-fps[hidden] { display: none; }
.sled-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: var(--fs-title); color: var(--text-2); }
.sled-loading[hidden] { display: none; }
.sledneck-app[data-screen="nogl"] .sled-buttons, .sledneck-app[data-screen="failed"] .sled-buttons,
.sledneck-app[data-screen="loading"] .sled-buttons { display: none; }

@media (prefers-reduced-motion: reduce) {
  .sled-count.pop { animation: none; }
}

