@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root{
  --bg: #0A0B0D;
  --surface: #16171B;
  --surface-2: #1C1D21;
  --sheet: #18191D;
  --text: #F3F4F6;
  --text-sub: #94969E;
  --text-mute: #64666E;
  --hairline: rgba(255,255,255,0.07);
  --hairline-strong: rgba(255,255,255,0.14);
  --accent: #D9B45B;
  --accent-soft: rgba(217,180,91,0.14);
  --accent-border: rgba(217,180,91,0.35);
  --win: #5FB88A;
  --win-soft: rgba(95,184,138,0.14);
  --loss: #D97066;
  --loss-soft: rgba(217,112,102,0.14);
  --draw: #B8A369;
  --draw-soft: rgba(184,163,105,0.16);
  --live: #E5484D;
  --live-soft: rgba(229,72,77,0.16);
  --provisional: #7C9CD9;
  --provisional-soft: rgba(124,156,217,0.16);
  --provisional-border: rgba(124,156,217,0.38);
  --record: #9AA5B5;
  --record-soft: rgba(154,165,181,0.16);
  --record-border: rgba(154,165,181,0.38);
  --badge-surface: #E9E6DE;
  --nav-h: 74px;
}

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

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

body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  padding: calc(env(safe-area-inset-top) + 24px) 24px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  min-height: 100vh;
  overscroll-behavior-y: contain;
}

.board{
  max-width: 1400px;
  margin: 0 auto;
}

.page-header{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 14px;
}

.page-header-top{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  row-gap: 8px;
}

.app-logo{
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: block;
}

.page-header h1{
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.5px;
  line-height: 1;
}

.page-sub{
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}

.draft-team-picker{
  margin-left: auto;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  max-width: 100%;
}

.draft-team-picker option{
  background: var(--surface);
  color: var(--text);
}

