/* Any Given Sunday — v0 styles (mobile-first) */

:root {
  --bg: #0b132b;
  --bg-2: #131c3a;
  --card: #1a2547;
  --card-2: #21305c;
  --line: #2c3a66;
  --text: #eef2ff;
  --muted: #9aa6cc;
  --accent: #ffd166; /* end-zone gold */
  --win: #3ddc84;
  --lose: #ff6b6b;
  --tie: #ffd166;
  --you: #4cc9f0;
  --opp: #ff8fa3;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  /* dark base so iOS overscroll + notch/home-bar safe areas never flash white */
  background: var(--bg);
}
html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(1200px 600px at 50% -10%, #1b2750 0%, var(--bg) 55%);
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.4;
  min-height: 100vh;
  min-height: 100dvh;
}

#app {
  max-width: 540px;
  margin: 0 auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.screen {
  animation: fade 0.18s ease;
}
.hidden {
  display: none !important;
}
/* opacity-only: a transform here would make the fixed .sticky-foot position
   relative to the animating screen, flashing the Spin button at the top first. */
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  background: var(--card-2);
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(180deg, #ffdd80, var(--accent));
  color: #20232e;
}
.btn-secondary {
  background: var(--card-2);
  border: 1px solid var(--line);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-sm {
  padding: 8px 10px;
  font-size: 0.85rem;
  border-radius: 10px;
}
.btn-big {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
}

/* ---------- Intro ---------- */
.hero {
  text-align: center;
  padding: 28px 8px 10px;
}
.logo {
  font-size: 2.5rem;
  line-height: 0.95;
  letter-spacing: 1px;
  margin: 0;
  font-weight: 900;
}
.logo span {
  color: var(--accent);
}
.tagline {
  color: var(--muted);
  margin: 12px 4px 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.rules h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rules ol {
  margin: 0;
  padding-left: 18px;
}
.rules li {
  margin: 8px 0;
  color: #dde4ff;
}
.pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.fineprint {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  margin: 14px 6px 0;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.topbar-title {
  font-weight: 800;
}
.topbar-title span {
  color: var(--accent);
}

/* ---------- Roster ---------- */
.roster {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.slot {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
}
.slot .slot-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.slot.filled {
  border-style: solid;
  border-color: var(--you);
  background: linear-gradient(180deg, var(--card-2), var(--card));
}
.slot .slot-name {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.1;
}
.slot .slot-team {
  font-size: 0.62rem;
  color: var(--muted);
}
.slot .slot-x {
  font-size: 0.6rem;
  color: var(--opp);
  margin-top: 3px;
}
.slot .slot-empty {
  font-size: 1.3rem;
  color: var(--line);
  margin-top: 4px;
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.chip-active {
  background: var(--accent);
  color: #20232e;
  border-color: var(--accent);
}

/* ---------- Pool ---------- */
.pool {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 96px;
}
.pcard {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.pcard:active {
  background: var(--card-2);
}
.pcard.drafted {
  opacity: 0.4;
  pointer-events: none;
}
.pcard-main {
  flex: 1 1 auto;
  min-width: 0;
}
.pcard-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.pcard-sub {
  font-size: 0.74rem;
  color: var(--muted);
}
.pcard-avg {
  flex: 0 0 auto;
  text-align: right;
}
.pcard-avg b {
  font-size: 1.05rem;
  color: var(--accent);
}
.pcard-avg small {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
}

/* ---------- Sticky footer (draft) ---------- */
.sticky-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--bg) 70%, transparent);
}
.sticky-foot .btn {
  max-width: 540px;
  margin: 0 auto;
  display: block;
}

/* ---------- Result ---------- */
.banner {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 18px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.banner.win {
  background: rgba(61, 220, 132, 0.14);
  border: 1px solid var(--win);
  color: var(--win);
}
.banner.lose {
  background: rgba(255, 107, 107, 0.14);
  border: 1px solid var(--lose);
  color: var(--lose);
}
.banner.tie {
  background: rgba(255, 209, 102, 0.14);
  border: 1px solid var(--tie);
  color: var(--tie);
}

.scoreline {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.score-team {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.score-team .st-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}
.score-team .st-pts {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
}
.score-team.you { border-color: var(--you); }
.score-team.opp { border-color: var(--opp); }
.score-vs {
  align-self: center;
  font-weight: 800;
  color: var(--muted);
}

/* per-slot matchup rows */
.matchup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mrow {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.mrow-slot {
  text-align: center;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 5px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.mrow-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}
.side {
  padding: 10px;
  min-width: 0;
}
.side.right {
  text-align: right;
}
.side .s-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side .s-game {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
  /* lock to exactly two lines so the score below never bops with the stat-line length */
  line-height: 1.4;
  height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.side .s-pts {
  font-size: 1.25rem;
  font-weight: 900;
  margin-top: 4px;
  color: var(--text);          /* neutral off-white for both sides... */
}
.side .s-pts.winner { color: var(--win); }   /* ...the higher score turns green */
.mid-divider {
  width: 1px;
  background: var(--line);
}

.run-status {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin: -4px 0 12px;
}
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.action-row {
  display: flex;
  gap: 8px;
}
.action-row .btn {
  flex: 1;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: #000d;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 50;
  border: 1px solid var(--line);
  animation: fade 0.15s ease;
}

/* ---------- Setup menu (two independent axes: opponents × stats) ---------- */
.card.setup { padding: 14px; }
.setup-group { margin-bottom: 14px; }
.setup-group:last-of-type { margin-bottom: 4px; }
.setup-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 2px 7px;
}
.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font-weight: 800;
  font-size: 0.97rem;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.05s ease;
}
.seg-btn:active { transform: scale(0.98); }
.seg-btn small { font-weight: 600; font-size: 0.68rem; color: var(--muted); line-height: 1.1; }
.seg-btn.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.18), rgba(255, 209, 102, 0.05));
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.25);
}
.seg-btn.active small { color: #e8dcbb; }
.setup-summary {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin: 12px 4px 2px;
  line-height: 1.5;
}
.setup-summary .sum-stats { color: var(--muted); font-weight: 600; }

/* ⚡ Fast-sim switch (used by the per-week preview toggle) — iOS-style pill */
.fast-switch {
  flex: 0 0 auto;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card-2);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.fast-switch .fast-knob {
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.16s ease, background 0.16s ease;
}
.fast-switch.on {
  background: linear-gradient(180deg, #ffdd80, var(--accent));
  border-color: var(--accent);
}
.fast-switch.on .fast-knob { transform: translateY(-50%) translateX(19px); background: #20232e; }
.fast-switch:active .fast-knob { width: 23px; }   /* subtle press feedback */

/* ⚡ per-week fast-sim toggle row (injected on the matchup preview + result screens) */
.fast-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  max-width: 540px; margin: 0 auto 10px;
}
.fast-row-label { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.3px; color: var(--muted); }

/* ⚡ fast mode also compresses the CSS row animations so they match the quicker JS timers */
#matchup.fast-sim .mrow.just-in { animation-duration: 0.18s; }
#matchup.fast-sim .mrow.landed .s-pts { animation-duration: 0.14s; }

/* mode badge in the draft top bar */
.mode-badge {
  display: block;
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}

/* hidden stat block (Memory mode pool cards) */
.pcard-avg.hidden-stat {
  font-size: 1.2rem;
  opacity: 0.65;
  text-align: center;
}
.pcard-avg.hidden-stat small {
  display: block;
  font-size: 0.58rem;
  color: var(--muted);
}

/* ---------- Spin draft ---------- */
.slot-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.strack {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 7px 3px;
  text-align: center;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.strack.cur {
  border-style: solid;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.18);
}
.strack.filled {
  border-style: solid;
  border-color: var(--you);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  cursor: pointer;
}
.strack .st-slot { font-size: 0.62rem; font-weight: 800; color: var(--muted); letter-spacing: 0.5px; }
.strack .st-name { font-size: 0.7rem; font-weight: 700; margin-top: 3px; line-height: 1.05; }
.strack .st-era { font-size: 0.58rem; color: var(--muted); }
.strack .st-empty { font-size: 1rem; color: var(--line); margin-top: 4px; }
.strack.cur .st-empty { color: var(--accent); }

#spin-stage { text-align: center; padding: 8px 0 12px; }
/* ---------- Slot machine (vertical-reel spin) ---------- */
.slot-machine { display: flex; gap: 14px; justify-content: center; margin: 12px 0 22px; }
.reel {
  flex: 1;
  max-width: 180px;
  background: linear-gradient(180deg, var(--bg-2), #0e1530);
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 10px 8px 12px;
}
.reel-team { border-color: var(--accent); }
.reel-season { border-color: #c77dff; }
.reel-label { display: block; font-size: 0.7rem; font-weight: 800; letter-spacing: 1px; margin-bottom: 8px; }
.reel-team .reel-label { color: var(--accent); }
.reel-season .reel-label { color: #c77dff; }
.reel-window {
  position: relative;
  height: 64px;             /* one item tall — must match REEL_ITEM_H in app.js */
  overflow: hidden;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.3);
  /* inner top/bottom shadows sell the "behind glass" reel depth */
  box-shadow: inset 0 9px 9px -8px rgba(0, 0, 0, 0.75), inset 0 -9px 9px -8px rgba(0, 0, 0, 0.75);
}
.reel-strip { display: flex; flex-direction: column; will-change: transform; }
.reel-item {
  height: 64px;
  line-height: 64px;
  text-align: center;
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--text);
}
.reel.landed .reel-item:last-child { animation: reelLand 0.42s ease; }
@keyframes reelLand { 0% { transform: scale(1.16); } 55% { transform: scale(0.95); } 100% { transform: scale(1); } }
.rolling-note {
  margin: 18px 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--muted);
  animation: pulse 0.9s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.all-set { padding: 28px 12px; font-size: 1.1rem; font-weight: 700; color: var(--win); }

.pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.pick-ctx { font-size: 0.95rem; color: #dde4ff; }
.pick-ctx b { color: var(--accent); }

.s-era {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* re-roll budget counter (topbar) */
.reroll-count {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
}

/* open slot in tracker (what a spin can fill) */
.strack.open {
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.85;
}
.strack.open .st-empty { color: var(--accent); }
.strack.locked { cursor: default; }

/* a player whose position slot is already filled — shown but not pickable */
.pcard.unplaceable {
  opacity: 0.4;
  pointer-events: none;
}
.flex-tag {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

/* position tabs in the pick list */
.pos-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
}
.postab {
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
}
.postab small { font-weight: 600; font-size: 0.7rem; opacity: 0.75; }
.postab.active { background: var(--accent); color: #20232e; border-color: var(--accent); }
.postab.pos-filled { opacity: 0.5; }
.postab.pos-filled.active { opacity: 1; background: var(--card-2); color: var(--muted); }

/* paced result reveal — players show immediately; each game + score animates in */
.banner.simulating {
  background: rgba(76, 201, 240, 0.12);
  border: 1px solid var(--you);
  color: var(--you);
  letter-spacing: 2px;
}
/* each revealed row slides in at the top and pushes the rest down (feed from the top) */
.mrow.just-in { animation: rowIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rowIn {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: none; }
}
.mrow.rolling .s-pts { color: var(--muted); }            /* dim while stats flick... */
.mrow.landed .s-pts { animation: scorePop 0.3s ease; }   /* ...pop + color when they land */
.score-team .st-pts { animation: scorePop 0.3s ease; }
.score-team .st-pts.lead { color: var(--win); }   /* team currently ahead = green */
@keyframes scorePop { 0% { transform: scale(1.16); } 100% { transform: scale(1); } }

/* ---------- Matchup preview (scout the real team-season) ---------- */
.prev-hero {
  text-align: center;
  background: radial-gradient(420px 220px at 50% -20%, rgba(76, 201, 240, 0.16) 0%, transparent 60%),
    linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px 18px;
  margin-bottom: 14px;
}
.prev-up {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--you);
}
.prev-name {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.05;
  margin: 6px 0 4px;
  color: var(--text);
}
.prev-tag {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  font-style: italic;
  min-height: 1.1em;
}
.prev-power {
  margin-top: 12px;
}
.prev-stars {
  font-size: 1.35rem;
  letter-spacing: 3px;
  color: var(--accent);
  line-height: 1;
}
.prev-stars .dim {
  color: var(--line);
}
.prev-tier {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.prev-label {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
/* opponent roster cards reuse .pcard; add a slot badge and lock them non-interactive */
.prev-pcard {
  cursor: default;
}
.prev-pcard:active {
  background: var(--card);
}
.prev-slot {
  flex: 0 0 34px;
  text-align: center;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--muted);
}

/* ---------- Player avatar (real headshot, team-color frame, helmet fallback) ---------- */
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;       /* fixed size as a flex item (pick cards) */
  border-radius: 9px;
  border: 2px solid transparent;   /* team color set inline (Edit 9) */
  overflow: hidden;
  vertical-align: middle;
}
.av-helmet {            /* generic helmet fallback, shown under the photo (Edit 8) */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 22%;
  box-sizing: border-box;
  opacity: 0.95;
}
.av-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;                 /* hidden until it actually loads — helmet shows meanwhile */
  transition: opacity 0.25s ease;
}
.av-img.loaded { opacity: 1; }
.avatar.av-sm { width: 34px; height: 34px; flex-basis: 34px; }
.avatar.av-xs {
  width: 26px; height: 26px; flex-basis: 26px;
  align-self: center; margin: 2px auto 0;
}

/* ============================================================
   Title (home) + Onboarding  (additive — onboarding branch)
   ============================================================ */
#screen-title { display: flex; min-height: calc(100dvh - 40px); }
.title-wrap { margin: auto; text-align: center; padding: 24px 12px; max-width: 460px; }
.title-logo { font-size: 2.9rem; }
.title-line { color: var(--text); font-size: 1.02rem; line-height: 1.5; margin: 18px 6px 28px; }
.title-line b { color: var(--accent); }
.title-wrap .btn-big { max-width: 320px; margin: 0 auto; }
.title-wrap .fineprint { margin-top: 18px; }

#screen-onboarding { position: relative; display: flex; flex-direction: column; min-height: calc(100dvh - 40px); padding-top: 6px; }
.onb-skip {
  position: absolute; top: 0; right: 0; z-index: 2;
  background: transparent; border: none; color: var(--muted);
  font: inherit; font-weight: 700; font-size: 0.85rem; padding: 8px 10px; cursor: pointer;
}
.onb-track {
  display: flex; flex: 1 1 auto; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
}
.onb-track::-webkit-scrollbar { display: none; }
.onb-step {
  flex: 0 0 100%; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px 18px; gap: 18px;
}
.onb-step h3 { font-size: 1.3rem; font-weight: 900; margin: 0; }
.onb-step p { color: var(--muted); font-size: 0.95rem; line-height: 1.5; margin: 0; max-width: 340px; }
.onb-vis { width: 100%; max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 10px; }

.onb-dots { display: flex; gap: 8px; justify-content: center; padding: 14px 0 10px; }
.onb-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: all 0.2s ease; cursor: pointer; }
.onb-dot.active { background: var(--accent); width: 22px; }
.onb-next { max-width: 360px; margin: 0 auto 4px; display: block; }

/* mini versions of the real components, used as onboarding visuals */
.onb-mini-slot { margin: 0; gap: 10px; }
.onb-mini-slot .reel { padding: 8px 6px 9px; }
.onb-mini-slot .reel-window { height: 48px; }
.onb-mini-slot .reel-item { height: 48px; line-height: 48px; font-size: 1.5rem; }
.onb-arrow { color: var(--muted); font-size: 1.3rem; line-height: 1; }
.onb-pcard { width: 100%; text-align: left; }
.onb-resultcard {
  width: 100%; min-height: 64px; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.onb-resultcard .onb-rc-main { flex: 1 1 auto; min-width: 0; }
.onb-resultcard .s-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* fixed 2-line clamp so flickering through long+short stat strings never reflows the slide */
.onb-resultcard .s-game {
  height: 2.5em; line-height: 1.25; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.onb-dice { font-size: 0.8rem; color: var(--accent); font-weight: 700; }

/* live-demo states (slides animate via the real spin / flicker / reveal components) */
.onb-resultcard .s-pts { flex: 0 0 auto; font-size: 1.25rem; font-weight: 900; color: var(--text); }
.onb-resultcard .s-pts.winner { color: var(--win); }                 /* boom game lands green */
.onb-land-pop { animation: scorePop 0.34s ease; }                    /* the "pop" on the green land */
.onb-draft-card { width: 100%; }
.onb-draft-card.onb-landed { animation: rowIn 0.4s ease; }           /* drafted player drops in */
/* slide 3 — carousel of the real matchup reveal: ONE slot at a time, running score on top */
.onb-sim-score { width: 100%; margin: 0 0 10px; }
.onb-sim-score .score-team { padding: 7px 8px; }
.onb-sim-score .st-label { font-size: 0.62rem; }
.onb-sim-score .st-pts { font-size: 1.35rem; }
/* one matchup row on screen at a time; fixed height so swapping slots never jumps */
.onb-feed { width: 100%; min-height: 56px; gap: 0; justify-content: center; }
.onb-feed .mrow-slot { padding: 2px; font-size: 0.55rem; }
.onb-feed .side { padding: 6px 8px; gap: 7px; }
.onb-feed .avatar.av-sm { width: 26px; height: 26px; flex-basis: 26px; }
.onb-feed .s-name { font-size: 0.75rem; }
.onb-feed .s-game {
  font-size: 0.58rem; line-height: 1.3; height: 1.3em; margin-top: 1px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.onb-feed .s-pts { font-size: 0.95rem; margin-top: 1px; }
/* slot-machine: each slot slides up + fades IN, then slides up + fades OUT for the next */
.onb-feed .mrow.just-in { animation: onbRowUp 0.36s ease both; }
.onb-feed .mrow.onb-out { animation: onbRowOut 0.3s ease forwards; }
@keyframes onbRowUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes onbRowOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-12px); } }

/* ---------- Sign-in modal (the gate — pops up after onboarding) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background: rgba(7, 11, 26, 0.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade 0.18s ease;
}
.modal-card {
  position: relative; width: 100%; max-width: 380px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  animation: modalPop 0.22s cubic-bezier(.2, .8, .3, 1);
  transition: transform 0.2s ease;   /* smooth slide when lifted above the keyboard */
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--muted);
  font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 6px;
}
.modal-close:active { opacity: 0.6; }

/* the sign-in card */
.login-card { text-align: left; margin: 0; }
.login-pill { display: inline-block; margin: 0 0 10px; letter-spacing: 0.6px; }
.login-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 4px; }
.login-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 16px; }
.login-sub b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }

.login-input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--card-2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; margin-bottom: 10px; outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.login-input::placeholder { color: #6b78a6; }
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.25); }
.login-code-input {
  text-align: center; font-size: 1.5rem; letter-spacing: 0.4em;
  font-weight: 700; padding-left: calc(14px + 0.4em); /* offset letter-spacing so it reads centered */
}

/* Official "Continue with Google" button — white, with the real 4-colour G mark */
.login-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 14px;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: 12px;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.95rem; font-weight: 500;
}
.g-logo { flex: 0 0 auto; display: block; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.8rem; margin: 14px 0; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.login-altrow { display: flex; justify-content: space-between; margin-top: 12px; }
.link-btn {
  background: none; border: none; color: var(--you); font: inherit;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; padding: 4px 2px;
}
.link-btn:active { opacity: 0.7; }

.login-msg { font-size: 0.85rem; margin: 12px 2px 0; min-height: 1.1em; color: var(--muted); }
.login-msg.err { color: var(--lose); }
.login-msg.ok { color: var(--win); }

/* signed-in row + sign-out on the title screen */
.signed-in { color: var(--muted); font-size: 0.8rem; text-align: center; margin: 18px 6px 0; }
.signed-in b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
