/* Everything is sized in rem; the root font size is set by fit() in main.js so that the
   interface is about 22 units across the short side of any window. */
/* The display font: Kanit Black Italic (SIL Open Font Licence, see fonts/Kanit-LICENSE.txt).
   It is registered as a plain face under its own name, so any rule that asks for 'Kanit Display'
   gets the heavy slanted letters without also having to ask for bold and italic. The second
   file holds the extra accented letters some languages need. */
@font-face {
  font-family: 'Kanit Display';
  src: url('fonts/Kanit-BlackItalic.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Kanit Display';
  src: url('fonts/Kanit-BlackItalic-ext.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #cfe3ea; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #fff;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
h1, h2, button, .disp, #place, #score, #pop, #count, #hudTime, #bests b, #resLines b, #resCoins { font-family: 'Kanit Display', system-ui, sans-serif; font-weight: 400; letter-spacing: 0.01em; }

/* ---------- During a run ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 0.12rem 0 rgba(20, 30, 40, 0.55); }
#hudPlace { position: absolute; left: 0.8rem; top: 0.5rem; line-height: 1; }
#place { font-size: 2.6rem; color: #ffd24a; }
#placeOf { font-size: 1rem; opacity: 0.9; margin-left: 0.1rem; font-family: 'Kanit Display', sans-serif; }
#hudTime { position: absolute; left: 0.8rem; top: 3.2rem; font-size: 1rem; opacity: 0.95; }
#hudScore { position: absolute; right: 0.8rem; top: 0.6rem; text-align: right; line-height: 1; }
#score { font-size: 1.7rem; display: block; }
#combo { display: block; margin-top: 0.3rem; font-size: 1rem; color: #ffd24a; font-family: 'Kanit Display', sans-serif; min-height: 1rem; }
#progress {
  position: absolute; top: 1.1rem; left: 50%; transform: translateX(-50%);
  width: min(24rem, calc(100% - 17.4rem)); height: 0.5rem; border-radius: 0.3rem;
  background: rgba(20, 30, 40, 0.45); box-shadow: 0 0 0 0.1rem rgba(255, 255, 255, 0.35);
}
#progFill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: left; transform: scaleX(0); background: #ffd24a; border-radius: 0.3rem; }
#dots i { position: absolute; top: 50%; width: 0.7rem; height: 0.7rem; margin: -0.35rem 0 0 -0.35rem; border-radius: 50%; border: 0.1rem solid #fff; }
#boost { position: absolute; left: 50%; bottom: 4.9rem; transform: translateX(-50%); width: 9rem; height: 0.55rem; border-radius: 0.3rem; background: rgba(20, 30, 40, 0.45); overflow: hidden; opacity: 0; transition: opacity 0.2s; }
#boost.on { opacity: 1; }
#boostFill { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, #ff9d4d, #ffd24a); }
#call { position: absolute; left: 0; right: 0; top: 19%; text-align: center; }
#pop { text-align: center; font-size: 1.9rem; line-height: 1.1; color: #fff; padding: 0 0.5rem; }
#pop.good { color: #ffd24a; }
#pop.bad { color: #ff8a70; }
#pop.show { animation: pop 0.25s ease-out; }
@keyframes pop { from { transform: scale(1.5); } to { transform: scale(1); } }
#tally { margin-top: 0.3rem; text-align: center; font-size: 1.15rem; font-family: 'Kanit Display', sans-serif; color: #fff3c4; }
#hint { position: absolute; left: 1rem; right: 1rem; bottom: 6.2rem; text-align: center; font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
#hint span { display: inline-block; background: rgba(20, 30, 40, 0.6); border-radius: 0.6rem; padding: 0.4rem 0.8rem; text-shadow: none; }
#count { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-size: 5rem; color: #ffd24a; }

/* ---------- Screens over the scene ---------- */
.overlay {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7rem;
  padding: 0.8rem; text-align: center;
  background: linear-gradient(180deg, rgba(16, 38, 58, 0.72), rgba(16, 38, 58, 0.35) 45%, rgba(16, 38, 58, 0.78));
}
#loading, #adStandIn { background: #17364e; }
.logo { font-size: 3.2rem; line-height: 0.95; color: #fff; text-shadow: 0 0.22rem 0 #17364e, 0 0.4rem 0.6rem rgba(0, 0, 0, 0.35); transform: rotate(-3deg); }
.logo span { color: #ffb02e; }
.sub { font-size: 1rem; font-weight: 700; opacity: 0.95; text-shadow: 0 0.1rem 0 rgba(0, 0, 0, 0.4); }
#loadBar, #adStandInBar { width: 12rem; height: 0.7rem; border-radius: 0.4rem; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
#loadFill, #adStandInFill { display: block; width: 100%; height: 100%; background: #ffb02e; transform-origin: left; transform: scaleX(0); transition: transform 0.2s; }

button {
  border: 0; color: #fff; cursor: pointer; pointer-events: auto; line-height: 1.05;
  border-radius: 0.9rem; touch-action: manipulation;
}
button.big {
  min-width: 12rem; padding: 0.75rem 1.4rem 0.6rem; font-size: 1.7rem;
  background: linear-gradient(180deg, #ffb53d, #f2791f); box-shadow: 0 0.3rem 0 #a84a10, 0 0.5rem 0.8rem rgba(0, 0, 0, 0.3);
  text-shadow: 0 0.12rem 0 rgba(120, 50, 0, 0.6);
}
button.big small { display: block; font-family: system-ui, sans-serif; font-size: 0.7rem; font-weight: 700; letter-spacing: 0; opacity: 0.95; text-shadow: none; }
button.big small:empty { display: none; }
button.big:active, button.small:active, .kit:active { transform: translateY(0.15rem); }
button.small {
  padding: 0.5rem 1rem 0.4rem; font-size: 0.95rem;
  background: linear-gradient(180deg, #4a7fa8, #33607f); box-shadow: 0 0.2rem 0 #1e3d53;
}
button.small.gold { background: linear-gradient(180deg, #5cc27a, #3a9a5a); box-shadow: 0 0.2rem 0 #236a3b; }
button:disabled { filter: grayscale(0.8); opacity: 0.6; }

#bests { display: flex; gap: 0.5rem; }
#bests > div { min-width: 5.6rem; padding: 0.4rem 0.6rem 0.3rem; border-radius: 0.7rem; background: rgba(16, 38, 58, 0.7); box-shadow: inset 0 0 0 0.1rem rgba(255, 255, 255, 0.15); }
#bests small { display: block; font-size: 0.6rem; font-weight: 700; opacity: 0.8; white-space: nowrap; }
#bests b { font-size: 1.15rem; color: #ffd24a; }
#kits { display: grid; gap: 0.35rem; }
.kitRow { display: flex; gap: 0.45rem; align-items: center; }
.kitRow > span { width: 3.3rem; white-space: nowrap; text-align: right; font-family: 'Kanit Display', system-ui, sans-serif; font-size: 0.75rem; letter-spacing: 0.06em; color: #ffd24a; text-shadow: 0 0.1rem 0 #160d08; }
.kit {
  position: relative; width: 3.1rem; height: 3.1rem; border-radius: 0.8rem; padding: 0;
  box-shadow: inset 0 0 0 0.12rem rgba(255, 255, 255, 0.35), 0 0.2rem 0 rgba(0, 0, 0, 0.3); overflow: hidden;
}
.kit i { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; }
.kit.on { box-shadow: inset 0 0 0 0.22rem #ffd24a, 0 0.2rem 0 rgba(0, 0, 0, 0.3); }
.kit em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 0.8rem; background: rgba(10, 20, 30, 0.55); font-family: 'Kanit Display', sans-serif; }

/* The end of a run. */
#results { display: grid; grid-template-columns: minmax(0, 20rem); justify-content: center; align-content: center; justify-items: center; gap: 0.55rem; background: linear-gradient(180deg, rgba(16, 38, 58, 0.82), rgba(16, 38, 58, 0.7)); }
#resTitle { font-size: 2.2rem; color: #ffd24a; text-shadow: 0 0.18rem 0 #17364e; }
#resStars { display: flex; gap: 0.4rem; }
#resStars i { width: 2.4rem; height: 2.4rem; background: rgba(255, 255, 255, 0.2); clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 77%, 20% 100%, 30% 60%, 0 38%, 38% 35%); }
#resStars i.on { background: #ffd24a; }
#resLines { display: flex; gap: 0.5rem; }
#resLines > div { min-width: 5.4rem; padding: 0.4rem 0.6rem 0.3rem; border-radius: 0.7rem; background: rgba(255, 255, 255, 0.1); }
#resLines small { display: block; font-size: 0.6rem; font-weight: 700; opacity: 0.8; white-space: nowrap; }
#resLines b { font-size: 1.2rem; }
#resLines em { display: block; font-style: normal; font-size: 0.6rem; font-weight: 700; color: #ffd24a; min-height: 0.75rem; }
#resGoals { font-size: 0.8rem; font-weight: 700; line-height: 1.5; text-align: left; }
#resGoals div { opacity: 0.65; }
#resGoals div.on { opacity: 1; color: #ffe9a3; }
#resCoins { font-size: 1.2rem; }
#resCoins b { color: #ffd24a; }
body.wide #results { grid-template-columns: minmax(0, 19rem) minmax(0, 14rem); column-gap: 1.5rem; grid-auto-flow: dense; }
body.wide #resTitle, body.wide #resStars, body.wide #resLines, body.wide #resGoals { grid-column: 1; }
body.wide #resCoins, body.wide #btnDouble, body.wide #btnAgain, body.wide #btnMenu { grid-column: 2; }
body.wide #resCoins { grid-row: 1; }
body.wide #btnDouble { grid-row: 2; }
body.wide #btnAgain { grid-row: 3; }
body.wide #btnMenu { grid-row: 4; }

#adStandIn h2 { font-size: 1.6rem; }

/* In a wide window the trick names sit at the top, clear of the rider. */
body.wide #call { top: 2.5rem; }
body.wide #pop { font-size: 1.6rem; }

/* The four trick buttons: along the bottom in a tall window, a block of four at the right in a
   wide one. They are faint on the ground and light up in the air. */
/* The trick buttons: four round bubbles in a cluster at the bottom right, under the right
   thumb, so the left thumb is free to steer anywhere else. The right-hand pair sits a little
   higher, the way a thumb sweeps. Dim on the ground, lit in the air. */
/* The steering pad, bottom left: held (by a finger or the mouse) and slid across, like the
   drag anywhere on the screen it stands for. Left and right steer; in the air up and down
   flip and left and right spin, so those two light up there. */
#pad { position: absolute; left: 0.6rem; bottom: 2.2rem; width: 8.8rem; height: 8.8rem; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
#pad i {
  position: absolute; width: 2.9rem; height: 2.9rem; border-radius: 0.7rem; opacity: 0.75;
  background: linear-gradient(180deg, #4a7fa8, #2c5673); box-shadow: 0 0.22rem 0 #17364e, inset 0 0 0 0.12rem rgba(255, 255, 255, 0.3);
  display: flex; align-items: center; justify-content: center; color: #fff; font: 1.2rem system-ui, 'Segoe UI Symbol', sans-serif; font-style: normal;
}
#pad .up { left: 2.95rem; top: 0; } #pad .up::after { content: '\25B2'; }
#pad .down { left: 2.95rem; bottom: 0; } #pad .down::after { content: '\25BC'; }
#pad .left { left: 0; top: 2.95rem; } #pad .left::after { content: '\25C0'; }
#pad .right { right: 0; top: 2.95rem; } #pad .right::after { content: '\25B6'; }
#hud.grounded #pad .up, #hud.grounded #pad .down { opacity: 0.3; }
#pad i.on { background: linear-gradient(180deg, #ffb53d, #f2791f); box-shadow: 0 0.08rem 0 #a84a10, inset 0 0 0 0.12rem rgba(255, 255, 255, 0.4); transform: translateY(0.15rem); opacity: 1; }
body.wide #pad { left: 0.7rem; bottom: 0.8rem; }
#tricks { position: absolute; right: 0.55rem; bottom: 0.8rem; display: grid; grid-template-columns: repeat(2, 4.3rem); gap: 0.45rem; opacity: 0.4; transition: opacity 0.12s; }
#tricks.air { opacity: 1; }
#tricks button {
  width: 4.3rem; height: 4.3rem; padding: 0.1rem 0.2rem 0; font-size: 0.64rem; line-height: 1.05; border-radius: 50%;
  background: linear-gradient(180deg, #4a7fa8, #2c5673); box-shadow: 0 0.22rem 0 #17364e, inset 0 0 0 0.12rem rgba(255, 255, 255, 0.3);
  text-shadow: 0 0.1rem 0 rgba(0, 0, 0, 0.4);
}
#tricks button:nth-child(even) { transform: translateY(-1rem); }
#tricks.air button { background: linear-gradient(180deg, #ffb53d, #f2791f); box-shadow: 0 0.22rem 0 #a84a10, inset 0 0 0 0.12rem rgba(255, 255, 255, 0.4); }
#tricks button.on { transform: translateY(0.15rem); filter: brightness(1.25); }
#tricks button.on:nth-child(even) { transform: translateY(-0.85rem); }
/* With the bubbles at the right, the nitro bar sits at the bottom left and hints go above them. */
#boost { left: 0.9rem; bottom: 1.3rem; transform: none; }
#hint { bottom: 11.4rem; }
body.wide #tricks { right: 0.7rem; bottom: 0.7rem; grid-template-columns: repeat(2, 3.9rem); gap: 0.4rem; }
body.wide #tricks button { width: 3.9rem; height: 3.9rem; }
body.wide #boost { left: 50%; bottom: 1rem; transform: translateX(-50%); }
body.wide #hint { bottom: 2.4rem; left: 11rem; right: 11rem; }
body.wide #call { left: 8rem; right: 8rem; }

/* ---------- The title screen ----------
   Laid out like the front of a game box: a big slanted name at the top over a zigzag of trail,
   the rider in the open middle (drawn by the game, see heroShot in main.js), and everything
   to press at the bottom. The whole picture is washed in a warm evening colour. */
#menu {
  display: grid; justify-items: center; align-items: center; gap: 0.5rem; padding: 1.1rem 0.8rem 0.9rem;
  grid-template: "logo" auto "sub" auto "." 1fr "hills" auto "bests" auto "play" auto "garage" auto / 100%;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 40%, rgba(20, 6, 2, 0.6) 100%),
    linear-gradient(180deg, rgba(255, 150, 40, 0.46) 0%, rgba(240, 80, 20, 0.22) 42%, rgba(60, 14, 4, 0.62) 100%);
}
#menu .logo { grid-area: logo; }
#menu .sub { grid-area: sub; }
#bests { grid-area: bests; }
#kits { grid-area: kits; }
#btnPlay { grid-area: play; }
#volsMenu { grid-area: sound; }
#menuRow { grid-area: garage; display: flex; gap: 0.6rem; }

.logo.title {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  font-size: 3.3rem; line-height: 0.84; letter-spacing: 0; padding: 0.5rem 1.4rem 0.3rem 0.6rem;
  transform: rotate(-5deg); color: #fff;
  -webkit-text-stroke: 0.16rem #160d08; paint-order: stroke fill;
  text-shadow: 0.22rem 0.24rem 0 #160d08, 0.5rem 0.6rem 0.9rem rgba(0, 0, 0, 0.45);
}
.logo.title i { font-style: normal; }
.logo.title span { margin-left: 1.5rem; color: #ffb02e; background: linear-gradient(180deg, #ffe04a 10%, #ff7a1a 80%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; -webkit-text-stroke: 0; filter: drop-shadow(0.05rem 0.05rem 0 #160d08) drop-shadow(-0.05rem -0.05rem 0 #160d08) drop-shadow(0.05rem -0.05rem 0 #160d08) drop-shadow(-0.05rem 0.05rem 0 #160d08) drop-shadow(0.2rem 0.22rem 0 #160d08); text-shadow: none; }
/* The zigzag behind the name: a trail doubling back on itself. */
.logo.title::before {
  content: ''; position: absolute; z-index: -1; inset: -0.4rem -0.6rem -0.5rem -0.9rem;
  background: linear-gradient(100deg, #b3200c, #ff5a1f 55%, #ff9a2e);
  clip-path: polygon(0 16%, 86% 0, 100% 22%, 30% 44%, 100% 62%, 96% 100%, 8% 96%, 0 74%, 62% 52%, 4% 38%);
  filter: drop-shadow(0 0.3rem 0 #160d08);
}
#menu .sub {
  margin-top: 0.1rem; padding: 0.22rem 0.9rem 0.18rem; transform: rotate(-5deg) skewX(-12deg);
  font-family: 'Kanit Display', system-ui, sans-serif; font-weight: 400; font-size: 1rem; letter-spacing: 0.18em;
  color: #ffd24a; background: #160d08; text-shadow: none; opacity: 1;
}
#menu #bests > div { background: rgba(22, 13, 8, 0.78); box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.35); border-radius: 0.3rem; transform: skewX(-8deg); }
#menu #bests > div > * { display: block; transform: skewX(8deg); }
#garage .kit { border-radius: 0.4rem; transform: skewX(-8deg); }
#garage .kit:active { transform: skewX(-8deg) translateY(0.15rem); }
#menu #btnPlay {
  min-width: 13rem; padding: 0.7rem 1.8rem 0.6rem; font-size: 2.1rem; border-radius: 0.4rem; transform: skewX(-10deg);
  background: linear-gradient(180deg, #ffe04a, #ff7a1a); color: #160d08; text-shadow: none;
  box-shadow: 0 0 0 0.16rem #160d08, 0.3rem 0.36rem 0 #160d08; animation: ready 1.1s ease-in-out infinite;
}
#menu #btnPlay:active { transform: skewX(-10deg) translate(0.15rem, 0.18rem); box-shadow: 0 0 0 0.16rem #160d08, 0.12rem 0.16rem 0 #160d08; }
@keyframes ready { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.22); } }

/* In a wide window: name at the top left, bests at the bottom left, buttons at the bottom right. */
body.wide #menu {
  grid-template: "logo . ." auto "sub . ." auto ". . ." 1fr "hills . play" auto "bests . garage" auto / auto 1fr auto;
  justify-items: start; padding: 0.9rem 1.3rem 0.9rem;
}
body.wide #menu #bests { align-self: end; }
body.wide #menu #btnPlay, body.wide #menu #menuRow { justify-self: end; }
body.wide .logo.title { font-size: 3.7rem; }

/* ---------- The loading and results screens, in the same style as the title screen ---------- */
#loading { gap: 1.1rem; background: radial-gradient(120% 90% at 50% 40%, #7a2a10 0%, #3a1408 55%, #160d08 100%); }
#loadBar { width: 13rem; height: 0.8rem; border-radius: 0.2rem; transform: skewX(-12deg); background: #160d08; box-shadow: 0 0 0 0.12rem #160d08, inset 0 0 0 0.08rem rgba(255, 176, 46, 0.4); }
#loadFill { background: linear-gradient(90deg, #ff7a1a, #ffe04a); }
#loadText { font-family: 'Kanit Display', system-ui, sans-serif; letter-spacing: 0.12em; color: #ffd24a; text-transform: uppercase; font-size: 0.9rem; }

#results {
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 30%, rgba(20, 6, 2, 0.7) 100%),
    linear-gradient(180deg, rgba(120, 40, 10, 0.72) 0%, rgba(60, 16, 6, 0.78) 100%);
}
#resTitle {
  font-size: 2.9rem; line-height: 1; white-space: nowrap; transform: rotate(-4deg); padding: 0.2rem 0.6rem;
  color: #ffe04a; -webkit-text-stroke: 0.14rem #160d08; paint-order: stroke fill; text-shadow: 0.2rem 0.22rem 0 #160d08;
}
#resStars i { filter: drop-shadow(0.12rem 0.14rem 0 #160d08); background: rgba(22, 13, 8, 0.7); }
#resStars i.on { background: linear-gradient(180deg, #ffe04a, #ff9a1a); }
#resLines > div { background: rgba(22, 13, 8, 0.78); box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.35); border-radius: 0.3rem; transform: skewX(-8deg); }
#resLines > div > * { transform: skewX(8deg); }
#resLines b { display: block; color: #ffd24a; }
#resGoals { background: rgba(22, 13, 8, 0.6); padding: 0.35rem 0.8rem; border-radius: 0.3rem; }
#resCoins { font-size: 1.4rem; text-shadow: 0.12rem 0.14rem 0 #160d08; }
#btnAgain {
  min-width: 13rem; padding: 0.7rem 1.6rem 0.6rem; font-size: 1.9rem; border-radius: 0.4rem; transform: skewX(-10deg);
  background: linear-gradient(180deg, #ffe04a, #ff7a1a); color: #160d08; text-shadow: none;
  box-shadow: 0 0 0 0.16rem #160d08, 0.3rem 0.36rem 0 #160d08;
}
#btnAgain:active { transform: skewX(-10deg) translate(0.15rem, 0.18rem); box-shadow: 0 0 0 0.16rem #160d08, 0.12rem 0.16rem 0 #160d08; }
#btnMenu { border-radius: 0.3rem; transform: skewX(-8deg); background: #160d08; box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.5); color: #ffd24a; }
#btnDouble { border-radius: 0.3rem; transform: skewX(-8deg); box-shadow: 0 0 0 0.12rem #160d08, 0.2rem 0.24rem 0 #160d08; }
#btnMenu:active, #btnDouble:active { transform: skewX(-8deg) translateY(0.15rem); }
#btnAgain { white-space: nowrap; }
body.wide #btnAgain { font-size: 1.6rem; min-width: 0; padding-left: 1.2rem; padding-right: 1.2rem; }

/* ---------- Trick names, the streak and fire ---------- */
/* The trick name: slammed in, with fire moving through the letters. Its size is set in
   main.js from how long the text is. */
#pop { font-size: 1.3rem; line-height: 1.02; }
#pop.info { font-size: 1.3rem; color: #fff; }
/* Built to be cheap on phones, which stalled on the first version: no filters, and the
   text never grows past its resting size (a browser draws an animated element at the largest
   size the animation reaches, so slamming in from three times size meant drawing it huge).
   Two layers: the fiery words in front, and the same words behind in dark as the outline. */
#pop { position: relative; }
#pop.good, #pop.air { letter-spacing: 0.01em; transform-origin: 50% 60%; text-shadow: none; }
#pop.good span, #pop.air span {
  position: relative; display: inline-block; color: #ffd24a;
  background: linear-gradient(0deg, #ff3d00 0%, #ff9a00 38%, #ffe04a 68%, #fffbe0 100%); background-size: 100% 230%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: flicker 0.5s steps(4) infinite;
}
#pop.good::before, #pop.air::before {
  content: attr(data-text); position: absolute; inset: 0 0.5rem; color: #160d08;
  -webkit-text-stroke: 0.24rem #160d08; text-shadow: 0.14rem 0.18rem 0 #160d08;
}
#pop.air.show { animation: slam 0.2s cubic-bezier(0.2, 1.6, 0.4, 1); }
#pop.good.show { animation: slamBig 0.36s cubic-bezier(0.2, 1.5, 0.35, 1); }
#pop.bad { color: #ff8a70; -webkit-text-stroke: 0.1rem #160d08; paint-order: stroke fill; }
#pop.bad.show { animation: shudder 0.4s linear; }
@keyframes slam { from { transform: scale(0.4) rotate(-6deg); opacity: 0; } to { transform: scale(1) rotate(-2deg); opacity: 1; } }
@keyframes slamBig { 0% { transform: scale(0.25) rotate(8deg); opacity: 0; } 55% { transform: scale(1.14) rotate(-4deg); opacity: 1; } 100% { transform: scale(1) rotate(-2deg); } }
@keyframes flicker { 0% { background-position: 50% 0%; } 50% { background-position: 50% 60%; } 100% { background-position: 50% 0%; } }
@keyframes shudder { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-0.4rem) rotate(-2deg); } 40% { transform: translateX(0.4rem) rotate(2deg); } 60% { transform: translateX(-0.25rem); } 80% { transform: translateX(0.25rem); } }
#pop.good, #pop.air { transform: rotate(-2deg); }
#tally { font-size: 1.35rem; color: #fff; -webkit-text-stroke: 0.08rem #160d08; paint-order: stroke fill; }

/* The streak counter under the score. */
#combo { transform-origin: 100% 50%; -webkit-text-stroke: 0.07rem #160d08; paint-order: stroke fill; }
#combo.heat1 { color: #ffb02e; font-size: 1.15rem; }
#combo.heat2 { color: #ff7a1a; font-size: 1.3rem; }
#combo.heat3 { color: #ff3d2e; font-size: 1.45rem; }
#combo.bump { animation: bump 0.3s ease-out; }
@keyframes bump { from { transform: scale(0.5); } 60% { transform: scale(1.15); } to { transform: scale(1); } }

/* A streak title across the screen. */
#banner { position: absolute; left: 0; right: 0; top: 36%; text-align: center; opacity: 0; pointer-events: none; }
#banner.show { animation: banner 2.1s ease-out both; }
#bannerTitle {
  display: block; font-family: 'Kanit Display', system-ui, sans-serif; font-weight: 400; font-size: 3.4rem; line-height: 0.95; padding: 0 0.6rem;
  color: #ffe04a; -webkit-text-stroke: 0.16rem #160d08; paint-order: stroke fill; text-shadow: 0.22rem 0.26rem 0 #160d08, 0 0 1.4rem rgba(255, 110, 20, 0.9);
  transform: rotate(-4deg);
}
#bannerSub { display: inline-block; margin-top: 0.35rem; padding: 0.2rem 0.8rem 0.16rem; background: #160d08; color: #ffd24a; font-family: 'Kanit Display', system-ui, sans-serif; font-size: 1rem; letter-spacing: 0.08em; transform: rotate(-4deg) skewX(-12deg); text-shadow: none; }
#banner.level1 #bannerTitle { color: #ffb52a; }
#banner.level2 #bannerTitle { color: #ff8a1e; }
#banner.level3 #bannerTitle { color: #ff5a1e; }
#banner.level4 #bannerTitle { color: #ff3a5a; }
#banner.level5 #bannerTitle { color: #fff; text-shadow: 0.22rem 0.26rem 0 #160d08, 0 0 1.6rem rgba(255, 220, 80, 1); }
@keyframes banner { 0% { opacity: 0; transform: scale(0.3); } 10% { opacity: 1; transform: scale(1.12); } 16% { transform: scale(0.96); } 22% { transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08) translateY(-0.8rem); } }
body.wide #banner { top: 30%; }
body.wide #bannerTitle { font-size: 2.8rem; }

