/* ============================================================================
   Pocket — shared stylesheet
   ----------------------------------------------------------------------------
   Loaded by every page BEFORE its own <style> block, so page-level rules with
   equal specificity win. A page's <style> should only hold layout and widgets
   unique to that page; anything used on two or more pages belongs here.

   Sections
     1. Fonts
     2. Design tokens (palette, type, spacing, radius, shadow, z-index)
     3. Reset + base
     4. Typography (section labels)
     5. Nav (#rr-nav)
     6. Components (cards, forms, buttons, badges, league bar, empty states,
        page head, gate card, stat tiles, roster-fit lists + depth chips)
     7. Draft/research primitives (.panel, .board-search, .modal-close)
     8. Utilities
     9. Research profile sheet (shared by /draft research tab and /research)
    10. Responsive (768px grid collapse, iOS-safe inputs)
   ========================================================================== */


/* 1. Fonts ------------------------------------------------------------------
   Loaded from each page's <head> as a <link rel="stylesheet"> (after the
   preconnect hints) rather than @import here, so the browser can request the
   Google Fonts CSS in parallel with this file instead of after it. */


/* 2. Design tokens --------------------------------------------------------- */
:root {
  /* surfaces */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #111111;
  --bg-hover: #181818;
  --border: rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.14);

  /* text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.45);
  --text-muted: rgba(255,255,255,0.22);
  --text-body: rgba(255,255,255,0.62);

  /* accent (white-on-black product accent; used for focus rings + primary btn) */
  --accent: #ffffff;
  --accent-glow: rgba(255,255,255,0.06);
  --color-accent: var(--accent);

  /* brand (indigo → violet; home CTA, keyboard focus outline) */
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #8b5cf6;
  --brand-glow: rgba(99,102,241,0.18);

  /* positions */
  --qb: #ef4444;
  --rb: #10b981;
  --wr: #3b82f6;
  --te: #a855f7;
  --k: #6b7280;
  --dst: #6b7280;

  /* status */
  --gold: #fbbf24;
  --silver: #94a3b8;
  --bronze: #cd7f32;
  --danger: #ef4444;
  --success: #10b981;
  --amber: #f59e0b;
  --win: var(--success);
  --fair: var(--gold);
  --lose: var(--danger);

  /* type */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', monospace;
  --fs-2xs: 0.62rem;   /* badges, chips */
  --fs-xs: 0.7rem;     /* section labels, hints */
  --fs-sm: 0.78rem;    /* body copy in tools */
  --fs-md: 0.85rem;    /* loading / empty states */
  --fs-lg: 1.15rem;    /* page titles in tools */
  --fs-xl: 1.6rem;     /* hero titles */
  --tracking-label: 0.1em;

  /* spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* shadow */
  --shadow-focus: 0 0 0 3px var(--accent-glow);
  --shadow-card: 0 12px 40px rgba(0,0,0,0.35);

  /* z-index */
  --z-sticky: 1;
  --z-dropdown: 60;
  --z-nav: 100;
  --z-overlay: 860;
  --z-toast: 1000;
}


/* 3. Reset + base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  min-height: 100vh;
}

button, input, select, textarea { font-family: inherit; }

/* Keyboard focus ring. Text inputs replace this with the accent border + glow
   (see .form-row input:focus below), which is more specific and wins. */
:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }

/* Tool pages (/trade, /lineup, /team) toggle sections with the `hidden`
   attribute; several of those sections also carry an author `display: flex`,
   which beats the UA's [hidden] rule (e.g. /trade showed an empty "League:"
   select in manual mode). Scoped to #app so the draft/home pages are untouched;
   home.html applies the same rule globally. */
#app [hidden] { display: none !important; }


/* 4. Typography ------------------------------------------------------------ */
/* Small uppercase section label used by every tool page. */
.section-label,
.panel-title,
.col-hdr,
.rf-hdr,
.yt-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
}
.panel-title { margin-bottom: var(--space-3); }
.col-hdr { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.7rem; }
.col-hdr .total { font-family: var(--font-mono); text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-secondary); }

/* Smaller column label (roster-fit lists on /trade + /team). */
.rf-col-lbl { font-size: 0.66rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.3rem; }


/* 5. Nav ------------------------------------------------------------------- */
#rr-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.7rem var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}
#rr-nav .rr-logo {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
  margin-right: var(--space-2);
}
#rr-nav .rr-links {
  display: flex;
  gap: 0.15rem;
  flex: 1;
}
#rr-nav .rr-link {
  font-size: var(--fs-sm);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  transition: background 0.12s, color 0.12s;
}
#rr-nav .rr-link:hover { background: var(--accent-glow); color: var(--text-primary); }
#rr-nav .rr-link.active { color: var(--text-primary); background: var(--accent-glow); }
#rr-nav .rr-link.dim { opacity: 0.38; cursor: default; }
#rr-nav .rr-auth { margin-left: auto; display: flex; align-items: center; }
#rr-sign-in {
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.32rem 0.9rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s;
}
#rr-sign-in:hover { background: var(--accent-glow); }