/* ---- League filter chips (mobile jump-nav) ---- */
.filter-chips{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 18px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar{ display: none; }

.filter-chip{
  flex: 0 0 auto;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: #C7C9D1;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.filter-chip:active{
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Persistent selection (Standings' league filter) rather than the
   touch feedback above — filled solid so it reads as "on" even after
   you lift your finger, not just a footprint from the last :active tap. */
.filter-chip.active{
  background: var(--accent);
  border-color: var(--accent);
  color: #0A0B0D;
}

.leagues{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.league{
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  overflow: hidden;
  scroll-margin-top: 16px;
}

.league-tab{
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--hairline);
  display:flex;
  align-items:center;
  justify-content: space-between;
}

.league-tab-left{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Standings-only header layout: the title gets its own top line (it
   can run long, e.g. "English Premier League"), and the season sits
   on the second line alongside the Scoring/Results chips instead of
   next to the title — same fix as the Teams-tab header (see
   .league-tab.board-league-tab above): a small/muted .n label paired
   with the bold title line read as mismatched, so it moved down to
   share a line with something the same size/weight instead — see
   leagueBlockHtml in js/board.js. */
.league-tab.standings-league-tab{
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.league-tab-top{
  display:flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.league-tab-chips{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 8px;
}

/* Scoring + Results grouped together so space-between above only
   splits "chips" from "season" — without this wrapper, a league with
   both chips gave space-between three items to spread out, which
   pushed Results away from Scoring into the middle of the row instead
   of keeping the two chips together on the left. */
.league-tab-chips-left{
  display:flex;
  align-items:center;
  gap: 8px;
}

/* Teams-tab header layout: title with the season directly beneath it
   on the left (wraps onto a second line for the longer league names,
   e.g. "National Football League"), the Upcoming/Last Result column
   label on its own on the right — bottom-aligned against the season
   line (both small/muted .n text) rather than the bold title line, so
   it doesn't read as paired with the title despite the size/weight
   mismatch — see renderBoard in js/board.js. */
.league-tab.board-league-tab{
  align-items: flex-end;
}

.board-league-tab .league-tab-left{
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.league-tab .n{
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mute);
  letter-spacing: 0.2px;
}

.team{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 14px 18px;
  position: relative;
  min-height: 44px;
}

.team + .team{
  border-top: 1px solid rgba(255,255,255,0.06);
}

.badge{
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.14);
  overflow: hidden;
}

/* Real crests are transparent PNGs — a white backdrop keeps them
   legible regardless of how close a team's own accent color is to its
   crest's dominant color (see teamBadgeHtml in js/app.js). */
.badge.badge-crest{
  background: var(--badge-surface);
}

.badge img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  box-sizing: border-box;
}

.team-name{
  font-weight: 700;
  font-size: 16.5px;
  line-height: 1.15;
  letter-spacing: -0.1px;
}

.team-sub{
  font-size: 11.5px;
  color: var(--text-sub);
  font-weight: 500;
  letter-spacing: 0.1px;
  margin-top: 1px;
}

.scoring-chip{
  flex: 0 0 auto;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-mute);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  padding: 5px 11px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.scoring-chip:hover{
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}

@media (max-width: 1100px){
  .leagues{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px){
  body{ padding: calc(env(safe-area-inset-top) + 16px) 16px calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
  .leagues{ grid-template-columns: 1fr; gap: 16px; }
}

/* ---- Interactive team rows ---- */
.team.clickable{
  cursor: pointer;
  transition: background 0.15s ease;
}

.team.clickable:hover{
  background: rgba(255,255,255,0.03);
}

.team.clickable:active{
  background: rgba(255,255,255,0.05);
}

.team-main{
  flex: 1;
  min-width: 0;
}

.row-status{
  flex: 0 0 auto;
  margin-left: auto;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.row-status.w{ background: var(--win-soft); color: var(--win); }
.row-status.l{ background: var(--loss-soft); color: var(--loss); }
.row-status.d{ background: var(--draw-soft); color: var(--draw); }
.row-status.next{
  background: rgba(255,255,255,0.06);
  color: var(--text-sub);
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
}
.row-status.live{
  background: var(--live-soft);
  color: var(--live);
}

/* ---- Modal ---- */
.modal-overlay{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,7,9,0.6);
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 300;
}

.modal-overlay.open{
  display: flex;
}

.modal{
  background: var(--sheet);
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  max-width: 400px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

@media (max-width: 700px){
  .modal-overlay{
    align-items: flex-end;
    padding: 0;
  }

  .modal{
    max-width: none;
    max-height: 88vh;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -24px 64px rgba(0,0,0,0.55);
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-up 0.22s ease-out;
  }

  .modal::before{
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.18);
    margin: 10px auto 0;
  }
}

@keyframes sheet-up{
  from{ transform: translateY(24px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

.modal-accent{
  height: 6px;
  width: 100%;
}

.modal-head{
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 22px 16px;
  position: relative;
}

.modal-head .badge{
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.modal-head h2{
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.3px;
}

.modal-head .modal-sub{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 500;
  margin-top: 3px;
}

.modal-close{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  cursor: pointer;
  padding: 0;
}

.modal-close svg{ width: 14px; height: 14px; }

.modal-close:hover{ color: var(--text); background: rgba(255,255,255,0.1); }

.stat-strip{
  display: flex;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.stat-cell{
  flex: 1;
  text-align: center;
  padding: 14px 6px;
}

.stat-cell + .stat-cell{
  border-left: 1px solid var(--hairline);
}

.stat-cell .num{
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.3px;
}

.stat-cell .lbl{
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.modal-body{
  padding: 18px 22px 22px;
}

.modal-section-title{
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.form-list{
  margin-bottom: 20px;
}

.form-item{
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
}

.form-pill{
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 10px;
}

.form-pill.w{ background: var(--win-soft); color: var(--win); }
.form-pill.d{ background: var(--draw-soft); color: var(--draw); }
.form-pill.l{ background: var(--loss-soft); color: var(--loss); }

.form-detail{
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}

.form-detail .opp{
  display: block;
}

.form-detail .meta{
  color: var(--text-sub);
  font-weight: 500;
  font-size: 11.5px;
  margin-top: 1px;
}

.form-score{
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
}

.next-match{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.next-match .nm-teams{
  font-weight: 700;
  font-size: 14px;
}

.next-match .nm-when{
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 500;
  margin-top: 2px;
}

.next-match .nm-prob{
  text-align: right;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.next-match .nm-prob .lbl{
  font-family: 'Manrope', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.scoring-list{
  display: flex;
  flex-direction: column;
}

.scoring-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}

.scoring-item + .scoring-item{
  border-top: 1px solid rgba(255,255,255,0.055);
}

.scoring-label{
  font-size: 13px;
  font-weight: 600;
}

.scoring-value{
  flex: 0 0 auto;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.scoring-value.pos{
  background: var(--win-soft);
  color: var(--win);
}

.scoring-value.neg{
  background: var(--loss-soft);
  color: var(--loss);
}

/* ---- Season tracker (achievement checklist, in team modal) ---- */
.tracker-total{
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 600;
  margin-bottom: 10px;
}

.tracker-total b{
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
}

.tracker-list{
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.tracker-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  min-height: 44px;
}

.tracker-item + .tracker-item{
  border-top: 1px solid rgba(255,255,255,0.055);
}

.tracker-check{
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tracker-check svg{ width: 11px; height: 11px; }

.tracker-item.achieved .tracker-check{
  background: var(--win);
  border-color: transparent;
}

.tracker-label{
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-sub);
}

.tracker-item.achieved .tracker-label{
  color: var(--text);
}

.tracker-value{
  flex: 0 0 auto;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1.5px solid rgba(255,255,255,0.12);
  color: var(--text-mute);
  background: transparent;
}

.tracker-item.achieved .tracker-value.pos{
  background: var(--win-soft);
  color: var(--win);
  border-color: transparent;
}

.tracker-item.achieved .tracker-value.neg{
  background: var(--loss-soft);
  color: var(--loss);
  border-color: transparent;
}

/* Rank-based rules (e.g. "2nd in EPL") that currently apply — amber
   instead of the green/red used for a real, locked-in fact, since
   these read straight off today's table and can still change before
   the season ends. */
.tracker-item.provisional .tracker-check{
  background: var(--provisional);
  border-color: transparent;
}

.tracker-item.provisional .tracker-label{ color: var(--text); }

.tracker-item.provisional .tracker-value{
  background: var(--provisional-soft);
  color: var(--provisional);
  border-color: transparent;
}

.provisional-tag{
  display: inline-block;
  margin-left: 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--provisional);
  background: var(--provisional-soft);
  border: 1px solid var(--provisional-border);
  border-radius: 20px;
  padding: 2px 6px;
  vertical-align: middle;
}

.provisional-note{
  display: inline-block;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--provisional-border);
  color: var(--provisional);
  font-weight: 600;
}

.tracker-item.readonly{ cursor: default; }

.tracker-manage-link{
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 2px 2px;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.055);
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
}

/* ---- League Facts (EPL achievements, marked from the Results modal) ---- */
.league-facts-list{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fact-row + .fact-row{
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.055);
}

.fact-row-top{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.fact-label{
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.fact-auto-tag{
  flex: 0 0 auto;
  font-family: 'Manrope', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--win);
  background: var(--win-soft);
  border-radius: 20px;
  padding: 2px 7px;
}

.fact-pts{
  flex: 0 0 auto;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.fact-pts.pos{ background: var(--win-soft); color: var(--win); }
.fact-pts.neg{ background: var(--loss-soft); color: var(--loss); }

.fact-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.fact-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 4px 8px 4px 4px;
}

.fact-chip-badge{
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 8.5px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.14);
}

.fact-chip-owner{
  color: var(--text-sub);
  font-weight: 600;
}

.fact-chip-x{
  border: none;
  background: none;
  color: var(--text-mute);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
  font-family: inherit;
}

.fact-chip-x:hover{ color: var(--loss); }

.fact-empty{
  font-size: 12px;
  color: var(--text-mute);
  font-style: italic;
}

.fact-picker{
  width: 100%;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  padding: 8px 10px;
}

/* ---- Live data additions ---- */
.live-badge{
  display:inline-block;
  font-family: 'Manrope', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--win);
  background: var(--win-soft);
  border-radius: 20px;
  padding: 2px 7px;
  vertical-align: middle;
}

.live-badge.err{
  color: var(--loss);
  background: var(--loss-soft);
}

.no-live-note{
  font-size: 13px;
  color: var(--text-sub);
  font-style: italic;
  line-height: 1.5;
  padding: 6px 0 10px;
}

.loading-note{
  font-size: 13px;
  color: var(--text-sub);
  padding: 4px 0;
}

.updated-note{
  font-size: 10.5px;
  color: var(--text-mute);
  text-align: right;
  margin-top: 10px;
  letter-spacing: 0.1px;
}

/* ---- Standings view (real per-league tables) ---- */
/* Pinned so the league filter stays reachable while scrolling a long
   table — offset by the safe-area inset (not a flat 0) so it settles
   below the notch/status bar instead of sliding under it. */
.standings-filter-row{
  position: sticky;
  top: env(safe-area-inset-top);
  background: var(--bg);
  z-index: 5;
}

.standings-toggle{
  display: flex;
  gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--hairline);
}

/* NFL's second toggle row (Divisions/Full Conference), stacked right
   under the first (AFC/NFC/Person) — pulled closer so the pair reads as
   one nested choice ("which conference, then how to view it") instead
   of two unrelated toggle bars. */
.standings-subtoggle{
  padding-top: 0;
}

.toggle-btn{
  flex: 1;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: var(--text-sub);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.toggle-btn.active{
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.standings-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 900px){
  .standings-grid{ grid-template-columns: 1fr; }
}

.standings-row{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  min-height: 44px;
}

.standings-row.clickable{ cursor: pointer; }
.standings-row.clickable:hover{ background: rgba(255,255,255,0.03); }

.standings-row + .standings-row{
  border-top: 1px solid rgba(255,255,255,0.06);
}

.standings-row .team-name{ font-size: 15px; }

.standings-rank{
  flex: 0 0 18px;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-mute);
}

/* NFL Standings' "Divisions" view: a small label row ("AFC North")
   ahead of that division's 4 team rows, since — unlike EPL's single
   table or CFB's flat Top 25 — there's no one ranking that spans all
   32 teams. */
.standings-group-header{
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-mute);
  background: rgba(255,255,255,0.02);
  padding: 10px 18px 6px;
}

.standings-group-header + .standings-row{ border-top: none; }

/* Person view's real W-D-L record chip — its own color (not the gold
   used by the League view's "drafted by" chip below, or the "Person"
   toggle) so all three don't read as the same signal. */
.person-record-chip{
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1px;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--record);
  background: var(--record-soft);
  border: 1px solid var(--record-border);
}

.drafted-by-chip{
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1px;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

/* ---- Overall view (cross-drafter leaderboard) ----
   List (level 1) shows confirmed points only — a stacked league-mix bar
   sized/colored by each league's confirmed points, plus the confirmed
   total. Tapping a row expands it in place (level 1.5): confirmed
   points per league, top confirmed awards, and a note pointing at any
   provisional points sitting in the full breakdown (level 2), which
   never touches the ranking number. */

/* -- Real/Simulated data toggle + banner --
   TEMPORARY: a preview aid for showing the page's shape before the
   season produces real results. Safe to delete this block (and the
   matching "TEMPORARY" block in js/app.js, and the toggle markup in
   index.html) once real data makes it unnecessary. */
.ob-mode{
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ob-mode-label{
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.ob-mode-switch{
  display: flex;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.ob-mode-btn{
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
}
.ob-mode-btn.active{
  color: var(--accent);
  background: var(--accent-soft);
}
.ob-sim-banner{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

/* -- Legend -- */
.ob-legend{ margin-bottom: 14px; }
.ob-legend-toggle{
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mute);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}
.ob-legend-toggle-dots{
  display: flex;
  gap: 3px;
  flex: 0 0 auto;
}
.ob-legend-toggle-dots span{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.ob-legend-panel{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.ob-legend-chip{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.ob-legend-dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

/* -- List -- */
.ob-list{
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
}
.ob-row{ border-bottom: 1px solid var(--hairline); }
.ob-row:last-child{ border-bottom: none; }
.ob-row.leader{ background: var(--accent-soft); }
.ob-row.expanded{ background: var(--surface-2); }
.ob-row.current .ob-name{ color: var(--accent); }

.ob-row-head{
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  min-height: 44px;
  cursor: pointer;
}
.ob-rank{
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--text-mute);
}
.ob-row.leader .ob-rank{ color: var(--accent); }
.ob-row-main{ min-width: 0; }
.ob-name{
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ob-mix-line{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.ob-mix{
  flex: 1;
  min-width: 0;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  display: flex;
}
.ob-mix-seg{ height: 100%; }
.ob-total{
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  color: var(--win);
}
.ob-total.neg{ color: var(--loss); }
.ob-total.zero{ color: var(--text-mute); }

@media (max-width: 480px){
  .ob-row-head{
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 10px;
  }
  .ob-rank{ font-size: 13px; }
  .ob-name{ font-size: 16px; }
  .ob-mix{ height: 9px; border-radius: 4px; }
  .ob-total{ font-size: 17px; }
}

/* -- Inline expand -- */
.ob-expand{
  padding: 2px 14px 16px;
  border-top: 1px solid var(--hairline);
}
.ob-section-title{
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 16px 0 8px;
}
.ob-lg-row{
  display: grid;
  grid-template-columns: 8px 74px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.ob-lg-dot{
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}
.ob-lg-label{
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
}
.ob-lg-track{
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.ob-lg-track span{
  display: block;
  height: 100%;
}
.ob-lg-pts,
.ob-award-pts,
.ob-rule-pts,
.ob-card-pts{
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  color: var(--win);
}
.ob-lg-pts{ font-size: 13px; }
.ob-award-pts,
.ob-rule-pts{ font-size: 15px; }
.ob-card-pts{ font-size: 22px; }
.ob-lg-pts.neg, .ob-award-pts.neg, .ob-rule-pts.neg, .ob-card-pts.neg{ color: var(--loss); }
.ob-lg-pts.zero, .ob-award-pts.zero, .ob-rule-pts.zero, .ob-card-pts.zero{ color: var(--text-mute); }

.ob-award-list{ display: flex; flex-direction: column; gap: 8px; }
.ob-award{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
}
.ob-award-label{
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  text-wrap: pretty;
}
.ob-award-meta,
.ob-rule-meta{
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-mute);
  margin-top: 4px;
}
.ob-empty{
  font-size: 12.5px;
  color: var(--text-mute);
  line-height: 1.5;
  padding: 2px 0 4px;
}

/* The one place provisional shows on the list: a pointer to the
   breakdown, never folded into a drafter's headline number. */
.ob-pending{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: var(--provisional-soft);
  border: 1px solid var(--provisional-border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px;
  color: var(--text-sub);
}
.ob-stripe-swatch{
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
  background: repeating-linear-gradient(115deg, var(--provisional) 0 3px, var(--provisional-soft) 3px 6px);
}

.ob-detail-link{
  display: block;
  width: 100%;
  margin-top: 14px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  color: var(--accent);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ob-detail-link:hover{
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.ob-foot{
  padding: 16px 4px 8px;
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.5;
}

/* -- Detail -- */
.ob-back{
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 2px;
  cursor: pointer;
}
.ob-back:hover{ color: var(--text); }
.ob-detail-head{
  padding: 4px 2px 18px;
  border-bottom: 1px solid var(--hairline);
}
.ob-detail-rank{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}
.ob-detail-name{
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 6px 0 0;
}
.ob-detail-total{
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
}
.ob-detail-total b{
  font-family: 'Space Grotesk', sans-serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.ob-detail-total b.neg{ color: var(--loss); }
.ob-detail-total span{
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* Confirmed vs provisional: texture, not just hue — the stripe reads
   before any color is parsed. */
.ob-split{
  display: flex;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 18px;
}
.ob-split-confirmed{ background: var(--win); }
.ob-split-provisional{
  background: repeating-linear-gradient(115deg, var(--provisional) 0 5px, var(--provisional-soft) 5px 10px);
}
.ob-split-legend{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 12px;
}
.ob-pill{
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.ob-pill i{
  width: 9px;
  height: 9px;
  border-radius: 2px;
}
.ob-pill.confirmed{
  background: var(--win-soft);
  border: 1px solid rgba(95, 184, 138, 0.28);
}
.ob-pill.confirmed i{ background: var(--win); }
.ob-pill.provisional{
  background: var(--provisional-soft);
  border: 1px solid var(--provisional-border);
}
.ob-pill.provisional i{
  background: repeating-linear-gradient(115deg, var(--provisional) 0 3px, var(--provisional-soft) 3px 6px);
}
.ob-split-note{
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.5;
  text-wrap: pretty;
}

.ob-cards{ display: flex; flex-direction: column; gap: 10px; }
.ob-card{
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 14px;
}
.ob-card-head{
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.ob-card-main{ min-width: 0; }
.ob-card-title{
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.ob-card-sub{
  font-size: 11.5px;
  color: var(--text-mute);
  margin-top: 2px;
  line-height: 1.4;
}
.ob-rule-list{
  margin-top: 12px;
  border-top: 1px solid var(--hairline);
  padding-top: 4px;
}
.ob-rule{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  cursor: pointer;
}
.ob-rule-main{ min-width: 0; }
.ob-rule-label{
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  text-wrap: pretty;
}
.ob-prov-tag{
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--provisional);
  border: 1px solid var(--provisional-border);
  border-radius: 4px;
  padding: 2px 5px;
}
.ob-card-prov{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.4;
}

/* ---- Views + bottom tab bar ---- */
.view{ display: none; }
.view.active{ display: block; }

/* Tiny build marker in the corner so you can confirm a device is
   running the latest deploy rather than a stale cached copy. */
.build-tag{
  position: fixed;
  left: 10px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 6px);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-mute);
  opacity: 0.45;
  pointer-events: none;
  z-index: 150;
}

.tab-bar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(19,20,24,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
  display: flex;
  z-index: 200;
}

.tab-btn{
  flex: 1;
  border: none;
  background: none;
  color: var(--text-mute);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.tab-btn svg{ width: 22px; height: 22px; }

.tab-label{
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1px;
}

.tab-btn.active{ color: var(--accent); }
