/* Compute Runner · boxd
   zinc ink and paper, coral for threats, sage for safe and running.
   display: Doto (dot matrix, like the LEDs on a rack). text: JetBrains Mono.
   rule of the page: the game talks, the page whispers. */

:root {
  --bg: #07070b;
  --panel: rgba(17, 17, 24, 0.72);
  --panel-solid: #111118;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #6b6b75;
  --coral: #e05a6d;
  --coral-soft: #e8798a;
  --coral-glow: rgba(224, 90, 109, 0.35);
  --sage: #7db89e;
  --gold: #f9e2af;
  --display: 'Doto', 'JetBrains Mono', ui-monospace, monospace;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --radius: 22px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* fullscreen hides the scrollbar, keep its room so the card does not shift */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 50% -120px, rgba(88, 80, 140, 0.16), transparent 70%),
    radial-gradient(900px 480px at 85% 108%, rgba(224, 90, 109, 0.08), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--mono);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration-color: rgba(244, 244, 245, 0.3);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--coral);
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 6px;
}

kbd {
  display: inline-block;
  font: 700 0.85em/1 var(--mono);
  padding: 0.38em 0.6em 0.32em;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  background: linear-gradient(#1c1c25, #121219);
  color: var(--text);
  text-transform: lowercase;
}

h2 {
  margin: 0;
  font: 900 clamp(22px, 2.4vw, 30px) / 1 var(--display);
  letter-spacing: -0.02em;
}

h3 {
  margin: 0;
}

.fine {
  margin: 0;
  color: var(--dim);
  font-size: 11px;
}

.label {
  margin: 0;
  font: 700 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-1%, 3%); }
  80% { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ── header ─────────────────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 0;
  background: linear-gradient(rgba(7, 7, 11, 0.9), rgba(7, 7, 11, 0));
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* an anon player's rank, above everything: "#2 today, as anon" and a way to claim it */
.banner {
  position: relative;
  z-index: 21;
  border-bottom: 1px solid rgba(249, 226, 175, 0.28);
  background: linear-gradient(90deg, #2b2412, #15130e 70%);
  animation: fade-in 0.4s ease both;
}

.banner[hidden] {
  display: none;
}

.banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px var(--gutter);
}

.banner-rank {
  flex: none;
  font: 900 28px/1 var(--display);
  color: var(--gold);
}

.banner-rank[hidden] {
  display: none;
}

.banner-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
}

.banner-text small {
  color: var(--muted);
  font-size: 11.5px;
}

.banner-btn {
  flex: none;
  padding: 10px 16px;
}

/* the details sheet the banner opens: a card in the middle, a sheet from the bottom on phones */
.claim {
  width: min(420px, calc(100% - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.claim::backdrop {
  background: rgba(3, 3, 6, 0.62);
  backdrop-filter: blur(3px);
}

.claim-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 22px 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(249, 226, 175, 0.3);
  background:
    linear-gradient(rgba(249, 226, 175, 0.07), transparent 140px),
    var(--panel-solid);
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.85);
  animation: slam 0.36s var(--ease-out) both;
}

.claim-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
}

.claim-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.claim-title {
  margin: 0;
  font: 900 26px/1.1 var(--display);
}

.claim-lead {
  margin: 0 36px 10px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.claim-card input[hidden],
.claim-card [hidden] {
  display: none;
}

.claim-hint {
  margin: -2px 2px 6px;
  color: var(--gold);
  font-size: 11px;
}

.claim-hint a {
  color: inherit;
  text-underline-offset: 3px;
}

.claim-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 6px;
  font-size: 11px;
}

.claim-foot .link-btn[hidden] {
  display: none;
}

.claim-save {
  padding: 13px;
  font-size: 14px;
}

.claim .form-error {
  margin: 0;
}

/* boot screen, played by js/ui/intro.js on every load */
.intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  transition: opacity 0.4s ease;
  /* if the script never runs, get out of the way on its own */
  animation: intro-out 0.4s 4s forwards;
}

.intro.is-out {
  opacity: 0;
}

