/* Rocket Fling - the whole interface.
 *
 * ONE RULE RUNS THROUGH THIS FILE: every measurement is in rem, and the rem
 * is set once per resize by fitUI() in js/ui.js from the size of the window.
 * Nothing here is in px, vw or vh.
 *
 * That is what fixes the embedded view. On CrazyGames the game runs in a frame
 * that is often only 800 by 460 - and the old interface mixed fixed pixels
 * (a 46 px coin bar, a 360 px result card) with viewport units (clamp(...vw)).
 * Two of the three then kept their size while the picture around them shrank,
 * so the gauges slid off the edge and the cards ran into each other. With a
 * single scale factor behind every number the small frame shows the same
 * layout as full screen, only smaller - which is exactly what was asked for.
 *
 * The look: thick dark outlines, saturated colours, deep drop shadows, round
 * corners and things that move when they change. Built for young players -
 * every reward is meant to be visible without reading anything.
 */

/* The typeface the whole interface was drawn for. It was named first in the
   font stack from the start but never shipped, so every player saw the system
   fallback instead - thin, square lettering inside round, fat shapes. Shipped
   as a file of its own: the portal does not allow fonts fetched from elsewhere.
   One variable file covers every weight used here. */
@font-face {
  font-family: "Baloo 2";
  src: url("fonts/baloo2-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Outline colour of every card, badge and gauge - one dark blue for all of
     them, so the interface reads as one set of stickers. */
  --line: #20263c;
  --ink: #ffffff;
  --card: #ffffff;
  --panel: #2f3a5c;
  --panel-2: #3b4770;
  --mute: #93a0c4;

  --gold: #ffc72e;
  --gold-dk: #c07c00;
  --green: #33d66d;
  --green-dk: #17a24a;
  --purple: #a35bff;
  --purple-dk: #6c26c0;
  --pink: #ff4d8f;
  --pink-dk: #cc1f63;
  --cyan: #35d1ff;
  --cyan-dk: #0d84bd;
  --orange: #ff8a1f;
  --red: #ff4d5e;
  --violet: #c08cff;

  /* Room kept free at the bottom edge of the workshop for the prompt. It has
     to clear the prompt's own height plus the drop shadow under the cards -
     at 4.5rem they overlapped by a few pixels, which is exactly the kind of
     thing a hard-coded pair of numbers does when one of them changes. */
  --prompt-room: 4.4rem;

  /* The thrust gauge and the tutorial arrow share these measurements */
  --boost-size: 6.6rem;
  --arrow-size: 2.6rem;

  --font: "Baloo 2", "Segoe UI", system-ui, -apple-system, "Trebuchet MS",
          "Helvetica Neue", Arial, sans-serif;

  /* Every outlined headline uses one of these three weights, so the stroke
     width stays in proportion when the whole interface scales. */
  --stroke-s: 0.16rem;
  --stroke-m: 0.26rem;
  --stroke-l: 0.4rem;
}

* { box-sizing: border-box; }

/* The rem itself. fitUI() overwrites this on every resize; the value here is
   only what the first frame uses before the script has run. */
html { font-size: 16px; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0a1018;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* The overlay lets every tap through by default - only the things you are
   meant to press take them back. */
#ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hidden { display: none !important; }

/* ---------- Drawings ---------- */

/* Holders for the inline SVGs from icons.js. `.icon` takes the surrounding
   colour, `.art` brings its own. Both are sized in em, so each one keeps
   whatever size the CSS around it decided. */
.icon, .art {
  display: inline-grid;
  place-items: center;
  line-height: 0;
  flex: none;
}

.icon > svg, .art > svg {
  width: 1em;
  height: 1em;
  display: block;
  overflow: visible;
}

/* The badge behind the camcorder on every ad button. It was a disc around a
   play triangle; a camera is a wide shape and needs a wide badge, or it has to
   be shrunk until it reads as a smudge. */
.play-icon > svg,
.reward-icon > svg { width: 100%; height: 100%; }
.play-icon, .reward-icon { font-size: 0; }

/* ---------- Shared shapes ---------- */

/* Every raised surface in the game is built from these two: a hard dark
   outline and a solid shadow below it, never a blur. */
.plate {
  border: var(--stroke-m) solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 0.28rem 0 rgba(0, 0, 0, 0.34);
}

/* Outlined lettering. The stroke is painted first so it sits behind the fill
   rather than eating into it. */
.stroked {
  -webkit-text-stroke: var(--stroke-m) var(--line);
  paint-order: stroke fill;
}

/* ---------- Loading ---------- */

/* The loading screen is the game in miniature: the sky of the first biome, a
   sun, round hills sliding past in three layers and the rocket in flight over
   them. It used to be a rocket standing on a pad in space - a picture of
   waiting. This is a picture of what the wait is for.

   `--p` is the real progress, set from boot() in main.js as each step
   finishes, and everything here reads it: the bar, the number, how high the
   rocket has climbed and how hard it burns. */
#loader {
  --p: 0;
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #2f8fe6 0%, #6ec1f6 46%, #d6f1ff 78%);
  z-index: 100;
  pointer-events: auto;
  transition: opacity 0.45s ease;
  overflow: hidden;
}

#loader.gone { opacity: 0; pointer-events: none; }

/* The sun: a disc with a slow wheel of rays behind it */
.ld-sun {
  position: absolute;
  right: 9%;
  top: 9%;
  width: 6.4rem;
  height: 6.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 40%, #fffbe0 0 34%, #ffe27a 62%, #ffc93a 100%);
  box-shadow: 0 0 0 0.9rem rgba(255, 244, 190, 0.28), 0 0 0 2.1rem rgba(255, 244, 190, 0.14);
}
.ld-sun i {
  position: absolute;
  inset: -5.5rem;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.2) 0 9deg, transparent 9deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 0 35%, #000 36%, transparent 70%);
  mask: radial-gradient(circle, transparent 0 35%, #000 36%, transparent 70%);
  animation: spin 40s linear infinite;
}

/* Clouds: one rounded bar with two bumps on it, each at its own pace */
.ld-cloud {
  position: absolute;
  left: 100%;
  width: 7.2rem;
  height: 2rem;
  border-radius: 99rem;
  background: #fff;
  opacity: 0.94;
  animation: cloudBy 26s linear infinite;
}
.ld-cloud::before,
.ld-cloud::after {
  content: "";
  position: absolute;
  bottom: 40%;
  border-radius: 50%;
  background: #fff;
}
.ld-cloud::before { left: 14%; width: 2.9rem; height: 2.9rem; }
.ld-cloud::after { left: 44%; width: 3.8rem; height: 3.8rem; }
.ld-cloud.c1 { top: 14%; animation-duration: 30s; animation-delay: -4s; }
.ld-cloud.c2 { top: 30%; scale: 0.7; animation-duration: 22s; animation-delay: -15s; opacity: 0.85; }
.ld-cloud.c3 { top: 46%; scale: 1.25; animation-duration: 18s; animation-delay: -9s; }
.ld-cloud.c4 { top: 6%; scale: 0.55; animation-duration: 36s; animation-delay: -24s; opacity: 0.8; }

@keyframes cloudBy {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-100vw - 14rem), 0, 0); }
}

/* Streaks of air going past - the cheapest way to say "fast" */
.ld-streak {
  position: absolute;
  left: 100%;
  width: 9rem;
  height: 0.22rem;
  border-radius: 99rem;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85));
  animation: cloudBy 1.5s linear infinite;
}
.ld-streak.s1 { top: 34%; }
.ld-streak.s2 { top: 52%; width: 6rem; animation-duration: 1.1s; animation-delay: -0.5s; }
.ld-streak.s3 { top: 43%; width: 12rem; animation-duration: 1.9s; animation-delay: -1.1s; opacity: 0.6; }

/* Three rows of hills. Each drawing is two screens wide and holds the same
   row twice, so sliding it by half its width loops without a seam; the nearer
   the row, the faster it goes. */
.ld-hills {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200%;
  display: block;
  animation: hillsBy 30s linear infinite;
}
.ld-hills.far { height: 46%; animation-duration: 48s; }
.ld-hills.mid { height: 36%; animation-duration: 20s; }
.ld-hills.near { height: 27%; animation-duration: 9s; }

@keyframes hillsBy {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.load-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 11%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.05rem;
  filter: drop-shadow(0 0.34rem 0 rgba(16, 28, 60, 0.4));
}

.load-title b { width: 1.1rem; }

/* Each letter drops in, then hops in turn - a title that just sits there is a
   title nobody waits for. The delay comes from the position, so there is no
   class per letter. */