/* The edges of the screen glow when the streak is hot. */
#heat {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 40%, rgba(0, 0, 0, 0) 55%, rgba(255, 90, 10, 0.5) 88%, rgba(255, 40, 0, 0.75) 100%);
  animation: breathe 0.9s ease-in-out infinite; will-change: transform, opacity;
}
/* It breathes by swelling (cheap) and not by a brightness filter over the whole screen. */
@keyframes breathe { 0%, 100% { transform: scale(1.12); } 50% { transform: scale(1); } }

/* ---------- Pausing ---------- */
/* The pause button: two bars in a small dark tile under the timer. */
#btnPause {
  position: absolute; left: 0.8rem; top: 4.7rem; width: 2.3rem; height: 2.3rem; border-radius: 0.3rem; padding: 0;
  display: flex; align-items: center; justify-content: center; gap: 0.32rem; transform: skewX(-8deg);
  background: rgba(22, 13, 8, 0.72); box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.5);
}
#btnPause i { display: block; width: 0.34rem; height: 1.05rem; background: #ffd24a; border-radius: 0.08rem; }
#btnPause:active { transform: skewX(-8deg) translateY(0.12rem); }
#pause {
  gap: 0.8rem;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 30%, rgba(20, 6, 2, 0.7) 100%),
    linear-gradient(180deg, rgba(120, 40, 10, 0.72) 0%, rgba(60, 16, 6, 0.8) 100%);
}
#pauseTitle {
  font-size: 3rem; line-height: 1; transform: rotate(-4deg); margin-bottom: 0.4rem;
  color: #ffe04a; -webkit-text-stroke: 0.14rem #160d08; paint-order: stroke fill; text-shadow: 0.2rem 0.22rem 0 #160d08;
}
#btnResume {
  min-width: 13rem; padding: 0.7rem 1.6rem 0.6rem; font-size: 1.9rem; border-radius: 0.4rem; transform: skewX(-10deg); white-space: nowrap;
  background: linear-gradient(180deg, #ffe04a, #ff7a1a); color: #160d08; text-shadow: none;
  box-shadow: 0 0 0 0.16rem #160d08, 0.3rem 0.36rem 0 #160d08;
}
#btnResume:active { transform: skewX(-10deg) translate(0.15rem, 0.18rem); box-shadow: 0 0 0 0.16rem #160d08, 0.12rem 0.16rem 0 #160d08; }
#btnRestart, #btnPauseMenu { min-width: 9rem; border-radius: 0.3rem; transform: skewX(-8deg); background: #160d08; box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.5); color: #ffd24a; font-size: 1.1rem; padding: 0.55rem 1rem 0.45rem; }
#btnRestart:active, #btnPauseMenu:active { transform: skewX(-8deg) translateY(0.15rem); }

