/* DrawPack: Sky Dash. Loaded after arcade.css and games-*.css, and before ui-hop.css.
   Builds on the Night Arcade tokens (src/game.html) and on the shared stage of the two canvas games (part 0).

   0 Shell bridge and the shared stage (Sky Dash and Road Hopper)   1 Stage   2 Prompts on the stage
   3 The result card   4 Small screens

   The night sky is the stage. The words that sit on it are dark glass with a hairline in the game's colour
   (--gc), and nothing on the stage takes a tap away from the game. */

/* ---------- 0. shell bridge ----------
   This game and Road Hopper were drawn for a shell with a few tokens the Night Arcade shell names differently.
   They are mapped here, on the game's own page only, so nothing outside the game can change.
   --gc is the game's colour: the first colour of its world (WORLDS in arcade.css, or the hue fallback). */
:root .view[data-view="skydash"] { --gc: var(--g1); --hair: #ffffff14; --hair-2: #ffffff26; --dim: color-mix(in srgb, var(--muted) 80%, var(--bg));
  --r-3: var(--r-md); --r-4: var(--r-lg); --spring: var(--ease-pop); --t-2: var(--t-ui); --t-3: var(--t-panel); }
@keyframes uiPop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* The shared stage of the canvas games: a cabinet that frames the playfield. Road Hopper (ui-hop.css) uses these rules too.
   Every selector starts with the two game pages inside :where(), which adds no weight: the rules can not reach another
   game, and the games' own rules below and in ui-hop.css still win. */
:where([data-view="skydash"], [data-view="roadhop"]) .gbx { container-type: inline-size; }
:where([data-view="skydash"], [data-view="roadhop"]) .gb-stage { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: clamp(300px, calc((100dvh - 224px) * .75), 456px); margin: 0 auto; }
/* the cabinet: a dark bezel with a hairline in the game's colour, and a sheet of glass over the playfield */
:where([data-view="skydash"], [data-view="roadhop"]) .gb-cab { position: relative; padding: 8px; border-radius: 24px; border: 1px solid color-mix(in srgb, var(--gc) 34%, var(--line));
  background: linear-gradient(180deg, #ffffff14, #ffffff05 26%, transparent 60%), #0a0d14;
  box-shadow: inset 0 1px 0 #ffffff24, inset 0 -1px 0 #000, var(--edge), 0 34px 60px -36px color-mix(in srgb, var(--gc) 75%, #000), 0 22px 40px -26px #000; }
:where([data-view="skydash"], [data-view="roadhop"]) .gb-cab .cv { max-width: none; margin: 0; border-radius: 16px; background: #0a0c12; -webkit-tap-highlight-color: transparent; }
:where([data-view="skydash"], [data-view="roadhop"]) .gb-cab::after { content: ""; position: absolute; inset: 8px; border-radius: 16px; pointer-events: none;
  background: linear-gradient(118deg, #ffffff12, transparent 26%); box-shadow: inset 0 0 0 1px #ffffff12, inset 0 1px 0 #ffffff30, inset 0 -34px 44px -34px #000c; }
@media (max-width: 699px) {
  :is(.view[data-view="skydash"], .view[data-view="roadhop"]) .game > .board { padding: 10px; } /* a phone: the playfield gets the room, as on the Plinko page */
  :where([data-view="skydash"], [data-view="roadhop"]) .gb-cab { padding: 6px; border-radius: 20px; }
  :where([data-view="skydash"], [data-view="roadhop"]) .gb-cab .cv, :where([data-view="skydash"], [data-view="roadhop"]) .gb-cab::after { border-radius: 14px; }
  :where([data-view="skydash"], [data-view="roadhop"]) .gb-cab::after { inset: 6px; }
}

/* ---------- 1. stage ---------- */
.view[data-view="skydash"] .gb-cab { background: linear-gradient(180deg, #ffffff14, #ffffff05 26%, transparent 60%), #060a16; }
.view[data-view="skydash"] .gb-cab::after { background: linear-gradient(118deg, #ffffff0d, transparent 24%); box-shadow: inset 0 0 0 1px #ffffff12, inset 0 1px 0 #ffffff30; z-index: 2; }
.sd-stage { position: relative; overflow: hidden; border-radius: 16px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.sd-stage .cv { display: block; width: 100%; background: #050916; }
.sd-stage.live { cursor: default; }
.sd-ov { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: 14px; pointer-events: none; }
.sd-ov[hidden] { display: none; }
#skydash-go { touch-action: none; }

/* ---------- 2. the paused prompt on the stage ---------- */
.sd-prompt { display: grid; justify-items: center; max-width: 100%; padding: 12px 20px; border-radius: 12px; text-align: center; background: #050a18e6; animation: uiPop var(--t-3) var(--spring) both; }
.sd-prompt b { font-size: 20px; font-weight: 700; color: #fff; }

/* ---------- 3. the result: the score and one plain line on a dark scrim over the sky (no card, no tiles) ---------- */
.sd-over { background: radial-gradient(80% 50% at 50% 46%, #030712d9, #0307128c 70%, #03071240); animation: sdFade var(--t-3) var(--ease) both; }
@keyframes sdFade { from { opacity: 0; } }
.sd-card { display: grid; justify-items: center; gap: 4px; max-width: 100%; text-align: center; animation: uiPop .34s var(--spring) both; }
.sd-tag { padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; color: #2a1800; background: var(--gold); }
.sd-num { font-family: var(--font-display); font-weight: 800; font-size: 68px; line-height: .95; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; color: #fff; }
.sd-unit { font-size: 14px; font-weight: 600; color: var(--fg-2, #c8cde6); }
.sd-line { margin-top: 8px; font-size: 14px; color: var(--fg-2, #c8cde6); white-space: nowrap; }
.sd-line b { font-family: var(--font-mono); font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; }
.sd-line b.c { color: var(--gold); }
.sd-card.best .sd-num { color: var(--gold); }

/* the low quality setting drops the glow around the words on the stage (the stage drops its own in the script) */


/* ---------- 4. small screens ---------- */
@media (max-width: 699px) {
  .sd-stage { border-radius: 14px; }
  .sd-num { font-size: 58px; }
}
/* The light skin needs nothing here: the shell keeps every game page in its dark cabinet (.dk in arcade.css),
   so the stage and the words over it always have the dark set of colours. */

/* ---------- 5. the play dock under the cabinet: Start, Lift, Resume and Fly again (the sky takes taps too) ---------- */
.view[data-view="skydash"] .gdock { width: 100%; max-width: clamp(300px, calc((100dvh - 224px) * .75), 456px); margin: 14px auto 0; }
.view[data-view="skydash"] .gdock #skydash-go { flex: 1 1 auto; min-height: 54px; }
.view[data-view="skydash"] .ctrl:not(:has(.stat:not([hidden]))):not(:has(.gmsg:not(:empty))) { display: none; } /* nothing to set up: no empty panel */
@media (max-width: 699px) { .view[data-view="skydash"] .gdock { margin-top: 10px; } .view[data-view="skydash"] .gdock #skydash-go { min-height: 52px; } }
