/* Spin to Glory — Supabase-inspired design system (see DESIGN.md).
   White canvas, near-black ink, ONE emerald CTA per viewport (near-black
   text on green — the brand's idiosyncratic choice), Inter at weight 500
   with negative tracking, square-ish 6px buttons, hairline cards.
   The pitch is our "composited product mockup": 12px radius, hairline,
   Level-2 shadow. Grass stays green — it's content, not chrome. */

:root {
  /* colors */
  --primary: #3ecf8e;
  --primary-deep: #24b47e;
  --primary-soft: #4ade80;
  --ink: #171717;
  --ink-mute: #707070;
  --ink-mute-2: #9a9a9a;
  --ink-faint: #b2b2b2;
  --on-primary: #171717;
  --on-dark: #ffffff;
  --canvas: #ffffff;
  --canvas-soft: #fafafa;
  --night: #1c1c1c;
  --night-soft: #202020;
  --hairline: #dfdfdf;
  --hairline-strong: #c7c7c7;
  --hairline-cool: #ededed;
  --purple: #6b01c2;
  --purple-soft: #eddbf9;
  --tomato: #ff2201;
  /* pitch greens (content, not in the brand token set) */
  --pitch-grass: #1d7a40;
  --pitch-grass-dark: #176635;
  /* radii — square-ish, technical, never pill (except tags) */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
}

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

html { background: var(--canvas); }

body {
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--canvas);
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none; /* no pull-to-refresh mid-draft */
}

button {
  font-family: inherit;
  touch-action: manipulation; /* kill double-tap zoom delay on game controls */
  -webkit-user-select: none;
  user-select: none;
}

#app {
  margin: 0 auto;
  padding: 0 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.screen { max-width: 560px; margin: 0 auto; }

/* ---- draft columns: selection left, field right (desktop) ---- */
.draft-columns { display: flex; flex-direction: column; }
.draft-right { order: -1; } /* mobile: field on top */
.draft-right .pitch { max-width: 360px; margin-left: auto; margin-right: auto; }

@media (min-width: 860px) {
  #screen-draft { max-width: 1020px; }
  .draft-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 32px;
    align-items: start;
  }
  .draft-right {
    order: 0;
    position: sticky;
    top: 16px;
  }
  .draft-right .pitch { max-width: none; }
}

.screen {
  display: none;
  padding: 24px 0 48px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}
.screen.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

.hidden { display: none !important; }

/* ============ MODE SELECT ============ */
.hero { text-align: center; padding: 44px 0 32px; }
.hero-badge {
  display: inline-block;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-cool);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--ink);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 56px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -1.7px;
  color: var(--ink);
}
/* the wordmark accent — emerald is the page's one chromatic event */
.hero .gold { color: var(--primary); }
.tagline { margin-top: 16px; color: var(--ink-mute); font-size: 16px; line-height: 1.5; }

/* 2×2 grid of feature cards: Classic = light hairline, BallerIQ = inverted
   night. Each carries a mini tactics board (the brand's "product UI
   fragment inside the card") drawn from real engine slot coordinates. */