.load-title span {
  display: inline-block;
  color: #ffe14d;
  -webkit-text-stroke: var(--stroke-l) var(--line);
  paint-order: stroke fill;
  text-shadow: 0 0.16rem 0 #e09a12;
  animation: letterIn 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both,
             letterHop 2.2s ease-in-out 0.9s infinite;
}
.load-title span:nth-child(1) { animation-delay: 0.00s, 0.90s; }
.load-title span:nth-child(2) { animation-delay: 0.05s, 0.96s; }
.load-title span:nth-child(3) { animation-delay: 0.10s, 1.02s; }
.load-title span:nth-child(4) { animation-delay: 0.15s, 1.08s; }
.load-title span:nth-child(5) { animation-delay: 0.20s, 1.14s; }
.load-title span:nth-child(6) { animation-delay: 0.25s, 1.20s; }
.load-title span:nth-child(n+8) { color: #fff; text-shadow: 0 0.16rem 0 #9fd2ff; }
.load-title span:nth-child(8) { animation-delay: 0.35s, 1.30s; }
.load-title span:nth-child(9) { animation-delay: 0.40s, 1.36s; }
.load-title span:nth-child(10) { animation-delay: 0.45s, 1.42s; }
.load-title span:nth-child(11) { animation-delay: 0.50s, 1.48s; }
.load-title span:nth-child(12) { animation-delay: 0.55s, 1.54s; }

@keyframes letterIn {
  from { opacity: 0; transform: translateY(-1.6rem) scale(0.5) rotate(-12deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes letterHop {
  0%, 62%, 100% { transform: translateY(0) scale(1); }
  70% { transform: translateY(-0.6rem) scale(1.1, 0.94); }
  80% { transform: translateY(0.1rem) scale(0.96, 1.04); }
}

/* The rocket, mid-screen. The outer box places it and lifts it with the
   progress; the inner one turns it into the flight direction and lets it bob. */
.ld-flight {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  /* `translate` rather than `transform`, so the lift-off animation below can
     own the transform. */
  translate: calc(-2rem + var(--p) * 4rem) calc(2.6rem - var(--p) * 3.6rem);
  transition: translate 0.3s ease-out;
}

.load-rocket {
  position: absolute;
  left: -3.6rem;
  top: -3.6rem;
  width: 7.2rem;
  height: 7.2rem;
  display: grid;
  place-items: center;
  rotate: 62deg;
  animation: hover 1.3s ease-in-out infinite;
}

/* One drawing, the same rocket the upgrade card shows - so the very first
   thing on screen is already the game's own art. */
.load-ship {
  position: relative;
  font-size: 7.2rem;
  filter: drop-shadow(0 0.22rem 0 rgba(16, 28, 60, 0.35));
}

/* The exhaust behind it. Not part of the drawing, because this is the one
   piece that has a job: it grows with the progress, so the engine spools up
   while the game builds itself. */
.load-flame {
  position: absolute;
  left: 50%;
  top: 84%;
  width: 1.9rem;
  height: calc(1.2rem + var(--p) * 3.4rem);
  margin-left: -0.95rem;
  border-radius: 50% 50% 50% 50% / 22% 22% 78% 78%;
  background: radial-gradient(ellipse at 50% 12%, #fff6b8 0 26%, #ffb01f 58%, #ff5b18 100%);
  transform-origin: 50% 0;
  transition: height 0.25s ease-out;
  animation: flicker 0.17s steps(2, end) infinite;
}

/* Puffs of smoke left behind along the flight path */
.ld-puff {
  position: absolute;
  left: 50%;
  top: 96%;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: -0.75rem;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: puff 1.2s ease-out infinite;
}
.ld-puff.p2 { animation-delay: -0.3s; }
.ld-puff.p3 { animation-delay: -0.6s; }
.ld-puff.p4 { animation-delay: -0.9s; }

@keyframes puff {
  0% { opacity: 0.95; transform: translateY(1rem) scale(0.5); }
  100% { opacity: 0; transform: translateY(11rem) scale(2.1); }
}

#loader.done .load-flame { height: 6.2rem; }

/* At the end it goes. The last thing the loading screen does is the thing the
   whole game is about. */
#loader.done .ld-flight {
  animation: liftOff 0.55s cubic-bezier(0.5, 0, 0.9, 0.5) forwards;
}

@keyframes liftOff {
  0% { transform: translate(0, 0) scale(1); }
  20% { transform: translate(-1.2rem, 0.7rem) scale(0.94); }
  100% { transform: translate(46rem, -25rem) scale(1.25); }
}

@keyframes hover {
  0%, 100% { transform: translateY(-0.3rem); }
  50% { transform: translateY(0.3rem); }
}

@keyframes flicker {
  0% { transform: scaleY(1) scaleX(1); }
  100% { transform: scaleY(0.8) scaleX(1.12); }
}

/* Bar, number and tip, as one block at the foot of the screen */
.ld-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(1.3rem, calc(env(safe-area-inset-bottom) + 0.9rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.load-bar {
  position: relative;
  width: 21rem;
  max-width: 76%;
  height: 1.6rem;
  border-radius: 99rem;
  background: #1c2748;
  border: var(--stroke-m) solid var(--line);
  box-shadow: 0 0.3rem 0 rgba(8, 16, 40, 0.35), inset 0 0.2rem 0 rgba(0, 0, 0, 0.25);
}

/* A real fill, not a shuttle. The bar used to slide back and forth on a loop,
   which said nothing at all - a slow load looked exactly like a hung one. */
.load-bar i {
  display: block;
  height: 100%;
  width: calc(var(--p) * 100%);
  min-width: 1.1rem;
  border-radius: 99rem;
  background: linear-gradient(90deg, #3ddc7a 0%, #b6f04a 55%, var(--gold) 100%);
  box-shadow: inset 0 0.22rem 0 rgba(255, 255, 255, 0.45), inset 0 -0.2rem 0 rgba(0, 0, 0, 0.14);
  /* Short on purpose: the boot steps land within a few frames of each other on
     a fast machine, and a long transition then leaves the bar crawling far
     behind the number below it. */
  transition: width 0.18s ease-out;
  position: relative;
  overflow: hidden;
}

/* Stripes running along the filled part, the same device as the route bar in
   flight: movement inside the bar says the work is still going on. */
.load-bar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.3) 0 0.45rem,
    rgba(255, 255, 255, 0) 0.45rem 1rem);
  animation: stripes 0.7s linear infinite;
}

/* A small rocket riding the front edge of the fill */
.ld-knob {
  position: absolute;
  top: 50%;
  left: calc(var(--p) * 100%);
  font-size: 2.5rem;
  translate: -50% -50%;
  rotate: 90deg;
  transition: left 0.18s ease-out;
  filter: drop-shadow(0 0.14rem 0 rgba(8, 16, 40, 0.4));
}

.load-pct {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.1rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: var(--stroke-m) var(--line);
  paint-order: stroke fill;
}

.ld-tip {
  max-width: 88%;
  padding: 0.2rem 0.9rem 0.28rem;
  border-radius: 99rem;
  background: rgba(22, 34, 72, 0.62);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07rem;
  text-align: center;
  color: #eaf4ff;
}
.ld-tip.swap { animation: tipIn 0.35s ease-out; }

@keyframes tipIn {
  from { opacity: 0; transform: translateY(0.4rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* Upright the title does not fit on one line, so it breaks at the gap */
@media (orientation: portrait) {
  .load-title { flex-wrap: wrap; top: 9%; font-size: 3.9rem; row-gap: 0.2rem; }
  .load-title b { width: 100%; height: 0; }
  .ld-sun { right: 6%; top: 3%; scale: 0.8; }
  .ld-hills.far { height: 38%; }
  .ld-hills.mid { height: 30%; }
  .ld-hills.near { height: 22%; }
}

/* ---------- Coins and settings ---------- */

#coinBar {
  position: absolute;
  top: max(0.7rem, env(safe-area-inset-top));
  right: max(0.7rem, env(safe-area-inset-right));
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.9rem;
  padding: 0 1rem 0 0.4rem;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: var(--stroke-m) solid var(--line);
  border-radius: 99rem;
  box-shadow: 0 0.28rem 0 rgba(0, 0, 0, 0.34);
  font-size: 1.35rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.coin-art { font-size: 2rem; filter: drop-shadow(0 0.12rem 0 rgba(0, 0, 0, 0.3)); }
#coinBar .coin-art { animation: coinSpin 4.5s ease-in-out infinite; }

/* Not a real rotation - the coin is drawn flat on, so it squashes and comes
   back. That reads as a spin and keeps the drawing readable throughout. */
@keyframes coinSpin {
  0%, 72%, 100% { transform: scaleX(1); }
  80% { transform: scaleX(0.16); }
  88% { transform: scaleX(1.06); }
}

#coinBar.bump { animation: bump 0.4s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.16) rotate(-1.5deg); }
  100% { transform: scale(1); }
}

/* The number that flies off the coin bar when money comes in. Money arriving
   silently is money the player does not notice. */
#cashGain {
  position: absolute;
  right: 1rem;
  top: 100%;
  font-size: 1.15rem;
  font-weight: 900;
  color: #7dffa8;
  -webkit-text-stroke: var(--stroke-m) var(--line);
  paint-order: stroke fill;
  opacity: 0;
  pointer-events: none;
}

#cashGain.show { animation: gainUp 1.05s ease-out; }

@keyframes gainUp {
  0% { opacity: 0; transform: translateY(-0.3rem) scale(0.7); }
  20% { opacity: 1; transform: translateY(0.1rem) scale(1.12); }
  70% { opacity: 1; transform: translateY(0.5rem) scale(1); }
  100% { opacity: 0; transform: translateY(1.5rem) scale(0.95); }
}

.round-btn {
  position: absolute;
  top: max(0.7rem, env(safe-area-inset-top));
  left: max(0.7rem, env(safe-area-inset-left));
  z-index: 22;
  width: 2.9rem;
  height: 2.9rem;
  display: grid;
  place-items: center;
  padding: 0;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: var(--stroke-m) solid var(--line);
  border-radius: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0.28rem 0 rgba(0, 0, 0, 0.34);
  transition: transform 0.09s ease, box-shadow 0.09s ease;
}
.round-btn:active { transform: translateY(0.28rem); box-shadow: 0 0 0 rgba(0, 0, 0, 0.34); }
#muteIcon { font-size: 1.5rem; }

/* The portal is holding the sound off from its own chrome, so the game's
   button has nothing left to switch. It says so instead of being pressed and
   doing nothing. */
#muteBtn.portal-muted {
  filter: grayscale(0.7) brightness(0.8);
  cursor: default;
}

#muteBtn.portal-muted:active { transform: none; }

/* The guide button. Under the coin bar on the right, which in the workshop is
   the one corner nothing else wants - the sound button and the account chip
   own the left, the personal best the middle. */
#infoBtn {
  left: auto;
  right: max(0.7rem, env(safe-area-inset-right));
  top: calc(max(0.7rem, env(safe-area-inset-top)) + 3.5rem);
}

#infoIcon { font-size: 1.6rem; }
#infoBtn.open { background: linear-gradient(180deg, #ffdb6b 0%, var(--gold) 100%); color: var(--line); }

/* Never opened: it asks. An explanation nobody finds explains nothing, and the
   one question the workshop raises - what does any of this do - is answered
   behind this button. It stops the first time it is pressed, for good. */
#infoBtn.fresh {
  box-shadow: 0 0.28rem 0 rgba(0, 0, 0, 0.34), 0 0 0 0.2rem var(--gold);
  animation: infoCall 2.8s ease-in-out infinite;
}

#infoBtn:active { animation: none; }

@keyframes infoCall {
  0%, 72%, 100% { transform: none; }
  79% { transform: scale(1.14) rotate(-7deg); }
  87% { transform: scale(1.14) rotate(7deg); }
  94% { transform: scale(1.05) rotate(0deg); }
}

/* ---------- CrazyGames account ---------- */

/* Sits beside the sound button, in the workshop only - in flight the corners
   belong to the gauges. Signed out it is a button that opens the portal's own
   sign-in dialog; signed in it is just a label with the avatar and the name. */
#userChip {
  position: absolute;
  top: max(0.7rem, env(safe-area-inset-top));
  left: calc(max(0.7rem, env(safe-area-inset-left)) + 3.3rem);
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 11rem;
  height: 2.9rem;
  padding: 0 0.8rem 0 0.25rem;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: var(--stroke-m) solid var(--line);
  border-radius: 99rem;
  box-shadow: 0 0.28rem 0 rgba(0, 0, 0, 0.34);
  color: var(--ink);
  font-family: var(--font);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.09s ease, box-shadow 0.09s ease;
}

#userChip:active { transform: translateY(0.28rem); box-shadow: 0 0 0 rgba(0, 0, 0, 0.34); }

/* Signed in there is nothing left to press */
#userChip.signed-in { cursor: default; }
#userChip.signed-in:active { transform: none; box-shadow: 0 0.28rem 0 rgba(0, 0, 0, 0.34); }

.user-face {
  position: relative;
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: #1b2138;
  border: var(--stroke-s) solid var(--line);
}

.user-face img { width: 100%; height: 100%; object-fit: cover; display: none; }
/* Only when the portal's picture really arrived - a broken image is worse
   than the drawn stand-in. */
#userChip.has-pic .user-face img { display: block; }
#userChip.has-pic #userFallback { display: none; }
#userFallback { font-size: 1.5rem; }

#userName {
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.06rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-text-stroke: var(--stroke-s) var(--line);
  paint-order: stroke fill;
}

