/* =========================================================================
   FAN MOVEMENT — ECHO THE STAND
   Authored design: floodlit stand, print/halftone texture, scarf palette,
   condensed poster type. No generic neon, no card-grid filler.
   ========================================================================= */

:root {
  --ink: #0c0a09;
  --ink-2: #15110c;
  --bone: #f4ece0;
  --bone-dim: rgba(244, 236, 224, 0.6);
  --bone-faint: rgba(244, 236, 224, 0.32);
  --signal: #ffd21e; /* kit yellow */
  --signal-deep: #d6a500;
  --hot: #e02234; /* scarf red */
  --hot-deep: #9c0f1d;
  --flood: #fff6e0;

  --display: "Anton", "Arial Narrow", Impact, Haettenschweiler, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  /* live "heat" of the crowd, 0..1, written by app.js */
  --heat: 0;

  /* height of the top banner strip; the game area subtracts it */
  --adtop-h: clamp(52px, 11vw, 90px);
}

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

/* several toggled elements set their own display — hidden must always win */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--cond);
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--cond);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: top 0.18s ease;
}
.skip-link:focus {
  top: 12px;
}

/* visually hidden but available to assistive tech */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Atmosphere layers ---------- */
.stadium,
.background-video,
.vignette,
.floodlight,
.halftone {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stadium {
  z-index: -4;
  display: block;
}

.background-video {
  z-index: -3;
  object-fit: cover;
  opacity: 0; /* fades in only if a real video asset loads */
  transition:
    opacity 0.6s ease,
    filter 0.6s ease;
}
.background-video.is-live {
  opacity: 0.9;
}

/* When the crowd video is live it becomes the hero background:
   hide the canvas crowd and darken the plate so the text stays legible. */
body.video-live .stadium {
  opacity: 0;
}
body.video-live .vignette {
  background: radial-gradient(130% 120% at 50% 34%, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.72) 100%);
}

/* Full time: the chant broke — the stand goes quiet and grey */
body.stand-quiet .background-video {
  opacity: 0.25;
  filter: grayscale(0.4);
}
body.stand-quiet:not(.video-live) .stadium {
  opacity: 0.35;
}

/* Floodlight bloom that breathes with the crowd heat.
   Static gradient + compositor-cheap opacity (no per-frame repaint, no blend). */
.floodlight {
  z-index: -2;
  background: radial-gradient(
    120% 80% at 50% -10%,
    rgba(255, 246, 224, 0.34) 0%,
    rgba(255, 246, 224, 0) 60%
  );
  opacity: calc(0.32 + 0.55 * var(--heat));
  transition: opacity 0.25s ease;
}

.vignette {
  z-index: -1;
  background:
    radial-gradient(140% 120% at 50% 30%, transparent 40%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(12, 10, 9, 0.2) 0%, rgba(12, 10, 9, 0.85) 100%);
}

/* Faint print/halftone texture so the dark never reads as flat AI-black.
   Plain layer (no blend) so it stays cached and never recomposites with the canvas. */
.halftone {
  z-index: -1;
  opacity: 0.6;
  background-image: radial-gradient(rgba(244, 236, 224, 0.05) 1px, transparent 1.4px);
  background-size: 6px 6px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(14px, 3vw, 22px) clamp(16px, 4vw, 32px);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--display);
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1;
}
.wordmark__fan {
  color: var(--signal);
}
.wordmark__move {
  color: var(--bone);
  -webkit-text-stroke: 0;
}

.sound-toggle {
  appearance: none;
  border: 2px solid var(--bone-dim);
  background: transparent;
  color: var(--bone);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  padding: 7px 14px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    color 0.18s ease;
}
.sound-toggle:hover {
  border-color: var(--signal);
}
.sound-toggle:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}
.sound-toggle .sound-toggle__off {
  display: none;
}
.sound-toggle[aria-pressed="false"] {
  color: var(--bone-dim);
}
.sound-toggle[aria-pressed="false"] .sound-toggle__on {
  display: none;
}
.sound-toggle[aria-pressed="false"] .sound-toggle__off {
  display: inline;
}

/* ---------- Hero / experience ---------- */
main {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  width: 100%;
}

.experience {
  min-height: calc(100svh - 84px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vh, 18px);
  padding: 2vh clamp(16px, 4vw, 32px) 4vh;
  text-align: center;
}
/* when the top banner is shown, keep the whole game on one screen */
body:has(.ad-slot--top:not([hidden])) .experience {
  min-height: calc(100svh - 84px - var(--adtop-h));
}
.experience:focus {
  outline: none; /* skip-link target (tabindex="-1") */
}