.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
.mode-card {
  border-radius: var(--r-lg);
  padding: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.mode-card:hover, .mode-card:active {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}
.card-dark {
  background: var(--night);
  color: var(--on-dark);
  border: 1px solid #2a2a2a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  position: relative;
}
/* XI cards are the featured tier: emerald ring + glow + corner badge */
.mode-card.featured {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 8px 28px rgba(62, 207, 142, 0.22);
}
.mode-card.featured:hover {
  box-shadow: 0 0 0 1px var(--primary), 0 18px 50px rgba(62, 207, 142, 0.3);
}
.featured-badge {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 10px; font-weight: 600; letter-spacing: 0.6px;
  border-radius: 9999px;
  padding: 3px 9px;
}

/* mini tactics board */
.mini-pitch {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(
    180deg,
    var(--pitch-grass) 0,
    var(--pitch-grass) 25%,
    var(--pitch-grass-dark) 25%,
    var(--pitch-grass-dark) 50%
  );
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.card-dark .mini-pitch {
  background: repeating-linear-gradient(
    180deg,
    #14532d 0,
    #14532d 25%,
    #0f3d21 25%,
    #0f3d21 50%
  );
}
.mini-line {
  position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.mini-dot {
  position: absolute;
  width: 10%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  display: flex; align-items: center; justify-content: center;
}
.mode-card:hover .mini-dot { animation: dotPop 0.45s ease; }
@keyframes dotPop { 0% { transform: translate(-50%, -50%) scale(1); } 40% { transform: translate(-50%, -50%) scale(1.25); } 100% { transform: translate(-50%, -50%) scale(1); } }
.mini-dot.mystery {
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px dashed rgba(255, 255, 255, 0.8);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  box-shadow: none;
}

.mode-card-body { padding: 16px 18px 18px; }
.mode-name { font-size: 19px; font-weight: 500; letter-spacing: -0.3px; }
.mode-desc { font-size: 13px; margin-top: 4px; line-height: 1.45; color: var(--ink-mute); }
.card-dark .mode-desc { color: #a3a3a3; }
.mode-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.pill-stats {
  display: inline-block;
  font-size: 10px; font-weight: 600; letter-spacing: 0.6px;
  border-radius: 9999px; padding: 3px 9px;
}
.pill-on { background: var(--primary); color: var(--on-primary); }
.pill-hidden { background: var(--purple-soft); color: var(--purple); }
.mode-meta {
  display: inline-block;
  font-size: 11px; font-weight: 500;
  background: var(--canvas-soft); color: var(--ink);
  border: 1px solid var(--hairline-cool);
  border-radius: 9999px; padding: 2px 8px;
}
.card-dark .mode-meta { background: var(--night-soft); color: var(--on-dark); border-color: #333; }

.mode-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-cool);
  border-radius: 9999px;
  padding: 3px 10px;
  margin-left: 8px;
}

.footnote { text-align: center; color: var(--ink-mute-2); font-size: 13px; margin-top: 24px; }

/* static crawlable about/FAQ — quiet footer territory */
.about {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline-cool);
  color: var(--ink-mute);
  font-size: 14px;
  line-height: 1.55;
}
.about h2 {
  font-size: 16px; font-weight: 500; letter-spacing: -0.2px;
  color: var(--ink); margin: 22px 0 8px;
}
.about p { margin: 0 0 10px; }
.about strong { color: var(--ink); font-weight: 500; }
.about ol { margin: 0 0 10px 20px; }
.about li { margin-bottom: 6px; }
.about details {
  border: 1px solid var(--hairline-cool);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--canvas-soft);
}
.about summary { cursor: pointer; font-weight: 500; color: var(--ink); }
.about details p { margin: 8px 0 2px; }

/* ============ FORMATION SELECT ============ */
.sub-header { display: flex; align-items: center; gap: 8px; padding: 8px 0 0; }
.sub-title { font-size: 20px; font-weight: 500; letter-spacing: -0.4px; }
.sub-note { color: var(--ink-mute); font-size: 14px; margin: 6px 0 18px; }
.formation-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.formation-card {
  background: var(--night);
  color: var(--on-dark);
  border: 1px solid #2a2a2a;
  border-radius: var(--r-lg);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.formation-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(62, 207, 142, 0.2);
}
.mini-pitch.tall { aspect-ratio: 3 / 4; }
.formation-body { padding: 12px 14px 14px; }
.formation-code { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
.formation-desc { font-size: 12px; color: #a3a3a3; margin-top: 3px; }

@media (max-width: 460px) {
  .formation-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .formation-code { font-size: 17px; }
}

/* ============ DRAFT ============ */
.draft-header { display: flex; align-items: center; gap: 14px; padding: 8px 0 4px; }
.draft-progress { flex: 1; }
#draft-slot-count {
  font-size: 12px; font-weight: 500; color: var(--ink-mute);
  letter-spacing: 1px; text-transform: uppercase;
}
.progress-bar {
  height: 4px; background: var(--hairline-cool);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
/* progress is chart-adjacent — emerald earns its place here */
#progress-fill { height: 100%; width: 0; background: var(--primary); border-radius: 2px; transition: width 0.3s ease; }

.btn-ghost {
  background: none; border: none; color: var(--ink-mute);
  font-size: 18px; cursor: pointer;
  min-width: 44px; min-height: 44px; /* comfortable thumb target */
}

.draft-status {
  text-align: center;
  font-size: 14px;
  color: var(--ink-mute);
  padding: 12px 8px 6px;
  line-height: 1.45;
}
.draft-status.placing { color: var(--ink); font-weight: 500; }
.draft-status strong { font-weight: 600; }
/* animated pointer toward the pitch: above on mobile, right on desktop */
.draft-status.placing::before {
  content: "☝️ ";
  display: inline-block;
  animation: nudgeUp 1s ease-in-out infinite;
}
@keyframes nudgeUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@media (min-width: 860px) {
  .draft-status.placing::before {
    content: "👉 ";
    animation: nudgeRight 1s ease-in-out infinite;
  }
  @keyframes nudgeRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
  }
}

/* spin — compact so the selection area fits more */
#spin-stage { text-align: center; padding: 6px 0; }
.spin-wheel {
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.spin-wheel.spinning { border-color: var(--hairline-strong); }
.spin-wheel.landed {
  border: 1px solid var(--primary);
  box-shadow: 0 8px 24px rgba(62, 207, 142, 0.25);
  animation: pop 0.45s ease;
}
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }

.spin-display { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 16px; }
.spin-q { font-size: 48px; font-weight: 500; color: var(--hairline); }
.spin-flag { font-size: 34px; line-height: 1; }
.spin-year { font-size: 28px; font-weight: 500; letter-spacing: -0.42px; color: var(--ink); line-height: 1.2; }
.spin-country { font-size: 16px; font-weight: 500; color: var(--ink-mute); }

/* the ONE filled green button per viewport — near-black text, never white */
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: var(--r-sm);
  padding: 12px 20px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-deep); }