.intro canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro-by {
  position: absolute;
  top: 60%;
  left: 0;
  right: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 400 14px/1 var(--mono);
  color: var(--muted);
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}

.intro-by svg {
  width: 15px;
  height: 15px;
  fill: var(--text);
}

.intro-by b {
  color: var(--text);
  font-weight: 500;
}

.intro.is-by .intro-by {
  opacity: 1;
  transform: none;
}

@keyframes intro-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro {
    display: none;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 500 19px/1 var(--mono);
}

.brand-mark {
  width: 22px;
  height: 22px;
  fill: var(--text);
}

/* icon keys (sound, leave fullscreen): frosted fill, no outline */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound,
.me-btn,
.is-immersive .exit {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s var(--ease-out);
}

@media (hover: hover) {
  .sound:hover,
  .me-btn:hover,
  .exit:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
  }
}

.sound:active,
.me-btn:active,
.exit:active {
  transform: scale(0.92);
}

/* your details: a person, and your name once you gave one. not `.me`, that is your row on the board */
.me-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.me-btn.has-name {
  grid-auto-flow: column;
  gap: 7px;
  width: auto;
  max-width: 180px;
  padding: 0 13px 0 11px;
  color: var(--text);
}

.me-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 12.5px/1 var(--mono);
}

.me-btn:not(.has-name) .me-name {
  display: none;
}

.sound-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
}

.sound-bars i {
  width: 2px;
  height: 100%;
  background: var(--sage);
  border-radius: 1px;
  transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
}

.sound-bars i:nth-child(2) { animation-delay: -0.3s; }
.sound-bars i:nth-child(3) { animation-delay: -0.6s; }
.sound-bars i:nth-child(4) { animation-delay: -0.15s; }

.sound[aria-pressed='false'] .sound-bars i {
  animation: none;
  transform: scaleY(0.25);
  background: var(--dim);
}

@keyframes eq {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* ── hero ───────────────────────────────────────────────────────────── */

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hero-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: clamp(4px, 1.5vw, 18px) 0 clamp(18px, 2.2vw, 26px);
  animation: rise 0.7s var(--ease-out) both;
}

.title {
  margin: 0;
  font: 900 clamp(42px, 6.2vw, 92px) / 0.9 var(--display);
  letter-spacing: -0.035em;
  white-space: nowrap;
  text-shadow:
    0 0 18px rgba(244, 244, 245, 0.26),
    0 0 60px rgba(224, 90, 109, 0.16);
  animation: flicker 6s 1s infinite;
}

@keyframes flicker {
  0%, 94%, 100% { opacity: 1; }
  95% { opacity: 0.6; }
  96% { opacity: 1; }
  97.5% { opacity: 0.75; }
  98.5% { opacity: 1; }
}

.tagline {
  margin: 0;
  font-size: clamp(13px, 1.4vw, 16px);
  color: var(--muted);
}

.tagline b {
  font-weight: 500;
  color: var(--gold);
}

/* the stage is cut into the boxd mark: rounded card, notch bottom left */
.stage-zone {
  position: relative;
}

.stage-wrap {
  position: relative;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55));
  animation: rise 0.9s 0.12s var(--ease-out) both;
}

