* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--tw-void);
  color: var(--tw-star);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

#stage { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.6vh, 14px);
  padding: 16px;
  text-align: center;
  overflow-y: auto;
  touch-action: pan-y;
  background: radial-gradient(ellipse at center, rgba(11, 10, 28, 0.45) 0%, rgba(11, 10, 28, 0.85) 75%);
  /* never a horizontal scroll; the vertical one (short iframes) is thin and themed, not the browser's white bar */
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 140, 255, 0.35) transparent;
}
.screen::-webkit-scrollbar { width: 6px; height: 0; }
.screen::-webkit-scrollbar-track { background: transparent; }
.screen::-webkit-scrollbar-thumb { background: rgba(160, 140, 255, 0.35); border-radius: 3px; }

/* title: the twin shadow is the signature (static, never animated). "Drift" = core violet -> hype gradient; gold is
   reserved for stardust. A drop-shadow (not text-shadow) carries the glow because the fill is a clipped background. */
.title {
  font-family: var(--tw-font-display);
  font-size: clamp(34px, 9vmin, 68px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--tw-star);
  text-shadow: var(--tw-twin-glow);
}
.title span {
  display: block; width: fit-content; margin: 2px auto 0; padding: 0 0.04em;
  background: linear-gradient(90deg, var(--tw-core-hi), var(--tw-pulse)); -webkit-background-clip: text; background-clip: text;
  color: transparent; text-shadow: none; filter: drop-shadow(0 0 14px rgba(255, 95, 210, 0.45));
}
h2, .res-title, .res .big-score { font-family: var(--tw-font-display); }

h2 { font-size: clamp(24px, 5.5vmin, 40px); font-weight: 800; }
h3 { font-size: 16px; margin: 14px 0 6px; text-align: left; opacity: 0.85; }
h3 small { opacity: 0.7; font-weight: 600; }

.tagline { font-size: clamp(14px, 2.8vmin, 19px); max-width: 26em; opacity: 0.9; }
.hint { font-size: clamp(12px, 2.4vmin, 15px); opacity: 0.6; }
.best-line { font-size: clamp(14px, 2.8vmin, 18px); }
.best-line b { color: var(--tw-star); margin: 0 2px; font-variant-numeric: tabular-nums; }
.best-line .sep { opacity: 0.4; margin: 0 6px; }
.note { font-size: 12px; opacity: 0.65; line-height: 1.45; text-align: left; margin-top: 6px; }

.btn {
  min-width: 170px;
  min-height: 46px;
  padding: 9px 24px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  font-size: clamp(16px, 3.2vmin, 21px);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.primary {
  border-color: var(--tw-ring);
  background: linear-gradient(180deg, var(--tw-ring-hi), var(--tw-ring-lo));
  color: var(--tw-ink-cyan);
  box-shadow: 0 0 22px rgba(125, 249, 255, 0.35);
}
.btn small { font-size: 0.62em; font-weight: 600; opacity: 0.8; }
.daily-btn { border-color: var(--tw-core); background: var(--tw-core-a12); } /* secondary = core violet; gold is currency only */
/* start Play: the one glowing thing on the start screen, same orbit ring as Play again */
#btn-play { min-width: min(260px, 100%); animation: orbitBreathe var(--tw-dur-breathe) ease-in-out infinite; }
/* Rewarded-ad button: deliberately NOT green (Poki rule), carries the 🎬 marker, same size as the normal buttons. */
.ad-btn { border-color: var(--tw-ad); background: var(--tw-ad-a16); }
.btn:focus-visible, .icon-btn:focus-visible, .tile:focus-visible, .coll-item:focus-visible { outline: 3px solid var(--tw-spark); outline-offset: 3px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn-row .btn { min-width: 130px; }

.icon-btn {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(11, 10, 28, 0.55);
  color: var(--tw-star);
  font-size: 18px;
  cursor: pointer;
  flex: none;
}
.icon-btn svg { fill: currentColor; stroke: currentColor; }
/* icon sprite: symbols live in index.html (#i-*), drawn in currentColor */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 22px; height: 22px; flex: none; display: block; }
.icon-btn .ico { stroke: none; }

/* start-screen tiles: one row of three equal tiles at every phone width (360px included). Each tile is a 3-row grid —
   fixed icon row / label / count — so labels start on one line and counts sit on one baseline even when the style tile
   shows its taller canvas preview or a label wraps to two lines (FR "Changer de style", JA "スタイルカプセル"). */
.menu-row { display: grid; grid-template-columns: repeat(3, minmax(0, 112px)); gap: 12px; justify-content: center; width: 100%; }
.tile {
  min-width: 0;
  min-height: 100px;
  padding: 10px 6px 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  /* opaque: the orbit drawn on the canvas behind must not show through and sit on the numbers */
  background: linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06)), var(--tw-tile);
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  display: grid;
  grid-template-rows: 44px 1fr auto;
  justify-items: center;
  row-gap: 4px;
}
.tile:hover { background: linear-gradient(rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.13)), var(--tw-tile); }
.tile > span[data-i18n] { align-self: start; max-width: 100%; overflow-wrap: break-word; }
/* satellites: every tile carries a round 44px "planet" (icon disc, or the style preview canvas) on the same row */
.tile-ico {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--tw-ring);
  background: radial-gradient(circle at 35% 30%, rgba(125, 249, 255, 0.22), rgba(21, 18, 58, 0.9) 70%);
  box-shadow: inset 0 0 0 1.5px rgba(125, 249, 255, 0.35);
}
.tile-ico .ico { width: 24px; height: 24px; filter: drop-shadow(1.5px 1.5px 0 rgba(160, 140, 255, 0.55)); }
.tile .loadout-cv { border-radius: 50%; outline: 1.5px solid rgba(160, 140, 255, 0.4); outline-offset: -1.5px; }
.tile b { align-self: end; color: var(--tw-star-2); font-size: 14px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile #start-dust { color: var(--tw-spark); } /* stardust is the currency: the only gold number */

#hud {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
}
#hud button { pointer-events: auto; }
.hud-buttons { display: flex; gap: 10px; margin-left: auto; }
.hud-target {
  font-size: clamp(13px, 2.4vmin, 16px);
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 10, 28, 0.55);
  color: var(--tw-spark);
}
.hud-target:empty { display: none; }
/* the live rank hint ("全球第 25 名 · 再 2 分超越…") wraps to two lines instead of being cut (QA 2026-12-02) */
.hud-target {
  max-width: calc(100vw - 140px); overflow: hidden; white-space: normal; line-height: 1.25; text-align: left;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; border-radius: 16px;
}
.corner {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
}
.corner-row { display: flex; gap: 8px; }
/* start screen: centred when it fits, scrolls from the top when it does not (plain justify-content:center pushes the
   title up under the 🌐/sound corner and out of reach on 360x740 with the guide card open) */