/* Mobile hamburger (shared/nav.js toggles #rr-nav.open). Hidden on desktop;
   the ≤768px rules live in section 10. */
.nav-hamburger { display: none; }


/* 6. Components ------------------------------------------------------------ */

/* Page shell for the tool pages (/trade, /lineup, /team). Pages set max-width. */
#app { max-width: 900px; margin: 0 auto; padding: var(--space-6) var(--space-4) 3rem; }
#loading { text-align: center; padding: 5rem; color: var(--text-secondary); font-size: var(--fs-md); }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); }
.setup-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-5); margin-bottom: var(--space-5); }
.setup-card h2 { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.4rem; }
.setup-card p { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.9rem; line-height: 1.5; }

/* Forms */
.form-row { display: flex; gap: var(--space-2); }
.form-row input,
.form-row select {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  transition: border-color 0.15s;
}
.form-row input:focus,
.form-row select:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.error-msg { font-size: 0.76rem; color: var(--danger); margin-top: 0.4rem; }

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 1.1rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.btn-primary:hover:not(:disabled) { background: rgba(255,255,255,0.88); }
.btn-primary:active:not(:disabled) { transform: scale(0.97); }

.btn-secondary {
  background: none;
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 0.45rem 1.1rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-secondary:hover:not(:disabled) { background: var(--accent-glow); }

/* Brand gradient CTA (home hero). */
.btn-brand {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 var(--space-5);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  font-family: inherit; font-weight: 600; font-size: 0.9rem; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: filter 0.12s, background 0.12s, border-color 0.12s;
}
.btn-brand:hover { filter: brightness(1.08); }

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}
.pos-badge { font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 700; padding: 0.1rem 0.3rem; border-radius: var(--radius-xs); letter-spacing: 0.04em; white-space: nowrap; }
.QB  { background: rgba(239,68,68,.18);   color: var(--qb); }
.RB  { background: rgba(16,185,129,.18);  color: var(--rb); }
.WR  { background: rgba(59,130,246,.18);  color: var(--wr); }
.TE  { background: rgba(168,85,247,.18);  color: var(--te); }
.K   { background: rgba(107,114,128,.18); color: var(--k); }
.DEF, .DST { background: rgba(107,114,128,.18); color: var(--dst); }
/* Split badge for FLEX / SUPER_FLEX slots: equal-width segments, one per eligible position. */
.slot-split-badge { display: inline-flex; border-radius: var(--radius-xs); overflow: hidden; flex-shrink: 0; height: 16px; }
.slot-split-badge .sb { display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.44rem; font-weight: 800; letter-spacing: 0; width: 9px; }
.slot-split-badge.sflx { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; width: 26px; }
.slot-split-badge.sflx .sb { width: auto; }
.slot-split-badge .sb.QB { background: rgba(239,68,68,.35);  color: var(--qb); }
.slot-split-badge .sb.WR { background: rgba(59,130,246,.35); color: var(--wr); }
.slot-split-badge .sb.RB { background: rgba(16,185,129,.35); color: var(--rb); }
.slot-split-badge .sb.TE { background: rgba(168,85,247,.35); color: var(--te); }

/* Positional tiers: liability → asset (/team table + /trade roster fit). */
.st-critical, .rf-st-critical { color: var(--danger); }
.st-upgrade,  .rf-st-upgrade  { color: var(--amber); }
.st-thin,     .rf-st-thin     { color: var(--gold); }
.st-solid,    .rf-st-solid    { color: var(--text-muted); }
.st-deep,     .rf-st-deep     { color: var(--success); }
.st-loaded,   .rf-st-loaded   { color: #4ade80; text-shadow: 0 0 10px rgba(74,222,128,.45); }

/* Trade verdict tones (/trade badge + home mock). */
.vd-WIN,  .v-WIN  { background: rgba(16,185,129,.12); color: var(--win);  border: 1px solid rgba(16,185,129,.28); }
.vd-FAIR, .v-FAIR { background: rgba(251,191,36,.08); color: var(--fair); border: 1px solid rgba(251,191,36,.22); }
.vd-LOSE, .v-LOSE { background: rgba(239,68,68,.08);  color: var(--lose); border: 1px solid rgba(239,68,68,.22); }

/* League picker bar + settings strip (/trade, /lineup, /team). */
#league-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-bottom: 0.8rem; font-size: var(--fs-sm); color: var(--text-secondary); }
#league-bar select { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.3rem 0.6rem; color: var(--text-primary); font-size: var(--fs-sm); max-width: 100%; transition: border-color 0.15s; }
#league-bar select:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
#league-bar select option { background: var(--bg-secondary); }
#league-hint { font-size: 0.72rem; color: var(--text-muted); }
#league-hint.warn { color: var(--danger); }
#league-settings-strip { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: var(--space-4); }
.ls-tag { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 0.15rem 0.5rem; font-size: 0.72rem; color: var(--text-secondary); font-family: var(--font-mono); }

/* Empty / helper text */
/* Designed empty state for list slots (/trade sides, /lineup columns, /team table).
   Dashed outline + muted copy; optional .eh-icon / .eh-sub children. */
.empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
  padding: var(--space-5) var(--space-4);
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.4;
}
.empty-hint .eh-icon { font-size: 1.25rem; line-height: 1; opacity: 0.45; margin-bottom: 0.1rem; }
.empty-hint .eh-sub { font-size: var(--fs-xs); font-weight: 400; opacity: 0.8; }
td.empty-hint { display: table-cell; border: none; padding: var(--space-6) var(--space-4); }
.empty-state { text-align: center; padding: var(--space-8); color: var(--text-muted); font-size: var(--fs-md); }

