/* ============================================================
   PRIDE OF LONDON — SHARED DESIGN SYSTEM
   ============================================================
   Design tokens, base reset, and common components used across
   every screen: top bar, bottom nav, badges, fixture cards, form
   pills, section labels, dev notes, the theme preview toggle,
   segmented controls, and availability rows.

   Extracted from 9 files that were previously each carrying a full
   duplicate copy of all of this — a font or color change used to
   mean editing 9 files and hoping none were missed. Now it's one
   file. Anything screen-specific (Live's scoreboard, Transfer
   Center's cards, etc.) stays inline in that screen's own <style>
   block — this file only holds what's genuinely shared.
   ============================================================ */

  :root {
    --bright-blue:   #0A3FA3;
    --bright-blue-2: #1553C9; /* lighter step, for gradients/hover */
    --midwest-gold:  #C4972E;
    --midwest-gold-2:#D9AE4E;
    --deep-navy:     #0B1830;
    --deep-navy-2:   #101F3D; /* card surface, one step up */
    --warm-ivory:    #F5F1E7;
    --graphite:      #6B7280;
    --success:       #2E9E5B;
    --danger:        #D6484B;

    --text-primary:  var(--warm-ivory);
    --text-mute:     #8FA0C4;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;
    --space-6: 48px;

    --shadow-card: 0 4px 20px rgba(0,0,0,0.35);
    --shadow-float: 0 8px 32px rgba(0,0,0,0.45);

    --hairline: rgba(255,255,255,0.07);
    --hairline-strong: rgba(255,255,255,0.1);
    --nav-bg: rgba(11,24,48,0.88);
    --body-glow: rgba(21,83,201,0.18);
    --icon-accent: var(--midwest-gold-2);   /* dark mode: gold owns icons/toggles/nav */
  }

  /* ============================================================
     LIGHT THEME — same tokens, redefined. Everything referencing
     these variables re-themes automatically.
     ============================================================ */
  [data-theme="light"] {
    --deep-navy:     #FAF6EC;
    --deep-navy-2:   #FFFFFF;
    --warm-ivory:    #17223F;
    --text-primary:  #17223F;
    --text-mute:     #6B6656;
    --midwest-gold-2:#9C7A1F;
    --graphite:      #8A8577;
    --nav-bg: rgba(255,255,255,0.85);
    --body-glow: rgba(196,151,46,0.08);
    --icon-accent: var(--bright-blue);   /* light mode: royal blue (this season's kit blue) owns icons/toggles/nav */
    --hairline: rgba(11,24,48,0.08);
    --hairline-strong: rgba(11,24,48,0.12);
    --shadow-card: 0 2px 12px rgba(23,34,63,0.08);
    --shadow-float: 0 8px 28px rgba(23,34,63,0.14);
  }


  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body {
    margin: 0;
    background: var(--deep-navy);
    color: var(--text-primary);
    font-family: var(--font-body);
    overscroll-behavior-y: none;
    overflow-x: hidden;
    transition: background 0.25s ease, color 0.25s ease;
  }
  body {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background:
      radial-gradient(ellipse at top, var(--body-glow), transparent 55%),
      var(--deep-navy);
  }
  h1, h2, h3 { font-family: var(--font-display); margin: 0; }
  ::selection { background: var(--midwest-gold); color: var(--deep-navy); }


  /* ============================================================
     TOP BAR
     ============================================================ */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-3) var(--space-2);
  }
  .topbar .brand { display: flex; align-items: center; gap: var(--space-2); }
  .topbar .brand svg { width: 42px; height: 42px; }
  .topbar .brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
  }
  .topbar .brand-text small {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    color: var(--text-mute);
    text-transform: uppercase;
  }


  .icon-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--hairline);
    border: 1px solid var(--hairline);
    color: var(--warm-ivory);
    transition: transform 0.08s ease, background 0.15s ease;
  }
  .icon-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.12); }
  .icon-btn svg { width: 18px; height: 18px; }


  .page-title { padding: var(--space-2) var(--space-3) 0; }
  .page-title h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.01em; }


  /* ============================================================
     BOTTOM NAV — 6 tabs
     ============================================================ */
  .tabbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(201,169,97,0.14);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 20;
  }
  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: var(--radius-sm);
    color: var(--text-mute);
    transition: color 0.15s ease, transform 0.08s ease;
  }
  .tab:active { transform: scale(0.92); }
  .tab svg { width: 21px; height: 21px; }
  .tab span { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.02em; }
  .tab.active { color: var(--midwest-gold); }
  .tab.live-tab.active { color: var(--midwest-gold-2); }
  [data-theme="light"] .tab.active { color: var(--icon-accent); }
  [data-theme="light"] .tab.live-tab.active { color: var(--icon-accent); }
  .live-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--midwest-gold-2);
    position: absolute; margin-left: 14px; margin-top: -2px;
    box-shadow: 0 0 6px var(--midwest-gold-2);
  }


  .badge-circle {
    border-radius: 50%;
    background: var(--hairline);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-mute);
  }


  /* Fixture Card */
  .fixture-card {
    background: linear-gradient(155deg, var(--deep-navy-2), #0C1731 70%);
    border: 1px solid rgba(201,169,97,0.18);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease;
  }
  .fixture-card:active { transform: scale(0.985); }
  .fixture-card::after {
    content: '';
    position: absolute;
    top: -40%; right: -20%;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(201,169,97,0.12), transparent 70%);
    pointer-events: none;
  }
  .fixture-comp {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--midwest-gold);
    font-weight: 600;
    margin-bottom: var(--space-3);
  }
  .fixture-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
  }
  .fixture-team { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .badge-circle {
    border-radius: 50%;
    background: var(--hairline);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-mute);
  }
  .fixture-team .badge-circle {
    width: 44px; height: 44px;
    font-size: 0.85rem;
  }
  .fixture-team.us .badge-circle { border-color: var(--midwest-gold); color: var(--midwest-gold); }
  .fixture-team span.name { font-size: 0.76rem; color: var(--text-primary); font-weight: 500; }
  .fixture-vs { font-family: var(--font-display); color: var(--text-mute); font-size: 0.85rem; padding-top: 14px; }


  /* Form pills */
  .form-row { display: flex; align-items: center; gap: var(--space-2); }
  .form-pill {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-body);
  }
  .form-pill.w { background: rgba(46,158,91,0.18); color: var(--success); border: 1px solid rgba(46,158,91,0.4); }
  .form-pill.d { background: rgba(201,169,97,0.15); color: var(--midwest-gold); border: 1px solid rgba(201,169,97,0.4); }
  .form-pill.l { background: rgba(214,72,75,0.15); color: var(--danger); border: 1px solid rgba(214,72,75,0.4); }


  .section-label {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-mute);
    font-weight: 600;
    margin: var(--space-5) 0 var(--space-2) var(--space-1);
  }
  .section-label:first-of-type { margin-top: var(--space-3); }


  .dev-note {
    margin-top: var(--space-6);
    border: 1px dashed rgba(201,169,97,0.3);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    font-size: 0.74rem;
    color: var(--text-mute);
    line-height: 1.5;
  }
  .dev-note strong { color: var(--midwest-gold); }


  .theme-preview-control {
    position: fixed; right: 10px; top: 100px; z-index: 90;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
    border: 1px dashed rgba(255,255,255,0.25); border-radius: 12px;
    padding: 5px; display: flex; gap: 4px;
  }
  .theme-preview-control button {
    font-size: 0.6rem; font-weight: 600; padding: 5px 9px; border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); color: #ccc; cursor: pointer;
  }
  .theme-preview-control button.active { background: var(--midwest-gold); color: var(--deep-navy); border-color: var(--midwest-gold); }


  .segmented {
    display: flex;
    background: var(--deep-navy-2);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: 3px;
    margin: var(--space-3);
  }
  .segmented button {
    flex: 1;
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 8px 0;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-mute);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .segmented button.active { background: var(--midwest-gold); color: var(--deep-navy); }


  .avail-row { display: flex; align-items: center; gap: var(--space-2); padding: 8px 0; border-bottom: 1px solid var(--hairline); }
  .avail-row:last-child { border-bottom: none; }
  .avail-photo { width: 34px; height: 34px; border-radius: 50%; background: var(--hairline); border: 1px solid rgba(255,255,255,0.1); flex-shrink: 0; }
  .avail-name { flex: 1; font-size: 0.8rem; }
  .avail-reason { font-size: 0.66rem; color: var(--text-mute); }
  .avail-status { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
  .avail-status.out { background: rgba(214,72,75,0.15); color: var(--danger); }
  .avail-status.doubt { background: rgba(196,151,46,0.15); color: var(--midwest-gold-2); }