#screen-start { justify-content: flex-start; padding-top: calc(max(10px, env(safe-area-inset-top)) + 54px); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
#screen-start > :first-child { margin-top: auto; }
#screen-start > .hint { margin-bottom: auto; }
@media (max-height: 560px) { #screen-start { padding-top: 10px; } }

/* language picker: each language in its own name and script */
.lang-box { max-width: 420px; }
.lang-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.lang-opt {
  font: inherit; font-size: 15px; font-weight: 700; color: inherit; cursor: pointer;
  padding: 11px 10px; border-radius: 12px; border: 1px solid rgba(160, 140, 255, .28);
  background: rgba(160, 140, 255, .08); text-align: center; min-width: 0; overflow-wrap: anywhere;
}
.lang-opt.active { border-color: var(--tw-ring); background: rgba(125, 249, 255, .16); box-shadow: 0 0 0 1px var(--tw-ring) inset; }

.big-score {
  font-size: clamp(50px, 14vmin, 110px);
  font-weight: 800;
  line-height: 1;
  color: var(--tw-spark);
  text-shadow: 0 0 24px rgba(255, 209, 102, 0.45);
}
.badge {
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--tw-pulse);
  color: var(--tw-ink); /* 7.22:1 — white on #ff4d8d was 3.14:1 */
  font-weight: 800;
  font-size: clamp(13px, 2.6vmin, 17px);
  animation: pop 0.6s ease infinite alternate;
}
@keyframes pop { from { transform: scale(1); } to { transform: scale(1.08); } }
.hint-line { font-size: clamp(14px, 2.8vmin, 18px); font-weight: 700; color: var(--tw-pulse); max-width: 28em; }
.hint-line:empty { display: none; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 6px 20px;
  font-size: clamp(12px, 2.4vmin, 15px);
}
.stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stats span { opacity: 0.65; }
.stats b { font-size: 1.2em; }
@media (max-width: 420px) { .stats { grid-template-columns: repeat(2, auto); } }

.reward-line { font-size: clamp(15px, 3vmin, 19px); }
.reward-line b, .dust-ico { color: var(--tw-spark); }
.reward-line small { opacity: 0.7; font-size: 0.75em; }
.frag-ico { color: var(--tw-ad); }
.ach-toasts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 34em; }
.ach-toasts:empty { display: none; }
.ach-chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--tw-spark-a16); border: 1px solid rgba(255, 209, 102, 0.6); }

/* compact layout for short landscape screens (phones, 800x450 iframes) */
@media (max-height: 560px) {
  .title span { display: inline; }
  .tagline, .hint { display: none; }
  .screen { gap: 6px; padding: 10px; }
  .tile { min-height: 64px; padding: 6px; grid-template-rows: 30px 1fr auto; row-gap: 2px; }
  .tile-ico { width: 30px; height: 30px; }
  .tile-ico .ico { width: 18px; height: 18px; }
  .tile .loadout-cv { width: 30px; height: 30px; }
  .big-score { font-size: 54px; }
  .btn { min-height: 40px; padding: 6px 18px; }
}

/* panels */
.panel { background: rgba(8, 7, 20, 0.88); justify-content: center; }
.panel-box {
  width: min(560px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  background: var(--tw-hull);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
/* porthole open (BACKLOG #3): the panel irises open from its centre, the dim backdrop fades in. Opening only (closing is
   instant: .hidden is display:none); no fill mode, so the clip is gone once it has played. */
@media (prefers-reduced-motion: no-preference) {
  .panel { animation: panelDim var(--tw-dur-fast, 180ms) ease-out; }
  .panel .panel-box { animation: panelIris 320ms var(--tw-ease-orbit, cubic-bezier(.2, 1.2, .4, 1)); }
}
@keyframes panelDim { from { background-color: rgba(8, 7, 20, 0); } }
@keyframes panelIris { from { clip-path: circle(0% at 50% 50%); opacity: 0.4; } 70% { opacity: 1; } to { clip-path: circle(75% at 50% 50%); } }
.panel-box header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.panel-box header h2 { font-size: 22px; }
.panel-body { padding: 12px 16px 16px; overflow-y: auto; touch-action: pan-y; text-align: left; }
.panel-body.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }

.wallet { display: flex; gap: 18px; justify-content: center; font-size: 15px; margin-bottom: 6px; }
.cap-stage { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 8px; }
.cap-stage canvas { width: 120px; height: 120px; }
.cap-result { min-height: 1.4em; font-weight: 800; text-align: center; }
#btn-open { display: flex; margin: 0 auto; }
.pity { font-size: 13px; text-align: center; margin-top: 8px; opacity: 0.85; }
.rates, .top-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rates th, .rates td, .top-table th, .top-table td { padding: 5px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); text-align: left; }
.rates th, .top-table th { opacity: 0.6; font-weight: 600; }
/* odds table (r12): 6 columns cannot fit a phone in the long languages (de 360: ~443px in a 326px body), and the odds must
   stay fully readable (STANDARD §3) — so the TABLE scrolls sideways in its own box, never the whole panel. Rarity column
   stays pinned while swiping; a ring-coloured glow sits on the right edge only while there is more to the right (the
   "local" cover layer slides over it at the end). Keyboard: the box is focusable (role=region, named by the heading). */
.rates-wrap {
  overflow-x: auto; overscroll-behavior-x: contain; touch-action: pan-x pan-y; border-radius: 8px;
  background:
    linear-gradient(to left, var(--tw-hull) 40%, rgba(0, 0, 0, 0)) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 100% 50%, rgba(77, 240, 255, 0.28), rgba(77, 240, 255, 0)) right center / 12px 100% no-repeat scroll;
}
.rates-wrap:focus-visible { outline: 3px solid var(--tw-spark); outline-offset: 2px; }
.rates-wrap .rates { border-collapse: separate; border-spacing: 0; }
.rates-wrap .rates td { white-space: nowrap; }
.rates-wrap .rates th:first-child, .rates-wrap .rates td:first-child { position: sticky; left: 0; z-index: 1; background: var(--tw-hull); white-space: normal; min-width: 64px; box-shadow: 8px 0 8px -8px rgba(0, 0, 0, 0.7); }
/* a pinned cell must be opaque: the table's th opacity:0.6 would let the scrolled columns show through, so the dim header
   tone moves into the text colour instead (same look). */