.eyebrow {
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(0.8rem, 2.4vw, 1rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--signal);
  padding-left: 0.42em; /* optical balance for the tracking */
}

/* ---------- Clicker: support counter, push button, share ---------- */
.support-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(0.75rem, 2.2vw, 0.95rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone-dim);
  padding-left: 0.3em;
}
.support-flag {
  width: 1.5em;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  flex: none;
}

.counter {
  font-family: var(--display);
  font-size: clamp(4rem, 16vw, 8.5rem);
  line-height: 0.86;
  letter-spacing: 0.01em;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 calc(2px + 8px * var(--heat)) calc(18px + 40px * var(--heat))
    rgba(255, 210, 30, calc(0.12 + 0.4 * var(--heat)));
  transition: transform 0.08s ease;
}
.counter.kick {
  transform: scale(1.04);
}

.push-button {
  --press: 9px;
  position: relative;
  margin-top: clamp(6px, 1.4vh, 16px);
  appearance: none;
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: clamp(0.42em, 2vw, 0.6em) clamp(1em, 6vw, 2em);
  cursor: pointer;
  font-family: var(--display);
  font-size: clamp(2.6rem, 10vw, 5rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: linear-gradient(180deg, #ffe262 0%, var(--signal) 46%, var(--signal-deep) 100%);
  box-shadow:
    0 var(--press) 0 var(--hot-deep),
    0 calc(var(--press) + 4px) 0 rgba(0, 0, 0, 0.4),
    0 calc(var(--press) + 20px) 30px rgba(224, 34, 52, calc(0.2 + 0.4 * var(--heat)));
  transform: translateY(0);
  overflow: hidden;
  isolation: isolate;
  touch-action: manipulation;
  transition:
    transform 0.09s ease,
    box-shadow 0.09s ease,
    filter 0.16s ease;
}
.push-button__label {
  position: relative;
  z-index: 1;
  display: block;
}
.push-button:hover {
  filter: brightness(1.05);
}
.push-button:focus-visible {
  outline: 3px solid var(--bone);
  outline-offset: 4px;
}
.push-button:active,
.push-button.is-active {
  transform: translateY(var(--press));
  box-shadow:
    0 0 0 var(--hot-deep),
    0 2px 0 rgba(0, 0, 0, 0.4),
    0 6px 18px rgba(224, 34, 52, calc(0.28 + 0.4 * var(--heat)));
}
.push-button__shine {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.5) 48%, transparent 66%);
  transform: translateX(-120%);
  pointer-events: none;
}
.push-button.is-active .push-button__shine {
  animation: shine 0.42s ease-out;
}
@keyframes shine {
  to {
    transform: translateX(120%);
  }
}

.push-help {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.share-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: clamp(8px, 2vh, 18px);
}
.share-row__label {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.share-row__btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.share-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 2px solid var(--bone-dim);
  border-radius: 999px;
  background: rgba(12, 10, 9, 0.5);
  color: var(--bone);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    color 0.16s ease;
}
.share-btn:hover {
  border-color: var(--signal);
  color: var(--signal);
}
.share-btn:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}
.share-btn--copy,
.share-btn--native {
  border-color: var(--signal);
  color: var(--signal);
}

/* Sequence-progress meter */
.meter {
  width: min(78vw, 420px);
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(244, 236, 224, 0.08);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(244, 236, 224, 0.12);
}
.meter__fill {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--signal) 0%, #ff9d1e 55%, var(--hot) 100%);
  transition: transform 0.14s ease;
}

/* Best round / roars stats */
.stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 0.8ch;
  font-family: var(--cond);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5ch;
}
.stat__k {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.stat__v {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
}
.stat__sep {
  color: var(--bone-faint);
}
#roars.pop {
  animation: pop 0.3s ease;
}
@keyframes pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.5);
    color: var(--hot);
  }
  100% {
    transform: scale(1);
  }
}

/* Round-complete flash (behind the content) */
.erupt {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    60% 50% at 50% 44%,
    rgba(255, 246, 224, 0.8) 0%,
    rgba(255, 210, 30, 0.28) 38%,
    transparent 70%
  );
}
.erupt.is-erupting {
  animation: erupt 0.5s ease-out;
}
@keyframes erupt {
  0% {
    opacity: 0;
  }
  14% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
  }
}

/* Real worldwide total (API-fed; hidden when the API is absent) */
.worldwide {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5ch;
  font-family: var(--cond);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bone-dim);
}
.worldwide__num {
  font-family: var(--display);
  font-size: 1.5em;
  color: var(--hot);
  font-variant-numeric: tabular-nums;
}
.worldwide__label {
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
}