.btn-primary:disabled { background: var(--hairline-cool); color: var(--ink-faint); cursor: default; }
.btn-primary.big { width: 100%; padding: 15px; font-size: 16px; }

.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  padding: 12px 20px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--canvas-soft); }

/* pick stage — options sit directly under the landed wheel */
.spin-sub { font-size: 11px; color: var(--ink-mute); font-weight: 500; margin-top: 3px; }

.player-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.player-card {
  display: flex; align-items: center; gap: 11px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  width: 100%;
}
.player-card:hover {
  border-color: var(--hairline-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.player-card.selected {
  border: 2px solid var(--primary);
  background: rgba(62, 207, 142, 0.06);
  padding: 9px 11px; /* keep size stable with the thicker border */
}
.pc-ovr {
  font-size: 17px; font-weight: 500; color: var(--ink);
  min-width: 40px; text-align: center;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-cool);
  border-radius: var(--r-sm); padding: 4px 6px;
}
.pc-main { flex: 1; min-width: 0; padding-right: 4px; }
.pc-name { font-size: 15px; font-weight: 500; letter-spacing: -0.2px; }
.player-card.balleriq .pc-name { font-size: 16px; }
.pc-pos { font-size: 11px; color: var(--ink-mute); font-weight: 500; margin-top: 2px; }
.pc-poslabel { color: var(--ink-mute-2); font-weight: 400; }

/* tap-to-select affordance: + flips to ✓ when the player is selected */
.pc-cta {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex-shrink: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  font-size: 15px; font-weight: 500; color: var(--ink-mute);
  transition: all 0.12s ease;
}
.player-card:hover .pc-cta { border-color: var(--ink); color: var(--ink); }
.player-card.selected .pc-cta {
  background: var(--primary); border-color: var(--primary);
  color: var(--on-primary); font-weight: 600;
}

#btn-skip { width: 100%; }

/* ============ PITCH VIEW (top of draft screen) ============ */
/* The pitch is our composited product mockup: rounded-lg container,
   hairline edge, Level-2 shadow, sitting on plain white canvas. */
.pitch {
  position: relative;
  margin-top: 14px;
  margin-bottom: 2px;
  aspect-ratio: 10 / 13;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: repeating-linear-gradient(
    180deg,
    var(--pitch-grass) 0,
    var(--pitch-grass) 12.5%,
    var(--pitch-grass-dark) 12.5%,
    var(--pitch-grass-dark) 25%
  );
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.pitch-half-line {
  position: absolute; left: 0; right: 0; top: 50%;
  border-top: 2px solid rgba(255, 255, 255, 0.28);
}
.pitch-circle {
  position: absolute; left: 50%; top: 50%;
  width: 26%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}
.pitch-box {
  position: absolute; left: 50%;
  width: 44%; height: 11%;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, 0.28);
}
.pitch-box-top { top: -2px; border-top: none; }
.pitch-box-bottom { bottom: -2px; border-bottom: none; }

.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 27%;
  max-width: 96px;
  padding: 8px 6px;
  border-radius: var(--r-md);
  text-align: center;
  color: #fff;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}
.pitch-slot.empty {
  border: 2px dashed rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}
.pitch-slot.current {
  border: 2px solid #fff;
  background: rgba(255, 255, 255, 0.22);
  animation: slotPulse 1.4s ease-in-out infinite;
}
@keyframes slotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
}
.pitch-slot.filled {
  border: 1px solid var(--hairline-strong);
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
/* move mode: picked-up player goes night-dark, legal slots go emerald */
.pitch-slot.move-source {
  border: 1px solid var(--night);
  background: var(--night);
  color: var(--on-dark);
  box-shadow: 0 0 0 4px rgba(28, 28, 28, 0.25);
}
.pitch-slot.move-target {
  border: 2px solid var(--primary);
  background: rgba(62, 207, 142, 0.3);
  animation: targetPulse 1.1s ease-in-out infinite;
}
.pitch-slot.filled.move-target { background: var(--primary); color: var(--on-primary); }
@keyframes targetPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(62, 207, 142, 0); }
}
/* placement mode: a spun player is selected. Strict eligibility — only the
   slots he genuinely plays glow; everything else is visibly blocked. */