/* Footnote legend under a tool page. */
.legend { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.7; margin-top: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.legend-title { display: block; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-muted); margin-bottom: 0.3rem; }

/* Collapsible explanation block — native <details>, collapsed by default, no JS.
   Used for page legends ("How to read this"), methodology notes and secondary
   lists (trade partners) so the primary view stays quiet. */
/* Term explainer: a small "?" that shows a definition on hover, keyboard focus, or
   tap (JS toggles .open on click so it works on touch, where title= does nothing).
   Markup: <span class="tip"><button type="button" class="tip-btn" aria-label="What is X?">?</button><span class="tip-box" role="tooltip">…</span></span> */
.tip { position: relative; display: inline-flex; align-items: center; vertical-align: middle; margin-left: 0.3rem; }
.tip-btn {
  width: 16px; height: 16px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border-bright); background: transparent; color: var(--text-muted);
  font-family: var(--font-sans); font-size: 0.6rem; font-weight: 700; line-height: 1; cursor: help;
  display: inline-flex; align-items: center; justify-content: center; text-transform: none; letter-spacing: 0;
  transition: color 0.12s, border-color 0.12s;
}
.tip-btn:hover, .tip-btn:focus-visible, .tip.open .tip-btn { color: var(--text-primary); border-color: var(--brand-400); }
.tip-box {
  display: none; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: min(280px, 80vw); padding: 0.5rem 0.65rem; z-index: 30;
  background: var(--bg-card); border: 1px solid var(--border-bright); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  color: var(--text-body); font-family: var(--font-sans); font-size: 0.74rem; font-weight: 400; line-height: 1.45;
  text-transform: none; letter-spacing: 0; white-space: normal; text-align: left; cursor: auto;
}
.tip-box::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--border-bright); }
.tip:hover .tip-box, .tip-btn:focus-visible + .tip-box, .tip.open .tip-box { display: block; }
.tip.tip-left .tip-box { left: auto; right: -4px; transform: none; }
.tip.tip-left .tip-box::after { left: auto; right: 8px; margin-left: 0; }
/* Tooltip in a table header: keep the header text and the "?" on one line. */
th .tip { margin-left: 0.25rem; }

.info-details { margin-top: var(--space-4); }
.info-details summary {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.info-details summary::-webkit-details-marker { display: none; }
.info-details summary:hover { color: var(--text-secondary); }
.info-details summary::before { content: '▶'; font-size: 0.55rem; transition: transform 0.15s; }
.info-details[open] summary::before { transform: rotate(90deg); }
.info-details .details-body { padding-top: var(--space-3); font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.6; }
.info-details .details-body p { margin: 0 0 var(--space-2); }
.legend-table { width: 100%; border-collapse: collapse; margin: var(--space-2) 0; }
.legend-table th { text-align: left; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-muted); padding: 0 var(--space-2) var(--space-1); border-bottom: 1px solid var(--border); }
.legend-table td { padding: var(--space-1) var(--space-2); vertical-align: top; }
.legend-table td:first-child { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; color: var(--text-secondary); width: 4rem; }
.legend-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.legend-note { font-size: 0.65rem; color: var(--text-muted); opacity: 0.75; margin-top: var(--space-1) !important; }

/* Tool page header: title + one-line sub on the left, controls (league picker) on the right. */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-4); }
.page-head-text { min-width: 0; flex: 1 1 260px; }
.page-title { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--text-primary); }
.page-sub { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.5; margin-top: 0.35rem; max-width: 60ch; }
.page-head #league-bar { margin-bottom: 0; flex: 0 1 auto; }
.page-head #league-bar select { min-width: 160px; }
.page-head #league-hint { flex-basis: 100%; }
.tool-head .page-title { font-size: var(--fs-xl); }

/* Static explainer under a tool page: real, crawlable copy for search engines
   and first-time visitors. Sits below the app UI, above the footer. */
.tool-about { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--border); color: var(--text-body); }
.tool-about h2 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: var(--text-primary); margin: 0 0 var(--space-2); }
.tool-about h2 + p + h2 { margin-top: var(--space-6); }
.tool-about p { font-size: var(--fs-sm); line-height: 1.65; max-width: 72ch; margin: 0; }
.tool-about a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.tool-about a:hover { color: var(--text-primary); }