.stage {
  position: relative;
  aspect-ratio: 600 / 230;
  border-radius: var(--radius);
  overflow: hidden;
  background: #05050a;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-edge {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.stage-edge path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

/* fullscreen while a run is on (js/ui/immersive.js): the stage takes the
   whole viewport, the page waits behind a veil */
.veil,
.exit {
  display: none;
}

.is-immersive,
.is-immersive body {
  overflow: hidden;
  overscroll-behavior: none;
}

.is-immersive .veil {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 34;
  background: var(--bg);
  animation: fade-in 0.45s ease both;
}

.is-immersive .stage-wrap {
  position: fixed;
  inset: 0;
  z-index: 35;
  filter: none;
  transform-origin: 0 0;
}

.is-immersive .stage {
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  touch-action: none;
}

.is-immersive .stage canvas {
  object-fit: contain;
}

.is-immersive .stage-edge {
  opacity: 0;
}

.is-immersive .exit {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  z-index: 2;
  animation: fade-in 0.3s 0.5s ease both;
}

.exit svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* touch: duck and fork sit on the sand, under the thumbs */
.is-immersive .pad {
  position: fixed;
  left: calc(16px + env(safe-area-inset-left));
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 36;
  margin: 0;
  animation: fade-in 0.3s 0.4s ease both;
}

/* phones on their side: one button per thumb, the middle stays clear */
@media (pointer: coarse) and (max-height: 500px) {
  .is-immersive .pad {
    justify-content: space-between;
  }

  .is-immersive .duck,
  .is-immersive .power {
    flex: 0 0 30%;
    height: 48px;
    opacity: 0.88;
  }
}

.is-immersive .incident[open] {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: flex;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  overflow-y: auto;
}

.is-immersive .incident-card {
  width: min(700px, 100%);
  margin: auto;
}

/* on the way out the page comes back while the stage shrinks into its card */
.is-leaving .veil {
  animation: fade-out 0.45s ease both;
}

.is-leaving .exit,
.is-leaving .incident {
  display: none;
}

.is-leaving .pad {
  visibility: hidden;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
  pointer-events: none;
  background: radial-gradient(55% 65% at 50% 45%, rgba(5, 5, 10, 0.5), transparent 75%);
  transition: opacity 0.25s ease;
}

.overlay[hidden] {
  display: grid;
  opacity: 0;
  visibility: hidden;
}

/* a runner just picked, powering up in front of the page (ui/pickscreen.js) */
.pickscreen {
  --aura: #f4f4f5;
  position: fixed;
  inset: 0;
  z-index: 60;
  background:
    radial-gradient(circle at 50% 54%, color-mix(in srgb, var(--aura) 16%, transparent), transparent 42%),
    radial-gradient(circle at 50% 54%, rgba(24, 20, 32, 0.9), rgba(7, 7, 11, 0.96) 72%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  animation: fade-in 0.16s ease both;
}

.pickscreen[hidden] {
  display: none;
}

.pickscreen.is-leaving {
  opacity: 0;
  transition: opacity 0.26s ease;
}

.pickscreen canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pick-title {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(56% + min(10vh, 9vw));
  text-align: center;
  pointer-events: none;
}

.pick-name,
.pick-trick {
  margin: 0;
  opacity: 0;
}

.pick-name {
  font: 900 clamp(44px, 8vw, 112px) / 1 var(--display);
  color: var(--text);
  text-shadow:
    0 0 26px var(--aura),
    0 4px 0 rgba(0, 0, 0, 0.5);
}

.pick-trick {
  margin-top: 10px;
  font: 900 clamp(16px, 2.2vw, 28px) / 1 var(--display);
  letter-spacing: 0.08em;
  color: var(--gold);
}

/* the burst: the name slams in, its signature under it */
.pickscreen.is-named .pick-name {
  animation: pick-slam 0.32s var(--ease-out) both;
}

.pickscreen.is-named .pick-trick {
  animation: pick-show 0.3s 0.18s ease both;
}

/* both start hidden (opacity 0), so their animations say where they end */
@keyframes pick-show {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes pick-slam {
  0% {
    opacity: 0;
    transform: scale(2.4);
  }
  60% {
    opacity: 1;
    transform: scale(0.94);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pickscreen.is-named .pick-name {
    animation: pick-show 0.2s ease both;
  }
}

.start-cta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font: 900 clamp(22px, 3.4vw, 44px) / 1 var(--display);
  letter-spacing: -0.02em;
}

.start-cta kbd {
  font-size: clamp(14px, 1.6vw, 20px);
  animation: tap 1.4s ease-in-out infinite;
}

@keyframes tap {
  0%, 55%, 100% { transform: translateY(0); border-bottom-width: 3px; }
  65% { transform: translateY(2px); border-bottom-width: 1px; }
}

.start-keys {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(13px, 1.4vw, 16px);
  color: var(--text);
}

.start-keys kbd {
  font-size: clamp(12px, 1.3vw, 15px);
  padding: 0.3em 0.5em 0.25em;
  margin-left: 6px;
}

.start-best {
  margin: 0;
  font: 900 14px/1 var(--display);
  color: var(--gold);
}

.pad,
.duck,
.power {
  display: none;
}

.start-power {
  margin-left: 4px;
}

/* ── roster ─────────────────────────────────────────────────────────── */

.roster-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
}

.roster {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 10px 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.25s var(--ease-out),
    border-color 0.2s ease,
    box-shadow 0.25s ease;
  animation: rise 0.6s var(--ease-out) both;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
}

.card[aria-checked='true'] {
  border-color: var(--accent, var(--text));
  box-shadow:
    0 0 0 1px var(--accent, var(--text)),
    0 18px 40px -20px var(--accent, var(--text));
}

/* picked: the card flares in its colour while the runner powers up on the stage */
.card.flare {
  animation: card-flare 0.9s var(--ease-out);
}

.card.flare .card-preview {
  animation: card-flash 0.9s ease-out;
}

@keyframes card-flare {
  0% {
    transform: scale(1);
  }
  12% {
    transform: scale(0.96);
  }
  40% {
    transform: scale(1.05);
    box-shadow:
      0 0 0 2px var(--accent, var(--text)),
      0 0 46px 6px var(--accent, var(--text));
  }
  100% {
    transform: scale(1);
  }
}

@keyframes card-flash {
  0%,
  100% {
    filter: none;
  }
  38% {
    filter: brightness(1.9) saturate(1.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card.flare,
  .card.flare .card-preview {
    animation: none;
  }
}

.card-preview {
  position: relative;
  aspect-ratio: 5 / 3;
  border-radius: 11px;
  overflow: hidden;
  background:
    radial-gradient(70% 90% at 50% 110%, rgba(224, 90, 109, 0.1), transparent 70%),
    linear-gradient(#0b0a14, #16141f);
}

.card-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.card-key {
  position: absolute;
  top: 7px;
  left: 7px;
  font: 700 10px/1 var(--mono);
  color: var(--dim);
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
}

.card-name {
  margin: 0 2px;
  font: 700 15px/1.1 var(--mono);
}

.stats {
  display: grid;
  gap: 5px;
  margin: 0 2px;
  padding: 0;
  list-style: none;
}

.stat {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: help;
}

.bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  height: 7px;
}

.bar i {
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.07);
}

.bar i.on {
  background: var(--accent, var(--text));
  box-shadow: 0 0 6px -1px var(--accent, var(--text));
  animation: seg 0.35s var(--ease-out) both;
}

@keyframes seg {
  from { transform: scaleY(0.2); opacity: 0; }
}

/* ── leaderboard and threats ─────────────────────────────────────────── */

.lower {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-top: 48px;
  align-items: start;
}

.panel {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* best run / time played: the board's title doubles as its switch */
.kinds {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.kinds button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font: 900 clamp(20px, 2.2vw, 28px) / 1 var(--display);
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: color 0.2s;
}

.kinds button[aria-selected='true'] {
  color: var(--text);
}

@media (hover: hover) {
  .kinds button[aria-selected='false']:hover {
    color: var(--muted);
  }
}

.tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.tabs button {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.tabs button[aria-selected='true'] {
  background: var(--text);
  color: #0a0a0f;
  font-weight: 700;
}

.board-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  margin: 14px 0 10px;
}

.prize-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font: 900 14px/1 var(--display);
  color: var(--gold);
  padding: 6px 8px 5px;
  border-radius: 8px;
  background: rgba(249, 226, 175, 0.07);
  border: 1px solid rgba(249, 226, 175, 0.18);
  white-space: nowrap;
}

.chip small {
  font: 400 10px var(--mono);
  color: var(--dim);
}

.board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  min-height: 120px;
  /* rows keep their height, one runner on the board is not one tall slab */
  align-content: start;
}

.row {
  display: grid;
  /* the avatar column fits the widest stack of runners on the board (board.js --stack) */
  grid-template-columns: 30px calc(30px + (var(--stack, 1) - 1) * 18px) 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  animation: rise 0.35s var(--ease-out) both;
}

.row.top3 {
  background: linear-gradient(90deg, rgba(249, 226, 175, 0.07), rgba(255, 255, 255, 0.02));
}

.row.me {
  border-color: var(--sage);
}

.rank {
  font: 900 16px/1 var(--display);
  color: var(--dim);
}

.row.top3 .rank {
  color: var(--gold);
}

.row-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--accent, #333);
}

.row-logo img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.row-avatars {
  display: flex;
  align-items: center;
}

/* every runner after the first tucks a little behind the one before it */
.row-avatars > * + * {
  margin-left: -12px;
}

.row-avatars > * {
  position: relative;
  flex: none;
}

.row-avatar {
  display: block;
  width: 30px;
  height: 30px;
}

.row-avatars > .row-avatar:not(:last-child) {
  filter: drop-shadow(2px 0 1px rgba(10, 10, 15, 0.9));
}

.row-who {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.row-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
}

.row-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* nobody gave a name yet; "you" marks the one this browser played */
.row-name.anon {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

.row-you {
  flex: none;
  padding: 1px 5px;
  border: 1px solid rgba(249, 226, 175, 0.5);
  border-radius: 5px;
  color: var(--gold);
  font: 700 9.5px/1.2 var(--mono);
}

/* org- and 7 characters, like a short commit hash */
.row-org {
  flex: none;
  font: 400 10.5px/1 var(--mono);
  color: var(--dim);
}

.row-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font: 400 10.5px/1.3 var(--mono);
  color: var(--dim);
}

.row-stats span {
  white-space: nowrap;
}

.row-prize {
  font: 700 10px/1 var(--mono);
  color: #0a0a0f;
  background: var(--gold);
  border-radius: 5px;
  padding: 4px 6px;
}

.row-score {
  font: 900 17px/1 var(--display);
  text-align: right;
  min-width: 64px;
}

.row-score small {
  font: 400 10px var(--mono);
  color: var(--dim);
  margin-left: 2px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--dim);
  border: 1px dashed var(--line-2);
  border-radius: 14px;
}