/* ---------- Volume sliders ----------
   Two slanted bars, MUSIC and EFFECTS: drag or tap along a bar to set it. */
.vols { display: grid; gap: 0.3rem; }
.vol { display: flex; align-items: center; gap: 0.5rem; }
.vol span { width: 4.4rem; text-align: right; font-family: 'Kanit Display', system-ui, sans-serif; font-size: 0.8rem; letter-spacing: 0.06em; color: #ffd24a; text-shadow: 0 0.1rem 0 #160d08; }
.vol .bar {
  position: relative; width: 8.6rem; height: 1.35rem; transform: skewX(-12deg); overflow: hidden; cursor: pointer;
  pointer-events: auto; touch-action: none;
  background: #160d08; box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.5); border-radius: 0.2rem;
}
.vol .bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: left; background: linear-gradient(90deg, #ff7a1a, #ffe04a); pointer-events: none; }
#volsPause { margin-top: 0.5rem; }

/* Skin tiles are a little smaller now that there are two rows of them. */
.kit { width: 2.75rem; height: 2.75rem; }


/* ---------- The hill picker ---------- */
#hills { grid-area: hills; display: flex; align-items: center; gap: 0.4rem; }
#hillCard { min-width: 11.5rem; padding: 0.3rem 0.8rem 0.25rem; text-align: center; background: rgba(22, 13, 8, 0.78); box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.35); border-radius: 0.3rem; transform: skewX(-8deg); }
#hillCard > * { display: block; transform: skewX(8deg); }
#hillName { font-family: 'Kanit Display', system-ui, sans-serif; font-weight: 400; font-size: 1.15rem; line-height: 1.1; color: #fff; white-space: nowrap; }
#hillStars { font-size: 0.9rem; line-height: 1.1; color: #ffd24a; letter-spacing: 0.12em; }
#hillStars.locked { font-family: 'Kanit Display', system-ui, sans-serif; font-size: 0.7rem; letter-spacing: 0.06em; color: #ff9a7a; }
#hillPrev, #hillNext { width: 2.3rem; height: 2.5rem; padding: 0; font-size: 1.3rem; border-radius: 0.3rem; transform: skewX(-8deg); background: #160d08; box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.5); color: #ffd24a; }
#hillPrev:active, #hillNext:active { transform: skewX(-8deg) translateY(0.12rem); }
#menu #btnPlay.locked { filter: grayscale(0.85) brightness(0.8); animation: none; }
body.wide #menu #hills { align-self: end; }

/* ---------- The garage: skins and sound, off the title screen ----------
   Same warm wash as the title screen and the same rider hanging in the open middle, so a
   new skin shows at once. Heading and coins at the top, everything to press at the bottom. */
#menu #btnGarage, #menu #btnGoals, #garage #btnGarageDone { border-radius: 0.3rem; transform: skewX(-8deg); }
#menu #btnGarage, #menu #btnGoals { position: relative; min-width: 7rem; background: #160d08; box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.5); color: #ffd24a; }
#menu #btnGarage:active, #menu #btnGoals:active { transform: skewX(-8deg) translateY(0.12rem); }
/* How many of today's goals are still to do, on the corner of the GOALS button. */
#goalsBadge { position: absolute; right: -0.45rem; top: -0.45rem; min-width: 1.25rem; height: 1.25rem; padding: 0 0.25rem; border-radius: 0.65rem; background: #ff3d2e; color: #fff; font-style: normal; font-size: 0.72rem; line-height: 1.25rem; text-align: center; font-family: 'Kanit Display', system-ui, sans-serif; }
#goalsBadge:empty { display: none; }
#garage {
  display: grid; justify-items: center; align-items: center; gap: 0.5rem; padding: 1.1rem 0.8rem 0.9rem;
  grid-template: "title" auto "coins" auto "." 1fr "note" auto "kits" auto "moves" auto "sound" auto "done" auto / 100%;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 40%, rgba(20, 6, 2, 0.6) 100%),
    linear-gradient(180deg, rgba(255, 150, 40, 0.46) 0%, rgba(240, 80, 20, 0.22) 42%, rgba(60, 14, 4, 0.62) 100%);
}
#garageTitle {
  grid-area: title; font-size: 2.6rem; line-height: 1; transform: rotate(-4deg);
  color: #ffe04a; -webkit-text-stroke: 0.14rem #160d08; paint-order: stroke fill; text-shadow: 0.2rem 0.22rem 0 #160d08;
}
#garageCoins { grid-area: coins; min-width: 6.5rem; padding: 0.3rem 0.8rem 0.25rem; text-align: center; background: rgba(22, 13, 8, 0.78); box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.35); border-radius: 0.3rem; transform: skewX(-8deg); }
#garageCoins > * { display: block; transform: skewX(8deg); }
#garageCoins small { font-size: 0.6rem; font-weight: 700; opacity: 0.8; }
#garageCoins b { font-family: 'Kanit Display', system-ui, sans-serif; font-weight: 400; font-size: 1.25rem; color: #ffd24a; }
#garageNote { grid-area: note; min-height: 1.2rem; margin: 0; font-size: 0.85rem; font-weight: 700; color: #fff; text-shadow: 0 0.1rem 0 #160d08, 0 0 0.4rem #160d08; text-align: center; }
#garage #btnGarageDone {
  grid-area: done; min-width: 11rem; padding: 0.5rem 1.6rem 0.4rem; font-size: 1.7rem;
  background: linear-gradient(180deg, #ffe04a, #ff7a1a); color: #160d08; text-shadow: none;
  box-shadow: 0 0 0 0.16rem #160d08, 0.3rem 0.36rem 0 #160d08;
}
#garage #btnGarageDone:active { transform: skewX(-8deg) translate(0.15rem, 0.18rem); box-shadow: 0 0 0 0.16rem #160d08, 0.12rem 0.16rem 0 #160d08; }
/* In a wide window: heading and coins at the top left, the rest down the right-hand side. */
body.wide #garage {
  grid-template: "title . kits" auto "coins . kits" auto ". . kits" 1fr "note . sound" auto "moves . done" auto / auto 1fr auto;
  justify-items: start; padding: 0.9rem 1.3rem 0.9rem;
}
body.wide #garage #kits, body.wide #garage #volsMenu, body.wide #garage #btnGarageDone { justify-self: end; }
body.wide #garage #kits { align-self: start; }
body.wide #garage #garageNote { align-self: end; text-align: left; max-width: 14rem; }

