/* ─────────────────────────────────────────
   Variables & Reset
───────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --card:        #21262d;
  --card-hover:  #2d333b;
  --border:      #30363d;
  --gold:        #d4af37;
  --gold-light:  #ffd700;
  --gold-glow:   rgba(212,175,55,.35);
  --green:       #3fb950;
  --red:         #f85149;
  --blue:        #388bfd;
  --purple:      #bc8cff;
  --orange:      #d29922;
  --text:        #e6edf3;
  --muted:       #8b949e;
  --r:           12px;
  --r-sm:        8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────
   Screen Shell
───────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ─────────────────────────────────────────
   Shared Atoms
───────────────────────────────────────── */
.gold { color: var(--gold); }

.section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
}

.btn-primary {
  padding: 15px 52px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: var(--gold);
  color: #0d1117;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold-light);
  transform: scale(1.04);
  box-shadow: 0 8px 32px var(--gold-glow);
}
.btn-primary:disabled { opacity: .3; cursor: not-allowed; }


/* ─────────────────────────────────────────
   HOME SCREEN
───────────────────────────────────────── */
#home-screen {
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #1c2640 0%, var(--bg) 70%);
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 920px;
}

/* Decorative rings at top */
.home-rings-deco {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}
.deco-ring {
  font-size: 22px;
  line-height: 1;
  opacity: .6;
  user-select: none;
}
.deco-ring::before { content: '💍'; }

.home-title {
  font-size: clamp(64px, 12vw, 108px);
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1;
  color: var(--text);
  margin-bottom: 14px;
  text-transform: uppercase;
}

.home-sub {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 56px;
  text-align: center;
}

/* Style picker */
.style-picker { width: 100%; margin-bottom: 40px; }
.style-picker > .section-eyebrow { text-align: center; margin-bottom: 20px; }

.style-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.style-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: 28px 24px;
  cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  text-align: center;
}
.style-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px var(--gold-glow);
}
.style-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 16px 48px var(--gold-glow);
}

.style-card-icon  { font-size: 36px; margin-bottom: 12px; }
.style-card-name  { font-size: 17px; font-weight: 800; letter-spacing: 2px; margin-bottom: 10px; }
.style-card-desc  { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 16px; }
.style-card-roster {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold);
  opacity: .75;
}


/* ─────────────────────────────────────────
   DRAFT SCREEN
───────────────────────────────────────── */
/* Fixed-height screen so body + sidebar scroll independently */
#draft-screen {
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

/* Header */
.draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.draft-header-left { display: flex; align-items: center; gap: 14px; }

.logo-small { font-size: 17px; font-weight: 900; letter-spacing: 2px; }

.style-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.style-badge.balanced   { background: rgba(56,139,253,.12);  color: var(--blue);   border: 1px solid rgba(56,139,253,.3);  }
.style-badge.pass_heavy { background: rgba(188,140,255,.12); color: var(--purple); border: 1px solid rgba(188,140,255,.3); }
.style-badge.run_heavy  { background: rgba(210,153,34,.12);  color: var(--orange); border: 1px solid rgba(210,153,34,.3);  }

.pick-counter { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ── Draft layout: scrollable body + fixed right sidebar ── */
.draft-layout {
  flex: 1;
  display: flex;
  min-height: 0; /* lets flex children scroll */
  overflow: hidden;
}

/* Right sidebar */
.draft-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
}

.sidebar-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Vertical slot list */
.draft-slots-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slot-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: transparent;
  transition: border-color .15s, background .15s;
}
.slot-chip.active {
  border-color: var(--gold);
  background: rgba(212,175,55,.08);
}
.slot-chip.filled {
  border-color: rgba(63,185,80,.35);
  background: rgba(63,185,80,.06);
  padding: 12px 14px;
}
.slot-chip.filled .slot-chip-avatar {
  width: 56px;
  height: 56px;
}
.slot-chip.filled .slot-chip-name {
  font-size: 14px;
}
.slot-chip.filled .slot-chip-score {
  font-size: 14px;
}

