/* Shell and locker room.
 *
 * Everything self hosted: system fonts, CSS drawn artwork, no images, no CDN.
 * The whole look is built from gradients and box shadows so the app loads
 * instantly on a home network and works with the iPad offline once cached.
 *
 * One theme, not two. The runner is a basketball arena and a light mode
 * version of it would be a different game. The admin side keeps the kit's
 * light and dark toggle, because that is a tool rather than a toy.
 */

:root {
  --ink: #070b16;
  --ink-2: #0d1428;
  --ink-3: #17203f;
  --ink-4: #223056;

  --ball: #f97316;
  --ball-2: #ea580c;
  --gold: #fbbf24;
  --mint: #34d399;
  --sky: #38bdf8;
  --pink: #f472b6;
  --purple: #a78bfa;

  --paper: #f6f8ff;
  --muted: #94a3c7;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.2);

  --r: 18px;
  --r-sm: 12px;

  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }

/* The runner hides and shows almost everything with the `hidden` attribute.
 * The browser's own [hidden] rule is display:none at the lowest possible
 * specificity, so any class here that sets display (and most of them do:
 * flex, grid, inline-flex) silently beats it and the element stays on screen.
 * One declaration, once, rather than a display:none paired with every one.
 */
[hidden] { display: none !important; }

html {
  background: var(--ink);
  /* Stops the iPad enlarging text when the app is turned sideways. */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(90rem 50rem at 50% -20rem, #1d2a55 0%, transparent 60%),
    radial-gradient(60rem 40rem at 110% 110%, #2a1a3d 0%, transparent 55%),
    var(--ink);
  color: var(--paper);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* A game surface, not a document: dragging a rep button must not start a
     text selection, and a fast double tap must not zoom the court. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a { color: var(--sky); }

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

/* ── Top bar ──────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.9rem 0 1.2rem;
}

.topbar .logo {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.topbar .spacer { flex: 1 1 auto; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.chip.gold { color: var(--gold); border-color: rgba(251, 191, 36, 0.35); }
.chip.fire { color: var(--ball); border-color: rgba(249, 115, 22, 0.35); }

/* ── Panels ───────────────────────────────────────────────────────────── */

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.panel.hero {
  background:
    linear-gradient(180deg, rgba(249, 115, 22, 0.16), rgba(249, 115, 22, 0.02) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border-color: rgba(249, 115, 22, 0.3);
}

h1 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.7rem, 6vw, 2.5rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.sub { color: var(--muted); margin: 0 0 1rem; }

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.85rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--paper);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s ease;
}

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

.btn.big {
  width: 100%;
  min-height: 74px;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn.primary {
  background: linear-gradient(180deg, var(--ball), var(--ball-2));
  color: #1a0b02;
  box-shadow: 0 12px 30px -10px rgba(249, 115, 22, 0.8),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn.ghost { border: 1px solid var(--line-2); background: transparent; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Lineup ───────────────────────────────────────────────────────────── */

.lineup { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: 0.6rem; }

.lineup li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.lineup .em { font-size: 1.6rem; line-height: 1; width: 2rem; text-align: center; }
.lineup .nm { font-weight: 800; }
.lineup .dt { color: var(--muted); font-size: 0.85rem; }
.lineup .no {
  margin-left: auto;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ── Meters ───────────────────────────────────────────────────────────── */

.meter {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--line);
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--ball));
  transition: width 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.meter.xp > span { background: linear-gradient(90deg, var(--sky), var(--purple)); }

.meter-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.meter-row b { color: var(--paper); }

/* ── Streak strip ─────────────────────────────────────────────────────── */

.streak {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 5px;
}

.streak i {
  aspect-ratio: 1;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.streak i.on {
  background: linear-gradient(180deg, var(--ball), var(--ball-2));
  border-color: transparent;
  box-shadow: 0 0 12px -2px rgba(249, 115, 22, 0.8);
}

/* ── Reward ───────────────────────────────────────────────────────────── */

.reward-name {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.7rem;
}

.reward-ready {
  border-color: rgba(52, 211, 153, 0.45);
  background:
    linear-gradient(180deg, rgba(52, 211, 153, 0.18), rgba(52, 211, 153, 0.02)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding-top: 1rem;
}

.foot a { color: var(--muted); }

.empty {
  color: var(--muted);
  padding: 1rem 0;
}

/* ── Motion ───────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