.board-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  margin: 14px auto 0;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.board-pager[hidden] {
  display: none;
}

.pager-pages {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pager-step,
.pager-num {
  display: grid;
  place-items: center;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s,
    opacity 0.2s;
}

.pager-step {
  width: 32px;
}

.pager-step svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pager-step:disabled {
  opacity: 0;
  pointer-events: none;
}

.pager-num {
  min-width: 38px;
  padding: 0 8px;
  font: 900 15px/1 var(--display);
  letter-spacing: 0.02em;
}

.pager-num[aria-current='page'] {
  background: var(--text);
  color: #0a0a0f;
  cursor: default;
}

.pager-gap {
  padding: 0 4px;
  color: var(--dim);
  font: 900 14px/1 var(--display);
}

@media (hover: hover) {
  .pager-step:hover,
  .pager-num:not([aria-current='page']):hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
  }
}

.pager-step:focus-visible,
.pager-num:focus-visible,
.board-me-jump:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}

.board-me-jump {
  padding: 5px 12px;
  border: 1px solid rgba(125, 184, 158, 0.3);
  border-radius: 999px;
  background: rgba(125, 184, 158, 0.08);
  color: var(--sage);
  cursor: pointer;
  font: 700 11px var(--mono);
  letter-spacing: 0.04em;
  transition:
    background 0.2s,
    border-color 0.2s;
}

