:root {
  color-scheme: dark;
  font-synthesis: none;
  /* The logo's red, the hero burst's blue; a black page with panels a step lighter. */
  --red: #E00000; --red-hi: #FF3B30; --flash: #38C4F8; --gold: #FFCB05;
  --bg: #08080A; --fg: #F4F4F5; --fg-2: #A1A1AA; --line: rgba(255, 255, 255, .1);
  --panel: #131316; --panel-2: #1B1B1F;
  --tint: rgba(255, 255, 255, .06);
  --shadow: rgba(0, 0, 0, .5);
  /* Markers: red on the dark page, white on the red hero. Live signals are the burst's blue. */
  --accent: var(--red-hi); --accent-ink: #fff; --accent-edge: rgba(0, 0, 0, .2);
  --live: var(--flash);
  /* A pull is a pokéball: HIT is the white half, BRICK the black one. */
  --hit: #fff; --hit-ink: #C00000; --brick: #232329; --brick-ink: #F4F4F5;
  --track: rgba(255, 255, 255, .12);
  --font-num: "Anton", "Arial Narrow", sans-serif;
  --font-display: "Archivo Black", "Arial Black", sans-serif;
  --font-ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --nav-h: 64px; --strip-h: 84px;
  --gx: 48px;
}
@media (max-width: 760px) { :root { --gx: 16px; } }
@media (max-width: 520px) { :root { --nav-h: 56px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.4 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
[hidden] { display: none !important; }
p, h1, h2, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.gx {
  padding-left: max(var(--gx), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gx), env(safe-area-inset-right, 0px));
}
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.gl-ready .slab-fallback { visibility: hidden; }

/* Hero: the live view sits on the red burst, white on red; the totals strip below it is the black band. */
.hero-bg {
  --burst-y: 46%; --burst-size: cover;
  /* Spike tips reach 0.165 of the image width (measured on hero-burst.webp); cover renders the image the wider of the
     viewport and 16:9. */
  --burst-r: calc(max(100vw, 177.7svh) * .17);
  --burst: url(../assets/hero-burst.webp) 50% var(--burst-y) / var(--burst-size) no-repeat;
  position: absolute; inset: 0 0 auto; z-index: -2; pointer-events: none; overflow: hidden; /* under the 3D canvas (z -1) */
  height: max(100svh, calc(var(--nav-h) + 580px));
  background: #F00000; /* the image's own red, sampled from hero-burst.webp */
  animation: hero-in 1s var(--ease-out) backwards;
  transition: opacity .7s var(--ease), visibility 0s;
}
@keyframes hero-in { from { opacity: 0; } }
/* Leaving the live view the red steps away fast; coming back it fades in. */
body[data-view]:not([data-view="live"]) .hero-bg {
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility 0s linear .3s;
}
.hero-bg::before, .hero-bg::after { content: ""; }
.hero-bg::before, .hero-burst, .hero-bg::after { position: absolute; inset: 0; }
/* Rays stay still; only the flash moves. It is the same image masked to the burst over a base masked the other way, so
   a moving copy never doubles the spikes. */
.hero-bg::before {
  background: var(--burst);
  -webkit-mask: radial-gradient(circle calc(var(--burst-r) * 1.2) at 50% var(--burst-y), transparent 83%, #000);
          mask: radial-gradient(circle calc(var(--burst-r) * 1.2) at 50% var(--burst-y), transparent 83%, #000);
}
/* The flash lives by turning, never by zooming: two copies turn slowly in opposite directions, so the spikes cross and
   shimmer while the outline holds still, and the light at its heart breathes. */
.hero-burst {
  background: var(--burst);
  -webkit-mask: radial-gradient(circle calc(var(--burst-r) * 1.2) at 50% var(--burst-y), #000 83%, transparent);
          mask: radial-gradient(circle calc(var(--burst-r) * 1.2) at 50% var(--burst-y), #000 83%, transparent);
  transform-origin: 50% var(--burst-y);
  animation: burst-turn 160s linear infinite;
  will-change: rotate;
  transition: filter 1s var(--ease);
}
.hero-burst--b { opacity: .55; mix-blend-mode: screen; animation-duration: 110s; animation-direction: reverse; }
.hero-burst:not(.hero-burst--b)::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle calc(var(--burst-r) * .45) at 50% var(--burst-y), rgba(220, 245, 255, .9), rgba(90, 200, 250, .35) 45%, transparent 75%);
  opacity: .15; animation: burst-glow 3.8s ease-in-out infinite alternate;
}
@keyframes burst-turn { to { rotate: 360deg; } }
@keyframes burst-glow { to { opacity: .5; } }
/* On a tall screen cover would blow the burst up past the copy; it stays about one and a half slabs wide and its
   edges melt into the image's red. */
@media (max-aspect-ratio: 1/1) {
  .hero-bg { --burst-y: 43%; --burst-size: 280vw auto; --burst-r: 47.6vw; }
  .hero-bg::before {
    background: radial-gradient(ellipse 135vw 76vw at 50% var(--burst-y), transparent 55%, #F00000 96%), var(--burst);
  }
}
/* The pull, for as long as an opening holds the stage: the lights go down on the field and stay on the slab. */
.hero-bg::after {
  background: radial-gradient(circle at 50% var(--burst-y),
    rgba(255, 255, 255, .45), rgba(56, 196, 248, .12) calc(var(--burst-r) * .5), rgba(20, 0, 0, .4) calc(var(--burst-r) * 1.05),
    rgba(12, 0, 0, .86) calc(var(--burst-r) * 2.1));
  opacity: 0; transition: opacity .9s var(--ease);
}
/* A pack opening: the flash runs hotter instead of jumping closer. */
body[data-phase="opening"] .hero-burst { filter: brightness(1.12) saturate(1.15); }
body[data-phase="opening"] .hero-bg::after { opacity: 1; }
body:not([data-view]) :is(.nav, .live-view), body[data-view="live"] :is(.nav, .live-view) {
  --fg: #fff; --fg-2: rgba(255, 255, 255, .9); --line: rgba(255, 255, 255, .4);
  --track: rgba(60, 0, 0, .34); --tint: rgba(255, 255, 255, .14);
  --accent: #fff; --accent-ink: var(--red); --brick: #0B0B0D;
}
/* Small white type over the moving red needs a breath of shadow to hold its edge; solid controls do not. */
body:not([data-view]) .live-view, body[data-view="live"] .live-view { text-shadow: 0 1px 2px rgba(70, 0, 0, .3), 0 0 18px rgba(70, 0, 0, .25); }
.live-view :is(.btn-join, .btn-dark, .pill, .spl-chip, .spl-me) { text-shadow: none; }
/* Pop-ups over the hero stay dark surfaces. */
body :is(.nav, .live-view) :is(.account, .menu) {
  --fg-2: #A1A1AA; --line: rgba(255, 255, 255, .1); --tint: rgba(255, 255, 255, .06); --accent: var(--red-hi); --accent-ink: #fff;
}

.label {
  font: 500 11px/1.2 var(--font-ui);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.num {
  font-family: var(--font-num);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.dot {
  display: inline-block; flex: none;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
}

.link { font: 500 14px/1 var(--font-ui); text-decoration: none; padding: 10px 0; }
.link:hover, .btn-text:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn-text { font: 500 13px/1 var(--font-ui); padding: 8px 0; }

.btn-dark {
  height: 40px; padding: 0 16px;
  border-radius: 8px;
  background: var(--fg); color: var(--bg);
  font: 500 14px/1 var(--font-ui);
  white-space: nowrap;
  transition: opacity .15s;
}
.btn-dark:hover { opacity: .88; }

.btn-dark:disabled { opacity: .45; }

/* The one big action: the white half of the pokéball. */
.btn-join {
  height: 54px; padding: 0 26px; border-radius: 10px;
  background: var(--hit); color: var(--hit-ink);
  font: 400 17px/1 var(--font-display); letter-spacing: .04em; white-space: nowrap;
  box-shadow: 0 10px 24px -12px var(--shadow), inset 0 -3px 0 rgba(0, 0, 0, .08);
  transition: filter .15s, transform .08s;
}
.btn-join:not(:disabled):hover { filter: brightness(.96); }
.btn-join:not(:disabled):active { transform: translateY(1px); }
.btn-join:disabled { opacity: .6; }
@media (max-width: 520px) { .btn-join { height: 50px; padding: 0 18px; font-size: 15px; } }

.nav { position: relative; z-index: 10; }
.screen {
  position: relative; z-index: 2;
  height: calc(100vh - var(--nav-h));
  height: calc(100svh - var(--nav-h));
  min-height: 580px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg, .hero-burst, .hero-burst::after { animation: none; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