/* Circular player photo in filled slots */
.slot-chip-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--card);
  border: 2px solid rgba(63,185,80,.45);
}
.slot-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.chip-avatar-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  background: linear-gradient(135deg, #1c2640, var(--card));
}

/* Placeholder dot for empty / active slots */
.slot-chip-dot {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px dashed var(--border);
  background: transparent;
}
.slot-chip-dot.active {
  border-color: var(--gold);
  border-style: solid;
  background: rgba(212,175,55,.08);
  animation: chipPulse 1.6s ease-in-out infinite;
}
@keyframes chipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,.45); }
  50%       { box-shadow: 0 0 0 7px rgba(212,175,55,0); }
}

/* Stacked label + name */
.slot-chip-mid {
  flex: 1;
  min-width: 0;
}
.slot-chip-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.slot-chip.active .slot-chip-label { color: var(--gold); }
.slot-chip.filled .slot-chip-label { color: var(--green); }

.slot-chip-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.slot-chip-score {
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Draft body — flex column, no scroll, everything fits in viewport */
.draft-body {
  flex: 1;
  min-width: 0;
  padding: 12px 18px 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.drafting-label {
  text-align: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.drafting-now {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--muted);
  margin-bottom: 3px;
}
.drafting-pos {
  display: block;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 4px;
}
.drafting-team {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  background: rgba(212,175,55,.1);
  border: 1px solid rgba(212,175,55,.3);
}

/* Reroll buttons */
.draft-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 6px 0 8px;
  flex-shrink: 0;
}
.btn-reroll {
  padding: 7px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-reroll:hover:not(:disabled) {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(212,175,55,.08);
}
.btn-reroll:disabled {
  opacity: .25;
  cursor: not-allowed;
}
.btn-reveal {
  color: var(--blue);
  border-color: rgba(56,139,253,.35);
}
.btn-reveal:hover:not(:disabled) {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(56,139,253,.08);
}

/* Player grid — 5 cols × 3 rows, fills remaining body height without scrolling */
.player-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  flex: 1;
  min-height: 0;
}

/* Player card */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.player-card {
  background: linear-gradient(170deg, var(--team-tint, rgba(33,38,45,0)) 0%, var(--card) 65%);
  border: 2px solid var(--team-border, var(--border));
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s, background .15s;
  animation: cardIn .3s ease both;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.player-card:hover {
  background: linear-gradient(170deg, var(--team-tint-hover, rgba(56,139,253,.12)) 0%, var(--card-hover) 70%);
  border-color: var(--team-border, var(--gold));
  transform: translateY(-4px);
  box-shadow: 0 12px 36px var(--team-tint, var(--gold-glow));
}
.player-card.selected {
  border-color: var(--team-border, var(--gold));
  box-shadow: 0 0 0 3px var(--team-border, var(--gold)), 0 16px 40px var(--team-tint-hover, var(--gold-glow));
  transform: scale(1.04);
  pointer-events: none;
}

/* Headshot — fixed at 52% of card height so body has more visual weight */
.player-headshot {
  width: 100%;
  flex: 0 0 70%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  position: relative;
}

/* Blurred team logo fills the background behind the player photo */
.headshot-logo-bg {
  position: absolute;
  inset: -15%;
  width: 130%;
  height: 130%;
  object-fit: contain;
  object-position: center;
  filter: blur(8px) brightness(0.4) saturate(1.6);
  pointer-events: none;
  z-index: 0;
}

/* Player photo sits on top of the blurred logo */
.headshot-player-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.headshot-placeholder {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--muted);
  letter-spacing: 1px;
}

/* Card body — flex:1 fills the remaining card height below the headshot */
.player-card-body { padding: 6px 8px; flex: 1; }

.player-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-card-meta {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.player-card-score {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
}
.player-card-stats {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
}

/* Score + stats slide in after pick — hidden height saves space before reveal */
.player-card-reveal {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}
.player-card.revealed .player-card-reveal {
  max-height: 80px;
}

/* Score colours (shared) */
.pos  { color: var(--green); background: rgba(63,185,80,.12);  border: 1px solid rgba(63,185,80,.25);  }
.neg  { color: var(--red);   background: rgba(248,81,73,.12);  border: 1px solid rgba(248,81,73,.25);  }
.zero { color: var(--gold);  background: rgba(212,175,55,.12); border: 1px solid rgba(212,175,55,.25); }

.pos-text  { color: var(--green); }
.neg-text  { color: var(--red);   }
.zero-text { color: var(--gold);  }


/* ─────────────────────────────────────────
   RESULTS SCREEN
───────────────────────────────────────── */
#results-screen {
  align-items: center;
  padding: 48px 24px 60px;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, #1c2640 0%, var(--bg) 65%);
}

.results-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 680px;
  gap: 0;
}