/* ---------- Personal best ---------- */

/* A distance game whose record is nowhere on screen throws away its own
   motivation. It only appears once there is a run to beat. */
#bestBar {
  position: absolute;
  top: max(0.7rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 1.1rem 0.35rem 0.55rem;
  border-radius: 99rem;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: var(--stroke-m) solid var(--line);
  box-shadow: 0 0.28rem 0 rgba(0, 0, 0, 0.34);
  white-space: nowrap;
}

.best-cup { font-size: 1.9rem; filter: drop-shadow(0 0.1rem 0 rgba(0, 0, 0, 0.3)); }
.best-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.best-label { color: var(--gold); font-size: 0.68rem; font-weight: 900; letter-spacing: 0.12rem; }
#bestVal { font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }

/* ---------- Flight display ---------- */

#flightHud {
  position: absolute;
  inset: 0;
  z-index: 15;
}

/* Route progress, top centre */
.route {
  position: absolute;
  top: max(0.8rem, calc(env(safe-area-inset-top) + 0.3rem));
  left: 50%;
  transform: translateX(-50%);
  width: 28rem;
  max-width: 72%;
}

/* A deep groove for the fill to run in: dark at the top where the rim throws
   its shadow, a shade lighter at the bottom */
.route-track {
  position: relative;
  height: 2rem;
  background: linear-gradient(180deg, #10152a 0%, #1c2340 55%, #283152 100%);
  border: var(--stroke-m) solid var(--line);
  border-radius: 99rem;
  overflow: visible;
}

/* The fill: a glassy cyan tube - bright on top, deep blue underneath, a
   highlight along its top and a glow round it, so it reads as lit rather
   than painted */
.route-fill {
  position: absolute;
  left: 0.14rem;
  top: 0.14rem;
  bottom: 0.14rem;
  width: 0;
  min-width: 0.6rem;
  border-radius: 99rem;
  background: linear-gradient(180deg, #c4f8ff 0%, #66e2ff 28%, #22b2f4 62%, #1570d2 100%);
  box-shadow: inset 0 -0.16rem 0 rgba(8, 46, 128, 0.35), 0 0 0.9rem rgba(70, 214, 255, 0.55);
  transition: width 0.12s linear;
  overflow: hidden;
}

.route-fill::after {
  content: '';
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  top: 0.14rem;
  height: 30%;
  border-radius: 99rem;
  background: rgba(255, 255, 255, 0.6);
}

/* Barber-pole stripes running along the filled part. Movement in the bar is
   what makes the distance feel like it is being earned. Softer than they
   were: on top of the glass they only need to be seen moving. */
.route-shine {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.24) 0 0.45rem,
    rgba(255, 255, 255, 0) 0.45rem 1.05rem);
  animation: stripes 0.8s linear infinite;
}

@keyframes stripes {
  from { background-position: 0 0; }
  to { background-position: 1.16rem 0; }
}

/* Three marks split the route into quarters - short notches in the middle of
   the groove, not lines from rim to rim */
.route-marks { position: absolute; inset: 0.5rem 0.14rem; display: flex; }
.route-marks span { flex: 1; border-right: 0.16rem solid rgba(255, 255, 255, 0.2); }
.route-marks span:last-child { border-right: none; }

/* The percentage: a small glossy tab under the bar, in the same blue as the
   bars along the top edge */
.route-pct {
  margin: 0.32rem auto 0;
  width: fit-content;
  padding: 0.04rem 0.7rem 0.1rem;
  border-radius: 99rem;
  background: linear-gradient(180deg, #4c5b8e 0%, #37436c 52%, #2b3558 100%);
  border: var(--stroke-s) solid var(--line);
  box-shadow: inset 0 0.12rem 0 rgba(255, 255, 255, 0.24), 0 0.2rem 0 rgba(0, 0, 0, 0.3);
  color: #dff6ff;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08rem;
  font-variant-numeric: tabular-nums;
}

.route-rocket,
.route-flag,
.route-best {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
}

/* The badge that rides the bar. It carries the rocket drawing rather than a
   dot, so the thing moving along the route is the thing you are flying. A
   ring of the fill's own cyan round it ties it to the bar it pulls along. */
.route-rocket {
  left: 0;
  z-index: 2;
  width: 2.7rem;
  height: 2.7rem;
  margin: -1.35rem 0 0 -1.35rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, #ffffff 0%, #f1f6ff 50%, #c8d7f1 100%);
  border: var(--stroke-m) solid var(--line);
  box-shadow: 0 0.18rem 0 rgba(0, 0, 0, 0.3), 0 0 0 0.2rem rgba(102, 226, 255, 0.6),
    0 0 1rem rgba(102, 226, 255, 0.65);
  transition: left 0.12s linear;
}

/* The badge is a white disc, and the rocket inside it inherited the white of
   the text around it - white on white, so there was nothing to see. It gets a
   colour of its own, and points along the bar instead of down it. */
.route-rocket .art {
  font-size: 1.6rem;
  color: var(--red);
  transform: rotate(45deg);
  filter: drop-shadow(0 0.08rem 0 rgba(32, 38, 60, 0.35));
}

/* The flag gets the same badge as the rocket. On the dark bar the bare
   chequered drawing was a dark mark on a dark ground and disappeared. Gold
   once the rocket is through. */
.route-flag {
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  margin: -1.25rem -1.25rem 0 0;
  font-size: 1.6rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, #ffffff 0%, #eef3fc 50%, #c8d7f1 100%);
  border: var(--stroke-m) solid var(--line);
  box-shadow: 0 0.16rem 0 rgba(0, 0, 0, 0.3);
}
.route-flag.reached {
  background: radial-gradient(circle at 50% 28%, #fff4b8 0%, #ffd34d 50%, #f0a400 100%);
  box-shadow: 0 0.16rem 0 rgba(0, 0, 0, 0.3), 0 0 1rem rgba(255, 200, 60, 0.75);
}

/* The record, as a cup on the route: a dark disc with a gold ring, so it
   stands out on the cyan fill and on the dark groove alike. Once the rocket
   is past it, it steps back. */
.route-best {
  left: 0;
  z-index: 1;
  width: 1.9rem;
  height: 1.9rem;
  margin: -0.95rem 0 0 -0.95rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #46548a 0%, #2b3558 100%);
  border: var(--stroke-s) solid var(--line);
  box-shadow: 0 0 0 0.16rem #ffc72e, 0 0.2rem 0 0.16rem rgba(0, 0, 0, 0.28),
    0 0 0.8rem 0.16rem rgba(255, 199, 46, 0.5);
  font-size: 1.35rem;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.route-best.passed {
  transform: scale(0.8);
  opacity: 0.6;
}

/* The distance. Gold in a dark outline - the number the whole game is about
   should not look like the rest of the text.
   Deliberately a flat colour and not a gradient: a gradient fill needs
   background-clip:text, and that cannot be combined with a text stroke in one
   pass - the stroke gets clipped away with everything else outside the glyph.
   Drawing the outline a second time behind it left a dark blob at this stroke
   width. The extra shadow underneath carries the depth instead.
   The unit is set smaller than the number, so the eye goes to what changes. */
#distVal {
  position: absolute;
  top: max(4.5rem, calc(env(safe-area-inset-top) + 4rem));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 2.9rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.03rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #ffd84d;
  -webkit-text-stroke: var(--stroke-l) var(--line);
  paint-order: stroke fill;
  text-shadow: 0 0.24rem 0 rgba(32, 38, 60, 0.55);
  transition: color 0.3s ease;
}

#distVal .dv-unit {
  font-size: 0.6em;
  -webkit-text-stroke-width: var(--stroke-m);
  color: #fff1b0;
}

/* Every full kilometre: a short kick */
#distVal.bump { animation: dist-bump 0.34s ease-out; }
@keyframes dist-bump {
  0% { transform: translateX(-50%) scale(1); }
  35% { transform: translateX(-50%) scale(1.14); }
  100% { transform: translateX(-50%) scale(1); }
}

/* Beyond the old record: a hotter gold with a glow, and a ribbon under the
   number that says why */
#distVal.record {
  color: #ffb52e;
  text-shadow: 0 0.24rem 0 rgba(32, 38, 60, 0.55), 0 0 1.4rem rgba(255, 150, 30, 0.75);
}
#distVal.record .dv-unit { color: #ffe08a; }
#distVal.record::after {
  content: 'NEW BEST';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 0.3rem;
  padding: 0.06rem 0.6rem 0.1rem;
  border-radius: 99rem;
  background: linear-gradient(180deg, #d5a6ff 0%, var(--purple) 55%, var(--purple-dk) 100%);
  border: var(--stroke-s) solid var(--line);
  box-shadow: inset 0 0.12rem 0 rgba(255, 255, 255, 0.3), 0 0.2rem 0 rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.12rem;
  -webkit-text-stroke: 0;
  text-shadow: none;
  animation: best-in 0.35s ease-out;
}
@keyframes best-in {
  from { transform: translateX(-50%) scale(0.4); opacity: 0; }
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Round speedometer, bottom left */
.speedo {
  position: absolute;
  left: max(0.8rem, env(safe-area-inset-left));
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  width: 9.4rem;
  height: 9.4rem;
  filter: drop-shadow(0 0.3rem 0 rgba(0, 0, 0, 0.3));
}

.speedo svg { width: 100%; height: 100%; display: block; }

#speedArc { transition: stroke-dasharray 0.1s linear; }
#speedNeedle { transition: transform 0.09s ease-out; }

.speedo-read {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 17%;
  text-align: center;
}

.speedo-read #speedVal {
  font-size: 1.6rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  -webkit-text-stroke: var(--stroke-m) var(--line);
  paint-order: stroke fill;
}

.speedo-unit {
  margin-top: 0.05rem;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.13rem;
  color: #b9c5e8;
  -webkit-text-stroke: var(--stroke-s) var(--line);
  paint-order: stroke fill;
}

/* Thrust gauge, bottom right. A round tank that empties from the top - the
   flame inside it goes out with the fuel. */
.boost {
  position: absolute;
  right: max(0.8rem, env(safe-area-inset-right));
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  width: var(--boost-size);
  height: var(--boost-size);
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0.3rem 0 rgba(0, 0, 0, 0.3));
}

.boost-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #1b2138;
  border: var(--stroke-m) solid var(--line);
  overflow: hidden;
}

.boost-ring i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: linear-gradient(180deg, #ffd84d 0%, var(--orange) 45%, #ff4d18 100%);
  transition: height 0.1s linear;
}

/* The surface of the fuel, so the level reads as liquid and not as a bar */
.boost-ring i::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: -0.3rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #ffe89a;
  opacity: 0.9;
}