@media (hover: hover) {
  .board-me-jump:hover {
    background: rgba(125, 184, 158, 0.16);
    border-color: rgba(125, 184, 158, 0.5);
  }
}

.board-me {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 0;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(125, 184, 158, 0.3);
  color: var(--sage);
  font-size: 12px;
}

.board-me[hidden] {
  display: none;
}


.threats h2 {
  margin: 6px 0 14px;
}

.threat-list {
  display: grid;
  gap: 10px;
}

.threat {
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.threat:hover,
.threat.open {
  border-color: rgba(224, 90, 109, 0.35);
  background: rgba(22, 20, 30, 0.9);
}

.threat:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
  border-radius: 16px;
}

.threat-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 10px;
}

.threat-pic {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  background: radial-gradient(70% 70% at 50% 100%, rgba(224, 90, 109, 0.2), transparent 70%), #0d0c14;
}

.threat-pic img {
  max-width: 64px;
  max-height: 64px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6));
  transition: transform 0.35s var(--ease-out);
}

.threat:hover .threat-pic img,
.threat.open .threat-pic img {
  transform: scale(1.08) rotate(-3deg);
}

.threat-text h3 {
  font: 900 20px/1 var(--display);
  letter-spacing: -0.02em;
}

.threat-kind {
  margin: 5px 0 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--coral);
}