.rates-wrap .rates th { opacity: 1; color: color-mix(in srgb, currentColor 60%, transparent); }
@media (max-width: 420px) {
  .rates { font-size: 12.5px; }
  .rates th, .rates td { padding: 5px 5px; }
}
.r-common { color: var(--tw-rarity-common); } .r-rare { color: var(--tw-rarity-rare); } .r-epic { color: var(--tw-rarity-epic); } .r-legendary { color: var(--tw-rarity-legendary); }
.top-table .me td { color: var(--tw-spark); font-weight: 700; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 209, 102, 0.2); color: var(--tw-spark); }

.progress { position: relative; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-bottom: 10px; }
.progress-bar { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--tw-core-lo), var(--tw-ring)); }
.progress span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 22px; font-weight: 700; }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.coll-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04); color: inherit; font: inherit; font-size: 11px; cursor: pointer;
}
/* every style preview is a round planet, like the start-screen satellites */
.coll-item canvas { width: 56px; height: 56px; border-radius: 50%; outline: 1.5px solid rgba(160, 140, 255, 0.3); outline-offset: -1.5px; }
.coll-item.equipped canvas { outline-color: var(--tw-ring); }
.coll-item.locked canvas { opacity: 0.25; filter: grayscale(1); }
.coll-item.equipped { border-color: var(--tw-ring); box-shadow: 0 0 10px rgba(125, 249, 255, 0.4); }
.coll-item.selected { background: rgba(255, 255, 255, 0.12); }
.coll-detail { min-height: 64px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); font-size: 14px; }
.coll-detail .btn { min-width: 120px; min-height: 40px; font-size: 15px; }

.ach-list { list-style: none; display: grid; gap: 6px; }
.ach-list li { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); font-size: 13px; }
/* achievements: each marker is a small satellite disc; unlocked = hype magenta (the same as the results chips), locked = dim */
.ach-list li { min-height: 48px; }
.ach-list li.done { background: var(--tw-pulse-a20); box-shadow: inset 0 0 0 1px rgba(255, 95, 210, 0.35); }
.ach-list .ico {
  width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 15px; line-height: 1;
  background: radial-gradient(circle at 35% 30%, rgba(160, 140, 255, 0.25), rgba(21, 18, 58, 0.9) 70%); box-shadow: inset 0 0 0 1.5px rgba(160, 140, 255, 0.3); color: var(--tw-star-3);
}
.ach-list li.done .ico { color: var(--tw-pulse); background: radial-gradient(circle at 35% 30%, rgba(255, 95, 210, 0.35), rgba(26, 6, 24, 0.9) 70%); box-shadow: inset 0 0 0 1.5px rgba(255, 95, 210, 0.6), 0 0 10px rgba(255, 95, 210, 0.35); }
.ach-list li:not(.done) .ico { opacity: 0.7; }
.ach-list .txt { flex: 1; }
.ach-list .txt small { display: block; opacity: 0.65; }
.ach-list .rw { color: var(--tw-spark); font-weight: 700; white-space: nowrap; }

/* ---------- results screen「分數環」(ART-DIRECTION §8.3) ----------
   score -> (new best) -> stats line -> stardust -> achievements -> one big Play again -> round secondary actions.
   The score sits in the centre of an instrument ring whose arc = this run / personal best (--res-progress, real numbers
   set by game.js; 1 = new best). Steps fade in on .is-score / .is-dust (set by game.js, instant with reduced motion);
   Play again is visible from the first frame and never waits for the sequence. */
@property --res-fill { syntax: '<number>'; inherits: true; initial-value: 0; }
.res-screen {
  background: radial-gradient(ellipse at 50% 34%, rgba(29, 23, 70, 0.72) 0%, rgba(8, 7, 20, 0.94) 70%);
  /* centred when it fits, scrolls from the top when it does not */
  justify-content: flex-start;
}
.res {
  --ring: clamp(190px, 60vmin, 280px);
  width: min(440px, 100%);
  margin: auto 0;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(6px, 1.4vh, 14px);
  /* the new-best burst rings grow past the column: clip them, never widen the page (QA 2026-12-02: 408 > 348) */
  overflow-x: clip;
}
/* Play again + secondary row: pinned to the bottom of the screen when the content is taller than the iframe */
.res-foot {
  position: sticky; bottom: 0; z-index: 2; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 0 2px; margin-top: auto;
}
/* typing a nickname (QA-BRIEF 3a-2): the phone keyboard takes ~300px, and the pinned foot then sat on top of #global-name.
   While the name box has focus the foot goes back into the flow (it follows #global-box, so a sibling selector does it —
   no :has() needed), and the input keeps room around it when the browser scrolls it into view. */
#global-box:focus-within ~ .res-foot { position: static; background: none; }
#global-name { scroll-margin-top: 16px; scroll-margin-bottom: 140px; }.res-title { font-size: clamp(12px, 2.2vmin, 15px); font-weight: 800; letter-spacing: var(--tw-track-label); text-transform: uppercase; color: var(--tw-star-3); }
.res-title:lang(zh), .res-title:lang(ja), .res-title:lang(ko) { letter-spacing: 0.3em; }

/* the ring: a fixed square, score centred in it, the new-best badge hangs on its bottom edge */
.res-score { position: relative; width: var(--ring); height: var(--ring); display: grid; place-items: center; flex: none; }
.score-ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
/* track + instrument ticks (60, every 5th longer) */
.score-ring::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-conic-gradient(from -0.5deg, rgba(242, 240, 255, 0.22) 0 1deg, transparent 1deg 30deg),
    repeating-conic-gradient(from -0.3deg, rgba(242, 240, 255, 0.10) 0 0.6deg, transparent 0.6deg 6deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
}
/* the arc: grows from 0 to --res-progress once the score has counted up */
.score-ring::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--tw-ring) calc(var(--res-fill) * 360deg), rgba(160, 140, 255, 0.16) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  filter: drop-shadow(0 0 6px rgba(125, 249, 255, 0.55));
}
/* only animates forward: when the screen resets (classes removed) the arc snaps back to 0 */
.res-score { --res-fill: 0; }
.res.is-score .res-score { --res-fill: var(--res-progress, 0); transition: --res-fill 0.9s var(--tw-ease-drift); }
/* glowing head at the end of the arc */
.score-ring-dot {
  position: absolute; left: 50%; top: 0; width: 12px; height: 12px; margin: -4px 0 0 -6px; border-radius: 50%;
  background: var(--tw-hot); box-shadow: 0 0 0 3px var(--tw-ring), 0 0 14px 4px rgba(125, 249, 255, 0.7);
  transform-origin: 6px calc(var(--ring) / 2 + 4px); transform: rotate(calc(var(--res-fill) * 360deg));
  opacity: 0; transition: opacity var(--tw-dur-fast) ease;
}
.res.is-score .score-ring-dot { opacity: 1; }
/* new best: the full ring lights up in the hype colour */
.res-score.best .score-ring::after { background: conic-gradient(var(--tw-pulse), var(--tw-ring), var(--tw-pulse)); filter: drop-shadow(0 0 10px rgba(255, 95, 210, 0.7)); }
.res-score.best .score-ring-dot { display: none; }