/* Row of league-settings tags with an optional highlighted lead tag (team name). */
.strip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: var(--space-4); }
.strip-row #league-settings-strip { margin-bottom: 0; }
.strip-row:empty { display: none; }
.ls-tag-hi { color: var(--text-primary); border-color: var(--border-bright); background: var(--accent-glow); font-weight: 500; }
.ls-tag-hi:empty { display: none; }

/* Sign-in / connect gate for a tool page: centered card with an eyebrow pill. */
.setup-card.gate {
  max-width: 520px;
  margin: 3rem auto var(--space-5);
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.setup-card.gate h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.45rem; }
.setup-card.gate p { font-size: var(--fs-md); line-height: 1.55; margin: 0 auto var(--space-5); max-width: 42ch; }
.setup-card.gate .btn-primary { min-height: 40px; padding: 0 1.4rem; font-size: 0.85rem; }
.setup-card.gate .form-row { max-width: 380px; margin: 0 auto; }
.setup-card.gate .error-msg { margin-top: 0.6rem; }
.gate-eyebrow {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(124,111,247,0.15);
  color: #a78bfa;
  border: 1px solid rgba(124,111,247,0.3);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.7rem;
  margin-bottom: var(--space-4);
}

/* Stat tiles: big mono number + uppercase label (/team Your Team, /trade verdict). */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-2); }
.stat-tile { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.75rem 0.5rem 0.65rem; text-align: center; min-width: 0; }
.stat-val { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--text-primary); white-space: nowrap; }
.stat-val small { font-family: var(--font-sans); font-size: 0.64rem; font-weight: 500; color: var(--text-muted); margin-left: 0.2rem; letter-spacing: 0; }
.stat-lbl { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-muted); margin-top: 0.45rem; }
.stat-tile.danger .stat-val { color: var(--danger); }

/* Roster-fit lists (/trade + /team). */
.rf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.rf-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.rf-row:last-child { border-bottom: none; }
.rf-name { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-empty { font-size: 0.74rem; color: var(--text-muted); padding: 0.3rem 0; }

/* Positional depth chips: position badge + count + tier (/trade Roster Fit, /team Your Team).
   Same silhouette as the Your Team chips on /trade (.yt-chip). */
.rf-depth { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.85rem; }
.rf-dep {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.55rem 0.22rem 0.32rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  cursor: default;
}
.rf-dep .pr { color: var(--text-muted); }


/* 7. Draft/research primitives ------------------------------------------- */
.panel {
  overflow-y: auto;
  padding: var(--space-3);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.board-search {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  color: rgba(255,255,255,0.8);
  font-size: var(--fs-sm);
  outline: none;
  font-family: inherit;
}
.board-search:focus { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.05); }
.board-search::placeholder { color: rgba(255,255,255,0.2); }

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-xs);
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }


/* 8. Utilities ------------------------------------------------------------- */
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* 9. Research profile sheet ----------------------------------------------- */
/* Identical on the draft page's Research tab and the standalone /research
   page. Generated from the former inline block; edit here, not per page. */
@keyframes rsch-page-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Two-pane research layout */
#research-detail-pane .rsch-head { border-radius: 0; margin: -1.5rem -2rem 1rem; }
.research-row.rsch-selected { background: rgba(124,111,247,0.1) !important; }
@media (max-width: 768px) {
  #research-screen { flex-direction: column !important; }
  #research-detail-pane { display: none !important; }
}

.research-controls { flex-shrink: 0; margin-bottom: 0.5rem; }