.threat-line {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* the worm you can ride, in the gold it glows with in the game */
.threat-golden {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--gold);
}

.threat-golden::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px 2px rgba(249, 226, 175, 0.55);
}

.threat-chevron {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--dim);
  font-size: 14px;
  line-height: 1;
  transition: transform 0.3s var(--ease-out), color 0.2s ease, border-color 0.2s ease;
}

.threat:hover .threat-chevron,
.threat.open .threat-chevron {
  transform: rotate(45deg);
  color: var(--coral);
  border-color: rgba(224, 90, 109, 0.45);
}

/* the details open in place: grid rows 0fr to 1fr animates the height */
.threat-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s var(--ease-out);
}

.threat.open .threat-more {
  grid-template-rows: 1fr;
}

@media (hover: hover) {
  .threat:hover .threat-more {
    grid-template-rows: 1fr;
  }
}

.threat-more-inner {
  overflow: hidden;
}

.threat-more-pad {
  padding: 2px 18px 18px 100px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.3s var(--ease-out);
}

.threat.open .threat-more-pad {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  .threat:hover .threat-more-pad {
    opacity: 1;
    transform: none;
  }
}

.threat-what {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}

.threat-label {
  margin: 0 0 7px;
  font: 700 10px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--coral);
}

.threat-label.sage {
  margin-top: 14px;
  color: var(--sage);
}

.threat-seen {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.threat-seen li {
  display: flex;
  gap: 8px;
}

.threat-seen li::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  margin-top: 6px;
  border-radius: 1.5px;
  background: var(--coral);
}

.threat-tip {
  margin: 0;
  padding-left: 11px;
  border-left: 2px solid var(--sage);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}

.threat-src {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  color: var(--dim);
}

/* footer */

.foot {
  max-width: 1240px;
  margin: 64px auto 0;
  padding: 22px var(--gutter) 40px;
  color: var(--dim);
  font-size: 11px;
  text-align: center;
}

.foot p {
  margin: 0;
}

/* ── incident report ───────────────────────────────────────────────── */

.incident {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  width: min(700px, 100%);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.incident:not([open]) {
  display: none;
}

/* only the card catches clicks, the stage around it stays clickable */
.incident {
  pointer-events: none;
}

.incident-card {
  pointer-events: auto;
}

.incident-card {
  position: relative;
  margin-top: clamp(14px, 3vw, 40px);
  padding: 20px 24px 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(224, 90, 109, 0.08), transparent 120px),
    var(--panel-solid);
  border: 1px solid rgba(224, 90, 109, 0.32);
  box-shadow:
    0 40px 90px -20px rgba(0, 0, 0, 0.85),
    0 0 80px -30px var(--coral-glow);
  overflow: hidden;
  animation: slam 0.42s var(--ease-out) both;
}

.incident-card:focus {
  outline: none;
}

@keyframes slam {
  0% { opacity: 0; transform: translateY(26px) scale(0.97); }
  55% { opacity: 1; transform: translateY(-3px) scale(1.005); }
  70% { transform: translateX(-4px); }
  85% { transform: translateX(3px); }
  100% { transform: none; }
}

.incident-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* the verdict, stamped on the report a beat after it lands */
.stamp {
  padding: 5px 10px 3px;
  font: 900 15px/1 var(--display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--coral);
  border: 2px solid var(--coral);
  border-radius: 7px;
  transform: rotate(-4deg);
  opacity: 0.85;
  animation: thump 0.5s 0.25s cubic-bezier(0.2, 2.2, 0.4, 1) both;
}