/* ---------- The three chant buttons ---------- */
/* Physical terrace buttons: distinct colour + position + voice per token. */
.chant-row {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 2.4vw, 18px);
  width: min(100%, 600px);
  margin-top: clamp(10px, 2vh, 20px);
}

.chant-btn {
  --press: 7px;
  --down: var(--hot-deep);
  --face: linear-gradient(180deg, #ffe262 0%, var(--signal) 46%, var(--signal-deep) 100%);
  --glow-rgb: 224, 34, 52;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  appearance: none;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: clamp(0.5em, 2.2vw, 0.66em) 0.2em;
  cursor: pointer;
  font-family: var(--display);
  font-size: clamp(1.55rem, 6.4vw, 2.9rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--face);
  box-shadow:
    0 var(--press) 0 var(--down),
    0 calc(var(--press) + 3px) 0 rgba(0, 0, 0, 0.4),
    0 calc(var(--press) + 16px) 26px rgba(var(--glow-rgb), calc(0.16 + 0.34 * var(--heat)));
  transform: translateY(0);
  overflow: hidden;
  isolation: isolate;
  touch-action: manipulation;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    filter 0.14s ease,
    opacity 0.18s ease;
}
.chant-btn--hoo {
  --down: var(--hot-deep);
  --face: linear-gradient(180deg, #ffe262 0%, var(--signal) 46%, var(--signal-deep) 100%);
  --glow-rgb: 224, 34, 52;
  color: var(--ink);
}
.chant-btn--hey {
  --down: #5c0710;
  --face: linear-gradient(180deg, #ff5360 0%, var(--hot) 46%, var(--hot-deep) 100%);
  --glow-rgb: 224, 34, 52;
  color: var(--bone);
}
.chant-btn--ole {
  --down: #857457;
  --face: linear-gradient(180deg, #fffaf0 0%, var(--bone) 48%, #cfc0a8 100%);
  --glow-rgb: 244, 236, 224;
  color: var(--ink);
}

.chant-btn__label {
  position: relative;
  z-index: 1;
  display: block;
}

.chant-btn:hover {
  filter: brightness(1.06);
}
.chant-btn:focus-visible {
  outline: 3px solid var(--bone);
  outline-offset: 4px;
}

/* idle + during the call: present but resting (guarded in JS, not disabled) */
.chant-btn[aria-disabled="true"] {
  cursor: default;
  pointer-events: none;
  opacity: 0.55;
  filter: saturate(0.55) brightness(0.82);
}

/* the stand calls this token — opacity/filter highlight (reduced-motion safe) */
.chant-btn.is-lit {
  opacity: 1;
  filter: brightness(1.22) saturate(1.15);
  box-shadow:
    0 var(--press) 0 var(--down),
    0 calc(var(--press) + 3px) 0 rgba(0, 0, 0, 0.4),
    0 calc(var(--press) + 16px) 40px rgba(var(--glow-rgb), 0.8);
}

/* the player presses it */
.chant-btn:active,
.chant-btn.is-active {
  transform: translateY(var(--press));
  box-shadow:
    0 0 0 var(--down),
    0 2px 0 rgba(0, 0, 0, 0.4),
    0 5px 18px rgba(var(--glow-rgb), calc(0.3 + 0.4 * var(--heat)));
}

.chant-btn__shine {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 48%,
    transparent 66%
  );
  transform: translateX(-120%);
  pointer-events: none;
}
.chant-btn.is-active .chant-btn__shine {
  animation: shine 0.42s ease-out;
}
@keyframes shine {
  to {
    transform: translateX(120%);
  }
}

.help-line {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--bone-dim);
  text-transform: uppercase;
}

/* ---------- Start button ---------- */
.start-btn {
  appearance: none;
  margin-top: clamp(6px, 1.4vh, 14px);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0.5em 1.3em;
  font-family: var(--display);
  font-size: clamp(1.15rem, 4.2vw, 1.7rem);
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: linear-gradient(180deg, #ffe262 0%, var(--signal) 46%, var(--signal-deep) 100%);
  box-shadow:
    0 6px 0 var(--hot-deep),
    0 9px 0 rgba(0, 0, 0, 0.4),
    0 20px 30px rgba(224, 34, 52, calc(0.18 + 0.3 * var(--heat)));
  cursor: pointer;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    filter 0.14s ease;
}
.start-btn:hover {
  filter: brightness(1.05);
}
.start-btn:active {
  transform: translateY(6px);
  box-shadow:
    0 0 0 var(--hot-deep),
    0 2px 0 rgba(0, 0, 0, 0.4),
    0 5px 16px rgba(224, 34, 52, 0.28);
}
.start-btn:focus-visible {
  outline: 3px solid var(--bone);
  outline-offset: 4px;
}

/* While the chant runs the hero keeps its layout — resting controls just
   turn invisible so fast fingers can't wander (START is idle-only). */
body.in-chant .nation-chip,
body.in-chant .stat--share,
body.in-chant .start-btn {
  visibility: hidden;
}

/* ---------- About / SEO content ---------- */
.about {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 110px) clamp(20px, 5vw, 40px);
  border-top: 1px solid rgba(244, 236, 224, 0.1);
}
.about__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
  margin-bottom: 0.5em;
  max-width: 16ch;
}
.about > p {
  max-width: 62ch;
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  color: var(--bone-dim);
}
.how {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 4vw, 44px);
  margin-top: clamp(36px, 6vh, 64px);
}
.how h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  color: var(--signal);
  margin-bottom: 0.3em;
}
.how p {
  color: var(--bone-dim);
  font-size: 0.98rem;
}