.rsch-filter-btn {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.63rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.rsch-filter-btn.active {
  background: rgba(124,111,247,0.15);
  border-color: rgba(124,111,247,0.5);
  color: #a78bfa;
}
.rsch-sort-btn {
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.rsch-sort-btn.active {
  background: rgba(255,255,255,0.07);
  border-color: var(--border-bright);
  color: var(--text-primary);
}
.rsch-tier-divider {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.2rem;
  font-size: 0.58rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  position: sticky; top: 0; z-index: 1;
}
.rsch-tier-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.rsch-summary { font-size: 0.65rem; color: var(--text-muted); padding: 0.25rem 0 0.3rem; flex-shrink: 0; }
.rsch-col-proj { font-family: var(--font-mono); font-size: 0.7rem; text-align: right; flex-shrink: 0; width: 38px; }
@media (max-width: 600px) { .rsch-col-proj { display: none; } }

.rsch-pos-btn {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.rsch-pos-btn.active {
  background: var(--bg-hover);
  border-color: var(--border-bright);
  color: var(--text-primary);
}

#research-player-list { flex: 1; overflow-y: auto; }

/* Roster needs summary bar */
#roster-needs {
  margin-top: 0.4rem; padding: 0.3rem 0.5rem;
  font-size: 0.7rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px;
  line-height: 1.4;
}
#roster-needs:empty { display: none; }
#roster-needs .rn-pos { font-weight: 700; }
.rn-QB { color: #f87171; }
.rn-RB { color: #4ade80; }
.rn-WR { color: #60a5fa; }
.rn-TE { color: #fb923c; }
.rn-FLEX { color: var(--text-secondary); }
.rn-K, .rn-DST { color: var(--text-muted); }

/* Trend arrow in player lists */
.trend-arrow { font-size: 0.7rem; cursor: help; margin-right: 2px; display: inline-block; }

.research-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.research-row:hover { background: var(--bg-hover); }
.research-row.rsch-dnd { opacity: 0.45; }

.rsch-pos-pill {
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  flex-shrink: 0;
  min-width: 30px;
  text-align: center;
}

.rsch-col { font-family: var(--font-mono); font-size: 0.7rem; text-align: right; flex-shrink: 0; }

/* Player profile sheet */
#research-profile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 860;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overscroll-behavior: contain;
}
#research-profile-overlay.open { display: flex; }

.research-sheet {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.research-sheet-body { overflow-y: auto; padding: 1.25rem 1.25rem 1rem; -webkit-overflow-scrolling: touch; }

.research-decision-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.rsch-decision-btn {
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
@media (hover: hover) {
  .rsch-decision-btn:hover { border-color: var(--border-bright); color: var(--text-primary); }
}
.rsch-decision-btn.active-target { background: rgba(245,158,11,0.15); border-color: var(--amber); color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.rsch-decision-btn.active-dnd { background: rgba(239,68,68,0.15); border-color: var(--danger); color: var(--danger); box-shadow: 0 0 0 1px var(--danger) inset; }
.rsch-decision-btn.active-neutral { background: var(--bg-hover); border-color: var(--border-bright); color: var(--text-primary); }

/* ── Profile sheet: header ── */
.rsch-head {
  position: relative;
  margin: -1.25rem -1.25rem 0;
  padding: 1.4rem 3.25rem 1.1rem 1.4rem;
  background:
    radial-gradient(130% 150% at 0% 0%, color-mix(in srgb, var(--pos-col) 15%, transparent), transparent 55%);
  border-bottom: 1px solid var(--border);
}
.rsch-head::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pos-col), transparent 75%);
}
.rsch-head-name {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.rsch-head-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
}
.rsch-injury {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  white-space: nowrap;
}
/* Injury status dot (list rows) */
.inj-dot {
  font-size: 0.55rem;
  margin-left: 3px;
  vertical-align: middle;
  cursor: help;
}
/* Injury pill (research profile header) */
.rsch-inj-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(234,179,8,0.12);
  color: #eab308;
  border: 1px solid rgba(234,179,8,0.35);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  white-space: nowrap;
}


/* ── Profile sheet: hero stats ── */
.rsch-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1.15rem;
}
.rsch-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 0.5rem 0.7rem;
  text-align: center;
}
.rsch-hero-val {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
  letter-spacing: -0.02em;
}
.rsch-hero-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

/* ── Profile sheet: VORP section ── */
.rsch-vorp-card { margin-top: 1rem; }
.rsch-vorp-title {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.rsch-vorp-nums {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-top: 0.4rem;
}
.rsch-vorp-main {
  font-size: 1.9rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}
.rsch-vorp-sub {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.rsch-vorp-sf {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-left: 0.75rem;
}
.rsch-vorp-context {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* ── Profile sheet: demand signal ── */
.rsch-demand { margin-top: 1.1rem; }
.rsch-demand-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.rsch-demand-badge {
  font-size: 0.64rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  white-space: nowrap;
  border: 1px solid;
}
.rsch-demand-text {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
}
.rsch-demand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* ── Profile sheet: typical draft slot ── */
.rsch-drafted {
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.rsch-drafted-main {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.rsch-drafted-main b { color: var(--text-primary); font-weight: 700; }
.rsch-drafted-sub {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ── Profile sheet: sources footer ── */
.rsch-src-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.7rem;
}

/* ── Profile sheet: scouting report ── */
.rsch-scout-section {
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  animation: rsch-fade-in 0.28s ease;
}
.rsch-scout-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.55rem;
}
.rsch-scout-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Profile sheet: health card ── */
.rsch-health-card {
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid;
  animation: rsch-fade-in 0.22s ease;
}
.rsch-health-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.rsch-health-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.63rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  border: 1px solid;
  white-space: nowrap;
}
.rsch-health-note {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.4rem;
}
.rsch-health-timeline {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

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

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


/* 10. Responsive ----------------------------------------------------------- */
@media (max-width: 768px) {
  /* Two-column grids collapse to one. */
  .rf-grid { grid-template-columns: 1fr; }

  /* Page head stacks: title block, then a full-width league picker. */
  .page-head { align-items: stretch; margin-bottom: var(--space-3); }
  .page-title { font-size: 1.4rem; }
  .page-head #league-bar { flex: 1 1 100%; }
  .page-head #league-bar select { flex: 1; min-width: 0; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-val { font-size: 1.2rem; }
  .setup-card.gate { margin-top: var(--space-6); padding: var(--space-6) var(--space-5); }

  /* 16px inputs stop iOS focus-zoom; 40px touch targets. */
  .form-row input,
  .form-row select,
  #league-bar select,
  .board-search { min-height: 40px; font-size: 16px; }
  .btn-primary,
  .btn-secondary { min-height: 40px; }

  /* Nav collapses into a hamburger. Links + auth become a full-width stacked
     dropdown inside the sticky nav when #rr-nav.open (see shared/nav.js). */
  #rr-nav { flex-wrap: wrap; padding: 0.55rem var(--space-4); }
  #rr-nav .rr-logo { margin-right: 0; }
  .nav-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 44px;
    height: 44px;
    font-size: 1.35rem;
    line-height: 1;
    background: none;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.12s;
  }
  .nav-hamburger:hover,
  #rr-nav.open .nav-hamburger { background: var(--accent-glow); }
  #rr-nav .rr-links,
  #rr-nav .rr-auth { display: none; }
  #rr-nav.open .rr-links,
  #rr-nav.open .rr-auth {
    display: flex;
    flex-direction: column;
    flex: 0 0 100%;
    order: 10;
  }
  #rr-nav.open .rr-links {
    gap: 0.25rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
  }
  #rr-nav.open .rr-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.9rem;
    font-size: var(--fs-md);
  }
  #rr-nav.open .rr-auth {
    margin-left: 0;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.5rem 0 0.3rem;
  }
  #rr-nav.open #rr-sign-in { min-height: 48px; font-size: 0.9rem; }
  #rr-nav.open { box-shadow: var(--shadow-card); }
}


/* 11. Footer --------------------------------------------------------------- */
/* Shared site footer. Identical markup on every page (home, draft setup,
   research, trade, lineup, team). One line on desktop, two rows on mobile.
   index.html nests it inside #setup-screen so it hides once a draft starts. */
.rr-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.rr-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.rr-footer-brand { white-space: nowrap; letter-spacing: 0.02em; }
.rr-footer-links { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.rr-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  transition: color 0.15s ease;
}
.rr-footer-links a:hover { color: var(--text-primary); }
/* Tool pages (#app shell) pin the footer to the viewport bottom on short/gated states. */
body:has(> #app) { display: flex; flex-direction: column; }
body:has(> #app) > .rr-footer { margin-top: auto; }
@media (max-width: 768px) {
  .rr-footer { padding: var(--space-4); }
  .rr-footer-inner { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .rr-footer-links { gap: var(--space-4); }
  .rr-footer-links a { min-height: 44px; }
}


/* === NBA theme === ===========================================================
   Basketball orange for the /nba section. A page opts in with
   <body class="sport-nba">; any element can also carry .sport-nba to theme a
   single block (home.html's NBA banner + section do this). Everything here is
   scoped under .sport-nba except the NFL | NBA switch, which every page with
   #rr-nav gets from shared/nav.js. Docs + contrast table: docs/nba-theme.md.

   Text and fills are checked against the dark UI (#000 / #0a0a0a / #111):
     --nba-400 #ff8a3d on #111 = 8.0:1   (accent text, active nav)
     --nba-300 #ffb27a on #111 = 10.7:1  (hover text)
     --nba-ink #1c0b02 on --nba-500 #f7711f = 6.7:1 (button label; 5.0:1 on pressed --nba-600)
   White on orange fails AA, so orange buttons always use the dark ink label. */

/* 12a. Sport switch (all pages) --------------------------------------------- */
#rr-nav .rr-sport,
#rr-nav .sport-switch {
  display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0;
  margin: 0 var(--space-2) 0 0; padding: 2px;
  border: 1px solid var(--border-bright); border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.02);
}
#rr-nav .rr-sport-opt,
#rr-nav .sport-switch a {
  display: inline-flex; align-items: center; gap: 0.35rem;
  min-height: 28px; padding: 0 0.7rem; border-radius: var(--radius-pill);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; line-height: 1;
  color: var(--text-secondary); text-decoration: none;
  transition: color 0.12s, background 0.12s;
}
#rr-nav .rr-sport-opt:hover,
#rr-nav .sport-switch a:hover { color: var(--text-primary); }
#rr-nav .rr-sport-opt.active,
#rr-nav .sport-switch a[aria-current="page"] { color: var(--bg-primary); background: var(--text-primary); }
/* Small orange ball dot on the NBA option so it reads as "the basketball one". */
#rr-nav .rr-sport-opt[data-sport="nba"]::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: #ff8a3d; box-shadow: 0 0 6px rgba(255,138,61,0.7);
}
/* Mobile menu copy of the switch: only shown inside the open hamburger. */
#rr-nav .rr-sport-menu { display: none; }
@media (max-width: 768px) {
  #rr-nav .rr-sport,
  #rr-nav .sport-switch { margin-right: 0; margin-left: var(--space-2); }
  #rr-nav .rr-sport-opt,
  #rr-nav .sport-switch a { min-height: 32px; padding: 0 0.75rem; }
  /* Menu open: the Sport row sits between the links and Sign In, and the bar
     pill steps aside (visibility, so the bar doesn't reflow). */
  #rr-nav.open > .rr-sport,
  #rr-nav.open > .sport-switch { visibility: hidden; }
  #rr-nav.open .rr-auth { order: 12; }
  #rr-nav.open .rr-sport-menu {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    flex: 0 0 100%; order: 11; border-top: 1px solid var(--border); margin-top: 0.5rem; padding: 0.6rem 0.9rem 0.2rem;
    font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--tracking-label);
    text-transform: uppercase; color: var(--text-muted);
  }
  #rr-nav.open .rr-sport-menu .rr-sport { margin: 0; }
  #rr-nav.open .rr-sport-menu .rr-sport-opt { min-height: 40px; padding: 0 1rem; font-size: 0.78rem; }
}
@media (max-width: 360px) {
  /* Tiny phones: the bar keeps logo + switch + hamburger; drop the label dot. */
  #rr-nav > .rr-sport .rr-sport-opt[data-sport="nba"]::before { display: none; }
}