.res .big-score {
  position: relative; font-size: clamp(64px, 21vmin, 132px); font-weight: 900; line-height: 0.95;
  color: var(--tw-score-fg); text-shadow: var(--tw-twin-glow); font-variant-numeric: tabular-nums;
}
.res-score.pop .big-score { animation: scorePop 0.45s var(--tw-ease-orbit); }
.res-score.best .big-score { color: var(--tw-hot); text-shadow: var(--tw-twin-best); }
/* two one-shot rings burst out of the centre (cyan, then hype), never a strobe. No "forwards": held at scale(7) the
   invisible 420px rings kept the screen scrollable (QA r3, 800x450 +9px); afterwards they fall back to opacity 0 at 60px */
.res-score.best::before, .res-score.best::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  border: 3px solid rgba(125, 249, 255, 0.9); opacity: 0; animation: ring var(--tw-dur-ring) ease-out 1; pointer-events: none;
}
.res-score.best::after { border-color: rgba(255, 95, 210, 0.85); animation-delay: 0.15s; }
.res .badge { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); margin: 0; white-space: nowrap; }
.res-score.best .badge { animation: badgeIn 0.5s var(--tw-ease-orbit) both; }
@keyframes scorePop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes ring { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(7); opacity: 0; } }
@keyframes badgeIn { 0% { transform: translateX(-50%) scale(0); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }

/* steps: stats/hint after the score, stardust after that */
.res-stats, .res .hint-line, .res-dust { transition: opacity var(--tw-dur-base) ease, transform var(--tw-dur-base) var(--tw-ease-drift); }
.res:not(.is-score) .res-stats, .res:not(.is-score) .hint-line { opacity: 0; transform: translateY(6px); }
.res:not(.is-dust) .res-dust { opacity: 0; }
.res-ring-slot { display: contents; }
.res-ring-slot + .res-stats { margin-top: 18px; } /* room for the badge hanging on the ring */
.res-stats { font-size: clamp(13px, 2.5vmin, 16px); color: var(--tw-star-2); font-variant-numeric: tabular-nums; }
.res-stats b { color: var(--tw-hot); font-weight: 700; }
.res .hint-line { font-size: clamp(13px, 2.5vmin, 16px); }
.res-dust { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; min-height: 30px; }
.dust-total { display: inline-flex; align-items: center; gap: 6px; font-size: clamp(20px, 4vmin, 26px); font-weight: 800; color: var(--tw-spark); font-variant-numeric: tabular-nums; }
.dust-parts { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dust-part { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 209, 102, 0.14); color: var(--tw-spark-soft); }
.pill { min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); color: inherit; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pill:disabled { opacity: 0.5; cursor: default; }
/* rewarded-ad pill: not green (Poki), clearly marked with 🎬 */
.ad-pill { border-color: var(--tw-ad); background: var(--tw-ad-a18); }
.res .ach-toasts { min-height: 0; gap: 6px; }
/* an unlocked achievement is a hype moment: hype colour, not the currency gold */
.res .ach-chip { background: var(--tw-pulse-a20); border-color: rgba(255, 95, 210, 0.6); animation: chipIn 0.35s var(--tw-ease-orbit) both; }
@keyframes chipIn { from { transform: translateY(8px) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.global-row { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; flex-wrap: wrap; }
.global-row input {
  flex: 1 1 140px; max-width: 200px; min-width: 0; min-height: 36px; padding: 4px 12px; border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); color: inherit;
  font: inherit; font-size: 16px; user-select: text; -webkit-user-select: text; touch-action: manipulation;
}
.global-row input:focus { outline: none; border-color: var(--tw-ring); }
.g-ico { font-size: 18px; }
.g-btn { border-color: var(--tw-spark); color: var(--tw-spark-soft); }
.g-msg { flex-basis: 100%; font-size: 12px; text-align: center; opacity: 0.75; min-height: 0; }
.g-msg:empty { display: none; }
.g-msg.ok { color: var(--tw-shield); opacity: 1; font-weight: 800; font-size: 14px; }
.g-msg.err { color: var(--tw-shard-soft); opacity: 1; }
.link-btn { background: none; border: none; color: rgba(242, 240, 255, 0.6); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }

/* Play again: the only glowing thing on screen, with its orbit ring (2px ring after a 3px vacuum gap) */
.btn.big { width: min(320px, 100%); min-height: var(--tw-btn-h-big); font-size: clamp(19px, 3.8vmin, 24px); }
.res .btn.big { margin-top: 2px; }
.btn.primary.big { animation: orbitBreathe var(--tw-dur-breathe) ease-in-out infinite; }
.btn.primary.big:active { box-shadow: 0 0 0 2px var(--tw-ring), 0 0 18px rgba(125, 249, 255, 0.5); animation: none; }
@keyframes orbitBreathe {
  0%, 100% { box-shadow: 0 0 0 var(--tw-orbit-gap) var(--tw-void), 0 0 0 calc(var(--tw-orbit-gap) + var(--tw-orbit-w)) rgba(125, 249, 255, 0.45), 0 0 18px 4px rgba(125, 249, 255, 0.3); }
  50% { box-shadow: 0 0 0 var(--tw-orbit-gap) var(--tw-void), 0 0 0 calc(var(--tw-orbit-gap) + var(--tw-orbit-w)) rgba(125, 249, 255, 0.8), 0 0 34px 8px rgba(125, 249, 255, 0.45); }
}
@keyframes breathe { 0%, 100% { box-shadow: 0 0 18px rgba(125, 249, 255, 0.35); } 50% { box-shadow: 0 0 34px rgba(125, 249, 255, 0.7); } }

/* secondary actions: round icon buttons, label under the circle (long DE/FR labels wrap instead of clipping) */
.res-actions { display: flex; gap: 4px; justify-content: center; width: 100%; }
/* equal columns when they fit; a column never gets narrower than its longest word (DE "Punktekarte", PT "Compartilhar"),
   the others give way instead. Multi-word labels wrap at spaces; nothing breaks mid-word. */
.act { min-width: min-content; }
.act > span:last-child { max-width: 100%; }
/* the nickname pill can be long (DE "In der Bestenliste als Spieler#1615 · Namen wählen"): wrap inside the screen */
.res .pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.act {
  flex: 1 1 0; max-width: 96px; min-height: 64px; padding: 2px; border: 0; border-radius: var(--tw-r-sm); background: transparent;
  color: var(--tw-star-2); font: inherit; font-size: 12px; font-weight: 700; line-height: 1.2; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px;
}
.act-ico .ico { filter: drop-shadow(1.5px 1.5px 0 rgba(160, 140, 255, 0.55)); }
#btn-share .act-ico .ico { filter: none; }
.act-ico {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid rgba(242, 240, 255, 0.25); background: rgba(21, 18, 58, 0.7);
  font-size: 18px; line-height: 1; color: var(--tw-ring);
  transition: border-color var(--tw-dur-fast) ease, background var(--tw-dur-fast) ease, transform var(--tw-dur-instant) ease;
}
.act:hover .act-ico { border-color: var(--tw-ring); background: var(--tw-ring-a12); }
.act:active .act-ico { transform: scale(var(--tw-press-scale)); }
.act:hover { color: var(--tw-star); }
#btn-share .act-ico { color: var(--tw-ink-cyan); background: var(--tw-ring-grad); border-color: transparent; }
.dust-part { animation: chipIn 0.3s var(--tw-ease-orbit) both; }
.spark-p {
  position: absolute; width: 8px; height: 8px; border-radius: 2px; margin: -4px 0 0 -4px; pointer-events: none; z-index: 3;
  animation: fly 1s cubic-bezier(.15, .7, .3, 1) forwards;
}
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) rotate(540deg) scale(0.4); opacity: 0; } }
/* one soft cyan wash, not a white flash (photosensitivity) */
.flash { animation: flash 0.6s ease-out; }
@keyframes flash { 0% { background-color: rgba(125, 249, 255, 0.18); } 100% { background-color: transparent; } }