.boost-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 68%;
  height: 68%;
}

.boost-art { font-size: 2.9rem; }

/* Full tank: the flame breathes. Empty: it goes grey and stops. */
.boost:not(.empty) .boost-art { animation: pulse 0.75s ease-in-out infinite; }
.boost.empty .boost-art { filter: grayscale(1) brightness(0.65); }

/* Sits in the overlay rather than in the flight display, because it also has
   to speak in the workshop - "no ad available", "next ad in 9s". Inside the
   flight display those messages were painted onto a hidden element. */
#comboPop {
  position: absolute;
  top: 33%;
  left: 50%;
  width: max-content;
  max-width: 90%;
  text-align: center;
  z-index: 45;
  pointer-events: none;
  transform: translate(-50%, -50%);
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 0.06rem;
  color: var(--gold);
  -webkit-text-stroke: var(--stroke-l) var(--line);
  paint-order: stroke fill;
  opacity: 0;
}

/* The burst behind the word. It is one element, so it costs nothing, and it
   turns a line of text into something that happened. */
#comboPop::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9rem;
  height: 9rem;
  margin: -4.5rem 0 0 -4.5rem;
  z-index: -1;
  background: conic-gradient(from 0deg,
    rgba(255, 255, 255, 0.5) 0 6deg, transparent 6deg 30deg);
  border-radius: 50%;
  opacity: 0;
}

#comboPop.show { animation: comboPop 0.85s cubic-bezier(0.2, 1.35, 0.4, 1); }
#comboPop.show::before { animation: comboRays 0.85s ease-out; }

@keyframes comboPop {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.4) rotate(-8deg); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.24) rotate(3deg); }
  60% { opacity: 1; transform: translate(-50%, -55%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -100%) scale(0.9); }
}

@keyframes comboRays {
  0% { opacity: 0.85; transform: scale(0.3) rotate(0deg); }
  100% { opacity: 0; transform: scale(1.5) rotate(40deg); }
}

/* ---------- Power bar ---------- */

#powerUi {
  position: absolute;
  bottom: max(6rem, calc(env(safe-area-inset-bottom) + 5.4rem));
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
}

.power-track {
  position: relative;
  width: 22rem;
  max-width: 78vw;
  height: 2.1rem;
  border-radius: 99rem;
  background: linear-gradient(90deg, var(--red) 0%, var(--gold) 55%, var(--green) 100%);
  border: var(--stroke-m) solid var(--line);
  box-shadow: 0 0.28rem 0 rgba(0, 0, 0, 0.34);
}

/* The target zone has to read at a glance. At 55 % white on the green end of
   the gradient it was almost invisible - the prompt said "tap at the top" and
   you had to guess where the top was. */
.power-perfect {
  position: absolute;
  top: -0.12rem;
  bottom: -0.12rem;
  background: repeating-linear-gradient(-45deg, #ffffff 0 0.4rem, #ffe27a 0.4rem 0.8rem);
  border-left: 0.16rem solid var(--line);
  border-right: 0.16rem solid var(--line);
  animation: perfectGlow 0.55s ease-in-out infinite alternate;
}

@keyframes perfectGlow {
  from { box-shadow: 0 0 0 rgba(255, 226, 122, 0); }
  to { box-shadow: 0 0 0.9rem 0.15rem rgba(255, 226, 122, 0.9); }
}

/* The word sits above the zone and moves with it, so the target is named and
   not only coloured. */
.power-perfect span {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1rem;
  color: #fff6c8;
  -webkit-text-stroke: var(--stroke-m) var(--line);
  paint-order: stroke fill;
}

.power-needle {
  position: absolute;
  top: -0.45rem;
  bottom: -0.45rem;
  width: 0.45rem;
  margin-left: -0.22rem;
  border-radius: 99rem;
  background: #ffffff;
  border: var(--stroke-m) solid var(--line);
  box-sizing: content-box;
}

/* ---------- Prompt line ---------- */

/* The prompt at the bottom edge. Deliberately quieter than the rest of the
   interface: it is a hint, not a button, and at full weight it was competing
   with the upgrade cards right above it for the same attention.
   Its height is what --prompt-room below is reserved for; the two belong
   together, and when they drifted apart the cards ended up sitting on it. */
#prompt {
  position: absolute;
  bottom: max(1rem, calc(env(safe-area-inset-bottom) + 0.7rem));
  left: 50%;
  transform: translateX(-50%);
  z-index: 19;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 1.05rem 0.36rem 0.8rem;
  border-radius: 99rem;
  white-space: nowrap;
  background: linear-gradient(180deg,
    rgba(59, 71, 112, 0.8) 0%, rgba(47, 58, 92, 0.8) 100%);
  border: var(--stroke-s) solid rgba(32, 38, 60, 0.7);
  box-shadow: 0 0.2rem 0 rgba(0, 0, 0, 0.2);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.06rem;
  animation: breathe 1.4s ease-in-out infinite;
}

.prompt-hand { font-size: 1.5rem; animation: tapping 1.4s ease-in-out infinite; }

@keyframes tapping {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(0.22rem) rotate(2deg); }
}

/* For #prompt: keeps the left:50% centring while it pulses */
@keyframes breathe {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.035); }
}

/* The same pulse without the offset - for elements that already get their
   centre from the container. */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}

/* ---------- Workshop ---------- */

#menu {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 max(0.5rem, env(safe-area-inset-left))
           max(var(--prompt-room), calc(env(safe-area-inset-bottom) + var(--prompt-room) - 0.4rem));
}

.upgrades {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.6rem;
  /* Deliberately narrow: the cards should not crowd out the rocket. Every bit
     of room they give up is room the rocket above them gets. */
  width: 27rem;
  max-width: 94%;
  pointer-events: auto;
}

/* One upgrade is two controls stacked: the ad offer on top, and under it the
   card itself - coloured header with the name, a picture of what you are
   buying, a row of stars for the progress and a price button.
   The wrapper carries no colour of its own; it only holds the two apart. */
.up-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--font);
}

/* ---------- The ad offer, on its own button above the card ---------- */

/* It stands apart from the purchase on purpose. The two used to be the same
   button - press it with the coins and you bought the tier, press it without
   them and it played an advert instead - and the price is hardest to reach
   exactly when a card is tapped at most. Every one of those taps past the
   first was an advert nobody asked for. */
.up-ad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  min-width: 0;
  /* Nothing may ever sit outside this button. A centred flex row that does not
     fit spills out of both ends, which is how the camera ended up on the white
     of the card next to its own green button on a phone. */
  overflow: hidden;
  padding: 0.18rem 0.28rem 0.24rem;
  border: var(--stroke-s) solid var(--line);
  border-radius: 0.7rem;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.03rem;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.09s ease, box-shadow 0.09s ease;
  font-family: var(--font);
  -webkit-text-stroke: var(--stroke-s) rgba(32, 38, 60, 0.6);
  paint-order: stroke fill;
}

.up-ad-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nothing to offer - the tier is affordable, or there are no tiers left. It
   keeps its space so the three cards stay level with one another whatever the
   player happens to be able to pay for. */
.up-ad:disabled { visibility: hidden; }

.up-ad:not(:disabled):active {
  transform: translateY(0.24rem);
  box-shadow: 0 0.04rem 0 rgba(0, 0, 0, 0.3);
}

/* ---------- The card ---------- */

.up-main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--card);
  border: var(--stroke-m) solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 0.4rem 0 rgba(0, 0, 0, 0.34);
  cursor: pointer;
  transition: transform 0.09s ease, box-shadow 0.09s ease;
  font-family: var(--font);
  text-align: center;
}

.up-main:not(:disabled):active {
  transform: translateY(0.34rem);
  box-shadow: 0 0.06rem 0 rgba(0, 0, 0, 0.34);
}

/* Out of reach, or nothing left to buy. Switched off rather than repurposed:
   a button that quietly becomes a different button is how an accidental
   advert happens. */
.up-main:disabled { cursor: default; }

.up-head {
  display: block;
  position: relative;
  padding: 0.2rem 0.3rem 0.22rem;
  text-align: center;
  border-bottom: var(--stroke-s) solid var(--line);
}