@keyframes thump {
  from { opacity: 0; transform: rotate(-4deg) scale(2.2); }
  to { opacity: 0.85; transform: rotate(-4deg) scale(1); }
}

.again-top {
  padding: 8px 12px;
  font-size: 12px;
}

.incident-hero {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  margin: 20px 0;
}

.incident-sprite {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(224, 90, 109, 0.35));
}

.incident-headline {
  margin: 0;
  font: 900 clamp(22px, 3vw, 32px) / 1.02 var(--display);
  letter-spacing: -0.02em;
  color: var(--coral);
  text-wrap: balance;
}

.incident-score {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
}

.incident-score strong {
  font: 900 18px/1 var(--display);
  color: var(--text);
}

.best {
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(249, 226, 175, 0.12);
  color: var(--gold);
  font-size: 11px;
}

.fix {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(125, 184, 158, 0.06);
  border: 1px solid rgba(125, 184, 158, 0.16);
}

.fix-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.fix h3 {
  font: 700 10px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sage);
}

.fix .tip {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.seen {
  font-size: 11px;
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
}

.seen:hover {
  color: var(--sage);
}

.save {
  margin-top: 18px;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.4fr;
  gap: 8px;
}

/* a known player: name and org id, the email is on file */
.save.is-known .fields {
  grid-template-columns: 1fr 1.4fr;
}

/* saved under someone's email from here: runs go there, the profile is theirs */
.save.is-linked .fields,
.save.is-linked #org-help-btn {
  display: none;
}

.fields input[hidden] {
  display: none;
}

.submit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
}

/* two steps: the post on X, then submit, which stays dashed until the post
   has been opened. once it has, the light moves from one to the other */
.x-share,
.submit-btn {
  padding: 13px 20px;
  font-size: 14px;
}

.x-share svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.submit-btn {
  background: transparent;
  color: var(--text);
}

.submit-btn:disabled:not(.primary) {
  color: var(--dim);
  border-style: dashed;
  cursor: not-allowed;
}

.submit-btn.done:disabled {
  color: var(--sage);
  border-color: rgba(125, 184, 158, 0.4);
  border-style: solid;
  cursor: default;
}

input:not([type='checkbox']) {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font: 400 13px var(--mono);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:not([type='checkbox'])::placeholder {
  color: #55555f;
}

input:not([type='checkbox']):focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(125, 184, 158, 0.15);
}

input[aria-invalid='true'] {
  border-color: var(--coral) !important;
}

.save-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 11px;
}

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
}

.check input {
  width: 14px;
  height: 14px;
  accent-color: var(--sage);
}

.check[hidden] {
  display: none;
}

/* where the run lands: "#3 today · #12 this week" */
.ranks {
  color: var(--gold);
  font-size: 12px;
}

.form-error {
  margin: 8px 0 0;
  color: var(--coral);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  font: 700 13px/1 var(--mono);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn[hidden] {
  display: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--text);
  color: #0a0a0f;
  border-color: var(--text);
}

.btn.primary:hover {
  background: #fff;
}

.btn.primary[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
}

.btn.ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.btn kbd {
  font-size: 10px;
  padding: 3px 5px 2px;
}


.incident-note {
  margin: 12px 2px 0;
  font-size: 12px;
  color: var(--coral-soft);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--text);
}

.org-help {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.org-help code {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.05em 0.35em;
}


.why {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 11.5px;
  color: var(--muted);
}

.why-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0 0 10px;
}

.why-grid dt {
  color: var(--accent, var(--text));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  padding-top: 2px;
}

.why-grid dd {
  margin: 0;
}

.why-does {
  display: block;
  color: var(--text);
}

.why-fact {
  display: block;
  color: var(--dim);
  font-size: 11px;
}

.board-rules {
  margin-top: 12px;
}

/* ── responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .roster {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    margin: 0 calc(var(--gutter) * -1);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    scrollbar-width: none;
  }

  .roster::-webkit-scrollbar {
    display: none;
  }

  .card {
    scroll-snap-align: start;
  }
}

@media (max-width: 860px) {
  .lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .banner-inner {
    gap: 10px;
    padding: 9px 12px 9px 16px;
  }

  .banner-rank {
    font-size: 24px;
  }

  .banner-text {
    font-size: 12px;
  }

  .banner-text small {
    font-size: 10.5px;
  }

  .banner-btn {
    padding: 9px 12px;
    font-size: 12px;
  }

  /* the details sheet comes up from the bottom, under the thumbs */
  .claim {
    width: 100%;
    margin: auto 0 0;
  }

  .claim-card {
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  :root {
    --radius: 16px;
  }

  .title {
    font-size: 40px;
  }

  .hero-head {
    flex-direction: column;
    gap: 10px;
  }

  .tagline {
    font-size: 12px;
  }

  .incident {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .incident-card {
    margin-top: 0;
    border-radius: 20px 20px 0 0;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .incident-hero {
    grid-template-columns: 48px 1fr;
    margin: 14px 0;
  }

  .incident-sprite {
    width: 48px;
    height: 48px;
  }

  .fields {
    grid-template-columns: 1fr 1fr;
  }

  /* org ids are long: their own row, and a known player's name gets one too */
  .save.is-known .fields {
    grid-template-columns: 1fr;
  }

  .fields input[name='orgId'] {
    grid-column: 1 / -1;
  }

  .x-share,
  .submit-btn {
    flex: 1 1 0;
  }

  .submit-row .ranks {
    flex-basis: 100%;
  }

  .save-foot {
    flex-wrap: wrap;
  }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .why-grid dd {
    margin-bottom: 8px;
  }

  .threat-more-pad {
    padding: 2px 16px 16px;
  }
}

/* touch: tap replaces the keys, a real duck button appears */
@media (pointer: coarse) {
  .start-keys {
    display: none;
  }

  .pad {
    display: flex;
    gap: 10px;
    margin-top: 10px;
  }

  .duck {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    height: 56px;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: linear-gradient(#1c1c25, #121219);
    font: 700 13px var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  .duck.down {
    background: var(--text);
    color: #0a0a0f;
  }

  /* no run, no buttons. a pause keeps their place and the fork's drain bar */
  body:not(.is-live) .pad {
    display: none;
  }

  .is-paused .pad {
    visibility: hidden;
  }

  /* the special: charges cell by cell, glows when ready, burns down in flight */
  .power {
    position: relative;
    display: flex;
    flex: 0 0 40%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 56px;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: linear-gradient(#1c1c25, #121219);
    color: var(--muted);
    font: 700 13px var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition:
      color 0.2s,
      border-color 0.2s,
      transform 0.08s;
  }

  .power[hidden] {
    display: none;
  }

  .power:active {
    transform: scale(0.97);
  }

  .power-top {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .power svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
  }

  .power-cells {
    display: flex;
    gap: 3px;
  }

  .power-cells i {
    width: 7px;
    height: 4px;
    border-radius: 1px;
    background: rgba(244, 244, 245, 0.14);
    transition: background 0.2s;
  }

  .power-cells i.on {
    background: var(--sage);
  }

  .power[data-state='ready'] {
    color: var(--gold);
    border-color: var(--gold);
    animation: power-ready 1.1s ease-in-out infinite;
  }

  .power[data-state='ready'] .power-cells i {
    background: var(--gold);
  }

  .power[data-state='active'] {
    color: var(--gold);
    border-color: rgba(249, 226, 175, 0.45);
  }

  .power[data-state='active']::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--gold);
    transform-origin: left;
    animation: power-drain var(--flight, 5s) linear forwards;
  }

  .is-paused .power::after {
    animation-play-state: paused;
  }

  @keyframes power-ready {
    0%,
    100% {
      box-shadow:
        0 0 0 1px rgba(249, 226, 175, 0.3),
        0 0 16px rgba(249, 226, 175, 0.2);
    }
    50% {
      box-shadow:
        0 0 0 1px rgba(249, 226, 175, 0.6),
        0 0 28px rgba(249, 226, 175, 0.45);
    }
  }

  @keyframes power-drain {
    to {
      transform: scaleX(0);
    }
  }

  .stat {
    cursor: default;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