/* short portrait (the website's phone iframe: 318x425 .. 388x700): the ring shrinks with the height so the ring, the
   stats, Play again and the secondary row all fit without scrolling; the rest scrolls under the pinned foot */
@media (max-height: 760px) and (max-aspect-ratio: 4/3) {
  .res-screen { padding: 8px 10px 6px; }
  /* the column fills the screen; the ring slot gets whatever height the run's text leaves (QA r3: a fixed 100vh - N
     guess failed whenever a run had an extra hint line or achievement chips) */
  .res { flex: 1 1 auto; min-height: 0; margin: 0; gap: 4px; }
  .res-ring-slot { display: grid; place-items: start center; flex: 1 1 0; min-height: 130px; width: 100%; container-type: size; }
  /* only the ring slot gives way; text rows never shrink below their content (keyboard open, 360x340: the dust row was
     squeezed to 0 and drawn over the rank line and the name box) — too little height scrolls instead */
  .res > :not(.res-ring-slot) { flex-shrink: 0; }
  .res-ring-slot .res-score { --ring: clamp(112px, min(calc(100cqh - 18px), 62vw), 250px); }
  .res .big-score { font-size: calc(var(--ring) * 0.42); }
  .res-ring-slot + .res-stats { margin-top: 0; }
  .res-stats, .res .hint-line { font-size: 13px; }
  .res-dust { min-height: 0; gap: 4px 8px; }
  .dust-total { font-size: 20px; }
  .dust-part { font-size: 11px; padding: 1px 7px; }
  .res .ach-chip { padding: 2px 10px; font-size: 12px; }
  .res .btn.big { min-height: 48px; font-size: 19px; }
  /* backdrop only here: the foot sits on the screen's dark bottom edge, content scrolling under it fades out */
  .res-foot { gap: 6px; padding-top: 14px; background: linear-gradient(to bottom, rgba(8, 7, 20, 0), rgba(8, 7, 20, 0.92) 14px); }
  .act { min-height: 52px; font-size: 11px; gap: 3px; }
  .act-ico { width: 38px; height: 38px; }
}
@media (max-height: 600px) and (max-aspect-ratio: 4/3) { .res-title { display: none; } }
/* very short phones (318x520 iframe, r1.1 worst case: new best + 5 achievements + the longest rank line in id / fr /
   pt-BR): achievement chips and stardust parts each become ONE line that swipes sideways (fade on the right, like the chat
   phrases) instead of wrapping to 2-3 lines. Nothing is hidden for good; centred when they fit (auto margins on the
   first / last chip), scrolling from the start when they do not (no chip cut off on the left). */
@media (max-height: 600px) and (max-aspect-ratio: 4/3) {
  .res .ach-toasts, .res .dust-parts {
    flex-wrap: nowrap; justify-content: flex-start; width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain;
    touch-action: pan-x pan-y; scrollbar-width: none; padding: 1px 2px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent);
  }
  .res .res-dust { width: 100%; max-width: 100%; }
  .res .dust-parts { flex: 1 1 100%; min-width: 0; } /* a flex item: without min-width 0 its one-line content widened the row */
  .res .ach-toasts::-webkit-scrollbar, .res .dust-parts::-webkit-scrollbar { display: none; }
  .res .ach-toasts > *, .res .dust-parts > * { flex: none; white-space: nowrap; }
  .res .ach-toasts > :first-child, .res .dust-parts > :first-child { margin-left: auto; }
  .res .ach-toasts > :last-child, .res .dust-parts > :last-child { margin-right: auto; }
}

/* short landscape (phones, 800x450 iframes): ring on the left, everything else on the right */
@media (max-height: 560px) and (min-aspect-ratio: 4/3) {
  .res-screen { padding-top: 8px; padding-bottom: 8px; }
  .res { --ring: min(62vh, 230px); gap: 4px; }
  .res .big-score { font-size: clamp(44px, 15vh, 76px); }
  .res-title { display: none; }
  .act { min-height: 56px; }
  .act-ico { width: 40px; height: 40px; }
}
/* short landscape AND desktop up to 860px tall (site frame 1138x578 / 1138x639, QA r3; 1280x800 worst case +7px, r1.1): the stacked column is ~680-810px tall and the
   pinned foot covered the name chip and the global rank, so these heights also use the side-by-side layout */
@media (max-height: 860px) and (min-aspect-ratio: 4/3) and (min-height: 561px) {
  .res { --ring: min(56vh, 300px); }
}
@media (max-height: 860px) and (min-aspect-ratio: 4/3) {
  .res { width: min(800px, 100%); display: grid; grid-template-columns: auto minmax(0, 420px); justify-content: center; column-gap: 28px; align-items: center; justify-items: center; }
  .res > * { grid-column: 2; }
  .res .res-score { grid-column: 1; grid-row: 1 / span 8; }
  .res-ring-slot + .res-stats { margin-top: 0; }
}
/* very short landscape (800x450 window, the site's 758x308 iframe; QA 3a r1.1): with a new best, 5 achievements and the
   longest rank line (pt-BR / fr) the right column was 357px in a 308px frame and Play again covered the name chip.
   Space comes from the layout, not a vh guess: a narrower ring gives the text column more width (fewer wrapped lines),
   and the foot becomes ONE row (Play again + the five round actions side by side: ~56px instead of ~125px). */