/* ---------- Ad / partner slot ---------- */
.ad-slot {
  display: flex;
  justify-content: center;
  padding: clamp(28px, 6vh, 56px) clamp(16px, 4vw, 32px) clamp(40px, 8vh, 80px);
}
.ad-slot[hidden] {
  display: none;
}
.ad-slot__placeholder {
  width: min(970px, 100%);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed rgba(244, 236, 224, 0.28);
  border-radius: 4px;
  color: var(--bone-dim);
  font-family: var(--cond);
  font-weight: 600;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  text-transform: uppercase;
}
.ad-slot__placeholder small {
  letter-spacing: 0.06em;
  text-transform: none;
}

/* Top strip — visible on first load, sits above the game.
   The game's min-height compensates for it (see .experience below). */
.ad-slot--top {
  position: relative;
  z-index: 3;
  height: var(--adtop-h);
  padding: 8px clamp(12px, 4vw, 28px);
  background: rgba(12, 10, 9, 0.62);
  border-bottom: 1px solid rgba(244, 236, 224, 0.12);
}
.ad-slot--top .ad-slot__placeholder {
  width: min(728px, 100%);
  height: 100%;
  min-height: 0;
  border-style: dashed;
  border-radius: 3px;
}

/* Compact banner inside the full-time panel — a natural high-intent break. */
.ad-slot--panel {
  padding: clamp(10px, 2vh, 16px) 0 0;
}
.ad-slot--panel .ad-slot__placeholder {
  width: min(300px, 100%);
  min-height: 96px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(28px, 5vh, 44px) clamp(16px, 4vw, 32px) calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(244, 236, 224, 0.1);
  text-align: center;
}
.footer__brand {
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: var(--bone);
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}
.footer__links a {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  text-decoration: none;
  padding: 6px 4px; /* keeps tap target >=24px tall */
  transition: color 0.16s ease;
}
.footer__links a:hover,
.footer__links a:focus-visible {
  color: var(--signal);
}
.footer__legal {
  max-width: 64ch;
  font-size: 0.8rem;
  color: var(--bone-dim);
  letter-spacing: 0.02em;
}
.footer__rg {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer__tm {
  font-size: 0.74rem;
  max-width: 70ch;
}

/* ---------- Nation chip (hero) ---------- */
.nation-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid rgba(244, 236, 224, 0.3);
  border-radius: 999px;
  background: rgba(12, 10, 9, 0.45);
  color: var(--bone);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color 0.16s ease;
}
.nation-chip:hover {
  border-color: var(--signal);
}
.nation-chip__flag {
  font-size: 1.25em;
  line-height: 1;
}
.nation-chip__hint {
  color: var(--bone-dim);
  font-size: 0.86em;
  letter-spacing: 0.1em;
}

/* ---------- Lifetime title badge + share (stats row) ---------- */
.stat__badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 7px 2px;
  background: var(--hot);
  color: var(--flood);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 2px;
  transform: translateY(-2px);
}
.stat--share {
  position: relative;
}
.stat-share {
  appearance: none;
  border: 1.5px solid rgba(244, 236, 224, 0.34);
  background: transparent;
  color: var(--bone);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}