.pitch-slot.place-eligible {
  border: 2px solid var(--primary);
  background: rgba(62, 207, 142, 0.32);
  animation: targetPulse 1.1s ease-in-out infinite;
}
.pitch-slot.place-blocked {
  opacity: 0.4;
  filter: grayscale(0.5);
  cursor: not-allowed;
}
.ps-fit {
  font-size: 10px; font-weight: 600;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pitch-hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute-2);
  margin: 10px 0 2px;
  line-height: 1.45;
}

.ps-pos { font-size: 13px; font-weight: 600; letter-spacing: 0.5px; }
.ps-help {
  font-size: 9px; font-weight: 500; opacity: 0.85;
  text-transform: uppercase; letter-spacing: 0.4px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-name {
  font-size: 11px; font-weight: 600;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* avatars (initials circles) */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
}
.pc-avatar { width: 36px; height: 36px; font-size: 13px; }
.ps-avatar { width: 30px; height: 30px; font-size: 11px; }

/* ============ RESULT ============ */
.result-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 32px 24px;
  text-align: center;
  margin-top: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.result-trophy { font-size: 56px; }
.result-outcome {
  font-size: 32px; font-weight: 500; letter-spacing: -0.6px;
  margin-top: 8px; line-height: 1.15; color: var(--ink);
}
.result-rating { margin: 16px 0 22px; }
.rating-num { font-size: 64px; font-weight: 500; letter-spacing: -1.92px; color: var(--ink); display: block; line-height: 1.1; }
.rating-label { font-size: 11px; font-weight: 500; letter-spacing: 1.5px; color: var(--ink-mute-2); }

.result-lineup { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.rl-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-cool);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 14px;
}
.rl-pos { color: var(--ink-mute-2); font-weight: 600; min-width: 40px; font-size: 12px; }
.rl-name { flex: 1; font-weight: 500; color: var(--ink); }
.rl-squad { color: var(--ink-mute); font-size: 12px; }
.rl-ovr { color: var(--ink); font-weight: 600; }