/* 12b. Tokens ---------------------------------------------------------------- */
.sport-nba {
  /* orange family (basketball leather, not traffic-cone) */
  --nba-50:  #fff4ec;
  --nba-200: #ffd2ad;
  --nba-300: #ffb27a;
  --nba-400: #ff8a3d;
  --nba-500: #f7711f;
  --nba-600: #db5a0c;
  --nba-700: #a8430a;
  --nba-ink: #1c0b02;          /* label colour on orange fills */
  --nba-hardwood: #c8915a;     /* decorative court tone, never for text */
  --nba-surface: #120c08;      /* warm-tinted card surface */
  --nba-surface-2: #1a110b;
  --nba-border: rgba(255,138,61,0.22);
  --nba-border-bright: rgba(255,138,61,0.42);
  --nba-glow: rgba(255,138,61,0.14);
  --nba-glow-strong: rgba(247,113,31,0.32);
  --nba-ring: 0 0 0 3px rgba(255,138,61,0.35);
  --nba-line: rgba(255,178,122,0.07);  /* court-line pattern stroke */

  /* remap the shared semantic tokens so existing components follow */
  --accent: var(--nba-400);
  --accent-glow: var(--nba-glow);
  --color-accent: var(--nba-400);
  --brand-400: var(--nba-400);
  --brand-500: var(--nba-500);
  --brand-600: var(--nba-600);
  --brand-glow: var(--nba-glow);
  --shadow-focus: var(--nba-ring);
}
body.sport-nba { background: #050302; }
.sport-nba :focus-visible { outline-color: var(--nba-400); }
.sport-nba ::selection { background: rgba(247,113,31,0.35); color: #fff; }

/* 12c. Nav ------------------------------------------------------------------- */
.sport-nba #rr-nav {
  background: linear-gradient(180deg, rgba(26,13,5,0.96), rgba(10,7,5,0.96));
  border-bottom-color: var(--nba-border);
  box-shadow: inset 0 -1px 0 rgba(255,138,61,0.06);
}
/* Logo gets a tiny basketball (seams drawn with gradients, no asset). */
.sport-nba #rr-nav .rr-logo { display: inline-flex; align-items: center; gap: 0.45rem; }
.sport-nba #rr-nav .rr-logo::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none;
  background:
    linear-gradient(90deg, transparent 46%, var(--nba-ink) 46% 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, var(--nba-ink) 46% 54%, transparent 54%),
    radial-gradient(circle at 35% 30%, var(--nba-300), var(--nba-500) 60%, var(--nba-600));
  box-shadow: 0 0 10px rgba(255,138,61,0.45);
}
.sport-nba #rr-nav .rr-link:hover { color: var(--nba-300); background: var(--nba-glow); }
.sport-nba #rr-nav .rr-link.active,
.sport-nba #rr-nav .rr-link[aria-current="page"] {
  color: var(--nba-400); background: var(--nba-glow);
  box-shadow: inset 0 -2px 0 var(--nba-500);
}
.sport-nba #rr-nav .rr-sport-opt.active,
.sport-nba #rr-nav .sport-switch a[aria-current="page"] {
  color: var(--nba-ink);
  background: linear-gradient(135deg, var(--nba-400), var(--nba-500));
  box-shadow: 0 0 12px -2px var(--nba-glow-strong);
}
.sport-nba #rr-nav .rr-sport-opt.active::before { background: var(--nba-ink); box-shadow: none; }
.sport-nba #rr-sign-in:hover,
.sport-nba .nav-hamburger:hover,
.sport-nba #rr-nav.open .nav-hamburger { background: var(--nba-glow); border-color: var(--nba-border-bright); }