.stat-share:hover {
  border-color: var(--signal);
  color: var(--signal);
}
.share-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ---------- Overlay dialogs (picker / full time) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(12, 10, 9, 0.86);
}
.overlay__panel {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid rgba(244, 236, 224, 0.14);
  border-top: 6px solid var(--signal);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  padding: clamp(22px, 5vw, 40px);
  max-height: calc(100vh - 32px);
  max-height: calc(100svh - 32px);
  overflow-y: auto;
}
.picker-panel {
  max-width: 880px;
}
.results-panel {
  max-width: 460px;
  text-align: center;
}

/* Picker */
.picker__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.picker__sub {
  margin-top: 0.5em;
  color: var(--bone-dim);
}
.picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: clamp(16px, 3vh, 24px) 0 6px;
}
.picker__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: transparent;
  border: 1px solid rgba(244, 236, 224, 0.2);
  color: var(--bone);
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.picker__item:hover {
  border-color: var(--signal);
  background: rgba(255, 210, 30, 0.06);
}
.picker__item.is-current {
  border-color: var(--signal);
  color: var(--signal);
}
.picker__flag {
  font-size: 1.15em;
  line-height: 1;
}
.picker__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker__skip {
  appearance: none;
  margin-top: 14px;
  padding: 8px 6px;
  background: transparent;
  border: 0;
  color: var(--bone-dim);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.picker__skip:hover {
  color: var(--signal);
}

/* Full time */
.results__eyebrow {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--signal);
  padding-left: 0.42em;
}
.results__round {
  margin-top: 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: 0.92;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}
.results__best {
  margin-top: 14px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.results__best-num {
  font-family: var(--display);
  font-size: 1.2em;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
}
.results__new {
  margin-left: 6px;
}
.results__stats {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.results__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}
.results__share-wrap {
  position: relative;
  display: inline-block;
}
.action-btn {
  appearance: none;
  border: 2px solid rgba(244, 236, 224, 0.34);
  background: transparent;
  color: var(--bone);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 11px 18px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    filter 0.15s ease;
}
.action-btn:hover {
  border-color: var(--signal);
  color: var(--signal);
}
.action-btn--primary {
  border-color: var(--signal);
  background: var(--signal);
  color: var(--ink);
}
.action-btn--primary:hover {
  color: var(--ink);
  filter: brightness(1.06);
}

/* ---------- Leaderboard: world's loudest fans ---------- */
.board {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 110px) clamp(20px, 5vw, 40px);
  border-top: 1px solid rgba(244, 236, 224, 0.1);
}
.board__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
  margin-bottom: 0.5em;
  max-width: 16ch;
}
.board__hint {
  max-width: 62ch;
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  color: var(--bone-dim);
}
.board__table {
  width: min(760px, 100%);
  margin-top: clamp(28px, 5vh, 48px);
  border-collapse: collapse;
  font-family: var(--cond);
}
.board__table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-faint);
  padding: 0 12px 12px;
  border-bottom: 1px solid rgba(244, 236, 224, 0.16);
}
.board__th-rank {
  width: 3.2em;
}
.board__table th.board__th-roars {
  text-align: right;
}
.board__table td {
  padding: 12px;
  border-bottom: 1px solid rgba(244, 236, 224, 0.08);
}
.board__rank {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--bone-faint);
}
.board__nation {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.board__flag {
  font-size: 1.15em;
  line-height: 1;
}
.board__name {
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board__roars {
  text-align: right;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
}
.board__table tr.is-you td {
  background: rgba(255, 210, 30, 0.07);
}
.board__table tr.is-you .board__rank,
.board__table tr.is-you .board__name {
  color: var(--signal);
}
.board__table tr.is-gap td {
  border-top: 2px dashed rgba(244, 236, 224, 0.22);
}

/* ---------- Focus visibility ---------- */
.nation-chip:focus-visible,
.stat-share:focus-visible,
.picker__item:focus-visible,
.picker__skip:focus-visible,
.action-btn:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}
.action-btn--primary:focus-visible {
  outline-color: var(--bone);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .how {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .topbar {
    gap: 10px;
  }
  .wordmark {
    font-size: 1.2rem;
  }
  .sound-toggle {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    padding: 6px 10px;
    white-space: nowrap;
  }
  .picker__grid {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  }
  .chant-btn {
    border-radius: 14px;
    --press: 6px;
  }
  .help-line {
    font-size: 0.8rem;
  }
  .action-btn {
    font-size: 0.78rem;
    padding: 10px 14px;
  }
  .board__table td {
    padding: 10px 8px;
  }
  .board__table th {
    padding: 0 8px 10px;
  }
  .board__name {
    max-width: 38vw;
  }
}

/* ---------- Motion / accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .bigline {
    text-shadow: none;
  }
}
