/* ============================================================
   GOATvGOAT — Design System
   All colors hardcoded (no CSS variable dependency on dark bg)
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: #0d0d18;
  color: #e8e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: #f5c84a; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { line-height: 1.65; }

.label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

.container--wide {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 20px;
}

.card--bordered {
  border: 1px solid rgba(255,255,255,0.08);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.12s, opacity 0.12s;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn--gold {
  background: #f5c84a;
  color: #0d0d18;
  border: 2px solid #f5c84a;
}

.btn--ghost {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.4);
}

.btn--green {
  background: #1a2a1a;
  color: #22c55e;
  border: 1px solid #22c55e;
}

.btn--red {
  background: #1a0808;
  color: #ef4444;
  border: 1px solid #ef4444;
}

.btn--sim {
  background: #1a1a2e;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.4);
}

.btn--sim15 {
  background: #1e2535;
  color: #8ab4e8;
  border: 1px solid #5a7ab0;
}

.btn--full { width: 100%; }

.btn:disabled {
  background: #1e1e2e;
  color: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.1);
  cursor: not-allowed;
  transform: none;
}

/* ── Position Pills ───────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pill--PG { background: rgba(127,119,221,0.18); color: #7F77DD; border: 1px solid rgba(127,119,221,0.35); }
.pill--SG { background: rgba(29,158,117,0.18);  color: #1D9E75; border: 1px solid rgba(29,158,117,0.35); }
.pill--SF { background: rgba(239,159,39,0.18);  color: #EF9F27; border: 1px solid rgba(239,159,39,0.35); }
.pill--PF { background: rgba(212,83,126,0.18);  color: #D4537E; border: 1px solid rgba(212,83,126,0.35); }
.pill--C  { background: rgba(133,183,235,0.18); color: #85B7EB; border: 1px solid rgba(133,183,235,0.35); }

/* ── Nav ──────────────────────────────────────────────────── */
.goat-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,24,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.goat-nav__logo {
  font-size: 18px;
  font-weight: 800;
  color: #f5c84a;
  letter-spacing: -0.03em;
}