@media (max-height: 560px) and (min-aspect-ratio: 4/3) {
  .res { --ring: min(54vh, 210px); width: min(900px, 100%); grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; gap: 3px; }
  .res-stats, .res .hint-line { font-size: 12.5px; }
  .res-dust { min-height: 0; gap: 3px 8px; }
  .dust-total { font-size: 18px; }
  .dust-part { font-size: 11px; padding: 1px 7px; }
  .res .ach-chip { padding: 2px 9px; font-size: 11.5px; }
  .res .ach-toasts { gap: 4px; max-width: none; }
  .res .g-msg { font-size: 13px; }
  .res .name-chip { font-size: 12.5px; padding: 4px 12px; min-height: 0; }
  .res-foot { flex-direction: row; justify-content: center; align-items: center; gap: 8px; padding: 6px 0 0; }
  .res .btn.big { width: auto; flex: 0 1 190px; min-width: 120px; min-height: 48px; padding: 0 14px; font-size: 18px; margin: 0; }
  .res-actions { width: auto; flex: 0 1 auto; gap: 2px; }
  .act { flex: 0 0 auto; min-height: 48px; min-width: 48px; max-width: none; padding: 2px 3px; font-size: 10.5px; gap: 2px; }
  .act-ico { width: 34px; height: 34px; }
}

/* live line on the start screen (own website): real players online + latest real event */
.live-line { font-size: clamp(12px, 2.3vmin, 14px); font-weight: 700; color: var(--tw-live); max-width: 34em; white-space: pre-wrap; }
/* nickname chip under the results: gentle, non-blocking prompt for guests */
.name-chip { border-color: rgba(125, 249, 255, 0.55); color: var(--tw-ring-pale); }
.name-chip.prompt { animation: breathe 2.4s ease-in-out infinite; }
.name-edit { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.name-edit.hidden { display: none; }
.g-note { flex-basis: 100%; font-size: 12px; text-align: center; opacity: 0.7; }
.g-note:empty { display: none; }
.global-board { margin-bottom: 4px; }
.lb-opt { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 14px; margin: 10px 0 0; cursor: pointer; }
.lb-opt input { width: 20px; height: 20px; flex: none; accent-color: var(--tw-ring); }
/* secondary info: small and quiet, still selectable (players copy it for deletion requests) */
#lb-id { font-size: 11px; line-height: 1.5; opacity: 0.55; margin-top: 2px; word-break: break-all; user-select: text; -webkit-user-select: text; }

/* records panel: three clear sections (world board / my top 10 / achievements) with a divider and one heading level */
.rec-sec h3 { font-size: 17px; font-weight: 800; margin: 0 0 10px; opacity: 1; }
.rec-sec:not(.hidden) ~ .rec-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.rec-body { padding-top: 16px; padding-bottom: 20px; }

/* TSLBoard spacing. style.css starts with `* { margin: 0; padding: 0 }`, which has the same zero specificity as the
   widget's :where() defaults and comes later, so it erased every padding/margin of the board (rows were 18px tall and
   the "you" outline cut the rank). Restored here with plain .tslb selectors — tsl-board.js itself is untouched. */
.tslb { --tslb-row-pad: 10px 12px; }
.tslb .tslb-head { margin-bottom: 10px; }
.tslb .tslb-title { font-size: 17px; }
.tslb .tslb-live { padding: 3px 9px; }
.tslb .tslb-tabs { padding: 3px; margin-bottom: 0; }
.tslb .tslb-tab { padding: 8px 6px; min-height: 36px; }
/* room between the tabs and the podium: the 👑 (top -20px) and the #1 glow never touch the tabs */
.tslb .tslb-podium { margin: 34px 0 14px; }
.tslb .tslb-pod { gap: 4px; }
.tslb .tslb-list { gap: 6px; }
.tslb .tslb-row { padding: var(--tslb-row-pad); }
.tslb .tslb-gap { margin: 2px 0; }
.tslb .tslb-empty { padding: 22px 10px; }
.tslb .tslb-msg { padding: 14px; }

/* ---------- style system: tabs, loadout preview, NEW dots, guide ---------- */
.style-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); flex: 1; margin-right: 10px; }
.style-tabs button, .cat-tabs button {
  position: relative; flex: 1; border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 800;
  padding: 7px 8px; border-radius: 999px; cursor: pointer; opacity: 0.7;
}
/* narrow phones (r12, de 360): the three tab labels + the 46px close button used to need ~16px more than the header had,
   so the close button was cut by the panel edge. The tab strip may shrink (min-width 0), labels get tighter; the close
   button never shrinks (.icon-btn flex: none). */
.style-tabs { min-width: 0; }
.style-tabs button { min-width: 0; }
@media (max-width: 420px) {
  .panel-box header { padding: 8px 8px 8px 10px; }
  .style-tabs { margin-right: 6px; gap: 2px; }
  .style-tabs button { flex: 1 1 auto; font-size: 13px; padding: 7px 6px; }
  .style-tabs .has-new::after { top: 1px; right: 2px; }
}
@media (max-width: 340px) {
  .style-tabs button { font-size: 12px; padding: 7px 3px; letter-spacing: -0.01em; }
}
.style-tabs button.active, .cat-tabs button.active { background: linear-gradient(180deg, var(--tw-ring-hi), var(--tw-ring-lo)); color: var(--tw-ink-cyan); opacity: 1; }
.has-new::after { content: ''; position: absolute; top: 4px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--tw-pulse); box-shadow: 0 0 6px var(--tw-pulse); }
.cat-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); margin-bottom: 10px; }
.new-dot {
  position: absolute; top: 4px; right: 4px; font-size: 9px; font-weight: 900; padding: 1px 5px; border-radius: 999px;
  background: var(--tw-pulse); color: var(--tw-ink); box-shadow: 0 0 8px rgba(255, 95, 210, 0.7); letter-spacing: 0.04em; /* NEW = hype, not danger: ink on pulse 7.22:1 (white on shard was 3.1:1) */
}
.coll-item, .tile { position: relative; }
.loadout-cv { width: 44px; height: 44px; }
.coll-detail { justify-content: flex-start; }
.detail-cv { width: 96px; height: 96px; flex: none; }
.detail-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 140px; }
.detail-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.coll-detail .btn.small { min-width: 0; min-height: 38px; font-size: 14px; }
.equipped-view { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.equipped-big { width: 180px; height: 180px; }
.equipped-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.equipped-card canvas { width: 64px; height: 64px; flex: none; border-radius: 50%; outline: 1.5px solid rgba(160, 140, 255, 0.35); outline-offset: -1.5px; }
.equipped-card > div { flex: 1; font-size: 14px; }
.equipped-card small { opacity: 0.6; }
.equipped-card .btn.small { min-width: 0; min-height: 36px; font-size: 13px; padding: 4px 12px; }
.cap-hint { font-size: 13px; text-align: center; color: var(--tw-core-hi); min-height: 0; }
.cap-hint:empty { display: none; }
.cap-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 4px; width: 100%; }
.cap-actions.hidden { display: none; }
.btn.big-equip { width: min(280px, 100%); min-height: 50px; font-size: 19px; }
.guide {
  width: min(380px, 100%); padding: 10px 14px; border-radius: 14px; text-align: left;
  background: rgba(255, 209, 102, 0.1); border: 1px solid rgba(255, 209, 102, 0.55);
}
.guide b { color: var(--tw-spark); font-size: 15px; }
.guide-steps { margin: 4px 0 6px 1.3em; font-size: 13px; line-height: 1.5; }
.guide-btns { display: flex; align-items: center; gap: 12px; }
.guide .btn.small { min-height: 36px; font-size: 14px; }
.guide-pulse { animation: guidePulse 1.4s ease-in-out infinite; }
@keyframes guidePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.7); } 50% { box-shadow: 0 0 0 8px rgba(255, 209, 102, 0); } }
@media (max-height: 560px) { .guide-steps { display: none; } .guide { padding: 6px 10px; } }

