/* ============================================================
   BPC DESIGN SYSTEM v2.0
   Body Piloting Championships
   Lead Product Designer: June 2026
   
   Direction: 70% UFC/Red Bull · 20% F1 · 10% Apple
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,700&family=Barlow:wght@400;500;600&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {

  /* ── Canvas ── */
  --bg:           #080808;    /* Void — tunnel darkness */
  --depth:        #0F1219;    /* Panel depth */
  --surface:      #161B26;    /* Card surfaces */
  --surface-2:    #161B26;    /* Alias */
  --surface-3:    #1E2535;    /* Elevated / hover */
  --surface2:     #161B26;    /* Legacy alias */
  --surface3:     #1E2535;    /* Legacy alias */
  --lift:         #1E2535;    /* Interactive hover layer */

  /* ── Legacy navy aliases (preserved for compatibility) ── */
  --navy-deep:    #07090f;
  --navy:         #161B26;
  --navy-mid:     #1E2535;
  --navy-light:   #2A3A4A;
  --navy-rim:     #3A4A5A;

  /* ── Sport Colours ── */
  --red:          #E8001D;    /* Live events, primary CTA, score moments */
  --red-bright:   #FF1A33;    /* Hover state */
  --red-dim:      #8A0010;    /* Disabled/muted red */
  --red-glow:     rgba(232,0,29,0.12);

  --gold:         #C9A84C;    /* Championship Gold — achievements, champion marks */
  --gold-bright:  #E8C060;    /* Hover gold */
  --gold-glow:    rgba(201,168,76,0.12);

  --cyan:         #00C8B0;    /* Speed / velocity / TOP zone / timing */
  --teal:         #00C8B0;    /* Alias for legacy teal */
  --teal-dim:     #007A6E;
  --teal-glow:    rgba(0,200,176,0.12);

  --blue:         #0066FF;    /* BOTTOM zone / analytics */
  --blue-bright:  #4490FF;    /* Lighter blue for data labels */

  --purple:       #7B5EA7;    /* TRICK zone */

  /* ── Outcome Colours ── */
  --win:          #00A651;    /* Victory */
  --loss:         #CC1A1A;    /* Defeat (darker than --red, distinct) */
  --draw:         #4A6080;    /* Draw / neutral */
  --green:        #00A651;    /* Alias */
  --orange:       #E07020;    /* Tertiary accent */

  /* ── Text ── */
  --white:        #FFFFFF;
  --off-white:    #F0F4FF;
  --text:         #F0F4FF;    /* Primary text alias */
  --silver:       #A0AABB;    /* Secondary text */
  --dim:          #6A7A8A;    /* Labels, metadata, ghost text */
  --muted:        #4A5A6A;    /* Dividers, inactive elements */

  /* ── Borders ── */
  --border:       #1E2D3A;
  --border-light: #2A3A4A;

  /* ── Typography ── */
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body:    'Barlow', 'Arial', sans-serif;

  /* ── Radius ── */
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  --radius-pill:  999px;

  /* ── Shadows ── */
  --shadow-deep:  0 4px 24px rgba(0,0,0,0.8);
  --shadow-card:  0 2px 12px rgba(0,0,0,0.6);
  --shadow-red:   0 0 24px rgba(232,0,29,0.25);
  --shadow-gold:  0 0 20px rgba(201,168,76,0.2);
  --glow-red:     0 0 16px rgba(232,0,29,0.4);
  --glow-gold:    0 0 16px rgba(201,168,76,0.35);
  --glow-cyan:    0 0 16px rgba(0,200,176,0.35);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px; /* Unified base — was 18px, too large at rem scale */
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--off-white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   PAGE SHELL
   ============================================================ */
.bpc-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Subtle film grain — cinematic texture */
.bpc-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
.bpc-page > * { position: relative; z-index: 1; }

/* ============================================================
   NAVIGATION BAR
   ============================================================ */
.bpc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