.goat-nav__links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.goat-nav__links a {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.goat-nav__links a:hover  { color: #ffffff; text-decoration: none; }
.goat-nav__links a.active { color: #f5c84a; font-weight: 700; }

/* ── Nav user menu ────────────────────────────────────────── */
.nav-user-menu { position: relative; }

.nav-user-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-family: inherit;
}
.nav-user-btn:hover { color: #ffffff; }
.nav-user-caret { font-size: 10px; opacity: 0.6; }

.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 6px 0;
  min-width: 160px;
  z-index: 400;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.nav-user-dropdown.open { display: block; }

.nav-user-dropdown a,
.nav-user-logout {
  display: block;
  width: 100%;
  padding: 9px 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, color 0.1s;
}
.nav-user-dropdown a:hover,
.nav-user-logout:hover {
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  text-decoration: none;
}
.nav-user-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 4px 0;
}

/* ── Flash messages ───────────────────────────────────────── */
.flash-msg {
  max-width: 480px;
  margin: 8px auto 0;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: flash-slide-in 0.2s ease both;
}
.flash-msg--success { background: #14532d; border: 1px solid #22c55e; color: #86efac; }
.flash-msg--error   { background: #450a0a; border: 1px solid #ef4444; color: #fca5a5; }
.flash-msg--warning { background: #451a03; border: 1px solid #f97316; color: #fdba74; }
.flash-msg--info    { background: #0c1a3d; border: 1px solid #3b82f6; color: #93c5fd; }

@keyframes flash-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Progress bar ─────────────────────────────────────────── */
.progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: #f5c84a;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── Position floor pills ─────────────────────────────────── */
.floor-pills {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.floor-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  transition: all 0.25s;
}

.floor-pill.met {
  border-color: #f5c84a;
  color: #f5c84a;
  background: rgba(245,200,74,0.12);
}

/* ── Swipe card ───────────────────────────────────────────── */
.swipe-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  min-height: 480px;
  background: #13132a;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.swipe-card:active { cursor: grabbing; }

.swipe-card__jersey {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 160px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.18;
  pointer-events: none;
  letter-spacing: -0.05em;
}

.swipe-card__body {
  position: relative;
  z-index: 1;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.swipe-card__pos-badge {
  align-self: flex-start;
}

.swipe-card__name {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.swipe-card__years {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: -8px;
}

.swipe-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.swipe-card__highlight {
  font-style: italic;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  border-left: 3px solid;
  padding-left: 10px;
  line-height: 1.5;
  margin-top: 4px;
}

.swipe-card__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: auto;
  padding-top: 16px;
}

.swipe-card__btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, background 0.12s;
}

.swipe-card__btn--no  { border-color: #ef4444; color: #ef4444; }
.swipe-card__btn--yes { border-color: #22c55e; color: #22c55e; }
.swipe-card__btn--no:hover  { background: rgba(239,68,68,0.12); }
.swipe-card__btn--yes:hover { background: rgba(34,197,94,0.12); }
.swipe-card__btn:active { transform: scale(0.9); }

/* Swipe feedback overlays */
.swipe-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
  border-radius: 20px;
}

.swipe-card__overlay--yes {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  border: 3px solid #22c55e;
}

.swipe-card__overlay--no {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
  border: 3px solid #ef4444;
}

/* ── Speed toast ──────────────────────────────────────────── */
.speed-toast {
  position: fixed;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20,20,40,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #f5c84a;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  white-space: nowrap;
}

.speed-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Deck area ────────────────────────────────────────────── */
.deck-area {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 520px;
}

/* ── Top 30 / reveal ──────────────────────────────────────── */
.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.player-row__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.player-row__name { font-weight: 600; font-size: 15px; }
.player-row__meta { font-size: 12px; color: rgba(255,255,255,0.45); }

.player-row__score-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  flex: 1;
  min-width: 60px;
}

.player-row__score-fill {
  height: 100%;
  border-radius: 2px;
}

.fast-badge {
  font-size: 11px;
  color: #f5c84a;
  font-weight: 700;
}

/* ── Battle scoreboard ────────────────────────────────────── */
.battle-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.battle-player {
  background: #1a1a2e;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
  transition: border-color 0.2s;
}

.battle-player.attacking { border-color: #f5c84a; }
.battle-player.clutch    { border-color: #ef4444; background: rgba(239,68,68,0.05); }

.battle-player__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}

.battle-player__name  { font-size: 13px; font-weight: 600; }
.battle-player__score {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  margin: 6px 0;
}

.battle-player__role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
}

.battle-player__sigs {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
}

/* ── Dice ─────────────────────────────────────────────────── */
.dice-arena {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
  margin: 16px 0;
}

.dice-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dice-group__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.dice-group__dice {
  display: flex;
  gap: 8px;
}

.die {
  width: 52px;
  height: 52px;
  background: #1e1e38;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  transition: border-color 0.15s;
}

.die.gold    { border-color: #f5c84a; }
.die.red     { border-color: #ef4444; }
.die.rolling { animation: diceRoll 370ms ease; }
.die.sig-pulse { animation: diceRoll 370ms ease, sigPulse 600ms 370ms ease; }

.dice-group__sum {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
}

.dice-group.active .dice-group__label { color: #f5c84a; }
.dice-group.active .dice-group__sum   { color: #f5c84a; }

/* ── Momentum pips ────────────────────────────────────────── */
.momentum-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin: 8px 0;
}

.momentum-pips {
  display: flex;
  gap: 4px;
}

.pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: background 0.25s;
}

.pip.atk-active { background: #f5c84a; }
.pip.def-active { background: #ef4444; }

.momentum-label {
  font-size: 11px;
  font-weight: 700;
  color: #f5c84a;
  min-width: 80px;
  text-align: center;
}

/* ── Possession log ───────────────────────────────────────── */
.possession-log {
  height: 90px;
  overflow-y: auto;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  line-height: 1.4;
  padding: 2px 0;
}

.log-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.log-entry.atk     { color: rgba(255,255,255,0.75); }
.log-entry.stop    { color: rgba(133,183,235,0.85); }
.log-entry.bust    { color: #ef4444; }
.log-entry.clutch  { color: #f5c84a; background: rgba(245,200,74,0.06); border-radius: 6px; padding: 3px 5px; }
.log-entry.sig     { color: #f5c84a; }
.log-entry.win     { color: #22c55e; font-weight: 700; }

/* ── Interrupt cards ──────────────────────────────────────── */
.interrupt-card {
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
  animation: bustIn 250ms ease;
}

.interrupt-card--sig {
  background: rgba(245,200,74,0.08);
  border: 2px solid #f5c84a;
}

.interrupt-card--win {
  background: rgba(34,197,94,0.08);
  border: 2px solid #22c55e;
}

.interrupt-card--bust {
  background: #1a0808;
  border: 2px solid #ef4444;
}

.interrupt-card__badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.interrupt-card--sig  .interrupt-card__badge { color: #f5c84a; }
.interrupt-card--win  .interrupt-card__badge { color: #22c55e; }
.interrupt-card--bust .interrupt-card__badge { color: #ef4444; }

.interrupt-card__text {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.9);
}

.interrupt-card__score-anim {
  font-size: 20px;
  font-weight: 800;
  margin-top: 8px;
  color: #ef4444;
}

.interrupt-card__hint {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 8px;
}

/* ── Battle buttons ───────────────────────────────────────── */
.battle-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.btn-roll {
  background: #f5c84a;
  color: #0d0d18;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
  width: 100%;
}

.btn-roll:active { transform: scale(0.97); }
.btn-roll:disabled {
  background: #2a2a3a;
  color: rgba(255,255,255,0.25);
  cursor: not-allowed;
}

.btn-sim15 {
  background: #1e2535;
  color: #8ab4e8;
  border: 1px solid #5a7ab0;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.btn-sim {
  background: #1a1a2e;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.btn-see-summary {
  background: #1a2a1a;
  color: #22c55e;
  border: 1px solid #22c55e;
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

/* ── Battle mode label ────────────────────────────────────── */
.mode-label {
  font-size: 10px;
  text-align: center;
  color: rgba(255,255,255,0.35);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

/* ── Cinematic reveal ─────────────────────────────────────── */
.reveal-screen {
  min-height: 100vh;
  background: #0d0d18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.reveal-title {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  text-align: center;
  margin-bottom: 40px;
}

.reveal-card {
  width: 100%;
  max-width: 400px;
  background: #1a1a2e;
  border-radius: 16px;
  padding: 20px;
  border-left: 4px solid;
  opacity: 0;
  transform: translateY(30px);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.reveal-card.revealed {
  animation: cardLift 500ms ease forwards;
}

.reveal-card__jersey {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  font-weight: 900;
  opacity: 0.12;
  line-height: 1;
  pointer-events: none;
}

.reveal-card__rank {
  font-size: 32px;
  font-weight: 900;
  color: rgba(255,255,255,0.15);
  width: 36px;
  flex-shrink: 0;
}

.reveal-card__content { flex: 1; }
.reveal-card__pos     { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.reveal-card__name    { font-size: 20px; font-weight: 700; color: #ffffff; }
.reveal-card__stats   { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px; }

/* ── GOAT Board ───────────────────────────────────────────── */
.board-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}

.board-row:hover { background: rgba(255,255,255,0.05); }

.board-row.your-pick {
  border-color: rgba(245,200,74,0.3);
  background: rgba(245,200,74,0.05);
}

.board-rank {
  width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.board-rank--1 { color: #f5c84a; }
.board-rank--2 { color: #b0b8c8; }
.board-rank--3 { color: #cd7f32; }
.board-rank--other { color: rgba(255,255,255,0.3); }

.board-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.board-name  { font-weight: 600; font-size: 15px; flex: 1; }
.board-count { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.6); white-space: nowrap; }

.board-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 4px;
}

.board-bar__fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.your-pick-tag {
  font-size: 10px;
  color: #f5c84a;
  font-weight: 700;
  background: rgba(245,200,74,0.1);
  border: 1px solid rgba(245,200,74,0.3);
  border-radius: 6px;
  padding: 2px 7px;
}

/* ── Position filter tabs ─────────────────────────────────── */
.pos-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pos-tab {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  transition: all 0.15s;
  text-decoration: none;
}

.pos-tab:hover { background: rgba(255,255,255,0.09); color: #ffffff; }
.pos-tab.active {
  background: rgba(245,200,74,0.12);
  border-color: #f5c84a;
  color: #f5c84a;
}

/* ── Quick Draft board ────────────────────────────────────── */
.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.player-tile {
  background: #1a1a2e;
  border: 2px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
}

.player-tile:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}

.player-tile.selected {
  border-color: #f5c84a;
  background: rgba(245,200,74,0.07);
}

.player-tile__jersey {
  position: absolute;
  bottom: -5px;
  right: 4px;
  font-size: 52px;
  font-weight: 900;
  opacity: 0.1;
  line-height: 1;
  pointer-events: none;
}

.player-tile__name { font-size: 13px; font-weight: 600; position: relative; z-index: 1; }
.player-tile__pos  { font-size: 10px; color: rgba(255,255,255,0.45); margin-top: 2px; }

.player-tile__rank-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f5c84a;
  color: #0d0d18;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Share card ───────────────────────────────────────────── */
.share-card {
  background: #080810;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}

.share-card__eyebrow {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}

.share-card__jerseys {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 16px 0;
}

.share-jersey {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
}

.share-card__footer {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 16px;
}

/* ── Top 5 share card (square / Instagram) ────────────────── */
.top5-share-card {
  background: #080810;
  border-radius: 16px;
  padding: 28px 20px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  max-width: 360px;
  margin: 0 auto;
}

.top5-share-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.top5-share-row {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.top5-share-player {
  text-align: center;
}

.top5-share-player__num {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
}

.top5-share-player__name {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

/* ── Onboarding ───────────────────────────────────────────── */
.onboard-screen {
  min-height: 100vh;
  background: #0d0d18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.rule-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  margin: 24px 0;
}

.rule-card {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.rule-card__icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.rule-card__title {
  font-size: 14px;
  font-weight: 700;
  color: #f5c84a;
  margin-bottom: 3px;
}

.rule-card__body {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  line-height: 1.45;
}

/* ── Search input ─────────────────────────────────────────── */
.search-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: rgba(255,255,255,0.3); }
.search-input:focus { border-color: rgba(255,255,255,0.3); }

/* ── Social share buttons ─────────────────────────────────── */
.share-buttons {
  display: flex;
  gap: 10px;
}

.share-btn {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.85);
  transition: background 0.12s;
}

.share-btn:hover { background: rgba(255,255,255,0.08); }

/* ── Bracket / position selector ─────────────────────────── */
.bracket-positions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.bracket-pos-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  transition: all 0.15s;
}

.bracket-pos-btn.active  { background: rgba(245,200,74,0.1); border-color: #f5c84a; color: #f5c84a; }
.bracket-pos-btn.done    { background: rgba(34,197,94,0.08); border-color: #22c55e; color: #22c55e; }

/* ── Bias chart bars ──────────────────────────────────────── */
.bias-chart { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }

.bias-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bias-row__pos  { width: 24px; font-size: 11px; font-weight: 700; }
.bias-row__bar  { flex: 1; height: 20px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.bias-row__fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.bias-row__count { width: 28px; text-align: right; font-size: 12px; font-weight: 600; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes diceRoll {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(-15deg) scale(0.9); }
  75%  { transform: rotate(12deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

@keyframes sigPulse {
  0%   { box-shadow: 0 0 0 0 rgba(245,200,74,0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(245,200,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,200,74,0); }
}

@keyframes bustIn {
  0%   { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cardLift {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes swipeLeft {
  to { transform: translateX(-120%) rotate(-15deg); opacity: 0; }
}

@keyframes swipeRight {
  to { transform: translateX(120%) rotate(15deg); opacity: 0; }
}

/* ── Utilities ────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-gold   { color: #f5c84a; }
.text-green  { color: #22c55e; }
.text-red    { color: #ef4444; }
.text-muted  { color: rgba(255,255,255,0.45); }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.hidden  { display: none !important; }
.flex    { display: flex; }
.flex-col { flex-direction: column; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Bracket Transition Screen ────────────────────────────── */
#bracket-transition-screen {
  padding: 20px 0 4px;
  animation: none;
}

#bracket-transition-screen.bts-in {
  animation: bts-fade-up 0.28s ease both;
}

@keyframes bts-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Quick Draft Clock ────────────────────────────────────── */
.draft-pick-label {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #f5c84a;
  line-height: 1.1;
}

.draft-pick-label--tick {
  animation: draft-tick 0.32s ease both;
}

@keyframes draft-tick {
  0%   { opacity: 0.4; transform: scale(0.93); }
  60%  { opacity: 1;   transform: scale(1.04); }
  100% { opacity: 1;   transform: scale(1); }
}

@media (max-width: 480px) {
  .draft-pick-label { font-size: 17px; }
}

/* ── Bracket Tree ─────────────────────────────────────────── */
.bracket-tree-wrap {
  position: relative;
  overflow-x: auto;
  margin: 16px 0 20px;
  padding: 4px 0 4px;
}

.bt-grid {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.bt-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 0;
  padding: 0 18px 0 0; /* right padding = connector arm width */
}

.bt-col:last-child { padding-right: 0; }

.bt-match {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 4px;
}

.bt-slot {
  height: 34px;
  min-width: 90px;
  max-width: 112px;
  background: #14142a;
  border: 1px solid rgba(255,255,255,0.09);
  border-left: 3px solid rgba(255,255,255,0.15);
  border-radius: 7px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.25s, background 0.25s, opacity 0.25s;
}

.bt-slot__num  { display: none; } /* hidden in tree — name alone is enough */
.bt-slot__name { overflow: hidden; text-overflow: ellipsis; }

.bt-slot--tbd  {
  color: rgba(255,255,255,0.22);
  font-style: italic;
  font-size: 10px;
  border-left-color: rgba(255,255,255,0.07);
  justify-content: center;
}

.bt-slot--bye  {
  color: rgba(255,255,255,0.18);
  border-style: dashed;
  border-left-style: dashed;
  justify-content: center;
  font-size: 10px;
}

.bt-slot--winner {
  border-left-color: #22c55e !important;
  background: rgba(34,197,94,0.08);
  color: #22c55e;
}

.bt-slot--eliminated {
  opacity: 0.28;
}

.bt-slot--active {
  box-shadow: 0 0 0 2px #f5c84a;
  border-left-color: #f5c84a !important;
}

.bt-slot--champion {
  min-width: 92px;
  height: 40px;
  border-color: #f5c84a;
  border-left-color: #f5c84a;
  background: rgba(245,200,74,0.08);
  color: #f5c84a;
  font-weight: 800;
  font-size: 11px;
  justify-content: center;
  gap: 4px;
}

.bt-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* ── Hamburger button (hidden on desktop) ─────────────────── */
.goat-nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
}
.goat-nav__hamburger:hover { background: rgba(255,255,255,0.08); }
.goat-nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.75);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}
/* Three bars animate into an X when open */
.goat-nav__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.goat-nav__hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.goat-nav__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav — breakpoint ──────────────────────────────── */
@media (max-width: 768px) {
  .goat-nav__hamburger { display: flex; }

  /* Collapse the link row until mobile-open */
  .goat-nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(13,13,24,0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 6px 0 20px;
    z-index: 99;
    animation: mobileNavIn 0.2s ease;
  }
  @keyframes mobileNavIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .goat-nav__links.mobile-open { display: flex; }

  /* Stack every top-level link */
  .goat-nav__links > a {
    padding: 14px 22px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    width: 100%;
    box-sizing: border-box;
  }

  /* User menu stretches full width */
  .nav-user-menu { width: 100%; }
  .nav-user-btn {
    width: 100%;
    padding: 14px 22px;
    border-radius: 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    justify-content: flex-start;
    gap: 8px;
  }
  /* Hide the caret — sub-items always visible on mobile */
  .goat-nav__links.mobile-open .nav-user-caret { display: none; }

  /* Expand the user dropdown inline (no extra tap needed) */
  .goat-nav__links.mobile-open .nav-user-dropdown {
    position: static !important;
    display: flex !important;
    flex-direction: column;
    background: rgba(255,255,255,0.03);
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-width: 0;
    padding: 4px 0 8px;
  }
  .goat-nav__links.mobile-open .nav-user-dropdown a {
    padding: 11px 36px;
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    border-bottom: none;
  }
  .goat-nav__links.mobile-open .nav-user-divider {
    margin: 6px 22px;
  }
  .goat-nav__links.mobile-open .nav-user-logout {
    padding: 11px 36px;
    font-size: 14px;
    width: 100%;
    text-align: left;
  }

  /* Sign in / Join free for guests */
  .goat-nav__links > a[href*="login"] { color: rgba(255,255,255,0.7) !important; }
  .goat-nav__links > .btn--gold {
    margin: 10px 22px 0 !important;
    display: block !important;
    text-align: center !important;
    padding: 11px 14px !important;
    font-size: 14px !important;
    box-sizing: border-box;
    width: calc(100% - 44px);
  }
}

/* ── Small mobile ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .bt-slot { min-width: 62px; height: 28px; padding: 0 6px; font-size: 10px; }
  .bt-col { padding-right: 11px; }
  .bt-slot--champion { min-width: 66px; height: 32px; }
  .goat-nav { padding: 10px 14px; }
  .goat-nav__logo { font-size: 16px; }
  .container { padding: 0 12px; }
  .swipe-card { min-height: 440px; }
  .battle-player__score { font-size: 36px; }
  .die { width: 46px; height: 46px; font-size: 20px; }
}
