/* Sled Rush only. Everything else comes from ../shared/game.css. */
#screen{touch-action:none;user-select:none;-webkit-user-select:none;overflow:hidden;border-radius:6px}   /* steering never scrolls */
/* the 3D slope fills the game screen (the cards sit on top of it) */
canvas#world{position:absolute;inset:0;width:100%;height:100%;image-rendering:auto;border-radius:6px;cursor:crosshair}
canvas#world:focus-visible{outline:2px solid var(--cyan);outline-offset:-2px}
.flash{position:absolute;inset:0;opacity:0;pointer-events:none;border-radius:6px}
.overlay{z-index:2}.zone-banner{z-index:2}
/* the bar fills down the slope: pine to frost to gold */
.progress-fill{background:linear-gradient(90deg,#2fb36a,#9fe6ff,#ffd60a);transition:width .25s ease-out}
/* JUMP: a big round button over the slope's bottom right corner, on touch screens only (mouse = click, keys = Space) */
.game{position:relative}
.jump-btn{position:absolute;right:30px;bottom:32px;z-index:3;width:78px;height:78px;border-radius:50%;display:none;
  place-items:center;font:800 13px/1 "Plus Jakarta Sans",system-ui,sans-serif;letter-spacing:.06em;color:#fff;
  background:radial-gradient(circle at 35% 30%,rgba(255,150,160,.95),rgba(230,57,70,.88) 55%,rgba(110,14,28,.88));
  border:2px solid rgba(255,255,255,.85);box-shadow:0 0 0 4px rgba(255,214,10,.2),0 6px 16px rgba(0,0,0,.4);
  touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.jump-btn.on{background:radial-gradient(circle at 35% 30%,#fff7c0,#ffd60a 55%,#c89a10);color:#1a1240;transform:scale(.95)}
@media (pointer:coarse){.jump-btn{display:grid}}
.jump-btn.off{visibility:hidden}
@media (max-width:420px){.jump-btn{right:24px;bottom:28px;width:70px;height:70px;font-size:12px}}

/* ---------- phones, once the game has started (shared/phone-bar adds html.gw-slim and the slim bar) ----------
   Grid tricks: .hud becomes display:contents, so its parts sit straight in .game's grid next to the progress bar.
   Taps go through the display to the slope, so a drag can start anywhere; only the sound button catches them. */
@media (pointer:coarse){
  html.gw-slim .gw-frame .game{display:grid;gap:0;padding:0}
  html.gw-slim .hud{display:contents}
  html.gw-slim .hud .daily,html.gw-slim .hud .right,html.gw-slim .hud .tip,html.gw-slim .game .progress{position:relative;z-index:1;pointer-events:none}
  html.gw-slim .hud .daily{white-space:nowrap}
  html.gw-slim .hud .right{justify-self:end;gap:8px;font-variant-numeric:tabular-nums}
  html.gw-slim .hud .mute{position:relative;font-size:10px;letter-spacing:.04em;padding:4px 6px;pointer-events:auto}
  html.gw-slim .hud .mute::after{content:"";position:absolute;inset:-8px}     /* a bigger area to tap than to see */
  /* the tip floats over the top of the slope, so a new tip never moves or resizes the slope */
  html.gw-slim .hud .tip{align-self:start;justify-self:center;max-width:calc(100% - 20px);margin:0;padding:3px 10px;border-radius:10px;
    background:#0b0a10c4;font-size:12px;line-height:1.35;letter-spacing:.02em}
  html.gw-slim .hud .tip:empty{display:none}
  html.gw-slim .gw-frame #screen,html.gw-slim canvas#world,html.gw-slim .flash{border-radius:0}
  html.gw-slim .jump-btn{right:14px;bottom:calc(14px + env(safe-area-inset-bottom))}
}
/* upright: one line of display, the bar, then the slope from edge to edge */
@media (orientation:portrait){
  html.gw-slim .gw-frame .game{grid-template:auto auto minmax(0,1fr)/minmax(0,1fr) auto}
  html.gw-slim .hud{font-size:12px;letter-spacing:.02em}
  html.gw-slim .hud .daily{grid-area:1/1;align-self:center;margin:6px 0 6px 10px}
  html.gw-slim .hud .right{grid-area:1/2;margin:6px 10px 6px 8px}
  html.gw-slim .game .progress{grid-area:2/1/3/3;height:18px;margin:0 10px 6px}
  html.gw-slim .gw-frame #screen{grid-area:3/1/4/3}
  html.gw-slim .hud .tip{grid-area:3/1/4/3;margin-top:8px}
  html.gw-slim .gw-frame .journey .share-box{height:80px;margin-top:8px;padding:6px 10px;font-size:12px;line-height:1.35}
}
/* sideways: the slope takes the whole height and the display floats over its sky, name, bar, sound, hearts and score in one row */
@media (orientation:landscape){
  html.gw-slim .gw-frame .game{grid-template:auto minmax(0,1fr)/auto minmax(0,1fr) auto}
  html.gw-slim .gw-frame .game::before{content:"";position:absolute;inset:0 0 auto;height:56px;z-index:1;pointer-events:none;
    background:linear-gradient(#0b0a10e0,#0b0a1000)}
  html.gw-slim .hud{font-size:12px;letter-spacing:.02em;text-shadow:0 1px 2px #0b0a10}
  html.gw-slim .hud .daily{grid-area:1/1;align-self:center;margin:6px 0 0 10px;color:#d8d3e6}
  html.gw-slim .game .progress{grid-area:1/2;align-self:center;margin:6px 10px 0;background:#15121fcc}
  html.gw-slim .hud .right{grid-area:1/3;margin:6px 10px 0 0}
  html.gw-slim .hud .mute{color:#d8d3e6;background:#0b0a1080;border-color:#ffffff40}
  html.gw-slim .hud .mute[aria-pressed=true]{color:var(--flint);border-color:var(--flint)}
  html.gw-slim .gw-frame #screen{grid-area:1/1/3/4}
  html.gw-slim .hud .tip{grid-area:2/1/3/4;margin-top:6px}
  html.gw-slim .zone-banner{top:74px}
  /* the game-over card in two halves: how far you got on the left, score and buttons on the right, so it fits the height.
     It leaves room for the sound button, the one part of the display still on show. */
  html.gw-slim .game:has(#over:not([hidden])) .hud .right{z-index:3;visibility:hidden}
  html.gw-slim .game:has(#over:not([hidden])) .hud .mute{visibility:visible}
  html.gw-slim .gw-frame .journey .card{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(150px,1fr);column-gap:16px;align-items:center;justify-items:center;
    max-width:min(560px,calc(100% - 148px));padding:10px 14px}
  html.gw-slim .gw-frame .journey .card > *{grid-column:2}
  html.gw-slim .gw-frame .journey .card > .j-box{grid-column:1;grid-row:1/span 8;text-align:left}
  html.gw-slim .gw-frame .journey .j-head{font-size:17px}
  html.gw-slim .gw-frame .journey .j-sub{display:block;font-size:12px;margin:0}
  html.gw-slim .gw-frame .journey .j-grid{margin:8px 0 0}
  html.gw-slim .gw-frame .journey .j-tier{font-size:9.5px}
  html.gw-slim .gw-frame .journey .j-row,html.gw-slim .gw-frame .journey .j-names{grid-template-columns:46px repeat(5,1fr)}
  html.gw-slim .gw-frame .journey .new-best{padding:3px 10px;margin:0 0 4px;font-size:11px}
  html.gw-slim .gw-frame .journey .over-title{font-size:11px;margin:0}
  html.gw-slim .gw-frame .journey .big-score{font-size:30px;margin:2px 0}
  html.gw-slim .gw-frame .journey #distanceLine{display:block;font-size:12px;text-align:center}
  html.gw-slim .gw-frame .journey #bestScore{font-size:12px}
  html.gw-slim .gw-frame .journey .btn-row{flex-direction:column;gap:6px;margin-top:8px}
  html.gw-slim .gw-frame .journey .big{padding:9px 6px;font-size:14px}
  /* the share box takes the track's place on the left */
  html.gw-slim .gw-frame .journey .card:has(.share-box:not([hidden])) .j-grid{display:none}
  html.gw-slim .gw-frame .journey .card:has(.share-box:not([hidden])) .j-box{align-self:start}
  html.gw-slim .gw-frame .journey .card > .share-box{grid-column:1;grid-row:1/span 8;align-self:end;height:92px;margin:0;padding:8px 10px;font-size:12px}
}
/* a very narrow phone: the card moves over, so the sound button stays clear of it */
@media (orientation:landscape) and (max-width:620px){
  html.gw-slim .gw-frame .overlay.journey{padding-left:8px;padding-right:88px}
  html.gw-slim .gw-frame .journey .card{max-width:none}
}
/* a short phone held upright: the share box takes the track's place too */
@media (orientation:portrait) and (max-height:700px){
  html.gw-slim .gw-frame .journey .card:has(.share-box:not([hidden])) .j-grid{display:none}
}
/* a narrow phone held upright: the level says enough */
@media (orientation:portrait) and (max-width:340px){
  html.gw-slim .hud .daily{font-size:0}
  html.gw-slim .hud .daily .zone-label{font-size:12px}
}
@media (orientation:landscape) and (max-width:600px){
  html.gw-slim .hud .daily{font-size:0}
  html.gw-slim .hud .daily .zone-label{font-size:12px}
}
/* upright, while the rotate sign shows: it sits just under the display and the bar, over the sky, and Tobi's tip waits below it */
@media (orientation:portrait){
  html.gw-slim[data-rotate-sign] .rotate-sign{--rotate-top:calc(var(--slim) + 66px)}
  html.gw-slim[data-rotate-sign] .hud .tip{margin-top:84px}
  html.gw-slim[data-rotate-sign] .zone-banner{top:max(18%,214px)}
}
/* most phones: the game-over card fills the screen, so the sign steps aside until the next run */
@media (orientation:portrait) and (max-height:820px){
  html.gw-slim[data-rotate-sign]:has(#over:not([hidden])) .rotate-sign{display:none}
}
