/* Stollenflug supporter page (unterstuetzen.php). Builds on style.css's
   tokens and hero; everything here is prefixed sf- so it can't collide with
   the viewer's own panels (.lb-row etc. already exist there). */

:root {
  --warn: #ffb547; --bad: #ff4d5e;
  /* Power-up colours (crystal rush, boost, force field, slow motion), also
     read by stollenflug.js for the canvas. */
  --pu0: #ffcf4a; --pu1: #ff8a3d; --pu2: #2fe4f0; --pu3: #b48cff;
}

.wrap.wide { display: flex; flex-direction: column; gap: 14px; }
.wrap.wide > .hero { margin-bottom: 0; }

.sf-panel { background: var(--panel); border: 1px solid var(--border); border-top-color: var(--border-lit); padding: 16px; min-width: 0; }
.sf-panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .02em; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.sf-panel-hint { font-family: var(--font); font-weight: 500; font-size: 11px; color: var(--faint); }
/* Panel tabs (ranks panel: personal / server). */
.sf-tabs { display: inline-flex; gap: 6px; flex-shrink: 0; }
.sf-tab { padding: 3px 8px; font-family: var(--font); font-weight: 500; font-size: 11px; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.sf-tab:hover { color: var(--text); }
.sf-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sf-tab[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.sf-muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.sf-note { font-size: 12px; color: var(--faint); line-height: 1.5; margin-top: 10px; }
.sf-foot { text-align: center; margin-top: 0; }
.sf-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.sf-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ─── PayPal tile: optional thank-you, below the player's stats ─────────
   Sits in the left column where the leaderboard used to be and grows to
   fill it, the button at the bottom, level with the rank panel beside it. */
.sf-gate {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-width: 0;
  padding: 16px; border: 1px solid rgba(47,228,240,.45);
  background:
    radial-gradient(260px 120px at 100% 0, rgba(47,228,240,.14), rgba(47,228,240,0) 70%),
    linear-gradient(180deg, rgba(216,248,251,.04) 0, rgba(216,248,251,0) 100px), var(--surface);
  box-shadow: 0 0 24px rgba(47,228,240,.07);
}
.sf-gate-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sf-gate-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .02em; line-height: 1.25; text-wrap: balance; }
.sf-gate-extra { display: block; margin-top: 3px; font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: .02em; color: var(--accent); }
.sf-gate-text p { font-size: 12px; color: var(--muted); line-height: 1.55; }
.sf-gate-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.sf-gate-actions .connect-btn { margin-top: 0; padding: 11px 16px; font-size: 12px; white-space: nowrap; }
.sf-gate-thanks { font-size: 12px; color: var(--good); text-align: center; }
/* Its line is reserved from the start, so the thanks appearing moves nothing. */
.sf-gate-thanks[hidden] { display: block; visibility: hidden; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
/* The game takes the full width. Below it two columns that end level: the
   player's stats and the PayPal tile stacked on the left (the tile grows to
   fill), the rank shaft on the right. */
.sf-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.sf-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sf-grow { flex: 1 1 auto; }
@media (max-width: 680px) { .sf-bottom { grid-template-columns: minmax(0, 1fr); } }

/* ─── Game ───────────────────────────────────────────────────────────────── */
.sf-game-panel { padding: 0; }
.sf-hud { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.sf-hud-dist { font-size: 20px; font-weight: 700; color: var(--crystal); font-variant-numeric: tabular-nums; min-width: 6.5ch; }
.sf-hud-dist small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.sf-hud-next { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 5px; }
.sf-hud-next-label { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.sf-hud-next-label b { color: var(--text); font-weight: 500; }
.sf-bar { height: 3px; background: var(--border); position: relative; }
.sf-bar > i { position: absolute; inset: 0 auto 0 0; width: 0%; background: linear-gradient(90deg, rgba(47,228,240,.3), var(--accent)); box-shadow: 0 0 8px rgba(47,228,240,.5); }
/* Room for a long best ("Rekord 123.456 m") from the start: a new best
   after a flight must not change how the HUD wraps and push the game down. */
.sf-hud-tries { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 15ch; text-align: right; }
.sf-hud-tries b { color: var(--accent); }

.sf-game { position: relative; width: 100%; max-width: 100%; aspect-ratio: 800 / 340; background: var(--bg-deep); touch-action: none; cursor: pointer; }
.sf-game canvas { display: block; width: 100%; height: 100%; }
/* Tapping the game must never select, highlight or open the long-press menu:
   it's a button you hold, not content. The play area has no focus ring
   either - it only takes focus so the keyboard reaches the game. */
.sf-game-panel { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.sf-game-panel input, .sf-game-panel select { user-select: text; -webkit-user-select: text; }
.sf-game:focus, .sf-game:focus-visible { outline: none; }

.sf-full-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; background: var(--surface2); border: 1px solid var(--border-lit); color: var(--accent); cursor: pointer; border-radius: var(--radius); }
.sf-full-btn:hover { border-color: var(--accent); }
.sf-full-btn svg { width: 16px; height: 16px; }
.sf-full-btn .sf-full-out, .sf-full-btn[aria-pressed="true"] .sf-full-in { display: none; }
.sf-full-btn[aria-pressed="true"] .sf-full-out { display: block; }

/* Full screen: the real one (Fullscreen API, Android & desktop) or, where a
   page can't have it (iPhone Safari), a fixed layer over everything. Either
   way the play area takes all the room left by the HUD, and the canvas is
   scaled by stollenflug.js to the largest 800:340 box that fits. */
.sf-game-panel:fullscreen, .sf-game-panel.sf-pseudo-full {
  position: fixed; inset: 0; z-index: 100; width: 100vw; height: 100vh; height: 100dvh; max-width: none; margin: 0;
  display: flex; flex-direction: column; background: var(--bg-deep); border: 0;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.sf-game-panel:fullscreen .sf-game, .sf-pseudo-full .sf-game { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; display: flex; align-items: center; justify-content: center; }
.sf-game-panel:fullscreen .sf-game canvas, .sf-pseudo-full .sf-game canvas { flex: 0 0 auto; }
.sf-game-panel:fullscreen .sf-controls, .sf-pseudo-full .sf-controls { display: none; }
.sf-game-panel:fullscreen .sf-hud, .sf-pseudo-full .sf-hud { padding: 6px 12px; flex-wrap: nowrap; }
/* Phone held upright in the fallback mode: turn the whole layer by 90°, so
   the game is landscape anyway. Taps work the same - anywhere means thrust. */
.sf-game-panel.sf-pseudo-full.sf-rotate {
  width: 100vh; width: 100dvh; height: 100vw; inset: auto; top: 0; left: 0;
  transform-origin: top left; transform: rotate(90deg) translateY(-100%);
}
body.sf-noscroll { overflow: hidden; }
/* style.css enlarges .wrap by 120% on wide screens (zoom); the full-screen
   layer lives inside it, so it undoes that to match the screen exactly. */
@media (min-width: 821px) {
  .sf-game-panel:fullscreen, .sf-game-panel.sf-pseudo-full { zoom: calc(1 / 1.2); }
}

/* Phones: the game runs edge to edge, no gutter lost at the sides. */
@media (max-width: 520px) {
  .sf-game-panel:not(.sf-pseudo-full) { margin-inline: -16px; border-left: 0; border-right: 0; }
}
.sf-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 12px 16px; background: rgba(6,11,17,.66); cursor: default; }
.sf-overlay[hidden] { display: none; }
.sf-ov-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.sf-ov-h { font-family: var(--font-display); font-weight: 600; font-size: clamp(15px, 3vw, 22px); letter-spacing: .02em; text-wrap: balance; }
.sf-ov-h.sf-big { font-size: clamp(22px, 5vw, 34px); font-variant-numeric: tabular-nums; color: var(--crystal); text-shadow: 0 0 22px rgba(47,228,240,.35); }
.sf-ov-p { font-size: 13px; color: var(--muted); max-width: 44ch; }
.sf-up { color: var(--good); font-weight: 600; }
.sf-ov-err { font-size: 12px; color: var(--warn); max-width: 44ch; }
.sf-overlay.sf-ov-busted { background: radial-gradient(closest-side, rgba(255,77,94,.28), rgba(40,4,10,.9)); }
.sf-ov-busted .sf-ov-k { color: var(--bad); }
.sf-ov-busted .sf-ov-p { color: var(--text); }
.sf-busted {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 11vw, 92px); line-height: 1; letter-spacing: .08em;
  color: var(--bad); border: 4px solid var(--bad); padding: .08em .3em; margin-block: 6px 14px; transform: rotate(-6deg);
  text-shadow: 0 0 28px rgba(255,77,94,.6); box-shadow: 0 0 34px rgba(255,77,94,.35), inset 0 0 24px rgba(255,77,94,.25);
  animation: sf-stamp .35s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes sf-stamp { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sf-busted { animation: none; } }
.sf-ov-seed { font-family: var(--font-mono); font-size: 10px; color: var(--faint); letter-spacing: .04em; }
.sf-ov-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.sf-ov-row .connect-btn { width: auto; margin-top: 0; padding: 11px 18px; font-size: 12px; }
.sf-controls { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.sf-audio { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sf-volume { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); margin-right: 4px; }
.sf-volume svg { width: 14px; height: 14px; flex-shrink: 0; }
.sf-volume input { width: 90px; accent-color: var(--accent); }
.sf-audio-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border-lit); color: var(--accent); font: inherit; font-size: 12px; padding: 3px 9px; cursor: pointer; border-radius: var(--radius); transition: border-color .15s, color .15s; }
.sf-audio-btn:hover { border-color: var(--accent); }
.sf-audio-btn svg { width: 13px; height: 13px; }
/* Off: dimmed and struck through, so the state reads at a glance. */
.sf-audio-btn[aria-pressed="false"] { color: var(--faint); text-decoration: line-through; }
.sf-controls kbd { font-family: var(--font-mono); font-size: 11px; color: var(--text); background: var(--surface2); border: 1px solid var(--border-lit); border-bottom-width: 2px; padding: 0 6px; }
@media (max-width: 520px) {
  .sf-hud { gap: 10px; padding: 8px 12px; }
  .sf-hud-dist { font-size: 17px; }
  .sf-overlay { gap: 5px; }
  .sf-ov-p { font-size: 12px; }
  .sf-opt { display: none; }
}

/* ─── Player ────────────────────────────────────────────────────── */
.sf-select { width: 100%; background: var(--surface2); border: 1px solid var(--border-lit); color: var(--text); padding: 8px 10px; font-family: var(--font); font-size: 13px; border-radius: var(--radius); margin-bottom: 12px; }
.sf-stats { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.sf-stat { background: var(--surface2); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sf-stat-k { font-size: 11px; color: var(--muted); }
/* Fixed value height (two lines of the owner's 13px text): choosing a
   player, the owner's two-line rank or the ∞ sign never change the tiles'
   height and move the leaderboard below. */
.sf-stat-v { height: 32px; line-height: 32px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; color: var(--crystal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-stat-v.sf-rank { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--accent); }
.sf-stat-v.sf-none { color: var(--faint); }
.sf-stat-v.sf-inf { font-size: 26px; }
.sf-stat-v.sf-owner { white-space: normal; font-size: 13px; line-height: 16px; color: var(--crystal); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* Password field for the owner's name, inside the game overlay. */
.sf-lock { gap: 8px; }
.sf-lock input { width: 190px; max-width: 100%; background: var(--surface2); border: 1px solid var(--border-lit); color: var(--text); padding: 10px 12px; font-family: var(--font); font-size: 14px; border-radius: var(--radius); }
.sf-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* ─── Ranks panel: personal shaft / server list, one grid cell ─────────── */
.sf-views { display: grid; grid-template-columns: minmax(0, 1fr); }
.sf-view { grid-area: 1 / 1; min-width: 0; }
.sf-view[hidden] { display: block; visibility: hidden; }
.sf-view-hint { font-size: 11px; color: var(--faint); margin: -4px 0 10px; }
.sf-srv-h { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px 6px 0; font-size: 10px; color: var(--faint); font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.sf-srv { list-style: none; display: flex; flex-direction: column; }
.sf-srv li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 4px 7px 10px; border-bottom: 1px solid rgba(34,49,65,.7); font-size: 13px; }
.sf-srv li:last-child { border-bottom: none; }
.sf-srv-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.sf-srv-n em { font-style: normal; margin-left: 8px; font-family: var(--font-mono); font-size: 10px; color: var(--bg-deep); background: var(--accent); padding: 0 5px; vertical-align: 1px; }
.sf-srv-m { flex-shrink: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--accent); }
.sf-srv li.sf-me { background: linear-gradient(90deg, rgba(47,228,240,.14), rgba(47,228,240,0) 80%); }
.sf-srv li.sf-me::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.sf-srv li.sf-me .sf-srv-n { color: var(--crystal); font-weight: 600; }
.sf-srv-empty { color: var(--muted); }

/* ─── Record glow in the HUD: gold past your own best, diamond past the
   server's. The number keeps its width; shine and sparks are painted over
   it. Sparks (stollenflug.js, spark()) fly out of the number and on past the
   panel's edge - nothing on the way clips them. ───────────────────────── */
.sf-hud-dist { position: relative; z-index: 3; }
.sf-hud-dist.sf-gold > #sf-hud-m, .sf-hud-dist.sf-gold > small,
.sf-hud-dist.sf-diamond > #sf-hud-m, .sf-hud-dist.sf-diamond > small {
  -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 260% 100%;
  animation: sf-shine 1.8s linear infinite;
}
.sf-hud-dist.sf-gold > #sf-hud-m, .sf-hud-dist.sf-gold > small { background-image: linear-gradient(100deg, #a8680f 0%, #ffcf4a 28%, #fff6d2 44%, #ffcf4a 60%, #a8680f 100%); }
.sf-hud-dist.sf-gold > #sf-hud-m { filter: drop-shadow(0 0 7px rgba(255,190,60,.6)); }
.sf-hud-dist.sf-diamond > #sf-hud-m, .sf-hud-dist.sf-diamond > small { background-image: linear-gradient(100deg, #7fcfff 0%, #fff 22%, #d9c8ff 38%, #fff 50%, #a6f4ff 66%, #fff 80%, #7fcfff 100%); animation-duration: 1.3s; }
.sf-hud-dist.sf-diamond > #sf-hud-m { filter: drop-shadow(0 0 8px rgba(200,240,255,.75)) drop-shadow(0 0 16px rgba(160,200,255,.35)); }
@keyframes sf-shine { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.sf-hud-tries b.sf-gold-t { color: #ffcf4a; }
.sf-hud-tries b.sf-diamond-t { color: #d9f6ff; }
.sf-game-panel.sf-rec-diamond { border-color: #2c4a5c; border-top-color: #6fb6cc; box-shadow: 0 0 24px rgba(166,244,255,.12); }
.sf-sparks { position: absolute; left: 2.2ch; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 60; }
.sf-spark { position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; pointer-events: none; animation: sf-spark 1.6s cubic-bezier(.15,.7,.35,1) forwards; }
.sf-spark.sf-g { background: #ffd45c; box-shadow: 0 0 6px #ffb52e; }
.sf-spark.sf-d { left: -3px; top: -3px; width: 6px; height: 6px; background: #fff; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); filter: drop-shadow(0 0 4px #a6f4ff); }
.sf-spark.sf-d.sf-v { background: #e2d4ff; }
.sf-spark.sf-d.sf-c { background: #a6f4ff; }
@keyframes sf-spark { from { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .sf-hud-dist.sf-gold > #sf-hud-m, .sf-hud-dist.sf-gold > small,
  .sf-hud-dist.sf-diamond > #sf-hud-m, .sf-hud-dist.sf-diamond > small { animation: none; background-position: 50% 0; }
  .sf-sparks { display: none; }
}

/* ─── Rank shaft: the further you fly, the deeper the level (Sohle) ─────── */
.sf-shaft { list-style: none; display: flex; flex-direction: column; }
.sf-shaft li, .sf-shaft-h { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 28px; align-items: center; gap: 10px; }
.sf-shaft-h { padding: 0 4px 6px 0; font-size: 10px; color: var(--faint); font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.sf-shaft-h span:first-child, .sf-shaft-h span:last-child { text-align: right; }
.sf-shaft li { position: relative; padding: 7px 4px 7px 0; border-bottom: 1px solid rgba(34,49,65,.7); font-size: 13px; }
.sf-shaft li:last-child { border-bottom: none; }
.sf-lv { font-family: var(--font-mono); font-size: 10px; color: var(--faint); text-align: right; letter-spacing: .04em; }
.sf-nm { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-th { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--faint); }
.sf-ct { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--faint); text-align: right; }
.sf-facet { display: inline-block; width: 7px; height: 7px; margin-right: 8px; background: var(--border-lit); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); vertical-align: 1px; }
.sf-shaft li.sf-reached .sf-nm { color: var(--text); }
.sf-shaft li.sf-reached .sf-lv { color: var(--accent); }
.sf-shaft li.sf-reached .sf-th { color: var(--muted); }
.sf-shaft li.sf-reached .sf-facet { background: var(--accent); }
.sf-shaft li.sf-current { background: linear-gradient(90deg, rgba(47,228,240,.14), rgba(47,228,240,0) 80%); }
.sf-shaft li.sf-current::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.sf-shaft li.sf-current .sf-nm { color: var(--crystal); font-weight: 600; }
.sf-shaft li.sf-next .sf-th { color: var(--warn); }

/* "STOLLENFLUG" is one long word: at phone width the wide page's 26px title
   would push the banner past the screen edge. */
@media (max-width: 520px) {
  .hero-title { font-size: clamp(13px, 4.3vw, 26px); }
  /* A smaller mark leaves room for the title next to the home icon. */
  .wrap.wide .hero { --mark: 100px; }
}
@media (max-width: 380px) { .wrap.wide .hero { --mark: 64px; } }

/* ─── Crystals and power-ups ─────────────────────────────────────────────── */
.sf-hud-cr { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); min-width: 7ch; }
.sf-hud-cr span[aria-hidden] { color: var(--accent); }
.sf-hud-cr b { color: var(--crystal); }
.sf-lock input[inputmode="numeric"] { width: 118px; text-align: center; letter-spacing: .3em; }
.sf-ov-cr { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }

/* ─── Workshop ───────────────────────────────────────────────────────────── */
.sf-bal { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--muted); }
.sf-bal span { color: var(--accent); }
.sf-bal b { color: var(--crystal); font-variant-numeric: tabular-nums; }
.sf-shop-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: -4px 0 6px; }
/* One reserved line each, so a note or a message appearing moves nothing. */
.sf-shop-note, .sf-shop-msg { min-height: 18px; font-size: 12px; line-height: 18px; color: var(--warn); }
.sf-shop-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
.sf-shop-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sf-shop-col h3 { font-family: var(--font-mono); font-weight: 500; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 6px 0 0; }
.sf-item { display: grid; grid-template-columns: minmax(0, 1fr) 150px; grid-template-rows: auto auto; gap: 2px 12px; align-items: center; padding: 9px 10px; background: var(--surface2); border: 1px solid var(--border); }
.sf-item-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sf-item-t { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-item-d { grid-column: 1; font-size: 11px; line-height: 1.45; color: var(--muted); }
.sf-acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.sf-acts .sf-buy { flex: 1 1 auto; }
.sf-acts .sf-undo { flex: 0 0 34px; width: 34px; padding: 0; font-size: 18px; color: var(--warn); border-color: rgba(255,181,71,.5); background: transparent; }
.sf-from { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.sf-from[hidden] { display: none; }
.sf-from input { width: 110px; background: var(--surface2); border: 1px solid var(--border-lit); color: var(--text); padding: 7px 10px; font: 500 13px var(--font-mono); border-radius: var(--radius); }
.sf-sign { width: 16px; flex-shrink: 0; text-align: center; color: var(--accent); }
.sf-sign-pu0 { color: var(--pu0); } .sf-sign-pu1 { color: var(--pu1); } .sf-sign-pu2 { color: var(--pu2); } .sf-sign-pu3 { color: var(--pu3); }
.sf-pips { display: inline-flex; gap: 3px; margin-left: auto; }
.sf-pips i { width: 8px; height: 8px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: var(--border-lit); }
.sf-pips i.sf-on { background: var(--accent); }
.sf-buy { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 100%; min-height: 40px; padding: 5px 8px; background: var(--accent-dim); border: 1px solid rgba(47,228,240,.55); color: var(--accent); font: 600 12px var(--font); cursor: pointer; border-radius: var(--radius); }
.sf-buy:hover:not(:disabled) { border-color: var(--accent); background: #164552; }
.sf-buy:disabled { cursor: default; background: transparent; border-color: var(--border); color: var(--faint); }
.sf-price { font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
@media (max-width: 680px) {
  .sf-shop-body { grid-template-columns: minmax(0, 1fr); }
  .sf-item { grid-template-columns: minmax(0, 1fr) 118px; }
}

/* ─── Slot machine screen (after a flight) ───────────────────────────────── */
.sf-case { position: relative; width: min(620px, 92%); height: 104px; overflow: hidden; background: linear-gradient(180deg, #0a131c, #111d29 50%, #0a131c); border: 1px solid var(--border-lit); box-shadow: inset 0 0 24px rgba(0,0,0,.7); }
/* Darker edges, like the case window in the game this borrows from. */
.sf-case::before, .sf-case::after { content: ""; position: absolute; top: 0; bottom: 0; width: 18%; z-index: 2; pointer-events: none; }
.sf-case::before { left: 0; background: linear-gradient(90deg, rgba(6,11,17,.9), rgba(6,11,17,0)); }
.sf-case::after { right: 0; background: linear-gradient(270deg, rgba(6,11,17,.9), rgba(6,11,17,0)); }
.sf-strip { display: flex; gap: 4px; height: 100%; padding: 6px 0; will-change: transform; }
.sf-card { flex: 0 0 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 28%, #0d1721) 0%, #0d1721 78%); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); }
.sf-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--rc); box-shadow: 0 0 10px var(--rc); }
.sf-card-sym { font-size: 30px; line-height: 1; color: var(--rc); text-shadow: 0 0 12px color-mix(in srgb, var(--rc) 60%, transparent); }
.sf-card-t { max-width: 86px; font: 600 11px var(--font); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-card-win { border-color: var(--rc); box-shadow: 0 0 22px var(--rc), inset 0 0 14px color-mix(in srgb, var(--rc) 40%, transparent); }
/* The marker in the middle. */
.sf-marker { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; z-index: 3; background: #ffcf4a; box-shadow: 0 0 8px #ffcf4a; }
.sf-marker::before, .sf-marker::after { content: ""; position: absolute; left: -6px; border: 7px solid transparent; }
.sf-marker::before { top: 0; border-top-color: #ffcf4a; }
.sf-marker::after { bottom: 0; border-bottom-color: #ffcf4a; }
.sf-mwin { min-height: 20px; font: 700 14px var(--font-mono); color: var(--accent); text-align: center; }
.sf-case.sf-jackpot { border-color: #e4ae39; animation: sf-jp .22s steps(2) infinite; }
.sf-case.sf-jackpot ~ .sf-mwin { font-family: var(--font-display); font-size: 20px; text-shadow: 0 0 18px #e4ae39; }
@keyframes sf-jp { from { box-shadow: 0 0 46px #e4ae39, inset 0 0 18px rgba(228,174,57,.4); } to { box-shadow: 0 0 12px #3a7bff, inset 0 0 8px rgba(58,123,255,.3); } }
/* Jackpot: the whole window (or the full-screen game) turns once. */
.sf-spin-all { animation: sf-spin-all 1.6s cubic-bezier(.6, -.25, .3, 1.3); }
@keyframes sf-spin-all { 0% { transform: rotate(0) scale(1); } 45% { transform: rotate(200deg) scale(.8); } 100% { transform: rotate(360deg) scale(1); } }
.sf-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }
@media (max-width: 520px) {
  .sf-case { height: 78px; }
  .sf-card { flex-basis: 66px; gap: 3px; }
  .sf-card-sym { font-size: 21px; }
  .sf-card-t { font-size: 9px; max-width: 62px; }
}
@media (prefers-reduced-motion: reduce) { .sf-case.sf-jackpot { animation: none; } }

/* Crate odds under the strip, in rarity colours. */
.sf-odds { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; max-width: min(620px, 92%); padding: 5px 10px; background: rgba(6,11,17,.85); border: 1px solid var(--border); font: 500 11px var(--font-mono); color: var(--muted); }
.sf-odds span { white-space: nowrap; }
.sf-odds b { color: var(--rc); font-weight: 400; }
.sf-odds i { font-style: normal; color: var(--text); }
@media (max-width: 520px) { .sf-odds { font-size: 9px; gap: 2px 8px; } }
/* Test pilot: token-at-start toggle under a power-up. */
.sf-tokbtn { grid-column: 1; justify-self: start; margin-top: 4px; padding: 3px 8px; font: 500 11px var(--font); color: var(--muted); background: transparent; border: 1px dashed var(--border-lit); cursor: pointer; border-radius: var(--radius); }
.sf-tokbtn:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.sf-tokbtn[aria-pressed="true"] { color: var(--bg-deep); background: var(--warn); border: 1px solid var(--warn); }

/* While flying, the mouse pointer is hidden over the play area. */
.sf-running .sf-game, .sf-running .sf-game canvas { cursor: none; }

/* Notes under some levels of the rank shaft (what a rank allows), subtly marked. */
.sf-rnote { display: block; margin: 1px 0 0 15px; white-space: normal; font-size: 10.5px; font-style: italic; line-height: 1.3; color: var(--warn); opacity: .8; }