/* Brand mark */
.bpc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.bpc-logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.bpc-wordmark {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bpc-wordmark-top {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.20em;
  color: var(--white);
  line-height: 1;
  text-transform: uppercase;
}

.bpc-wordmark-sub {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  color: var(--dim);   /* Demoted from red — subtitle should not compete */
  text-transform: uppercase;
  line-height: 1;
}

/* Nav links */
.bpc-topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bpc-nav-link {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
  background: transparent;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.bpc-nav-link:hover {
  color: var(--white);
  border-color: var(--border-light);
}

.bpc-nav-link.active {
  color: var(--white);
  border-color: var(--red);
  background: var(--red-glow);
}

/* Nav button (primary CTA in nav) */
.bpc-nav-btn {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  border: none;
  padding: 8px 18px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}
.bpc-nav-btn:hover {
  background: var(--red-bright);
  box-shadow: var(--glow-red);
}

/* Live match indicator */
.bpc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  padding: 5px 10px;
  border: 1px solid rgba(232,0,29,0.4);
  border-radius: 2px;
  background: var(--red-glow);
}

/* Connection status */
.bpc-conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ============================================================
   STATUS DOTS
   ============================================================ */
.bpc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bpc-dot-live   { background: var(--cyan);   animation: bpc-pulse 2s ease-in-out infinite; }
.bpc-dot-red    { background: var(--red);    animation: bpc-pulse 1.4s ease-in-out infinite; }
.bpc-dot-gold   { background: var(--gold); }
.bpc-dot-navy   { background: var(--navy-rim); }
.bpc-dot-dim    { background: var(--muted); }

@keyframes bpc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.85); }
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.bpc-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.bpc-section-head-line {
  width: 3px;
  height: 20px;
  background: var(--red);
  border-radius: 1px;
  flex-shrink: 0;
}

.bpc-section-head-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Red accent line */
.bpc-redline {
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, transparent 100%);
  border-radius: 1px;
  margin-bottom: 16px;
}

/* ============================================================
   CARDS
   ============================================================ */
.bpc-card {
  background: var(--depth);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.bpc-card-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.30em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.bpc-card-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--red);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.bpc-btn {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s, transform 0.08s, border-color 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;     /* Apple 44px touch minimum */
  text-decoration: none;
}
.bpc-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.bpc-btn:not(:disabled):active { transform: scale(0.98); }

/* Tier 1 — Primary action */
.bpc-btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
.bpc-btn-primary:not(:disabled):hover {
  background: var(--red-bright);
  box-shadow: var(--glow-red);
}

/* Tier 2 — Secondary action */
.bpc-btn-secondary,
.bpc-btn-navy,
.bpc-btn-ghost {
  background: transparent;
  border-color: var(--border-light);
  color: var(--silver);
}
.bpc-btn-secondary:not(:disabled):hover,
.bpc-btn-navy:not(:disabled):hover,
.bpc-btn-ghost:not(:disabled):hover {
  border-color: var(--silver);
  color: var(--white);
  background: var(--lift);
}

/* Success */
.bpc-btn-success {
  background: transparent;
  border-color: var(--win);
  color: var(--win);
}
.bpc-btn-success:not(:disabled):hover {
  background: rgba(0,166,81,0.10);
}

/* Destructive — Stage 1 */
.bpc-btn-danger {
  background: transparent;
  border-color: rgba(204,26,26,0.6);
  color: var(--loss);
}
.bpc-btn-danger:not(:disabled):hover {
  background: rgba(204,26,26,0.10);
  border-color: var(--loss);
}

/* Gold — achievements, champion actions */
.bpc-btn-gold {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold);
}
.bpc-btn-gold:not(:disabled):hover {
  background: var(--gold-glow);
  box-shadow: var(--glow-gold);
}

/* Sizes */
.bpc-btn-xl { padding: 15px 36px; font-size: 0.90rem; min-height: 52px; }
.bpc-btn-lg { padding: 13px 28px; font-size: 0.84rem; min-height: 48px; }
.bpc-btn-sm { padding: 7px 14px;  font-size: 0.72rem; min-height: 36px; }

/* ============================================================
   FORMS
   ============================================================ */
.bpc-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bpc-form-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

.bpc-input,
.bpc-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-width: 2px;   /* Bottom-only emphasis */
  color: var(--off-white);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: 2px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.bpc-input:focus,
.bpc-select:focus {
  border-color: var(--border);
  border-bottom-color: var(--cyan);
  box-shadow: none;
}

.bpc-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* ============================================================
   BADGES
   ============================================================ */
.bpc-badge {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bpc-badge-live  { background: rgba(0,200,176,0.10); border-color: var(--cyan);  color: var(--cyan); }
.bpc-badge-red   { background: var(--red-glow);       border-color: var(--red);   color: var(--red); }
.bpc-badge-gold  { background: var(--gold-glow);       border-color: var(--gold);  color: var(--gold); }
.bpc-badge-dim   { background: var(--surface);         border-color: var(--border);color: var(--dim); }
.bpc-badge-navy  { background: var(--surface);         border-color: var(--border-light); color: var(--silver); }

/* ============================================================
   FIGHTER CARD (athlete roster)
   ============================================================ */
.fighter-card {
  background: var(--depth);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border); /* Grade tier colour applied via JS */
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.fighter-card:hover {
  border-color: var(--border-light);
  background: var(--surface);
  box-shadow: 0 6px 28px rgba(0,0,0,0.55);
}
.fighter-card.champion {
  border-left-color: var(--gold) !important;
}
.fighter-card.champion:hover {
  box-shadow: 0 6px 28px rgba(201,168,76,0.15);
}

/* Champion star marker */
.fighter-card.champion::after {
  content: '★';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.85rem;
  color: var(--gold);
  line-height: 1;
}

.fighter-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: var(--surface);
}