/* 12d. Buttons ---------------------------------------------------------------- */
.sport-nba .btn-primary,
.sport-nba .btn-brand,
.nba-btn {
  background: linear-gradient(135deg, var(--nba-400, #ff8a3d), var(--nba-500, #f7711f));
  color: var(--nba-ink, #1c0b02); border: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 20px -8px var(--nba-glow-strong, rgba(247,113,31,0.32));
}
.sport-nba .btn-primary:hover:not(:disabled),
.sport-nba .btn-brand:hover,
.nba-btn:hover { background: linear-gradient(135deg, var(--nba-300, #ffb27a), var(--nba-400, #ff8a3d)); filter: none; }
.sport-nba .btn-primary:active:not(:disabled),
.sport-nba .btn-brand:active,
.nba-btn:active { background: var(--nba-600, #db5a0c); transform: scale(0.98); }
.sport-nba .btn-primary:focus-visible,
.sport-nba .btn-brand:focus-visible,
.nba-btn:focus-visible { outline: none; box-shadow: var(--nba-ring, 0 0 0 3px rgba(255,138,61,0.35)); }
.nba-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-weight: 700; font-size: 0.9rem; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
}
.sport-nba .btn-secondary:hover:not(:disabled) { background: var(--nba-glow); border-color: var(--nba-border-bright); }
.sport-nba .btn-secondary:focus-visible { outline: none; box-shadow: var(--nba-ring); }

/* 12e. Chips, badges, tiers ---------------------------------------------------- */
.nba-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  min-height: 28px; padding: 0 0.7rem; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--nba-300); background: var(--nba-glow); border: 1px solid var(--nba-border);
  white-space: nowrap;
}
.nba-chip.solid { color: var(--nba-ink); background: var(--nba-400); border-color: transparent; }
.nba-badge {
  display: inline-flex; align-items: center; font-family: var(--font-mono);
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.12rem 0.4rem; border-radius: var(--radius-xs);
  color: var(--nba-400); background: rgba(255,138,61,0.12); border: 1px solid var(--nba-border);
}
.sport-nba .badge { background: rgba(255,138,61,0.08); color: var(--nba-200); }
.sport-nba .nd-chip-toggle[aria-pressed="true"],
.sport-nba .nd-views button[aria-pressed="true"] { border-color: var(--nba-border-bright); background: var(--nba-glow); color: var(--nba-200); }
/* Tier dividers: a short orange tick before the label. */
.sport-nba .rsch-tier-divider { color: var(--nba-300); }
.sport-nba .rsch-tier-divider::before {
  content: ""; width: 10px; height: 2px; border-radius: 2px; background: var(--nba-500); flex: none; margin-right: 0.4rem;
}
/* Tier ladder colours for pages that render tier numbers. */
.sport-nba .nba-tier-1 { color: var(--nba-300); }
.sport-nba .nba-tier-2 { color: var(--nba-400); }
.sport-nba .nba-tier-3 { color: var(--nba-hardwood); }
.sport-nba .nba-tier-4 { color: var(--text-secondary); }

/* 12f. Court motif (use sparingly: one hero/card per page) --------------------
   .nba-court paints a faint half-court: centre circle, free-throw lane and the
   three-point arc as 1px lines in --nba-line over a warm surface. Pure CSS
   gradients, no images; sits behind content via ::before. */
.nba-court { position: relative; isolation: isolate; overflow: hidden; }
.nba-court::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    /* three-point arc, anchored right */
    radial-gradient(circle at 100% 50%, transparent 0 239px, var(--nba-line, rgba(255,178,122,0.07)) 239px 240px, transparent 241px),
    /* free-throw circle */
    radial-gradient(circle at 100% 50%, transparent 0 89px, var(--nba-line, rgba(255,178,122,0.07)) 89px 90px, transparent 91px),
    /* half-court line + centre circle, anchored left */
    radial-gradient(circle at 0% 50%, transparent 0 69px, var(--nba-line, rgba(255,178,122,0.07)) 69px 70px, transparent 71px),
    linear-gradient(90deg, var(--nba-line, rgba(255,178,122,0.07)) 0 1px, transparent 1px);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,0.6) 50%, #000 100%);
          mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,0.6) 50%, #000 100%);
}
/* Ball-seam glyph for icons and empty states: <span class="nba-ball" aria-hidden="true"></span> */
.nba-ball {
  display: inline-block; width: 1em; height: 1em; border-radius: 50%; flex: none; vertical-align: -0.12em;
  background:
    radial-gradient(circle at -18% 50%, transparent 0 52%, var(--nba-ink, #1c0b02) 52% 58%, transparent 58%),
    radial-gradient(circle at 118% 50%, transparent 0 52%, var(--nba-ink, #1c0b02) 52% 58%, transparent 58%),
    linear-gradient(90deg, transparent 47%, var(--nba-ink, #1c0b02) 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 47%, var(--nba-ink, #1c0b02) 47% 53%, transparent 53%),
    radial-gradient(circle at 35% 30%, var(--nba-300, #ffb27a), var(--nba-500, #f7711f) 60%, var(--nba-600, #db5a0c));
}
@media (prefers-reduced-motion: reduce) {
  .nba-btn, .sport-nba .btn-primary, .sport-nba .btn-brand { transition: none; }
  .nba-btn:active, .sport-nba .btn-primary:active:not(:disabled), .sport-nba .btn-brand:active { transform: none; }
}
@media (prefers-contrast: more) {
  .sport-nba { --nba-border: rgba(255,138,61,0.6); --nba-line: rgba(255,178,122,0.0); }
}
/* === end NBA theme === */