.up-name {
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05rem;
  color: #ffffff;
  -webkit-text-stroke: var(--stroke-s) var(--line);
  paint-order: stroke fill;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* What the upgrade actually does, in two words. The card had the name of the
   thing and its price and nothing at all about what buying it changes - which
   left the whole workshop to be worked out by buying things and watching. The
   long version is in the guide; this is the headline.
   Dark on the light half of the header gradient, so it reads without the heavy
   outline the name needs. */
.up-sub {
  display: block;
  margin-top: -0.02rem;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.035rem;
  color: rgba(20, 24, 40, 0.72);
  -webkit-text-stroke: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.up-art {
  position: relative;
  width: 100%;
  /* Flatter than square - the models are elongated, and every bit of height
     the cards give up is height the rocket above them gets. */
  aspect-ratio: 1 / 0.58;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.up-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  filter: drop-shadow(0 0.2rem 0.3rem rgba(0, 0, 0, 0.4));
}

.up-art.has-art img { display: block; }
.up-art.has-art .up-fallback { display: none; }
.up-fallback { font-size: 2.4rem; }

/* The level badge sits on the picture rather than in the header - that is
   where the eye already is. */
.up-lv {
  position: absolute;
  left: 0.25rem;
  top: 0.25rem;
  min-width: 1.7rem;
  padding: 0.02rem 0.3rem 0.06rem;
  background: var(--line);
  border-radius: 0.45rem;
  font-size: 0.64rem;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Progress towards the next model, counted in stars. Kids read a row of stars
   filling up without being told what it means; a grey bar segment is an
   interface element. */
.up-stars {
  display: flex;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.16rem 0 0.06rem;
  background: #eef2fa;
  border-top: var(--stroke-s) solid rgba(32, 38, 60, 0.25);
}

.up-stars .art { font-size: 0.85rem; }
.up-stars .art.on { animation: starPop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }

@keyframes starPop {
  0% { transform: scale(0.2) rotate(-40deg); }
  60% { transform: scale(1.35) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

.up-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 0.24rem;
  padding: 0.22rem 0.2rem 0.3rem;
  border: var(--stroke-s) solid var(--line);
  border-radius: 0.7rem;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.03rem;
  color: #fff;
  -webkit-text-stroke: var(--stroke-s) rgba(32, 38, 60, 0.6);
  paint-order: stroke fill;
}

.up-buy .coin-art { font-size: 1.15rem; }
.up-price { font-variant-numeric: tabular-nums; }

/* One colour per card - the ad button above it takes the same colour, so the
   two read as one upgrade and not as two unrelated offers. */
.up-card.c-green .up-head { background: linear-gradient(180deg, #5ce88c 0%, var(--green) 100%); }
.up-card.c-green .up-art { background: linear-gradient(180deg, #b7f5cd 0%, #79e5a4 100%); }
.up-card.c-green .up-buy { background: var(--green); box-shadow: inset 0 -0.26rem 0 var(--green-dk); }
.up-card.c-green .up-ad {
  background: linear-gradient(180deg, #5ce88c 0%, var(--green) 100%);
  box-shadow: inset 0 -0.24rem 0 var(--green-dk), 0 0.26rem 0 rgba(0, 0, 0, 0.3);
}

.up-card.c-purple .up-head { background: linear-gradient(180deg, #bd86ff 0%, var(--purple) 100%); }
.up-card.c-purple .up-art { background: linear-gradient(180deg, #e2ccff 0%, #c19bff 100%); }
.up-card.c-purple .up-buy { background: var(--purple); box-shadow: inset 0 -0.26rem 0 var(--purple-dk); }
.up-card.c-purple .up-ad {
  background: linear-gradient(180deg, #bd86ff 0%, var(--purple) 100%);
  box-shadow: inset 0 -0.24rem 0 var(--purple-dk), 0 0.26rem 0 rgba(0, 0, 0, 0.3);
}

.up-card.c-pink .up-head { background: linear-gradient(180deg, #ff7fae 0%, var(--pink) 100%); }
.up-card.c-pink .up-art { background: linear-gradient(180deg, #ffd2e2 0%, #ff9dc0 100%); }
.up-card.c-pink .up-buy { background: var(--pink); box-shadow: inset 0 -0.26rem 0 var(--pink-dk); }
.up-card.c-pink .up-ad {
  background: linear-gradient(180deg, #ff7fae 0%, var(--pink) 100%);
  box-shadow: inset 0 -0.24rem 0 var(--pink-dk), 0 0.26rem 0 rgba(0, 0, 0, 0.3);
}

/* Too expensive: the price button greys out and stops responding, while the
   card around it stays perfectly readable - the price is the thing you came to
   look at while you are saving up. */
.up-card:not(.afford):not(.maxed) .up-buy {
  background: #93a0c4;
  box-shadow: inset 0 -0.26rem 0 #6a7699;
}

/* The shine that sweeps across a card you have just bought */
.up-main::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 30%, rgba(255, 255, 255, 0.85) 48%, transparent 66%);
  transform: translateX(-120%);
  pointer-events: none;
  opacity: 0;
}

.up-card.bought .up-main::after { animation: sweep 0.6s ease-out; }
@keyframes sweep {
  0% { opacity: 1; transform: translateX(-120%); }
  100% { opacity: 0; transform: translateX(120%); }
}

.up-card.bought { animation: boughtJump 0.42s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes boughtJump {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-0.5rem) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}

/* Multiplier on the income card */
.up-mult {
  position: absolute;
  right: 0.25rem;
  top: 0.25rem;
  padding: 0.02rem 0.35rem 0.08rem;
  border-radius: 0.45rem;
  background: var(--gold);
  border: var(--stroke-s) solid var(--line);
  font-size: 0.8rem;
  font-weight: 900;
  color: #6b3d00;
}

/* Maxed out: gold, and no coin - there is nothing left to pay. */
.up-card.maxed .up-buy .coin-art { display: none; }
.up-card.maxed .up-buy {
  background: linear-gradient(180deg, #ffdb6b 0%, var(--gold) 100%);
  box-shadow: inset 0 -0.26rem 0 var(--gold-dk);
  color: #6b3d00;
  -webkit-text-stroke: 0;
}

/* ---------- Upgrade through an ad ---------- */

/* The camera stands on the button itself rather than inside a white badge.
   The badge was the whole of what looked broken: a wide glyph keeps its aspect
   ratio inside its box, so in a badge barely taller than the text it came out
   a third the height of the word beside it, its lens clipped by the rounded
   corner - a dark smudge with a speck next to it. On the button's own colour
   the camera can simply be as big as the lettering, and the play triangle
   punched out of it shows that colour through. */
.play-icon {
  display: none;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  color: #fff;
  flex: none;
  -webkit-text-stroke: 0;
  filter: drop-shadow(0 0.1rem 0 rgba(32, 38, 60, 0.45));
}

.up-ad .play-icon { display: grid; }

/* Says in a word what the camera says in a picture, and says it on the button
   that plays the ad. */
.up-ad-tag {
  flex: none;
  padding: 0.04rem 0.3rem 0.09rem;
  border-radius: 0.38rem;
  background: rgba(20, 24, 40, 0.42);
  color: #fff;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.08rem;
  -webkit-text-stroke: 0;
}

/* ---------- Waiting between two opt-in ads ---------- */

/* After a reward has been claimed every rewarded button rests for a few
   seconds. It counts down rather than going dead: a button that simply stops
   responding is indistinguishable from a broken one, and that is the single
   most common thing players report about ad buttons. */
.up-card.ad-wait .up-ad {
  pointer-events: none;
  background: linear-gradient(180deg, #a6b1cd 0%, #93a0c4 100%);
  box-shadow: inset 0 -0.24rem 0 #6a7699, 0 0.26rem 0 rgba(0, 0, 0, 0.3);
}

.up-card.ad-wait .play-icon { color: #e3e8f4; }
/* The countdown already says what it is waiting for */
.up-card.ad-wait .up-ad-tag { display: none; }
.up-card.ad-wait .up-ad-text { font-size: 0.66rem; letter-spacing: 0.04rem; }

/* While the ad is loading */
.up-card.ad-loading .up-ad,
.up-card.ad-loading .up-main { pointer-events: none; }
.up-card.ad-loading .up-ad { filter: grayscale(0.5) brightness(0.85); }
.up-card.ad-loading .up-ad-text { font-size: 0; }
.up-card.ad-loading .up-ad-text::after { content: "…"; font-size: 0.8rem; }

/* ---------- Booster: ads only ---------- */

#boostSlot {
  position: absolute;
  left: max(0.6rem, env(safe-area-inset-left));
  bottom: max(6rem, calc(env(safe-area-inset-bottom) + 5.4rem));
  z-index: 31;
  pointer-events: auto;
}

.boost-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06rem;
  /* Wider than it was: it now carries its own name, what it upgrades and a
     button that says an ad is what plays. */
  width: 6.6rem;
  padding: 0.26rem 0.26rem 0.32rem;
  background: linear-gradient(180deg, #ff9f3d 0%, #ff5f2e 100%);
  border: var(--stroke-m) solid var(--line);
  border-radius: 0.9rem;
  box-shadow: 0 0.4rem 0 rgba(0, 0, 0, 0.34);
  cursor: pointer;
  font-family: var(--font);
  color: #fff;
  transition: transform 0.09s ease, box-shadow 0.09s ease;
  /* slightly tilted, so it reads as an extra and not as a fourth upgrade */
  rotate: -5deg;
}

.boost-card:active { transform: translateY(0.34rem); box-shadow: 0 0.06rem 0 rgba(0, 0, 0, 0.34); }

/* The card said "LVL 2" and nothing else, beside three other cards that each
   carry a level of their own - so the number belonged to nothing in
   particular. It now says which ladder it is counting, and out of how many. */
.boost-name {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05rem;
  -webkit-text-stroke: var(--stroke-s) var(--line);
  paint-order: stroke fill;
}

/* Two short lines under the flame. They need their own line height: left to
   the default, at this size the heavy text stroke on the level made the two
   run into each other on a phone. */
.boost-sub {
  font-size: 0.5rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0.04rem;
  color: rgba(255, 255, 255, 0.95);
}

.boost-lv {
  font-size: 0.62rem;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: 0.04rem;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: var(--stroke-s) var(--line);
  paint-order: stroke fill;
}

.boost-art-big { font-size: 1.9rem; filter: drop-shadow(0 0.12rem 0 rgba(0, 0, 0, 0.3)); }

.boost-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  width: 100%;
  margin-top: 0.12rem;
  padding: 0.16rem 0.1rem 0.22rem;
  background: #fff;
  border: var(--stroke-s) solid var(--line);
  border-radius: 0.5rem;
  color: #b83c00;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.03rem;
  white-space: nowrap;
}

/* The button here is white, so the camera takes the card's orange rather than
   the white it wears on the coloured upgrade buttons. */
.boost-buy .play-icon {
  display: grid;
  width: 1.15rem;
  height: 1.15rem;
  color: #f0620c;
  filter: none;
}

/* Counting down to the next offer */
.boost-card.ad-wait { pointer-events: none; }
.boost-card.ad-wait .boost-buy { background: #dbe1ee; color: #5c6789; }
.boost-card.ad-wait .boost-buy .play-icon { color: #7c88a8; }
.boost-card.maxed .boost-buy .play-icon { display: none; }

.boost-card.maxed { filter: saturate(0.45); cursor: default; }
.boost-card.maxed:active { transform: none; box-shadow: 0 0.4rem 0 rgba(0, 0, 0, 0.34); }
.boost-card.ad-loading { pointer-events: none; filter: brightness(0.85); }

/* ---------- The upgrade guide ---------- */

/* Four blocks, one per upgrade, plus the ads. It is the only place in the game
   with room for a sentence, so it is where everything the cards cannot say
   goes: what each upgrade changes about the flight, which numbers it moves,
   which level ladder the booster is counting, and what the camera buttons
   actually do. */
#infoPanel {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  background: rgba(8, 12, 22, 0.72);
  pointer-events: auto;
}

.info-card {
  display: flex;
  flex-direction: column;
  width: 30rem;
  max-width: 100%;
  max-height: 100%;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: var(--stroke-m) solid var(--line);
  border-radius: 1.1rem;
  box-shadow: 0 0.45rem 0 rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex: none;
  padding: 0.5rem 0.55rem 0.5rem 0.9rem;
  border-bottom: var(--stroke-s) solid rgba(0, 0, 0, 0.35);
}

.info-title {
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.06rem;
  color: #fff;
  -webkit-text-stroke: var(--stroke-s) var(--line);
  paint-order: stroke fill;
}

.info-close {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.12);
  border: var(--stroke-s) solid var(--line);
  border-radius: 0.55rem;
  color: #fff;
  cursor: pointer;
}

.info-close .icon { font-size: 1.1rem; }
.info-close:active { transform: translateY(0.14rem); }

.info-body {
  /* The one scrolling surface in the game. On a short frame the four blocks do
     not fit, and cutting them off would defeat the point of the panel. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.2rem 0.9rem 0.7rem;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: var(--stroke-s) solid rgba(255, 255, 255, 0.12);
}

.info-item:last-child { border-bottom: 0; }

.info-art {
  font-size: 2rem;
  flex: none;
  margin-top: 0.1rem;
}

.info-ads .info-art {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 1.65rem;
  padding: 0.16rem;
  font-size: 0;
  background: #fff;
  border: var(--stroke-s) solid var(--line);
  border-radius: 0.45rem;
  color: var(--gold-dk);
}

.info-ads .info-art > svg { width: 100%; height: 100%; }

.info-text { min-width: 0; }

.info-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.05rem;
  color: #fff;
}

.info-lv {
  padding: 0.02rem 0.34rem 0.06rem;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.58rem;
  letter-spacing: 0.06rem;
  color: var(--gold);
}

.info-what {
  margin: 0.16rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.38;
  color: #d3dcf2;
}

.info-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin-top: 0.3rem;
}

/* Now beside next, because "what does one more level buy" is the actual
   question a workshop asks. */
.info-row {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  font-size: 0.66rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #9fadd0;
}

.info-row-now { color: #eaf0ff; }
.info-row-arrow { color: #7d8ab0; }
.info-row-next { color: var(--green); }

/* ---------- Attention wiggle ---------- */

/* Only cards you can actually pay for speak up. The rule used to fire on
   .afford OR .by-ad, and since every non-maxed card is always one of the two,
   all three wiggled non-stop - motion that signals nothing. */
@keyframes nudge {
  0%, 80%, 100% { transform: none; }
  83% { transform: rotate(-2.5deg) scale(1.05); }
  87% { transform: rotate(2.5deg) scale(1.05); }
  91% { transform: rotate(-1.5deg) scale(1.02); }
  95% { transform: rotate(1deg) scale(1.01); }
}

.up-card.afford:not(.ad-loading) { animation: nudge 3.2s ease-in-out infinite; }

/* The three cards are offset, so they do not twitch in lockstep */
.up-card:nth-child(2) { animation-delay: 0.5s; }
.up-card:nth-child(3) { animation-delay: 1s; }

/* While pressing, the feedback wins */
.up-card:active { animation: none; }

@keyframes nudgeTilt {
  0%, 78%, 100% { rotate: -5deg; }
  82% { rotate: -12deg; }
  86% { rotate: 1deg; }
  90% { rotate: -7deg; }
  95% { rotate: -4deg; }
}

/* Three nudges per visit to the workshop, not for ever. It is the one card
   that is nothing but an ad offer, and a permanent wiggle from it reads as
   nagging. Re-showing the workshop restarts the animation, so it still
   announces itself every time you come back. */
.boost-card:not(.maxed):not(.ad-loading) { animation: nudgeTilt 3.7s ease-in-out 3; }
.boost-card:active { animation: none; }

/* A wiggle is an invitation, and there is nothing to accept while the button
   is counting down. Deliberately after the two rules above: it has to beat
   them, and on equal specificity the later rule is the one that does. */
.up-card.by-ad.ad-wait:not(.maxed) { animation: none; }
.boost-card.ad-wait:not(.maxed) { animation: none; rotate: -5deg; }

/* ---------- Result ---------- */

#result {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  pointer-events: auto;
  background: radial-gradient(circle at 50% 45%,
    rgba(20, 32, 60, 0.35) 0%, rgba(6, 12, 22, 0.72) 70%);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Slow rays turning behind the card. It is what tells the eye that something
   good happened before a single number has been read. */
.result-rays {
  position: absolute;
  width: 46rem;
  height: 46rem;
  background: conic-gradient(from 0deg,
    rgba(255, 236, 160, 0.10) 0 3deg, transparent 3deg 15deg);
  border-radius: 50%;
  animation: spin 24s linear infinite;
  pointer-events: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.result-card {
  position: relative;
  width: 21rem;
  max-width: 100%;
  padding: 1rem 1.1rem 0.9rem;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: var(--stroke-l) solid var(--line);
  border-radius: 1.4rem;
  box-shadow: 0 0.6rem 0 rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: rise 0.36s cubic-bezier(0.2, 1.35, 0.35, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1.6rem) scale(0.9); }
  to { opacity: 1; transform: none; }
}

.result-badge {
  display: inline-block;
  padding: 0.22rem 1rem 0.28rem;
  border-radius: 99rem;
  background: var(--cyan);
  color: #06364f;
  border: var(--stroke-m) solid var(--line);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14rem;
}

.result-badge.crash { background: var(--red); color: #4a0c05; }
.result-badge.splash { background: #4fb8e8; color: #04283d; }

.result-dist {
  margin: 0.5rem 0 0.1rem;
  font-size: 2.9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: var(--stroke-l) var(--line);
  paint-order: stroke fill;
}

.result-record {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.12rem;
  color: var(--gold);
  -webkit-text-stroke: var(--stroke-m) var(--line);
  paint-order: stroke fill;
  /* pulse rather than breathe: breathe carries a translateX(-50%) meant for
     #prompt, which shoved this line half its own width out of the card. */
  animation: pulse 0.85s ease-in-out infinite;
}

.result-record .art {
  font-size: 0.9rem;
  color: var(--gold);
  -webkit-text-stroke: 0;
  animation: spin 3.5s linear infinite;
}

.result-best {
  margin-top: 0.1rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06rem;
  color: var(--violet);
}

.result-best.short { color: var(--mute); }

.result-rows {
  margin: 0.7rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.6rem 0.34rem;
  background: rgba(255, 255, 255, 0.1);
  border: var(--stroke-s) solid rgba(32, 38, 60, 0.55);
  border-radius: 0.55rem;
  font-size: 0.8rem;
}

/* Without the perfect-launch line there is no row at all, and the coins
   would sit right up against the comparison with the best. */
.result-rows.hidden + .result-earn { margin-top: 0.8rem; }

.result-row span:first-child { color: #c3cee0; font-weight: 700; }
.result-row span:last-child { font-weight: 900; font-variant-numeric: tabular-nums; }
.result-row.good span:last-child { color: #7dffa8; }

.result-earn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: var(--stroke-m) var(--line);
  paint-order: stroke fill;
}

.result-earn .coin-art { font-size: 2rem; -webkit-text-stroke: 0; }

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.primary-btn {
  width: 100%;
  padding: 0.6rem 1rem 0.7rem;
  border: var(--stroke-m) solid var(--line);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #5ce88c 0%, var(--green) 100%);
  box-shadow: inset 0 -0.3rem 0 var(--green-dk), 0 0.4rem 0 rgba(0, 0, 0, 0.32);
  color: #fff;
  font-family: var(--font);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.09s ease, box-shadow 0.09s ease;
}

.primary-btn:active {
  transform: translateY(0.34rem);
  box-shadow: inset 0 -0.3rem 0 var(--green-dk), 0 0.06rem 0 rgba(0, 0, 0, 0.32);
}

.btn-main {
  font-size: 1.2rem;
  letter-spacing: 0.16rem;
  -webkit-text-stroke: var(--stroke-m) rgba(32, 38, 60, 0.7);
  paint-order: stroke fill;
}

.reward-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem 0.55rem;
  border: var(--stroke-m) solid var(--line);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #ffdb6b 0%, var(--gold) 100%);
  box-shadow: inset 0 -0.3rem 0 var(--gold-dk), 0 0.35rem 0 rgba(0, 0, 0, 0.32);
  color: #fff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.05rem;
  cursor: pointer;
  transition: transform 0.09s ease, box-shadow 0.09s ease;
  -webkit-text-stroke: var(--stroke-s) rgba(32, 38, 60, 0.7);
  paint-order: stroke fill;
}

.reward-btn:active {
  transform: translateY(0.3rem);
  box-shadow: inset 0 -0.3rem 0 var(--gold-dk), 0 0.06rem 0 rgba(0, 0, 0, 0.32);
}
.reward-btn:disabled { filter: grayscale(0.6) brightness(0.85); cursor: default; }

.reward-icon {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  color: #fff;
  flex: none;
  -webkit-text-stroke: 0;
  filter: drop-shadow(0 0.1rem 0 rgba(32, 38, 60, 0.45));
}

/* Says in a word what the camera already says in a picture. Doubling the coins
   costs an ad, and the button has to admit that before it is pressed. */
.reward-tag {
  padding: 0.04rem 0.34rem 0.1rem;
  border-radius: 0.4rem;
  background: rgba(20, 24, 40, 0.42);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.09rem;
  -webkit-text-stroke: 0;
}

.reward-btn.ad-wait { filter: grayscale(0.55) brightness(0.92); }

/* ---------- Steering stick (touch) ---------- */

/* A floating stick, not a fixed one: it appears under the finger wherever it
   lands and fades out when it lifts. On a small screen a stick nailed to one
   corner either sits where the thumb is not, or covers the landscape all game.
   This one is only ever there while a finger is.
   Deliberately see-through - it sits on top of the flight, and the flight is
   what the player needs to watch.
   The steering itself is unchanged; this only shows what was already there. */
#stick {
  position: absolute;
  left: 0;
  top: 0;
  width: 9rem;
  height: 9rem;
  margin: -4.5rem 0 0 -4.5rem;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.16s ease;
  z-index: 17;
}

#stick.on { opacity: 1; }

.stick-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(210, 228, 255, 0.12);
  border: 0.2rem solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 0 1.2rem rgba(255, 255, 255, 0.14);
}

/* Two faint chevrons, up and down. The stick is round because that is what
   reads as a stick, but the rocket only steers on one axis - so the ring says
   which way it actually goes. */
.stick-ring::before,
.stick-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: -0.55rem;
  border-top: 0.2rem solid rgba(255, 255, 255, 0.5);
  border-right: 0.2rem solid rgba(255, 255, 255, 0.5);
}

.stick-ring::before { top: 0.7rem; transform: rotate(-45deg); }
.stick-ring::after { bottom: 0.7rem; transform: rotate(135deg); }

.stick-knob {
  position: absolute;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%,
    rgba(255, 255, 255, 0.85) 0%, rgba(206, 226, 255, 0.6) 70%, rgba(160, 190, 240, 0.5) 100%);
  border: 0.22rem solid rgba(32, 38, 60, 0.45);
  box-shadow: 0 0.15rem 0.4rem rgba(8, 13, 28, 0.3);
  will-change: transform;
}

/* ---------- Tutorial arrow ---------- */

/* Points at the boost gauge while the first-run hint is up. A line of text on
   its own does not tell a new player which thing on screen it means. */
#boostArrow {
  position: absolute;
  right: calc(max(0.8rem, env(safe-area-inset-right)) + var(--boost-size) + 0.25rem);
  bottom: calc(max(0.8rem, env(safe-area-inset-bottom))
          + var(--boost-size) * 0.5 - 0.5 * var(--arrow-size));
  width: var(--arrow-size);
  height: var(--arrow-size);
  color: var(--gold);
  filter: drop-shadow(0 0.12rem 0 var(--line)) drop-shadow(0 0 0.4rem rgba(0, 0, 0, 0.5));
  animation: pointAt 0.85s ease-in-out infinite;
  z-index: 16;
}

#boostArrow .icon { width: 100%; height: 100%; font-size: var(--arrow-size); }

@keyframes pointAt {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(35%); }
}

/* ---------- Portrait ---------- */

/* In portrait the picture is narrow and tall. The scale factor already keeps
   everything in proportion; what changes here is only what has to move out of
   another element's way. */
@media (orientation: portrait) {
  /* The booster card would sit on top of the upgrade row, so it moves up to
     the top edge instead of beside them. */
  #boostSlot {
    bottom: auto;
    top: max(4.6rem, calc(env(safe-area-inset-top) + 4rem));
  }
  /* The coin bar owns the top right corner, and centred under it the best bar
     ran into it on a narrow screen. It stacks below instead. */
  #bestBar {
    left: auto;
    right: max(0.7rem, env(safe-area-inset-right));
    transform: none;
    top: calc(max(0.7rem, env(safe-area-inset-top)) + 3.4rem);
  }
  /* Which is the slot the guide button uses in landscape, so here it drops one
     further down the same column. */
  #infoBtn { top: calc(max(0.7rem, env(safe-area-inset-top)) + 6.9rem); }
  /* The route bar is centred, and the coin bar and the sound button own the
     top corners. On a narrow screen a full-width bar ran underneath both, so
     here it drops below them and the distance follows it down. */
  .route {
    top: calc(max(0.7rem, env(safe-area-inset-top)) + 3.5rem);
    max-width: 92%;
  }
  #distVal { top: calc(max(0.7rem, env(safe-area-inset-top)) + 7.6rem); }
  .upgrades { max-width: 98%; }
  .up-name { font-size: 0.7rem; }
  /* Speedometer and thrust gauge would meet in the middle on a narrow screen */
  .speedo { width: 8rem; height: 8rem; }
  :root { --boost-size: 5.6rem; }
}

/* The tutorial arrow would run off a narrow screen, so it moves above the
   gauge and points down instead. */
@media (max-aspect-ratio: 1/1) {
  #boostArrow {
    right: calc(max(0.8rem, env(safe-area-inset-right))
            + var(--boost-size) * 0.5 - 0.5 * var(--arrow-size));
    bottom: calc(max(0.8rem, env(safe-area-inset-bottom)) + var(--boost-size) + 0.25rem);
    transform: rotate(90deg);
    animation: pointDown 0.85s ease-in-out infinite;
  }
  @keyframes pointDown {
    0%, 100% { transform: rotate(90deg) translateX(0); }
    50% { transform: rotate(90deg) translateX(35%); }
  }
}

/* Anyone who has asked their system not to animate things gets an interface
   that holds still. The information is in the colours and the numbers; the
   motion is decoration on top of it. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

/* ---------- Finish ---------- */

/* One more pass over every raised surface in the interface. The pieces above
   were each drawn flat: one fill, one outline, one hard shadow. That reads as
   a sticker, which is the idea, but a sticker printed without a highlight.
   Everything here adds the same three things to all of them - a line of light
   along the top edge, a darker lip along the bottom, and a soft shadow under
   the hard one - so the bars, cards and buttons look moulded rather than cut
   out, and all in the same way.

   Kept in one block at the end on purpose: it only ever adds to box-shadow,
   background and border-radius, and never touches a size or a position, so
   the layout rules above stay the single place where layout is decided. */

:root {
  --gloss: inset 0 0.16rem 0 rgba(255, 255, 255, 0.26);
  --lip: inset 0 -0.2rem 0 rgba(8, 14, 36, 0.2);
  --soft: 0 0.55rem 1.1rem rgba(8, 14, 36, 0.26);
}

/* The bars along the top edge */
#coinBar,
#bestBar,
#userChip,
.round-btn {
  background: linear-gradient(180deg, #4c5b8e 0%, #37436c 52%, #2b3558 100%);
  box-shadow: var(--gloss), var(--lip), 0 0.28rem 0 rgba(0, 0, 0, 0.34), var(--soft);
}
.round-btn { border-radius: 1.05rem; }
.round-btn:active { box-shadow: var(--gloss), var(--lip); }

#coinBar { color: #fff3c4; }
#bestVal { color: #fff; }

/* The upgrade cards */
.up-main {
  border-radius: 1.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #eef2fb 100%);
  box-shadow: 0 0.4rem 0 rgba(0, 0, 0, 0.34), var(--soft);
}
.up-head {
  box-shadow: var(--gloss);
}
.up-art::after {
  /* A soft pool of light behind the model, so it stands on something */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 38%, rgba(255, 255, 255, 0.55) 0, rgba(255, 255, 255, 0) 62%);
  pointer-events: none;
}
.up-art img { position: relative; z-index: 1; }
.up-buy {
  border-radius: 0.8rem;
  box-shadow: var(--gloss), var(--lip);
}
.up-ad {
  box-shadow: var(--gloss), var(--lip), 0 0.24rem 0 rgba(0, 0, 0, 0.3);
}
.up-lv {
  box-shadow: 0 0.12rem 0 rgba(0, 0, 0, 0.25);
}

/* The booster card */
.boost-card {
  border-radius: 1.05rem;
  background: linear-gradient(180deg, #ffb24d 0%, #ff7a2e 55%, #f4521f 100%);
  box-shadow: var(--gloss), var(--lip), 0 0.4rem 0 rgba(0, 0, 0, 0.34), var(--soft);
}
.boost-buy { box-shadow: var(--lip), 0 0.14rem 0 rgba(0, 0, 0, 0.22); }

/* The prompt: the one thing on screen that says what to do next, so it is
   solid rather than see-through and carries the brightest edge of them all */
#prompt {
  background: linear-gradient(180deg, #55659c 0%, #38446f 100%);
  border-color: var(--line);
  box-shadow: var(--gloss), var(--lip), 0 0.24rem 0 rgba(0, 0, 0, 0.3), var(--soft);
}

/* Launch power */
.power-track {
  box-shadow: inset 0 0.18rem 0 rgba(0, 0, 0, 0.22), 0 0.28rem 0 rgba(0, 0, 0, 0.34), var(--soft);
}

/* Result and guide */
.result-card,
.info-card {
  background: linear-gradient(180deg, #4a598d 0%, #36426b 46%, #2a3457 100%);
  box-shadow: inset 0 0.2rem 0 rgba(255, 255, 255, 0.22), var(--lip),
    0 0.6rem 0 rgba(0, 0, 0, 0.35), 0 1.2rem 2.4rem rgba(6, 10, 30, 0.45);
}
.result-row {
  box-shadow: inset 0 0.1rem 0 rgba(255, 255, 255, 0.07);
}
.primary-btn {
  border-radius: 1rem;
  box-shadow: var(--gloss), inset 0 -0.3rem 0 var(--green-dk), 0 0.4rem 0 rgba(0, 0, 0, 0.32), var(--soft);
}
.primary-btn:active {
  box-shadow: var(--gloss), inset 0 -0.3rem 0 var(--green-dk), 0 0.06rem 0 rgba(0, 0, 0, 0.32);
}
.reward-btn {
  border-radius: 1rem;
  box-shadow: var(--gloss), var(--lip), 0 0.4rem 0 rgba(0, 0, 0, 0.32), var(--soft);
}
.reward-btn:active { box-shadow: var(--gloss), var(--lip), 0 0.06rem 0 rgba(0, 0, 0, 0.32); }

/* Flight gauges */
.route-track {
  box-shadow: inset 0 0.22rem 0 rgba(0, 0, 0, 0.4), inset 0 -0.1rem 0 rgba(255, 255, 255, 0.08),
    0 0.26rem 0 rgba(0, 0, 0, 0.3), var(--soft);
}
.speedo,
.boost {
  filter: drop-shadow(0 0.3rem 0 rgba(0, 0, 0, 0.3)) drop-shadow(0 0.5rem 0.7rem rgba(8, 14, 36, 0.24));
}

/* Buttons answer the pointer before they are pressed - on a desktop that is
   the only sign that a thing can be clicked at all */
@media (hover: hover) {
  .up-main:not(:disabled):hover,
  .primary-btn:hover,
  .reward-btn:not(:disabled):hover,
  .round-btn:hover,
  .boost-card:not(.maxed):hover { filter: brightness(1.06); }
  .up-ad:not(:disabled):hover { filter: brightness(1.08); }
}

/* ---------- Finish, second pass ---------- */

/* The first pass gave every surface the same light. This one gives the pieces
   that matter most a character of their own: the cards get a burst of rays
   behind the model and a button worth pressing, the prompt turns into the one
   gold thing on screen, and the result is laid out as a prize rather than as
   a table. */

/* --- Upgrade cards --- */

.up-main { border-radius: 1.3rem; }

.up-head { padding: 0.26rem 0.3rem 0.26rem; }
.up-name { font-size: 0.86rem; letter-spacing: 0.06rem; }
.up-sub { font-size: 0.54rem; letter-spacing: 0.05rem; color: rgba(16, 22, 44, 0.78); }

/* Rays behind the model, turning slowly. Drawn under the pool of light from
   the first pass, so the model stands in a spotlight on a sunburst. */
.up-art::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.34) 0 10deg, rgba(255, 255, 255, 0) 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 68%);
  mask: radial-gradient(circle, #000 0, transparent 68%);
  animation: spin 36s linear infinite;
  pointer-events: none;
}

.up-card.c-green .up-art { background: linear-gradient(180deg, #c9fbd9 0%, #5fdf93 100%); }
.up-card.c-purple .up-art { background: linear-gradient(180deg, #ecdcff 0%, #b384ff 100%); }
.up-card.c-pink .up-art { background: linear-gradient(180deg, #ffe0ec 0%, #ff86b3 100%); }

.up-lv {
  padding: 0.04rem 0.42rem 0.08rem;
  border-radius: 99rem;
  background: linear-gradient(180deg, #343c62 0%, #20263c 100%);
  border: 0.08rem solid rgba(255, 255, 255, 0.28);
  letter-spacing: 0.03rem;
  z-index: 2;
}
.up-mult { border-radius: 99rem; z-index: 2; box-shadow: var(--gloss), 0 0.12rem 0 rgba(0, 0, 0, 0.25); }

.up-stars { background: linear-gradient(180deg, #f7f9ff 0%, #e9eefa 100%); padding: 0.2rem 0 0.1rem; }
.up-stars .art { font-size: 0.92rem; filter: drop-shadow(0 0.06rem 0 rgba(0, 0, 0, 0.18)); }

.up-buy {
  margin: 0.26rem 0.3rem 0.32rem;
  padding: 0.26rem 0.2rem 0.36rem;
  border-radius: 0.85rem;
  font-size: 0.94rem;
}
.up-card.c-green .up-buy {
  background: linear-gradient(180deg, #6df3a0 0%, var(--green) 60%);
  box-shadow: var(--gloss), inset 0 -0.26rem 0 var(--green-dk);
}
.up-card.c-purple .up-buy {
  background: linear-gradient(180deg, #c99aff 0%, var(--purple) 60%);
  box-shadow: var(--gloss), inset 0 -0.26rem 0 var(--purple-dk);
}
.up-card.c-pink .up-buy {
  background: linear-gradient(180deg, #ff8fb8 0%, var(--pink) 60%);
  box-shadow: var(--gloss), inset 0 -0.26rem 0 var(--pink-dk);
}
.up-card:not(.afford):not(.maxed) .up-buy {
  background: linear-gradient(180deg, #a9b4d4 0%, #8b98bd 60%);
  box-shadow: var(--gloss), inset 0 -0.26rem 0 #6a7699;
}
.up-card.maxed .up-buy {
  background: linear-gradient(180deg, #ffe88a 0%, var(--gold) 60%);
  box-shadow: var(--gloss), inset 0 -0.26rem 0 var(--gold-dk);
}

/* A card you can pay for is lit from behind in its own colour - the row says
   at a glance which of the three is worth a look */
.up-card.c-green.afford .up-main {
  box-shadow: 0 0.4rem 0 rgba(0, 0, 0, 0.34), 0 0 1.3rem rgba(80, 240, 140, 0.75), var(--soft);
}
.up-card.c-purple.afford .up-main {
  box-shadow: 0 0.4rem 0 rgba(0, 0, 0, 0.34), 0 0 1.3rem rgba(190, 130, 255, 0.8), var(--soft);
}
.up-card.c-pink.afford .up-main {
  box-shadow: 0 0.4rem 0 rgba(0, 0, 0, 0.34), 0 0 1.3rem rgba(255, 120, 170, 0.8), var(--soft);
}

/* --- The prompt --- */

/* Gold, and the only gold bar on the screen. It was the same slate blue as
   every other bar, so the one line that tells the player what to do next
   looked like one more readout. */
#prompt {
  padding: 0.26rem 1.2rem 0.32rem 0.9rem;
  background: linear-gradient(180deg, #fff09a 0%, #ffd23a 48%, #ffb21f 100%);
  border: var(--stroke-m) solid var(--line);
  color: #4a2a00;
  box-shadow: inset 0 0.18rem 0 rgba(255, 255, 255, 0.6), inset 0 -0.24rem 0 rgba(170, 96, 0, 0.42),
    0 0.3rem 0 rgba(0, 0, 0, 0.32), 0 0 1.6rem rgba(255, 205, 70, 0.55), var(--soft);
}
#promptText { text-shadow: 0 0.07rem 0 rgba(255, 255, 255, 0.55); }

/* --- The bars along the top --- */

#coinBar {
  padding-right: 1.15rem;
  color: #ffe27a;
  text-shadow: 0 0.1rem 0 rgba(0, 0, 0, 0.3);
}
.best-label { color: #ffd23a; letter-spacing: 0.12rem; }

/* --- Result --- */

.result-card { border-radius: 1.7rem; }

/* A band of light across the top of the card, behind the badge */
.result-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5.6rem;
  border-radius: 1.4rem 1.4rem 60% 60% / 1.4rem 1.4rem 2.2rem 2.2rem;
  background: linear-gradient(180deg, rgba(120, 170, 255, 0.4) 0%, rgba(120, 170, 255, 0) 100%);
  pointer-events: none;
}
.result-card > * { position: relative; }

.result-dist {
  color: #fff;
  text-shadow: 0 0.2rem 0 rgba(8, 14, 36, 0.35);
}

.result-row {
  border-radius: 0.7rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

/* The takings, set into the card like a coin tray */
.result-earn {
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding: 0.12rem 1.3rem 0.18rem 0.7rem;
  border-radius: 99rem;
  background: linear-gradient(180deg, #1c2440 0%, #262f52 100%);
  border: 0.14rem solid rgba(255, 210, 60, 0.75);
  box-shadow: inset 0 0.22rem 0 rgba(0, 0, 0, 0.3), 0 0 1.1rem rgba(255, 200, 60, 0.35);
}

.primary-btn { background: linear-gradient(180deg, #74f5a4 0%, var(--green) 62%); }

/* --- Guide --- */

.info-card { border-radius: 1.5rem; }
.info-item {
  border-radius: 0.9rem;
}

/* The typeface carries far more air above and below its letters than the
   system fallback the layout was measured with - left alone, every line of
   text stood a third taller and the result card no longer fitted the frame.
   One fixed line height for the whole overlay puts the boxes back to the
   size they were drawn at. */
#ui { line-height: 1.26; }
.load-title { line-height: 1; }

/* --- The guide's scrollbar --- */

/* The guide is the one surface in the game that scrolls, and it scrolled on
   the browser's own bar: a white strip with square arrows, set into a panel
   where everything else is round and dark blue. This draws it in the
   interface's own terms - a sunken track and a raised, rounded grip in the
   colour of the other gauges.

   Two sets of rules, because the browsers split here. Chrome, Edge and Safari
   take the ::-webkit-scrollbar parts, which allow a rounded grip with a rim.
   Firefox only knows the two standard properties - and those must not reach
   Chrome, where setting them switches the detailed parts off. */
.info-body {
  scrollbar-gutter: stable;
  padding-right: 0.5rem;
}

.info-body::-webkit-scrollbar { width: 0.95rem; }

.info-body::-webkit-scrollbar-track {
  margin: 0.5rem 0 0.7rem;
  border-radius: 99rem;
  background: rgba(14, 20, 44, 0.55);
  box-shadow: inset 0 0.12rem 0.2rem rgba(0, 0, 0, 0.45);
}

.info-body::-webkit-scrollbar-thumb {
  /* The transparent border with the clipped background is what leaves a gap
     between the grip and the edge of its track */
  border: 0.2rem solid transparent;
  border-radius: 99rem;
  background: linear-gradient(180deg, #9aeaff 0%, var(--cyan) 55%, var(--cyan-dk) 100%);
  background-clip: padding-box;
  min-height: 2.4rem;
}
.info-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c4f4ff 0%, #5fdcff 55%, var(--cyan) 100%);
  background-clip: padding-box;
}
.info-body::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #fff09a 0%, var(--gold) 60%, var(--gold-dk) 100%);
  background-clip: padding-box;
}

.info-body::-webkit-scrollbar-button,
.info-body::-webkit-scrollbar-corner { display: none; width: 0; height: 0; }

@supports not selector(::-webkit-scrollbar) {
  .info-body {
    scrollbar-width: thin;
    scrollbar-color: var(--cyan) rgba(14, 20, 44, 0.55);
  }
}

/* ---------- Booster card, third pass ----------
   It was an orange slab with a flame, two lines of text and a white button -
   next to the three upgrade cards it looked unfinished. Now it has their
   language: a dark title strip, the flame on a lit badge with rays turning
   behind it, and the level as a row of pips that fill up. */
.boost-card {
  position: relative;
  width: 7rem;
  gap: 0.1rem;
  padding: 0 0.3rem 0.34rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 236, 150, 0.55) 0, rgba(255, 236, 150, 0) 58%),
    linear-gradient(180deg, #ffb347 0%, #ff7a2a 52%, #e8461c 100%);
}

.boost-name {
  align-self: stretch;
  margin: 0 -0.3rem 0.08rem;
  padding: 0.16rem 0 0.2rem;
  background: linear-gradient(180deg, #c2391a 0%, #9c2a12 100%);
  border-bottom: var(--stroke-s) solid var(--line);
  box-shadow: inset 0 0.12rem 0 rgba(255, 255, 255, 0.22);
  font-size: 0.74rem;
  text-align: center;
}

.boost-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  margin: 0.06rem 0 0.02rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fff6c8 0%, #ffd25a 38%, #ff8a2a 72%, #d94a18 100%);
  border: var(--stroke-s) solid var(--line);
  box-shadow: inset 0 0.18rem 0 rgba(255, 255, 255, 0.5), inset 0 -0.22rem 0 rgba(120, 30, 0, 0.35),
    0 0.2rem 0 rgba(0, 0, 0, 0.25), 0 0 1.1rem rgba(255, 210, 90, 0.75);
}

.boost-rays {
  position: absolute;
  inset: -55%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.55) 0 8deg, rgba(255, 255, 255, 0) 8deg 22deg);
  -webkit-mask: radial-gradient(circle, transparent 0 28%, #000 30%, transparent 66%);
  mask: radial-gradient(circle, transparent 0 28%, #000 30%, transparent 66%);
  animation: spin 14s linear infinite;
  pointer-events: none;
  z-index: -1;
}

.boost-badge .boost-art-big {
  position: relative;
  font-size: 1.85rem;
  line-height: 1;
  filter: drop-shadow(0 0.1rem 0 rgba(120, 30, 0, 0.45));
  animation: flameFlicker 1.6s ease-in-out infinite;
  transform-origin: 50% 85%;
}

@keyframes flameFlicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  30% { transform: scale(1.06, 0.95) rotate(-3deg); }
  60% { transform: scale(0.96, 1.07) rotate(2deg); }
}

.boost-sub { font-size: 0.5rem; text-shadow: 0 0.06rem 0 rgba(120, 30, 0, 0.45); }

.boost-pips {
  display: flex;
  gap: 0.1rem;
  width: 100%;
  padding: 0.12rem 0.14rem;
  background: rgba(32, 38, 60, 0.55);
  border-radius: 99rem;
  box-shadow: inset 0 0.08rem 0 rgba(0, 0, 0, 0.3);
}
.boost-pips i {
  flex: 1;
  height: 0.32rem;
  border-radius: 99rem;
  background: rgba(255, 255, 255, 0.22);
}
.boost-pips i.on {
  background: linear-gradient(180deg, #fff7c2 0%, #ffd23a 100%);
  box-shadow: 0 0 0.3rem rgba(255, 220, 90, 0.9);
}

.boost-lv { font-size: 0.6rem; line-height: 1.2; }

.boost-buy {
  margin-top: 0.14rem;
  background: linear-gradient(180deg, #ffffff 0%, #ffe9d6 100%);
}

.boost-card.maxed .boost-badge .boost-art-big,
.boost-card.maxed .boost-rays { animation: none; }

/* The header strip and the pips made it taller, and on a portrait screen it
   hangs from the top edge down towards the upgrade row - so it comes in a
   size smaller there. */
.boost-badge { width: 2.8rem; height: 2.8rem; }
.boost-badge .boost-art-big { font-size: 1.65rem; }
@media (orientation: portrait) {
  /* Laid out across rather than down: badge on the left, the text beside it.
     Stacked it reached down over the ad buttons of the upgrade row. */
  #boostSlot .boost-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "name name" "badge sub" "badge pips" "badge lv" "buy buy";
    column-gap: 0.3rem;
    row-gap: 0.04rem;
    align-items: center;
    width: 9.2rem;
  }
  #boostSlot .boost-name { grid-area: name; }
  #boostSlot .boost-badge { grid-area: badge; width: 2.5rem; height: 2.5rem; margin: 0.1rem 0 0.1rem 0.1rem; }
  #boostSlot .boost-badge .boost-art-big { font-size: 1.45rem; }
  #boostSlot .boost-sub { grid-area: sub; text-align: left; }
  #boostSlot .boost-pips { grid-area: pips; }
  #boostSlot .boost-lv { grid-area: lv; text-align: left; }
  #boostSlot .boost-buy { grid-area: buy; }
}