.result-breakdown {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 20px;
}
.result-breakdown span {
  font-size: 12px; font-weight: 400; color: var(--ink);
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-cool);
  border-radius: 9999px; padding: 5px 12px;
}
.result-brand { margin-top: 24px; font-size: 12px; font-weight: 500; color: var(--ink-mute-2); letter-spacing: 1.5px; }

/* Your Run — the tournament story */
.result-run { margin-top: 24px; text-align: left; }
.run-title {
  text-align: center;
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  color: var(--ink-mute-2); margin-bottom: 10px;
}
.run-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 14px;
}
.run-row.run-loss {
  background: rgba(255, 34, 1, 0.05);
  border-color: rgba(255, 34, 1, 0.35);
}
.run-stage {
  min-width: 96px;
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--ink-mute-2);
}
.run-opp { flex: 1; font-weight: 500; color: var(--ink); }
.run-score { font-weight: 700; }
.rs-win { color: var(--primary-deep); }
.rs-loss { color: #c41c01; }
.run-pens { font-style: normal; font-weight: 400; font-size: 11px; color: var(--ink-mute-2); margin-left: 5px; }
.run-final { text-align: center; font-weight: 600; margin-top: 12px; color: var(--ink); }

.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.result-actions button { flex: 1 1 40%; }

/* toast — button-on-dark voice */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--night); color: var(--on-dark);
  font-weight: 500; font-size: 13px;
  padding: 10px 18px; border-radius: var(--r-sm);
  opacity: 0; pointer-events: none;
  transition: all 0.25s ease;
  z-index: 99;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 460px) {
  /* one big card per row — each mode gets its moment */
  .mode-cards { grid-template-columns: 1fr; gap: 14px; }
  .mini-pitch { aspect-ratio: 21 / 9; }
}

@media (max-width: 420px) {
  .hero { padding-top: 28px; }
  .hero h1 { font-size: 40px; letter-spacing: -1.2px; }

  /* Fit pitch + spin button in one viewport — no scrolling to spin */
  .draft-right .pitch { max-width: 270px; margin-top: 8px; }
  .pitch-hint { font-size: 11px; margin: 6px 0 0; }
  .draft-status { padding: 8px 8px 4px; font-size: 13px; }
  #spin-stage { padding: 2px 0; }
  .spin-wheel { min-height: 92px; margin: 4px 0 10px; }
  .spin-display { padding: 10px; gap: 0; }
  .spin-q { font-size: 36px; }
  .spin-flag { font-size: 26px; }
  .spin-year { font-size: 22px; }
  .spin-country { font-size: 14px; }
  .btn-primary.big { padding: 13px; font-size: 15px; }

  /* Player cards: tighten while keeping breathing room. */
  .player-card { padding: 9px 11px; gap: 10px; }
  .player-card.selected { padding: 8px 10px; }
  .pc-main { flex: 1 1 0; min-width: 0; }
  .pc-name { font-size: 14px; }
  .player-card.balleriq .pc-name { font-size: 15px; }
  .pc-ovr { font-size: 16px; min-width: 38px; }
  .pc-avatar { width: 32px; height: 32px; font-size: 11px; }
  .ps-avatar { width: 24px; height: 24px; font-size: 9px; }
  .ps-name { font-size: 10px; }
  .ps-help { display: none; }
  .ps-fit { font-size: 9px; }

  .result-card { padding: 26px 18px; }
  .result-outcome { font-size: 26px; }
  .rl-row { padding: 10px 12px; gap: 9px; font-size: 13px; }
  .rl-squad { font-size: 11px; }
  .result-actions button { flex: 1 1 45%; padding: 13px 10px; }
}

@media (max-width: 350px) {
  .hero h1 { font-size: 36px; }
}