.results-team-score {
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 36px;
}

/* Rings row */
.rings-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ring {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  line-height: 1;
  opacity: .15;
  user-select: none;
}
.ring::before { content: '💍'; }

@keyframes ringPop {
  0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
  65%  { transform: scale(1.22) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.ring.earned {
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(212,175,55,.7));
  animation: ringPop .55s cubic-bezier(.175,.885,.32,1.275) both;
}

.rings-label {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 40px;
}

/* Final roster table */
.final-roster {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 36px;
}

.roster-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  animation: cardIn .3s ease both;
}
.roster-row:last-child { border-bottom: none; }

.roster-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card);
  flex-shrink: 0;
}
.roster-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.avatar-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1c2640, var(--card));
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
}

.roster-slot {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  width: 72px;
  flex-shrink: 0;
}

.roster-info { flex: 1; min-width: 0; }
.roster-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-meta {
  font-size: 11px;
  color: var(--muted);
}

.roster-score {
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}


/* ─────────────────────────────────────────
   HOW TO PLAY modal
───────────────────────────────────────── */
.htp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity .25s ease;
}
.htp-overlay.htp-hidden {
  opacity: 0;
  pointer-events: none;
}

.htp-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
}

/* Header */
.htp-header { text-align: center; }
.htp-logo {
  display: block;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.htp-tagline {
  font-size: 13px;
  color: var(--muted);
}

/* Steps */
.htp-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.htp-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.htp-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212,175,55,.15);
  border: 1px solid rgba(212,175,55,.4);
  color: var(--gold);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.htp-step-body { flex: 1; min-width: 0; }
.htp-step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.htp-step-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.htp-step-desc strong { color: var(--text); font-weight: 700; }

/* Ring thresholds */
.htp-rings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
}
.htp-rings-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 12px;
}
.htp-rings-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.htp-ring-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.htp-ring-rings {
  width: 52px;
  font-weight: 800;
  flex-shrink: 0;
}
.htp-ring-score {
  width: 40px;
  font-weight: 700;
  flex-shrink: 0;
}
.htp-ring-desc {
  color: var(--muted);
  font-size: 11px;
}

/* CTA button */
.htp-cta {
  width: 100%;
  margin-top: 4px;
}

/* ─────────────────────────────────────────
   Scrollbar
───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─────────────────────────────────────────
   Responsive — large desktop
───────────────────────────────────────── */
@media (max-width: 1200px) {
  .player-grid { grid-template-columns: repeat(5, 1fr); }
  .draft-sidebar { width: 240px; }
}
@media (max-width: 1000px) {
  .draft-sidebar { width: 200px; padding: 16px 12px; }
}