/* The bikes in the garage: a row of name tiles. A bike not yet bought is dimmed and shows its price. */
.ride {
  position: relative; min-width: 4.9rem; height: 2.3rem; padding: 0 0.5rem; border-radius: 0.4rem; transform: skewX(-8deg);
  background: #160d08; box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.5), 0 0.2rem 0 rgba(0, 0, 0, 0.3); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.ride b { font-family: 'Kanit Display', system-ui, sans-serif; font-weight: 400; font-size: 0.8rem; letter-spacing: 0.04em; }
.ride em { font-style: normal; font-family: 'Kanit Display', system-ui, sans-serif; font-size: 0.7rem; color: #ffd24a; margin-top: 0.15rem; }
.ride.locked b { opacity: 0.6; }
.ride.on { box-shadow: inset 0 0 0 0.2rem #ffd24a, 0 0.2rem 0 rgba(0, 0, 0, 0.3); }
.ride:active { transform: skewX(-8deg) translateY(0.15rem); }
#garageNote { max-width: 20rem; }

/* ---------- Tricks: the button into them from the garage, and their own screen ---------- */
#btnTricks { grid-area: moves; min-width: 9rem; border-radius: 0.3rem; transform: skewX(-8deg); background: #160d08; box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.5); color: #ffd24a; }
#btnTricks:active { transform: skewX(-8deg) translateY(0.12rem); }
body.wide #garage #btnTricks { align-self: end; }
/* The tricks screen is laid out like the garage: heading and coins at the top, the rider
   (holding whichever trick was last tapped) in the middle, the list and DONE at the bottom. */
#tricksScreen {
  display: grid; justify-items: center; align-items: center; gap: 0.5rem; padding: 1.1rem 0.8rem 0.9rem;
  grid-template: "title" auto "coins" auto "." 1fr "note" auto "list" auto "done" auto / 100%;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 40%, rgba(20, 6, 2, 0.6) 100%),
    linear-gradient(180deg, rgba(255, 150, 40, 0.46) 0%, rgba(240, 80, 20, 0.22) 42%, rgba(60, 14, 4, 0.62) 100%);
}
#tricksTitle {
  grid-area: title; font-size: 2.6rem; line-height: 1; transform: rotate(-4deg);
  color: #ffe04a; -webkit-text-stroke: 0.14rem #160d08; paint-order: stroke fill; text-shadow: 0.2rem 0.22rem 0 #160d08;
}
#tricksCoins { grid-area: coins; min-width: 6.5rem; padding: 0.3rem 0.8rem 0.25rem; text-align: center; background: rgba(22, 13, 8, 0.78); box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.35); border-radius: 0.3rem; transform: skewX(-8deg); }
#tricksCoins > * { display: block; transform: skewX(8deg); }
#tricksCoins small { font-size: 0.6rem; font-weight: 700; opacity: 0.8; }
#tricksCoins b { font-family: 'Kanit Display', system-ui, sans-serif; font-weight: 400; font-size: 1.25rem; color: #ffd24a; }
#tricksNote { grid-area: note; min-height: 2.3rem; max-width: 20rem; margin: 0; font-size: 0.85rem; font-weight: 700; line-height: 1.3; color: #fff; text-shadow: 0 0.1rem 0 #160d08, 0 0 0.4rem #160d08; text-align: center; }
#moveList { grid-area: list; display: grid; grid-template-columns: repeat(2, 9.9rem); gap: 0.4rem 0.45rem; }
/* One trick button's worth: its name, the harder trick it turns into, and either the number
   of the button it is on, or its price. */