/* share panel */
.share-text { font-size: 14px; line-height: 1.45; opacity: 0.9; max-width: 30em; margin-bottom: 4px; user-select: text; -webkit-user-select: text; word-break: break-all; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; margin: 6px 0; }
.sh {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05); color: inherit; font: inherit;
  font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.sh i { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 900; font-size: 16px; color: var(--tw-hot); } /* platform brand letters (ART-DIRECTION §12.4 exception) */
.sh:hover { background: rgba(255, 255, 255, 0.12); }
#share-social { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#share-social.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

.global-box { width: min(420px, 100%); }
.global-row { display: flex; gap: 8px; }
.global-row input {
  flex: 1; min-width: 0; min-height: 42px; padding: 6px 14px; border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); color: inherit;
  font: inherit; font-size: 16px; user-select: text; -webkit-user-select: text; touch-action: manipulation;
}
.global-row input:focus { outline: none; border-color: var(--tw-ring); }
.btn.small { min-width: 0; min-height: 42px; padding: 6px 16px; font-size: 15px; }
.note.center { text-align: center; }
.note.ok { color: var(--tw-shield); opacity: 1; font-weight: 700; }
.note.err { color: var(--tw-shard-soft); opacity: 1; }
.tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.tab { padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.tab.active { background: rgba(125, 249, 255, 0.18); border-color: var(--tw-ring); }

.share-box { width: min(440px, 100%); }
/* width also capped by the height left after header + save button, so the 4:5 card (1080x1350) fits short landscape */
.share-img { width: min(320px, 70vmin, calc((100dvh - 230px) * 0.8)); min-width: 160px; height: auto; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); user-select: auto; -webkit-user-select: auto; -webkit-touch-callout: default; }

.toast {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: 8px 16px; border-radius: 999px; background: rgba(21, 18, 58, 0.95); border: 1px solid rgba(255, 209, 102, 0.6);
  font-size: 14px; font-weight: 700; z-index: 20; pointer-events: none;
}

/* loading: the game's own mark instead of a generic spinner (BACKLOG (b)) — two rings, the orb orbiting the inner one.
   Same drawing as the favicon and the store icons; static with reduced motion. */