.fighter-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--border-light);
  letter-spacing: 0.08em;
}

.fighter-info {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
}

.fighter-name {
  font-family: var(--font-display);
  font-size: 1.0rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.1;
}

.fighter-division {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

.fighter-record {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.fighter-record-stat {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--dim);
}
.fighter-record-stat span {
  color: var(--off-white);
  font-weight: 700;
}

/* ============================================================
   DIVISION COLOURS — Grade tier system (locked)
   ============================================================ */
.div-high-speed   { color: var(--red);          border-color: var(--red); }
.div-mid-high     { color: var(--blue-bright);  border-color: var(--blue-bright); }
.div-mid-speed    { color: var(--gold);          border-color: var(--gold); }
.div-low-mid      { color: var(--win);           border-color: var(--win); }

/* Division border-left colours for athlete cards */
.div-accent-high  { border-left-color: var(--red) !important; }
.div-accent-midhigh { border-left-color: var(--blue-bright) !important; }
.div-accent-mid   { border-left-color: var(--gold) !important; }
.div-accent-low   { border-left-color: var(--win) !important; }

/* ============================================================
   SCORE DISPLAY (controller / match screens)
   ============================================================ */
.bpc-score-side {
  transition: background 0.25s, border-color 0.25s;
}
.bpc-score-side.leading {
  background: linear-gradient(135deg, rgba(201,168,76,0.07) 0%, transparent 60%);
  border-color: rgba(201,168,76,0.25);
}
.bpc-score-side.leading .bpc-score-num  { color: var(--gold); }
.bpc-score-side.leading .bpc-score-name { color: var(--gold); }
.bpc-score-side.leading .bpc-score-role { color: rgba(201,168,76,0.65); }

/* ============================================================
   TIMER
   ============================================================ */
.bpc-timer-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  transition: color 0.3s;
}

/* ============================================================
   CHAMPIONSHIP CHIP
   ============================================================ */
.bpc-champ-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-glow);
  border: 1px solid rgba(201,168,76,0.3);
  padding: 3px 10px;
  border-radius: 2px;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.bpc-empty {
  text-align: center;
  padding: 36px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

/* ============================================================
   TABLES
   ============================================================ */
.bpc-table {
  width: 100%;
  border-collapse: collapse;
}
.bpc-table th {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  background: var(--depth);
}
.bpc-table td {
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.bpc-table tr:last-child td { border-bottom: none; }
.bpc-table tr:hover td { background: var(--lift); }
.bpc-table .td-num {
  font-weight: 700;
  color: var(--white);
  font-size: 0.90rem;
}
.bpc-table .td-dim { color: var(--dim); font-size: 0.78rem; }

/* ============================================================
   RESULT INDICATORS
   ============================================================ */
.result-w { color: var(--win); }
.result-l { color: var(--loss); }
.result-d { color: var(--draw); }

.result-bar-w { background: var(--win); }
.result-bar-l { background: var(--loss); }
.result-bar-d { background: var(--draw); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-rim); }

/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */
@media (max-width: 768px) {
  .bpc-page { padding: 0 16px 40px; }
  .bpc-topbar { padding: 12px 0; }
  .bpc-wordmark-sub { display: none; } /* Hide on mobile — saves space */
}

@media (max-width: 480px) {
  .bpc-btn { min-height: 48px; } /* Larger touch target on small phones */
}

/* ============================================================
   QUICK NAV — compact cross-page section menu
   Used on hub/sub-pages to jump between Play/Athletes/Media/Learning
   without returning to index.html
   ============================================================ */
.bpc-quicknav {
  display: flex;
  gap: 2px;
  padding: 6px 0 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 30;
}

.qn-trigger {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.qn-trigger:hover,
.qn-trigger.open {
  color: var(--white);
  border-color: var(--border-light);
  background: var(--surface);
}
.qn-trigger .qn-caret {
  font-size: 0.62rem;
  transition: transform 0.15s;
  color: var(--muted);
}
.qn-trigger.open .qn-caret { transform: rotate(180deg); }

.qn-item { position: relative; }

.qn-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--depth);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
  z-index: 50;
}
.qn-menu.open { display: flex; flex-direction: column; }

.qn-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--off-white);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.qn-link:last-child { border-bottom: none; }
.qn-link:hover { background: var(--surface); }
.qn-link .qn-icon { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }

@media (max-width: 560px) {
  .qn-trigger { flex: 1 1 auto; justify-content: space-between; }
  .qn-menu { left: 0; right: 0; min-width: 0; }
}