.move {
  position: relative; height: 2.75rem; padding: 0 0.5rem 0 1.9rem; border-radius: 0.4rem; transform: skewX(-8deg); text-align: left;
  background: #160d08; box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.35), 0 0.2rem 0 rgba(0, 0, 0, 0.3); color: #fff;
  display: flex; flex-direction: column; justify-content: center; line-height: 1.05;
}
.move b { font-family: 'Kanit Display', system-ui, sans-serif; font-weight: 400; font-size: 0.78rem; letter-spacing: 0.03em; white-space: nowrap; }
.move small { align-self: stretch; font-size: 0.54rem; font-weight: 700; opacity: 0.75; white-space: nowrap; margin-top: 0.12rem; }
.move i { position: absolute; left: 0.35rem; top: 50%; width: 1.25rem; height: 1.25rem; margin-top: -0.625rem; border-radius: 50%; font-style: normal; font-family: 'Kanit Display', system-ui, sans-serif; font-size: 0.75rem; line-height: 1.25rem; text-align: center; background: linear-gradient(180deg, #ffb53d, #f2791f); color: #160d08; }
.move.spare i { background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.5); }
.move.locked { color: rgba(255, 255, 255, 0.6); }
.move.locked i { background: none; }
.move em { font-style: normal; font-family: 'Kanit Display', system-ui, sans-serif; font-size: 1.26em; color: #ffd24a; margin-right: 0.35rem; opacity: 1; }
.move.locked small { opacity: 1; }
.move.locked i::before { content: ''; position: absolute; inset: 0.3rem; border-radius: 50%; background: #ffd24a; box-shadow: inset 0 0 0 0.12rem #c98a10; }
.move.on { box-shadow: inset 0 0 0 0.2rem #ffd24a, 0 0.2rem 0 rgba(0, 0, 0, 0.3); }
.move:active { transform: skewX(-8deg) translateY(0.15rem); }
#btnTricksDone {
  grid-area: done; min-width: 11rem; padding: 0.5rem 1.6rem 0.4rem; font-size: 1.7rem; border-radius: 0.3rem; transform: skewX(-8deg);
  background: linear-gradient(180deg, #ffe04a, #ff7a1a); color: #160d08; text-shadow: none;
  box-shadow: 0 0 0 0.16rem #160d08, 0.3rem 0.36rem 0 #160d08;
}
#btnTricksDone:active { transform: skewX(-8deg) translate(0.15rem, 0.18rem); box-shadow: 0 0 0 0.16rem #160d08, 0.12rem 0.16rem 0 #160d08; }
body.wide #tricksScreen {
  grid-template: "title . list" auto "coins . list" auto ". . list" 1fr "note . done" auto / auto 1fr auto;
  justify-items: start; padding: 0.9rem 1.3rem 0.9rem;
}
body.wide #tricksScreen #moveList, body.wide #tricksScreen #btnTricksDone { justify-self: end; }
body.wide #tricksScreen #moveList { align-self: start; }
body.wide #tricksScreen #tricksNote { align-self: end; text-align: left; max-width: 15rem; }

/* The rider behind the title, garage and tricks screens can be turned by dragging the open
   part of the picture. */
#menu, #garage, #tricksScreen { touch-action: none; cursor: grab; }
#menu button, #garage button, #tricksScreen button { cursor: pointer; }

/* ---------- Speed streaks, on nitro ----------
   Thin pale lines fanning out from where the trail vanishes, round the edges of the screen
   only. Drawn once; after that only its fade and a small jitter change, which cost a phone nothing. */
#rush {
  position: absolute; inset: -12%; opacity: 0; transition: opacity 0.25s; pointer-events: none; will-change: transform, opacity;
  background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(255, 255, 255, 0) 0deg 4.2deg, rgba(210, 240, 255, 0.55) 4.5deg 4.8deg, rgba(255, 255, 255, 0) 5.1deg 9deg);
  -webkit-mask-image: radial-gradient(ellipse 55% 55% at 50% 46%, transparent 52%, #000 100%);
  mask-image: radial-gradient(ellipse 55% 55% at 50% 46%, transparent 52%, #000 100%);
  animation: rush 0.16s steps(1) infinite;
}
@keyframes rush { 0% { transform: rotate(0deg); } 33% { transform: rotate(3.1deg); } 66% { transform: rotate(6.3deg); } }

/* ---------- Kicks ----------
   Two bubbles in a row above the trick bubbles: kick left, kick right. Both sets are always
   on screen in the same places, so a thumb learns where each is; whichever cannot be used at
   the moment is greyed (tricks on the ground, kicks in the air). A kick bubble turns red when
   a rider is in reach on that side. */
#kicks { position: absolute; right: 0.55rem; bottom: 12rem; display: grid; grid-template-columns: repeat(2, 4.3rem); gap: 0.45rem; transition: opacity 0.12s; }
#kicks button {
  width: 4.3rem; height: 4.3rem; padding: 0; border-radius: 50%; font-size: 0.66rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; gap: 0.18rem;
  background: linear-gradient(180deg, #4a7fa8, #2c5673); box-shadow: 0 0.22rem 0 #17364e, inset 0 0 0 0.12rem rgba(255, 255, 255, 0.3);
  text-shadow: 0 0.1rem 0 rgba(0, 0, 0, 0.4);
}
#kicks button b { font-size: 1rem; }
#kicks button.near { background: linear-gradient(180deg, #ff6a4a, #d8321f); box-shadow: 0 0.22rem 0 #7a1a10, inset 0 0 0 0.12rem rgba(255, 255, 255, 0.4); }
#kicks button:active { transform: translateY(0.15rem); }
#hud:not(.grounded) #kicks { opacity: 0.35; }
#hud:not(.grounded) #kicks button { background: linear-gradient(180deg, #7d8790, #555e66); box-shadow: 0 0.22rem 0 #33393f, inset 0 0 0 0.12rem rgba(255, 255, 255, 0.2); }
#hint { bottom: 17.2rem; }
body.wide #kicks { right: 0.7rem; bottom: 10rem; grid-template-columns: repeat(2, 3.9rem); gap: 0.4rem; }
body.wide #hint { bottom: 2.4rem; }
body.wide #kicks button { width: 3.9rem; height: 3.9rem; }

/* In a wide window a long trick name is tilted across more of the screen, so the points under it sit a little lower. */
body.wide #tally { margin-top: 0.95rem; }

/* The hunter (the quickest rival of this race) wears a red ring on the progress bar. */
#dots i.hunter { box-shadow: 0 0 0 0.14rem #ff3d2e; z-index: 1; }

/* ---------- Daily goals ----------
   Laid out like the garage: heading and the streak at the top, the rider in the middle, the
   three goals and DONE at the bottom. */
#goals {
  display: grid; justify-items: center; align-items: center; gap: 0.5rem; padding: 1.1rem 0.8rem 0.9rem;
  grid-template: "title" auto "streak" auto "save" auto "." 1fr "list" auto "note" auto "done" auto / 100%;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 40%, rgba(20, 6, 2, 0.6) 100%),
    linear-gradient(180deg, rgba(255, 150, 40, 0.46) 0%, rgba(240, 80, 20, 0.22) 42%, rgba(60, 14, 4, 0.62) 100%);
  touch-action: none; cursor: grab;
}
#goalsTitle {
  grid-area: title; font-size: 2.3rem; line-height: 1; transform: rotate(-4deg); white-space: nowrap;
  color: #ffe04a; -webkit-text-stroke: 0.14rem #160d08; paint-order: stroke fill; text-shadow: 0.2rem 0.22rem 0 #160d08;
}
#goalsStreak { grid-area: streak; padding: 0.3rem 0.9rem 0.25rem; background: rgba(22, 13, 8, 0.78); box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.35); border-radius: 0.3rem; transform: skewX(-8deg); font-family: 'Kanit Display', system-ui, sans-serif; font-size: 0.85rem; letter-spacing: 0.04em; color: #ffd24a; text-align: center; }
#goalList { grid-area: list; display: grid; gap: 0.4rem; width: min(19.5rem, 100%); }
.goal { position: relative; padding: 0.4rem 0.7rem 0.55rem; border-radius: 0.4rem; background: rgba(22, 13, 8, 0.86); box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.35); overflow: hidden; }
.goal b { display: block; font-size: 0.85rem; font-weight: 700; line-height: 1.2; padding-right: 4.2rem; }
.goal small { display: block; margin-top: 0.1rem; font-size: 0.7rem; font-weight: 700; color: #ffd24a; }
.goal em { position: absolute; right: 0.7rem; top: 0.45rem; font-style: normal; font-family: 'Kanit Display', system-ui, sans-serif; font-size: 0.85rem; color: #fff; }
.goal u { position: absolute; left: 0; bottom: 0; height: 0.22rem; width: 100%; background: linear-gradient(90deg, #ff7a1a, #ffe04a); transform-origin: left; text-decoration: none; }
.goal.done { box-shadow: inset 0 0 0 0.12rem #6fd66f; }
.goal.done em { color: #8fe88f; }
.goal.done u { background: #6fd66f; }
#goalsNote { grid-area: note; margin: 0; min-height: 1.1rem; font-size: 0.8rem; font-weight: 700; color: #fff; text-shadow: 0 0.1rem 0 #160d08, 0 0 0.4rem #160d08; text-align: center; }
#btnGoalsDone {
  grid-area: done; min-width: 11rem; padding: 0.5rem 1.6rem 0.4rem; font-size: 1.7rem; border-radius: 0.3rem; transform: skewX(-8deg);
  background: linear-gradient(180deg, #ffe04a, #ff7a1a); color: #160d08; text-shadow: none;
  box-shadow: 0 0 0 0.16rem #160d08, 0.3rem 0.36rem 0 #160d08;
}
#btnGoalsDone:active { transform: skewX(-8deg) translate(0.15rem, 0.18rem); box-shadow: 0 0 0 0.16rem #160d08, 0.12rem 0.16rem 0 #160d08; }
body.wide #goals {
  grid-template: "title . list" auto "streak . list" auto "save . list" auto ". . list" 1fr "note . done" auto / auto 1fr auto;
  justify-items: start; padding: 0.9rem 1.3rem 0.9rem;
}
body.wide #goals #goalList, body.wide #goals #btnGoalsDone { justify-self: end; }
body.wide #goals #goalList { align-self: start; width: 19.5rem; }
body.wide #goals #goalsNote { align-self: end; text-align: left; }

/* A long trick name is tilted, so the points under it always keep a little clear of it. */
#tally { margin-top: 0.75rem; }

/* The offer to save a streak a missed day has just broken: watch an ad, keep the streak. */
#btnStreakAd { grid-area: save; max-width: min(19.5rem, 100%); padding: 0.45rem 0.9rem 0.4rem; font-size: 0.78rem; line-height: 1.15; border-radius: 0.3rem; cursor: pointer; }

/* ---------- How to ride ----------
   Shown once, the first time the game is opened (and again from the ? button): what each
   control does, a picture and a line apiece, with all the time in the world to read it. */
#menu #btnHow { position: relative; min-width: 2.6rem; padding-left: 0; padding-right: 0; border-radius: 0.3rem; transform: skewX(-8deg); background: #160d08; box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.5); color: #ffd24a; font-family: 'Kanit Display', system-ui, sans-serif; }
#menu #btnHow:active { transform: skewX(-8deg) translateY(0.12rem); }
#howto {
  display: grid; justify-items: center; align-content: center; gap: 0.7rem; padding: 1rem 0.8rem;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 30%, rgba(20, 6, 2, 0.7) 100%),
    linear-gradient(180deg, rgba(120, 40, 10, 0.86) 0%, rgba(60, 16, 6, 0.9) 100%);
}
#howTitle { font-size: 2.3rem; line-height: 1; transform: rotate(-4deg); white-space: nowrap; color: #ffe04a; -webkit-text-stroke: 0.14rem #160d08; paint-order: stroke fill; text-shadow: 0.2rem 0.22rem 0 #160d08; }
#howList { display: grid; gap: 0.45rem; width: min(20.5rem, 100%); }
.how { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0.7rem; border-radius: 0.4rem; background: rgba(22, 13, 8, 0.86); box-shadow: inset 0 0 0 0.1rem rgba(255, 176, 46, 0.35); }
.how i { flex: none; width: 2.6rem; height: 2.6rem; }
.how svg { width: 100%; height: 100%; display: block; }
.how b { display: block; font-family: 'Kanit Display', system-ui, sans-serif; font-weight: 400; font-size: 0.95rem; letter-spacing: 0.04em; color: #ffd24a; line-height: 1.1; }
.how span { display: block; font-size: 0.82rem; font-weight: 700; line-height: 1.25; }
#btnHowDone {
  min-width: 11rem; padding: 0.5rem 1.6rem 0.4rem; font-size: 1.7rem; border-radius: 0.3rem; transform: skewX(-8deg);
  background: linear-gradient(180deg, #ffe04a, #ff7a1a); color: #160d08; text-shadow: none;
  box-shadow: 0 0 0 0.16rem #160d08, 0.3rem 0.36rem 0 #160d08;
}
#btnHowDone:active { transform: skewX(-8deg) translate(0.15rem, 0.18rem); box-shadow: 0 0 0 0.16rem #160d08, 0.12rem 0.16rem 0 #160d08; }
/* In a wide window: two columns, so it all fits a short screen. */
body.wide #howto { gap: 0.5rem; }
body.wide #howList { grid-template-columns: repeat(2, minmax(0, 19rem)); width: auto; gap: 0.4rem 0.6rem; }
body.wide #howTitle { font-size: 1.9rem; }