/* ─────────────────────────────────────────
   Mobile  (≤ 767px)
   - Draft screen unlocks from 100vh
   - Sidebar becomes horizontal roster strip pinned above player cards
   - 3-column grid with aspect-ratio cards (no fixed row heights)
───────────────────────────────────────── */
@media (max-width: 767px) {

  /* ── Home ── */
  #home-screen { padding: 36px 16px 48px; }
  .home-sub { font-size: 15px; margin-bottom: 28px; }
  .style-cards { grid-template-columns: 1fr; }
  .style-card { padding: 20px 18px; }
  .style-card-icon { font-size: 28px; margin-bottom: 8px; }

  /* ── Draft screen: allow full-page scroll ── */
  #draft-screen { height: auto; overflow: visible; }

  .draft-layout {
    flex-direction: column;
    overflow: visible;
    min-height: unset;
  }

  /* ── Sidebar → horizontal roster strip pinned above draft body ── */
  .draft-sidebar {
    order: -1;          /* float above the draft body */
    width: 100%;
    border-left: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-title { display: none; }

  .draft-slots-bar {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
  }

  /* Compact vertical chip for the horizontal strip */
  .slot-chip {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    width: 50px;
    padding: 5px 4px 6px;
    gap: 3px;
    text-align: center;
  }
  .slot-chip.filled { padding: 5px 4px 6px; }

  .slot-chip-dot,
  .slot-chip-avatar,
  .slot-chip.filled .slot-chip-avatar {
    width: 32px;
    height: 32px;
  }

  .slot-chip-label { font-size: 8px; margin-bottom: 0; }

  /* Hide name & score in compact strip — position label is enough */
  .slot-chip-name,
  .slot-chip-score,
  .slot-chip.filled .slot-chip-name,
  .slot-chip.filled .slot-chip-score { display: none; }

  /* ── Draft body: full-width, scrollable ── */
  .draft-body {
    overflow-y: visible;
    padding: 10px 12px 24px;
  }

  /* ── Compact drafting label ── */
  .drafting-label { margin-bottom: 6px; }
  .drafting-now { margin-bottom: 2px; }
  .drafting-pos { font-size: 20px; margin-bottom: 3px; }
  .drafting-team { font-size: 12px; padding: 2px 12px; }

  /* ── Reroll buttons: stretch to fill row ── */
  .draft-actions { margin: 6px 0 10px; gap: 8px; }
  .btn-reroll {
    flex: 1;
    font-size: 10px;
    padding: 8px 6px;
    letter-spacing: 0.8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ── Player grid: 3 cols, auto-height rows (no desktop flex fill) ── */
  .player-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    flex: unset;
    min-height: unset;
    gap: 6px;
  }

  /* Cards: height determined by content, not grid cell fill */
  .player-card { height: auto; }

  /* Headshot: aspect-ratio crop instead of % of card height */
  .player-headshot {
    flex: unset;
    width: 100%;
    aspect-ratio: 1 / 1;   /* square crop on mobile */
  }

  /* Body: size to content */
  .player-card-body { flex: unset; flex-shrink: 0; padding: 5px 6px; }
  .player-card-name { font-size: 11px; margin-bottom: 1px; }
  .player-card-meta { font-size: 10px; margin-bottom: 1px; }

  /* ── How-to-play modal ── */
  .htp-modal { padding: 24px 18px 22px; gap: 18px; }
  .htp-logo { font-size: 26px; }
  .htp-step-num { width: 28px; height: 28px; font-size: 12px; }

  /* ── Results screen ── */
  #results-screen { padding: 28px 14px 44px; }
  .rings-label { font-size: 20px; margin-bottom: 28px; }
  .ring { width: 46px; height: 46px; border-width: 6px; }
  .rings-row { gap: 10px; margin-bottom: 10px; }
  .roster-slot { display: none; }
  .roster-row { padding: 10px 12px; gap: 10px; }
  .roster-name { font-size: 13px; }
}

/* ─────────────────────────────────────────
   Very small phones  (≤ 380px)
───────────────────────────────────────── */
@media (max-width: 380px) {
  .player-grid { grid-template-columns: repeat(2, 1fr); }
  .player-headshot { aspect-ratio: 4 / 3; }
  .btn-reroll { font-size: 9px; padding: 7px 4px; }
}