.spinner {
  position: relative; width: 72px; height: 72px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(242, 240, 255, 0.16);
}
.spinner::before { content: ''; position: absolute; inset: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px rgba(125, 249, 255, 0.55); }
.spinner::after {
  content: ''; position: absolute; left: 30px; top: 8px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--tw-hot); box-shadow: 0 0 0 3px var(--tw-ring), 0 0 14px 4px rgba(125, 249, 255, 0.7);
  transform-origin: 6px 28px; animation: spin 1.1s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .spinner::after { animation: none; transform: rotate(35deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes reveal { 0% { transform: scale(0.3) rotate(-30deg); opacity: 0; } 70% { transform: scale(1.15) rotate(6deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.reveal { animation: reveal 0.55s ease-out; }

/* TSLBoard skin — Twinring's own look: the two rings (cyan outer, violet core) */
.tslb{--tslb-accent:var(--tw-ring);--tslb-accent-2:var(--tw-core);--tslb-accent-ink:var(--tw-void);--tslb-me:var(--tw-ring);--tslb-me-bg:rgba(125,249,255,.14);--tslb-track:rgba(160,140,255,.12);--tslb-row-bg:rgba(160,140,255,.06);--tslb-row-alt:rgba(125,249,255,.06)}
/* planets, not medals (BACKLOG #3): #1 = white-hot planet with a tilted cyan orbit ring (replaces the 👑 emoji),
   #2 = ring-cyan planet, #3 = core-violet planet; numbers in ink. Scores are white — gold is the currency only.
   Live icons are CSS (no emoji): a glowing dot for "playing now", a small ring for "runs today". */
.tslb { --tslb-score: var(--tw-star); --tslb-live-fg: var(--tw-live); --tslb-live-bg: rgba(157, 255, 192, 0.10); --tslb-gold-1: var(--tw-ring); }
.tslb .tslb-live-ico { width: 8px; height: 8px; border-radius: 50%; vertical-align: 0.05em; }
.tslb .tslb-live-ico[data-kind="online"] { background: var(--tw-live); box-shadow: 0 0 0 3px rgba(157, 255, 192, 0.18), 0 0 8px var(--tw-live); }
.tslb .tslb-live-ico[data-kind="runs"] { box-shadow: inset 0 0 0 2px var(--tw-live); }
.tslb .tslb-live-ico[data-kind]::before { content: none; }
.tslb .tslb-podium { margin: 22px 0 14px; }
.tslb .tslb-medal { color: var(--tw-ink); font-family: var(--tw-font-display); }
.tslb .tslb-p1 .tslb-medal {
  background: radial-gradient(circle at 35% 30%, var(--tw-hot), var(--tw-ring-pale) 40%, var(--tw-ring) 70%, var(--tw-ring-lo));
  box-shadow: 0 0 18px rgba(125, 249, 255, 0.55), 0 0 42px rgba(125, 249, 255, 0.22);
}
.tslb .tslb-p1 .tslb-medal::before { content: none; }
.tslb .tslb-p1 .tslb-medal::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 96px; height: 26px; margin: -13px 0 0 -48px; border-radius: 50%;
  border: 2px solid rgba(125, 249, 255, 0.75); border-top-color: transparent; transform: rotate(-18deg); pointer-events: none;
}
.tslb .tslb-p2 .tslb-medal { background: radial-gradient(circle at 35% 30%, var(--tw-ring-mist), var(--tw-ring) 55%, var(--tw-ring-lo)); box-shadow: 0 0 12px rgba(125, 249, 255, 0.35); }
.tslb .tslb-p3 .tslb-medal { background: radial-gradient(circle at 35% 30%, var(--tw-core-mist), var(--tw-core-hi) 50%, var(--tw-core-lo)); box-shadow: 0 0 12px rgba(160, 140, 255, 0.4); }
.tslb .tslb-pod.tslb-open .tslb-medal::after { content: none; }
.tslb .tslb-block { background: linear-gradient(180deg, rgba(160, 140, 255, 0.22), rgba(160, 140, 255, 0.03)); }
.tslb .tslb-p1 .tslb-block { background: linear-gradient(180deg, rgba(125, 249, 255, 0.28), rgba(125, 249, 255, 0.03)); box-shadow: inset 0 2px 0 rgba(125, 249, 255, 0.6); }
.tslb .tslb-pscore { color: var(--tw-star); }
.tslb .tslb-p1 .tslb-pscore { color: var(--tw-ring); text-shadow: 0 0 10px rgba(125, 249, 255, 0.45); }
.tslb .tslb-sc { color: var(--tw-star); }
.tslb .tslb-row.tslb-me .tslb-sc { color: var(--tw-ring); }
.tslb .tslb-empty-ico { background: radial-gradient(circle, rgba(125, 249, 255, 0.22), transparent 70%); }
@media (prefers-reduced-motion: reduce) { .tslb .tslb-p1 .tslb-medal { animation: none; } }

/* ---------- scores held for review (Records > world leaderboard; only while a run is being checked) ----------
   an instrument readout: score in the ring colour, status as a small pill — pending = violet, approved = shield green,
   rejected = muted (never red: a held score is not the player's fault). */
.review-box { margin-top: 14px; padding: 12px; border-radius: var(--tw-r-md, 16px); background: rgba(160, 140, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(160, 140, 255, 0.22); }
.review-box h4 { font-size: 14px; font-weight: 800; margin-bottom: 8px; color: var(--tw-core-hi); }
.review-list { list-style: none; display: grid; gap: 6px; margin-bottom: 6px; }
.review-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 6px 8px 6px 14px; border-radius: 999px; background: rgba(11, 10, 28, 0.6); font-size: 13px; }
.review-list li b { font-size: 16px; font-weight: 800; color: var(--tw-ring); font-variant-numeric: tabular-nums; }
.review-list li span { padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; background: var(--tw-core-a12); color: var(--tw-core-hi); }
.review-list .review-approved span { background: rgba(125, 255, 207, 0.14); color: var(--tw-shield); }
.review-list .review-rejected span { background: rgba(242, 240, 255, 0.08); color: var(--tw-star-3); }
.review-box .note { margin-top: 4px; }

/* ---------- quick chat (TSLChat skin; own website only) ----------
   messages = quiet bubbles; yours outlined in ring cyan; leaderboard system lines in hype magenta (never gold: gold is
   the currency). The 30 preset phrases sit in their 5 groups, each ONE horizontally scrolling row of 44px chips with a
   fade on the right edge — about 260px instead of a whole phone screen. */
.chat-box { min-height: 0; }
.tslc {
  --tslc-fg: var(--tw-star); --tslc-radius: 14px; --tslc-bubble: rgba(160, 140, 255, 0.10); --tslc-me: rgba(125, 249, 255, 0.12);
  --tslc-sys: rgba(255, 95, 210, 0.12); --tslc-sys-fg: var(--tw-pulse-soft); --tslc-chip: rgba(160, 140, 255, 0.12); --tslc-chip-hover: rgba(125, 249, 255, 0.16);
  --tslc-muted: 0.62; --tslc-list-h: clamp(120px, 30vh, 300px);
}
.tslc .tslc-list { padding: 2px 2px 4px; scrollbar-width: thin; scrollbar-color: rgba(160, 140, 255, 0.35) transparent; }
.tslc .tslc-msg { font-size: 14px; }
.tslc .tslc-msg.tslc-me { box-shadow: inset 0 0 0 1.5px rgba(125, 249, 255, 0.55); }
.tslc .tslc-name { color: var(--tw-core-hi); }
.tslc .tslc-msg.tslc-me .tslc-name { color: var(--tw-ring); }
.tslc .tslc-msg.tslc-sys .tslc-name { color: var(--tw-pulse); }
.tslc .tslc-hide { min-height: 32px; }
.tslc .tslc-pick { gap: 6px; padding-top: 10px; border-top: 1px solid rgba(160, 140, 255, 0.18); }
.tslc .tslc-pick-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: var(--tw-star-3); opacity: 1; }
.tslc .tslc-group {
  flex-wrap: nowrap; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; touch-action: pan-x pan-y;
  scroll-snap-type: x proximity; scrollbar-width: none; padding: 1px 28px 1px 1px; margin-right: -2px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.tslc .tslc-group::-webkit-scrollbar { display: none; }
.tslc .tslc-chip { flex: none; min-height: 44px; padding: 8px 14px; font-size: 14px; font-weight: 700; white-space: nowrap; scroll-snap-align: start; box-shadow: inset 0 0 0 1px rgba(160, 140, 255, 0.25); }
.tslc .tslc-chip:hover { box-shadow: inset 0 0 0 1.5px var(--tw-ring); }
.tslc .tslc-chip:focus-visible { outline: 3px solid var(--tw-ring); outline-offset: 1px; }
.tslc .tslc-chip:active:not([disabled]) { transform: scale(var(--tw-press-scale)); }
.tslc .tslc-status { color: var(--tw-core-hi); opacity: 1; font-weight: 700; }
.tslc .tslc-note { font-size: 11px; }
@media (max-height: 600px) { .tslc { --tslc-list-h: clamp(90px, 24vh, 200px); } .tslc .tslc-chip { min-height: 40px; padding: 6px 12px; } }

/* ---------- Turnstile human check: appears only when Cloudflare needs an interaction (body > .tsl-human) ----------
   floats above the game at the bottom centre, never covers the top bar; no box of its own, so an invisible check
   leaves nothing on screen. */
.tsl-human { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 20px); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 1px rgba(125, 249, 255, 0.6)); }

/* leaderboard "you" row outside the top 10 ("你：第 24 名 · 玩家#1008"): two lines instead of an ellipsis (QA 2026-12-02) */
.tslb .tslb-row.tslb-me .tslb-nm {
  white-space: normal; overflow-wrap: anywhere; line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
