/* ============================================
   GREEN ARROW FORGE — FPL Decision Engine
   Design Tokens + Component Styles
   ============================================ */

/* --- Box model reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

/* --- Design Tokens --- */
:root {
  /* Type Scale */
  --text-xs:   clamp(0.7rem,  0.65rem + 0.25vw, 0.8rem);
  --text-sm:   clamp(0.8rem,  0.75rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.85rem + 0.2vw, 1rem);
  --text-lg:   clamp(1rem,    0.95rem + 0.3vw,  1.25rem);
  --text-xl:   clamp(1.25rem, 1rem    + 0.8vw,  1.75rem);
  --text-2xl:  clamp(1.5rem,  1.2rem  + 1.2vw,  2.25rem);
  --text-3xl:  clamp(2rem,    1rem    + 3vw,    3.5rem);

  /* 4px Spacing */
  --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;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Editorial Theme Colors — white background, black text, green as the only accent */
  --color-bg:          #ffffff;
  --color-surface:     #ffffff;
  --color-surface-2:   #f7f6f3;
  --color-border:      rgba(0,0,0,0.10);
  --color-divider:     rgba(0,0,0,0.06);

  --color-primary:     #00ff87;
  --color-primary-dim: rgba(0,255,135,0.18);
  --color-secondary:   #37003c;

  --color-text:        #111111;
  --color-text-muted:  #555555;
  --color-text-faint:  #999999;

  --color-danger:      #c62828;
  --color-warning:     #b86f1c;
  --color-success:     #157f3a;

  /* Radius — kept conservative for the editorial look */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows — light, papery */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 6px 18px rgba(0,0,0,0.08);

  /* Fonts */
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --font-display: 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;

  /* Sidebar */
  --sidebar-width: 220px;
  --sidebar-collapsed: 60px;
}

/* --- Body --- */
html, body {
  height: 100%;
  overflow: hidden;
  margin: 0;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.5;
}

/* --- Tabular Numbers --- */
.num, .kpi-value, .table-num, td, th {
  font-variant-numeric: tabular-nums lining-nums;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-text-faint); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* --- Focus Ring --- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Layout --- */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  height: 100dvh;
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  grid-row: 1 / -1;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: var(--space-4) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-brand-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.2;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-2) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-3) var(--space-3) var(--space-1);
  margin-top: var(--space-2);
}

.nav-section-label:first-child {
  margin-top: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
  white-space: nowrap;
  line-height: 1.4;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--color-text);
}

.nav-btn.active {
  background: var(--color-primary-dim);
  color: var(--color-primary);
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-footer a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: var(--color-text-muted);
}

/* --- Mobile Hamburger --- */
.hamburger {
  display: none;
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 200;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  color: var(--color-text);
  cursor: pointer;
}

.hamburger svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* --- Main Content --- */
.main-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
}

/* --- Tab Panels --- */
.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Page Header --- */
.page-header {
  margin-bottom: var(--space-6);
}

.page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- KPI Grid --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.kpi-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.kpi-value.accent {
  color: var(--color-primary);
}

.kpi-delta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.kpi-detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.kpi-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.kpi-grid-1 {
  grid-template-columns: 1fr;
  max-width: 320px;
}

/* --- Dashboard Header --- */
.dash-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.dash-gw-badge {
  background: var(--color-primary-dim);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.dash-updated {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-left: auto;
}

/* --- Projections Table --- */
.proj-section {
  margin-top: var(--space-4);
}

.proj-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.proj-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.pos-filters {
  display: flex;
  gap: var(--space-1);
}

.pos-filter-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pos-filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pos-filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #000;
}

.proj-table-wrapper {
  max-height: 600px;
  overflow-y: auto;
}

.proj-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-surface-2);
}

.xp-total {
  font-weight: 700;
  color: var(--color-primary);
}

.xp-header {
  color: var(--color-primary);
}

.projection-high {
  color: var(--color-primary);
  font-weight: 600;
}

.projection-mid {
  color: var(--color-text);
}

.projection-low {
  color: var(--color-text-faint);
}

/* Status dots */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.dot-available { background: #00ff87; }
.dot-doubtful { background: #f0883e; }
.dot-unavailable { background: #f85149; }

/* Position badges */
.pos-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.pos-gk  { background: #f0883e; color: #000; }
.pos-def { background: #00cc66; color: #000; }
.pos-mid { background: #4da6ff; color: #000; }
.pos-fwd { background: #f85149; color: #fff; }

/* --- Charts --- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.chart-card h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
}

/* --- Pitch Visualization --- */
.pitch-wrapper {
  max-width: 700px;
  margin: 0 auto var(--space-6);
}

.pitch {
  position: relative;
  width: 100%;
  padding-bottom: 130%;
  background: linear-gradient(180deg,
    #1a7a3a 0%,
    #1e8c42 8%,
    #1a7a3a 16%,
    #1e8c42 24%,
    #1a7a3a 32%,
    #1e8c42 40%,
    #1a7a3a 48%,
    #1e8c42 56%,
    #1a7a3a 64%,
    #1e8c42 72%,
    #1a7a3a 80%,
    #1e8c42 88%,
    #1a7a3a 100%
  );
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
}

.pitch-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pitch-lines svg {
  width: 100%;
  height: 100%;
}

/* Formation rows */
.pitch-formation {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5% 3% 4% 3%;
}

.formation-row {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

/* Player card on pitch */
.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  cursor: default;
  transition: transform var(--transition-fast);
}

.player-card:hover {
  transform: scale(1.05);
}

.player-shirt {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-xs);
  color: #fff;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border: 2px solid rgba(255,255,255,0.25);
}

.player-shirt .captain-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffd700;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}

.player-shirt .vc-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c0c0c0;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}

.player-name {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  background: rgba(0,0,0,0.65);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-top: var(--space-1);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.player-name .template-star {
  color: var(--color-primary);
  font-weight: 700;
}

.player-points {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  margin-top: 1px;
}

.player-price {
  font-size: 9px;
  color: rgba(255,255,255,0.7);
  margin-top: 1px;
}

/* Bench */
.bench-section {
  max-width: 700px;
  margin: 0 auto var(--space-4);
}

.bench-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
  text-align: center;
}

.bench-players {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.bench-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.7;
  width: 80px;
}

.bench-card .bench-order {
  font-size: 9px;
  color: var(--color-text-faint);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.bench-card .player-shirt {
  width: 36px;
  height: 36px;
}

.bench-card .player-name {
  font-size: 10px;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  text-shadow: none;
}

.bench-card .player-points {
  font-size: 9px;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}

/* Team Stats */
.team-stats {
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.team-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}

.team-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-top: var(--space-1);
}

/* --- Template Tab --- */
.template-info {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.template-info-icon {
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.template-info p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: none;
}

.template-count {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary-dim);
  color: var(--color-primary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

/* --- Tables --- */
.data-table-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th {
  background: var(--color-surface-2);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.data-table tbody tr.owned {
  background: rgba(0,255,135,0.05);
}

.data-table tbody tr.owned td:first-child {
  border-left: 3px solid var(--color-primary);
}

.data-table tbody tr.not-owned {
  opacity: 0.6;
}

.owned-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.owned-badge.yes {
  background: var(--color-primary-dim);
  color: var(--color-primary);
}

.owned-badge.no {
  background: rgba(248,81,73,0.1);
  color: var(--color-danger);
}

/* --- FDR Colors --- */
.fdr-1 { background: #257d5a; color: #fff; }
.fdr-2 { background: #00cc66; color: #000; }
.fdr-3 { background: #e0e0e0; color: #000; }
.fdr-4 { background: #ff4444; color: #fff; }
.fdr-5 { background: #7a1a1a; color: #fff; }

/* FDR Table */
.fdr-table {
  width: 100%;
  border-collapse: collapse;
}

.fdr-table th,
.fdr-table td {
  padding: var(--space-2) var(--space-3);
  text-align: center;
  font-size: var(--text-xs);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.fdr-table th {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.fdr-table td:first-child,
.fdr-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-surface-2);
  color: var(--color-text);
  font-weight: 600;
  text-align: left;
  min-width: 60px;
}

.fdr-table th:first-child {
  z-index: 3;
}

.fdr-cell {
  min-width: 50px;
  font-weight: 600;
  border-radius: 2px;
}

.fdr-scroll {
  overflow-x: auto;
  overscroll-behavior: contain;
}

/* --- League Scanner --- */
.league-input-group {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  max-width: 400px;
}

.league-input-group input {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
}

.league-input-group input::placeholder {
  color: var(--color-text-faint);
}

.btn-primary {
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary:hover {
  background: #00e67a;
}

/* --- Skeleton Loaders --- */
.skeleton {
  background: linear-gradient(90deg,
    var(--color-surface) 25%,
    var(--color-surface-2) 50%,
    var(--color-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
  width: 80%;
}

.skeleton-title {
  height: 24px;
  margin-bottom: var(--space-3);
  width: 60%;
}

.skeleton-card {
  height: 100px;
  width: 100%;
}

/* --- Error State --- */
.error-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--color-text-muted);
}

.error-state svg {
  width: 48px;
  height: 48px;
  color: var(--color-danger);
  margin-bottom: var(--space-4);
  margin-inline: auto;
}

.error-state p {
  font-size: var(--text-sm);
  max-width: none;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* --- Captain Tab --- */
.captain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.captain-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color var(--transition-fast);
}

.captain-card:first-child {
  border-color: rgba(0,255,135,0.3);
}

.captain-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.captain-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}

.captain-card:first-child .captain-rank {
  background: var(--color-primary);
  color: #000;
}

.captain-name {
  font-weight: 600;
  font-size: var(--text-base);
}

.captain-team {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.captain-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.captain-stat {
  text-align: center;
}

.captain-stat-label {
  font-size: 10px;
  color: var(--color-text-faint);
  text-transform: uppercase;
}

.captain-stat-val {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

/* --- Projections Table --- */
.projection-table td,
.projection-table th {
  text-align: center;
}

.projection-table td:first-child,
.projection-table th:first-child {
  text-align: left;
}

.projection-high {
  color: var(--color-primary);
  font-weight: 600;
}

.projection-low {
  color: var(--color-danger);
  font-weight: 600;
}

/* --- Transfer Cards --- */
.transfer-section {
  margin-bottom: var(--space-6);
}

.transfer-section h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
}

.transfer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.transfer-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.transfer-arrow {
  color: var(--color-primary);
  font-size: var(--text-lg);
  font-weight: 700;
}

.transfer-out {
  color: var(--color-danger);
}

.transfer-player {
  flex: 1;
}

.transfer-player-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.transfer-player-detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.transfer-gw {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* --- Transfer Recommendations --- */
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.rec-position-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.rec-position-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.rec-position-header h3 {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}

.rec-sell-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.rec-table {
  font-size: var(--text-sm);
}

.rec-table th {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-2);
}

.rec-table td {
  padding: var(--space-2) var(--space-2);
}

.rec-row:hover {
  background: oklch(1 0 0 / 0.04);
}

.rec-rank {
  color: var(--color-text-faint);
  font-weight: 600;
  width: 24px;
  text-align: center;
}

.rec-player {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rec-name {
  font-weight: 600;
  color: var(--color-text-primary);
}

.rec-team {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.rec-num {
  font-variant-numeric: tabular-nums lining-nums;
  text-align: center;
}

.rec-fixtures {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.rec-fix {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}

.fdr-bg-1 { background: #257d5a; color: #fff; }
.fdr-bg-2 { background: #00cc66; color: #000; }
.fdr-bg-3 { background: #e0e0e0; color: #000; }
.fdr-bg-4 { background: #ff4444; color: #fff; }
.fdr-bg-5 { background: #7a1a1a; color: #fff; }

.transfer-divider {
  margin-top: var(--space-6);
  margin-bottom: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.section-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0;
    width: 260px;
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .hamburger {
    display: block;
  }

  .main-content {
    padding: var(--space-4);
    padding-top: calc(var(--space-4) + 50px);
  }

  .pitch-wrapper {
    max-width: 100%;
  }

  .player-card {
    width: 55px;
  }

  .player-shirt {
    width: 34px;
    height: 34px;
  }

  .player-name {
    font-size: 9px;
    padding: 1px 3px;
    max-width: 55px;
  }

  .player-points {
    font-size: 8px;
  }

  .player-price {
    font-size: 8px;
  }

  .bench-card {
    width: 55px;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-container {
    height: 200px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-grid-3 {
    grid-template-columns: 1fr;
  }

  .pos-filters {
    flex-wrap: wrap;
  }

  .proj-table-wrapper {
    max-height: 400px;
  }

  .formation-row {
    gap: var(--space-1);
  }
}

@media (max-width: 400px) {
  .player-card {
    width: 48px;
  }

  .player-shirt {
    width: 30px;
    height: 30px;
  }

  .player-name {
    font-size: 8px;
    max-width: 48px;
  }

  .bench-players {
    gap: var(--space-2);
    padding: var(--space-3);
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Chip Planning --- */
.chip-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.chip-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chip-fh {
  background: rgba(255,215,0,0.15);
  color: #ffd700;
  border: 1px solid rgba(255,215,0,0.3);
}

.chip-wc {
  background: rgba(0,150,255,0.15);
  color: #4da6ff;
  border: 1px solid rgba(0,150,255,0.3);
}

.chip-gw {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.chip-stats {
  max-width: 700px;
  margin: var(--space-4) auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.chip-detail-section {
  max-width: 900px;
  margin: var(--space-6) auto;
}

.chip-detail-section h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
}

.chip-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.chip-own {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
}

/* Must-Have Grid (Wildcard) */
.must-have-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

.must-have-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition-fast);
}

.must-have-card:hover {
  border-color: rgba(0,255,135,0.3);
}

.must-have-shirt {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.2);
}

.must-have-info {
  flex: 1;
  min-width: 0;
}

.must-have-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.2;
}

.must-have-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.must-have-stats {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.must-have-stats strong {
  color: var(--color-primary);
}

.must-have-fix {
  display: flex;
  gap: 3px;
  margin-top: var(--space-1);
  flex-wrap: wrap;
}

/* Bench row in Wildcard detail table */
.bench-row {
  opacity: 0.55;
}

.bench-row td:first-child {
  border-left: 2px solid var(--color-text-faint);
}

/* Selection */
::selection {
  background: rgba(0,255,135,0.25);
  color: var(--color-text);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Buttons reset */
button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

/* Img defaults */
img, svg {
  display: block;
  max-width: 100%;
}

/* Table defaults */
table {
  border-collapse: collapse;
  width: 100%;
}

/* sr-only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   HEAT FORM TAB
   ============================================ */

/* Heat badge (ON FIRE, HOT, WARM, COOL, COLD) */
.heat-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.heat-fire  { background: rgba(255, 68, 0, 0.25); color: #ff4400; }
.heat-hot   { background: rgba(255, 153, 0, 0.22); color: #ff9900; }
.heat-warm  { background: rgba(255, 213, 0, 0.18); color: #ffd500; }
.heat-cool  { background: rgba(100, 160, 255, 0.18); color: #80b0ff; }
.heat-cold  { background: rgba(100, 140, 180, 0.15); color: #7090a8; }

/* KPI text colours */
.heat-fire-text { color: #ff4400 !important; }
.heat-cold-text { color: #7090a8 !important; }

/* Heat bar */
.heat-bar-wrap {
  display: inline-block;
  width: 60px;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.heat-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.heat-bar.heat-fire  { background: linear-gradient(90deg, #ff4400, #ff7700); }
.heat-bar.heat-hot   { background: linear-gradient(90deg, #ff8800, #ffaa00); }
.heat-bar.heat-warm  { background: linear-gradient(90deg, #ddaa00, #ffd500); }
.heat-bar.heat-cool  { background: linear-gradient(90deg, #5588cc, #80b0ff); }
.heat-bar.heat-cold  { background: linear-gradient(90deg, #506070, #7090a8); }

.heat-pct {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  vertical-align: middle;
}

/* Table cells */
.heat-rank { width: 30px; text-align: center; color: rgba(255,255,255,0.4); }
.heat-team { white-space: nowrap; }
.heat-record { white-space: nowrap; font-size: 0.8rem; color: rgba(255,255,255,0.7); }
.heat-goals { white-space: nowrap; font-size: 0.8rem; }
.heat-fixtures { white-space: nowrap; }
.heat-streaks { white-space: nowrap; }
.heat-players { font-size: 0.75rem; color: rgba(255,255,255,0.6); max-width: 220px; }

/* Streak badges */
.streak-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 4px;
}
.streak-win      { background: rgba(0,255,135,0.18); color: #00ff87; }
.streak-unbeaten { background: rgba(100,200,255,0.15); color: #80c8ff; }
.streak-hot      { background: rgba(255,68,0,0.18); color: #ff6633; }

/* Heat table specific overrides */
.heat-table th {
  font-size: 0.7rem;
  white-space: nowrap;
}
.heat-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

/* Blank GW fixture pill */
.fdr-bg-0 {
  background: rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.3) !important;
}

/* ============================================
   MY RANK TAB
   ============================================ */

/* 2-col KPI grid */
.kpi-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .kpi-grid-2 { grid-template-columns: 1fr; }
}

/* Peak / Valley cards */
.rank-peak-card { border-left: 3px solid #00ff87; }
.rank-valley-card { border-left: 3px solid #ff4444; }
.rank-best-text { color: #00ff87 !important; }
.rank-worst-text { color: #ff4444 !important; }

/* Movement arrows */
.rank-up { color: #00ff87; font-weight: 600; }
.rank-down { color: #ff4444; font-weight: 600; }
.rank-flat { color: rgba(255,255,255,0.4); }

/* Chart */
.rank-chart-section { margin-bottom: 24px; }
.rank-chart-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: rgba(255,255,255,0.85);
}
.rank-chart-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 12px;
}
.rank-chart-wrap {
  position: relative;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 12px 8px;
  overflow: hidden;
}
.rank-chart {
  width: 100%;
  height: auto;
  display: block;
}
.rank-hover-dot {
  cursor: pointer;
}
.rank-hover-dot:hover {
  fill: rgba(0,255,135,0.15) !important;
}

/* Tooltip */
.rank-tooltip {
  display: none;
  position: absolute;
  background: #1c2333;
  border: 1px solid rgba(0,255,135,0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #fff;
  line-height: 1.5;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

/* GW history table */
.rank-history-section { margin-bottom: 24px; }
.rank-history-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.85);
}
.rank-history-table td { padding: 6px 12px; }
.rank-cell { font-weight: 600; }
.rank-row-best td { background: rgba(0,255,135,0.06); }
.rank-row-worst td { background: rgba(255,68,68,0.06); }
.rank-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-right: 4px;
}
.rank-badge-best { background: rgba(0,255,135,0.2); color: #00ff87; }
.rank-badge-worst { background: rgba(255,68,68,0.2); color: #ff4444; }
.rank-badge-current { background: rgba(100,160,255,0.2); color: #80b0ff; }

/* Movement arrows in rank table */
.rank-arrow {
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}
.rank-arrow-up { color: #00ff87; }
.rank-arrow-down { color: #ff4444; }
.rank-arrow-flat { color: rgba(255,255,255,0.25); }

/* ============================================
   DGW PLANNER
   ============================================ */

/* Chip Roadmap */
.dgw-roadmap {
  background: #161b22;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.06);
}
.dgw-roadmap-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.9);
}
.dgw-roadmap-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dgw-roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border-left: 3px solid #00ff87;
}
.dgw-roadmap-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.dgw-roadmap-body {
  flex: 1;
  min-width: 0;
}
.dgw-roadmap-chip {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 4px;
}
.dgw-roadmap-gw {
  display: inline-block;
  background: rgba(0,255,135,0.15);
  color: #00ff87;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.dgw-roadmap-reason {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}

/* Squad Readiness */
.dgw-readiness {
  background: #161b22;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.06);
}
.dgw-readiness-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.9);
}
.dgw-readiness-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.dgw-readiness-stat {
  text-align: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}
.dgw-readiness-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.dgw-readiness-val.accent { color: #00ff87; }
.dgw-readiness-val.danger { color: #ff4444; }
.dgw-readiness-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dgw-blanking-list {
  padding: 10px 14px;
  background: rgba(255,68,68,0.08);
  border-radius: 8px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}
.dgw-blanking-label {
  color: #ff4444;
  font-weight: 600;
  margin-right: 6px;
}
.dgw-blanking-player {
  color: rgba(255,255,255,0.8);
}

/* Overview section */
.dgw-overview-section {
  margin-bottom: 24px;
}
.dgw-section-header {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.85);
}
.dgw-overview-table .dgw-doublers-cell {
  color: #00ff87;
  font-size: 0.82rem;
}
.dgw-overview-table .dgw-blanks-cell {
  color: #ff4444;
  font-size: 0.82rem;
}
.dgw-special-row td {
  background: rgba(0,255,135,0.03);
}

/* Type badges */
.dgw-type-badge, .dgw-type-badge-sm {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.dgw-type-double {
  background: rgba(0,255,135,0.18);
  color: #00ff87;
}
.dgw-type-blank {
  background: rgba(255,68,68,0.18);
  color: #ff4444;
}
.dgw-type-mixed {
  background: rgba(255,213,0,0.18);
  color: #ffd500;
}
.dgw-type-badge-sm {
  padding: 2px 8px;
  font-size: 0.65rem;
}
.dgw-mini-chip {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(0,255,135,0.12);
  color: #00ff87;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Scenario Cards */
.dgw-scenarios-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dgw-scenario-card {
  background: #161b22;
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,0.06);
}
.dgw-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dgw-gw-label {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}
.dgw-fix-count {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  margin-left: auto;
}
.dgw-chip-rec {
  padding: 10px 14px;
  background: rgba(0,255,135,0.06);
  border: 1px solid rgba(0,255,135,0.15);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
}
.dgw-chip-icon {
  font-size: 1.1rem;
  margin-right: 2px;
}

/* Section inside scenario card */
.dgw-section {
  margin-bottom: 16px;
}
.dgw-section:last-child {
  margin-bottom: 0;
}
.dgw-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  margin-bottom: 10px;
}

/* Teams grid in scenario card */
.dgw-teams-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dgw-team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
}
.dgw-team-badge {
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  min-width: 36px;
}
.dgw-team-fixtures {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.dgw-blank-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dgw-blank-team {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255,68,68,0.12);
  color: #ff4444;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}
.dgw-blank-pill {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255,68,68,0.15);
  color: #ff4444;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Player target tables */
.dgw-target-table td, .dgw-sell-table td {
  font-size: 0.82rem;
}
.dgw-pos-label {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(0,255,135,0.12);
  color: #00ff87;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.dgw-player-name {
  font-weight: 600;
  color: #fff;
}
.dgw-double-badge {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(0,255,135,0.2);
  color: #00ff87;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  margin-right: 4px;
}
.dgw-sell-row td {
  background: rgba(255,68,68,0.03);
}
.dgw-sell-reason {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255,68,68,0.15);
  color: #ff4444;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* No specials fallback */
.dgw-no-specials {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  background: #161b22;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  line-height: 1.6;
}
.dgw-no-specials-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 640px) {
  .dgw-readiness-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dgw-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .dgw-fix-count { margin-left: 0; }
  .dgw-roadmap-item { padding: 10px 12px; }
  .dgw-scenario-card { padding: 16px; }
}

/* =============================================================
   ===  EDITORIAL OVERLAY  =====================================
   =============================================================
   Reskins the dashboard to the Beatles-cover aesthetic without
   restructuring the components. Light surfaces, serif headings,
   monospace small-caps labels, green used only as accent.
*/

/* Darker readable green for use ON light surfaces (text/icons).
   --color-primary (#00ff87) is kept for backgrounds and the splash. */
:root {
  --color-primary-text: #0a8a3f;
}

/* ---- Sidebar (now: light card with serif wordmark) ---- */
.sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text);
}

.sidebar-brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.sidebar-footer {
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.sidebar-footer .wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-text-faint);
  letter-spacing: 0.01em;
}

.nav-btn:hover {
  background: rgba(0,0,0,0.04);
  color: var(--color-text);
}

.nav-btn.active {
  background: var(--color-primary-dim);
  color: var(--color-primary-text);
  font-weight: 600;
}

.nav-section-label {
  font-family: var(--font-mono);
  letter-spacing: 0.10em;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ---- Headings throughout the dashboard ---- */
.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.85rem, 1rem + 2vw, 2.75rem);
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--color-text);
}

.page-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.proj-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text);
}

.chart-card h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---- Labels & meta in monospace ---- */
.kpi-label,
.bench-title,
.team-stat-label,
.dash-gw-badge {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* KPI value: use display serif for that "magazine pull-quote" feel */
.kpi-value {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.kpi-value.accent {
  color: var(--color-primary-text);
}

/* ---- Green-as-text fixes (dark green so it reads on white) ---- */
.dash-gw-badge,
.template-count,
.owned-badge.yes,
.captain-rank,
.template-info-icon {
  color: var(--color-primary-text);
}

.xp-total,
.xp-header,
.projection-high {
  color: var(--color-primary-text);
}

/* Cards & surfaces: subtle, papery — no heavy shadows */
.kpi-card,
.chart-card,
.captain-card,
.template-info,
.team-stat,
.data-table-wrapper,
.bench-players {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

/* Tables: light hover, divider in black at low alpha */
.data-table tbody tr:hover {
  background: rgba(0,0,0,0.025);
}

.data-table tbody tr.owned {
  background: rgba(0,255,135,0.08);
}

.data-table th {
  background: var(--color-surface-2);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

/* FDR table header sticky cells in light theme */
.fdr-table th,
.fdr-table td:first-child,
.fdr-table th:first-child {
  background: var(--color-surface-2);
}

/* Skeleton loader in light theme */
.skeleton {
  background: linear-gradient(90deg,
    #f0eee9 25%,
    #e6e3dd 50%,
    #f0eee9 75%
  );
  background-size: 200% 100%;
}

/* Mobile hamburger in light theme */
.hamburger {
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

/* Scrollbar in light theme */
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.32);
}

/* League input in light theme */
.league-input-group input {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

/* Pitch (the football-pitch visualization on My Team tab) — KEEP green grass.
   Just refine the border to fit the light theme. */
.pitch {
  border: 1px solid rgba(0,0,0,0.18);
  box-shadow: var(--shadow-md);
}

/* DGW etc. fallback boxes that referenced dark theme directly */
.dgw-no-specials {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* =============================================================
   ===  SPLASH SCREEN  =========================================
   =============================================================
   Editorial cover. White background, large serif title halves
   flanking a thin-line football pitch, with the green-arrow logo
   as the only color (at the center spot). Mono-caps "COME ON IN"
   dismisses the splash with a soft fade. */

.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #ffffff;
  color: #111111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(2rem, 6vh, 4rem) clamp(1.5rem, 5vw, 6rem);
  overflow: hidden;
  transition: opacity 0.6s ease;
}

.splash.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.splash-stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 5rem);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.splash-title-left,
.splash-title-right {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 6vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: #111;
  white-space: nowrap;
  animation: splash-fade-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.splash-title-left  { text-align: right; }
.splash-title-right { text-align: left; }

.splash-art {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splash-fade-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.splash-pitch {
  height: min(72vh, 800px);
  width: auto;
  max-width: 100%;
  color: #111;
}

.splash-enter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  animation: splash-fade-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}

.splash-enter:hover {
  color: var(--color-primary-text);
}

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

/* Mobile: stack vertically, smaller pitch */
@media (max-width: 760px) {
  .splash-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    text-align: center;
    gap: 1.5rem;
  }
  .splash-title-left,
  .splash-title-right {
    text-align: center;
    font-size: clamp(2rem, 12vw, 4rem);
  }
  .splash-pitch {
    height: min(50vh, 560px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-title-left,
  .splash-title-right,
  .splash-art,
  .splash-enter {
    animation: none;
  }
  .splash {
    transition: none;
  }
}

/* =============================================================
   ===  NIGHT MODE  ============================================
   =============================================================
   Toggled by adding `night` class to <body>. Inverts the editorial
   palette: deep near-black background, soft off-white text, bright
   green accent (which reads fine on dark).
*/
body.night {
  --color-bg:           #0e0e10;
  --color-surface:      #18181b;
  --color-surface-2:    #232328;
  --color-border:       rgba(255,255,255,0.10);
  --color-divider:      rgba(255,255,255,0.06);

  --color-text:         #f3f3f3;
  --color-text-muted:   #a6a6ad;
  --color-text-faint:   #6a6a72;

  /* In dark mode the bright primary green reads cleanly as text */
  --color-primary-text: #00ff87;

  --color-danger:       #f86b6b;
  --color-warning:      #e3a064;
  --color-success:      #00ff87;

  /* Shadows: faint glow on dark */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.45);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.55);
}

/* Hover states need black-tint reversal in night mode */
body.night .nav-btn:hover {
  background: rgba(255,255,255,0.05);
}
body.night .data-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}
body.night .data-table tbody tr.owned {
  background: rgba(0,255,135,0.07);
}

/* Skeleton loader shimmer for dark surfaces */
body.night .skeleton {
  background: linear-gradient(90deg,
    #1a1a1d 25%,
    #232328 50%,
    #1a1a1d 75%
  );
}

/* Scrollbar */
body.night ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
}
body.night ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.32);
}

/* Mobile hamburger surface */
body.night .hamburger {
  background: var(--color-surface);
  color: var(--color-text);
}

/* Pitch border in dark mode */
body.night .pitch {
  border: 1px solid rgba(255,255,255,0.15);
}

/* =============================================================
   ===  THEME TOGGLE BUTTON  ===================================
   ============================================================= */
.theme-toggle {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 150;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast),
              transform var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Show moon in day mode (click to go night) */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

/* Show sun in night mode (click to go day) */
body.night .theme-toggle .icon-moon { display: none; }
body.night .theme-toggle .icon-sun  { display: block; }

/* =============================================================
   ===  BRIEFING TAB  ==========================================
   ============================================================= */

.briefing-loading {
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.briefing-section {
  margin-bottom: var(--space-12);
}

.briefing-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.briefing-section-label,
.briefing-meta-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.briefing-timestamp {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-faint);
  letter-spacing: 0.04em;
}

.briefing-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

/* ---- Hero card (Daily Briefing) ---- */
.briefing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-4);
}

.briefing-hero {
  padding: var(--space-10) var(--space-8);
}

.briefing-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 1rem + 1.4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.briefing-summary {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  max-width: 60ch;
}

.briefing-pending {
  text-align: left;
}
.briefing-pending p {
  color: var(--color-text-muted);
  max-width: 60ch;
  line-height: 1.6;
}

/* ---- Items list (Daily Briefing children) ---- */
.briefing-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.briefing-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
}

.briefing-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.briefing-item-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.005em;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.briefing-item-detail {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: var(--space-2);
}

.briefing-item-implication {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.6;
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-primary);
  margin-bottom: var(--space-3);
}

.briefing-sources {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  margin-top: var(--space-3);
}

.source-link {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.source-link:hover {
  color: var(--color-text);
}

/* ---- Tags / chips ---- */
.badge,
.team-chip,
.confidence-tag,
.alert-severity,
.alert-category,
.watch-manager {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.badge {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.team-chip {
  background: #111;
  color: #fff;
  letter-spacing: 0.08em;
}
body.night .team-chip {
  background: #f3f3f3;
  color: #111;
}

.confidence-tag.confidence-high   { background: rgba(0,255,135,0.18); color: var(--color-primary-text); }
.confidence-tag.confidence-medium { background: rgba(184,111,28,0.18); color: var(--color-warning); }
.confidence-tag.confidence-low    { background: rgba(0,0,0,0.06); color: var(--color-text-muted); }
body.night .confidence-tag.confidence-low { background: rgba(255,255,255,0.08); }

/* ---- Alerts ---- */
.alert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.alert-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  border-left: 3px solid var(--color-text-faint);
}

.alert-card.alert-high   { border-left-color: var(--color-danger); }
.alert-card.alert-medium { border-left-color: var(--color-warning); }
.alert-card.alert-low    { border-left-color: var(--color-text-faint); }

.alert-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.alert-severity {
  background: var(--color-danger);
  color: #fff;
}
.alert-card.alert-medium .alert-severity { background: var(--color-warning); }
.alert-card.alert-low    .alert-severity { background: var(--color-text-faint); color: var(--color-surface); }

.alert-player {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 0;
  background: none;
}

.alert-category {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.alert-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.alert-detail,
.alert-recommendation {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

/* ---- Twenty Watch grid ---- */
.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.watch-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.watch-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.watch-manager {
  background: none;
  color: var(--color-text-muted);
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.watch-summary {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.watch-key-player {
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.watch-implication {
  font-size: var(--text-sm);
  color: var(--color-text);
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-primary);
  line-height: 1.55;
  margin-bottom: var(--space-3);
}

.watch-setpieces {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-2);
  margin-top: var(--space-3);
}

/* =============================================================
   ===  BRIEFING TAB — VISUAL REFINEMENT (v2)  ================
   =============================================================
   Reduces visual density in the Briefing tab:
   - Larger section gaps so DIGEST / ALERTS / TWENTY WATCH / SET-PIECES
     read as distinct chapters, not a continuous wall
   - Lighter borders on items; rely on whitespace to separate
   - Softer FPL-implication callout (less heavy left border)
   - Twenty Watch cards: tighter typographic hierarchy, set-piece
     info demoted to a quieter footer line
   - Alerts get more visible severity color so they stand apart
*/

/* Section spacing — give each chapter room to breathe */
.briefing-section {
  margin-bottom: var(--space-16);
}
.briefing-section:last-child {
  margin-bottom: var(--space-8);
}

.briefing-section-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}

/* ---- Daily Briefing items: lighter, airier ---- */
.briefing-items {
  gap: var(--space-6);
}

.briefing-item {
  background: transparent;
  border: none;
  border-top: 1px solid var(--color-divider);
  border-radius: 0;
  padding: var(--space-6) 0 var(--space-2) 0;
  box-shadow: none;
}

.briefing-item:first-child {
  border-top: none;
  padding-top: var(--space-2);
}

.briefing-item-meta {
  margin-bottom: var(--space-2);
  gap: var(--space-2);
}

.briefing-item-headline {
  font-size: 1.45rem;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

.briefing-item-detail {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  max-width: 72ch;
}

/* Softer FPL-implication treatment — looks like an editorial pull-aside */
.briefing-item-implication {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-text);
  padding: var(--space-3) var(--space-4);
  border-left: 2px solid var(--color-primary-dim);
  background: rgba(0,255,135,0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: var(--space-3);
  max-width: 72ch;
}

body.night .briefing-item-implication {
  background: rgba(0,255,135,0.06);
}

.briefing-sources {
  margin-top: var(--space-2);
  opacity: 0.7;
}

/* ---- Alerts: turn UP the contrast so they read as warnings, not items ---- */
.alert-card {
  border-left-width: 4px;
  padding: var(--space-5) var(--space-6);
}

.alert-card.alert-high {
  background: rgba(198,40,40,0.04);
}
body.night .alert-card.alert-high {
  background: rgba(248,107,107,0.06);
}

.alert-card.alert-medium {
  background: rgba(184,111,28,0.04);
}
body.night .alert-card.alert-medium {
  background: rgba(227,160,100,0.05);
}

.alert-recommendation {
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

/* ---- Twenty Watch cards: tighter hierarchy, less crowded ---- */
.watch-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-5);
}

.watch-card {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.watch-card-header {
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  gap: var(--space-3);
}

.watch-manager {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text);
  background: none;
  padding: 0;
  letter-spacing: 0;
  text-transform: none;
}

.watch-summary {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 0;
}

.watch-key-player {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-divider);
}

.watch-key-player strong {
  color: var(--color-text);
  font-weight: 500;
}

/* Softer implication callout in watch cards */
.watch-implication {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--color-text);
  padding: var(--space-3) var(--space-4);
  border-left: 2px solid var(--color-primary-dim);
  background: rgba(0,255,135,0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0;
}

body.night .watch-implication {
  background: rgba(0,255,135,0.06);
}

/* Set-pieces: demoted to a quiet footer */
.watch-setpieces {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-3);
  margin-top: var(--space-1);
  line-height: 1.5;
}

/* ---- Set-piece registry table: lighter cells, fewer borders ---- */
.briefing-section .data-table th {
  font-size: 0.7rem;
  padding: var(--space-3) var(--space-4);
}

.briefing-section .data-table td {
  padding: var(--space-3) var(--space-4);
  font-size: 0.85rem;
}

/* Confidence tags slightly more discreet (smaller) */
.confidence-tag {
  font-size: 0.6rem;
  padding: 2px 6px;
}

/* Badges quieter */
.badge,
.team-chip,
.alert-severity,
.alert-category {
  font-size: 0.62rem;
  padding: 2px 7px;
}

/* =============================================================
   ===  SEASON LEADERS TAB  ====================================
   ============================================================= */

.leaders-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-12);
}

.leaders-mini-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.leaders-mini-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}

.leaders-mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.leaders-mini-row {
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  gap: var(--space-2);
  align-items: center;
  padding: 4px 0;
  font-size: 0.85rem;
}

.leaders-mini-row + .leaders-mini-row {
  border-top: 1px solid var(--color-divider);
}

.leaders-mini-rank {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-faint);
  text-align: right;
}

.leaders-mini-name {
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaders-mini-team {
  font-size: 0.6rem !important;
  padding: 2px 6px !important;
}

.leaders-mini-value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-primary-text);
  font-weight: 500;
  white-space: nowrap;
}

/* ---- Section: full table ---- */
.leaders-section {
  margin-bottom: var(--space-12);
}

.leaders-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}

.leaders-control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.leaders-control-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.leaders-pills {
  display: flex;
  gap: 4px;
}

.leaders-pill {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.leaders-pill:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.leaders-pill.active {
  background: var(--color-primary-dim);
  border-color: var(--color-primary);
  color: var(--color-primary-text);
  font-weight: 600;
}

.leaders-select {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 6px 30px 6px 12px;
  cursor: pointer;
}

.leaders-table .leaders-rank {
  width: 40px;
  font-family: var(--font-mono);
  color: var(--color-text-faint);
}

.leaders-table .leaders-name {
  font-weight: 500;
}

.leaders-table .leaders-metric-cell {
  font-weight: 600;
  color: var(--color-primary-text);
}

.leaders-table td.num,
.leaders-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* =============================================================
   ===  YEAR IN REVIEW TAB  ====================================
   ============================================================= */

/* ---- Best XV pitch ---- */
.yir-pitch {
  position: relative;
  max-width: 820px;
  margin: 0 auto var(--space-6);
  aspect-ratio: 13 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.yir-pitch-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    #1a7a3a 0%, #1e8c42 12%, #1a7a3a 25%, #1e8c42 38%,
    #1a7a3a 50%, #1e8c42 62%, #1a7a3a 75%, #1e8c42 88%, #1a7a3a 100%);
}

.yir-formation {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 100%;
  padding: 3% 4%;
  gap: 1%;
}

.yir-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: var(--space-2);
}

.yir-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 18%;
  min-width: 0;
}

.yir-shirt {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  background: #444;
}

.yir-shirt.pos-gkp-shirt { background: #f0883e; }
.yir-shirt.pos-def-shirt { background: #00cc66; color: #000; }
.yir-shirt.pos-mid-shirt { background: #4da6ff; color: #000; }
.yir-shirt.pos-fwd-shirt { background: #f85149; }

.yir-player-name {
  margin-top: var(--space-1);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.65);
  padding: 2px 6px;
  border-radius: 3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}

.yir-player-team,
.yir-player-pts,
.yir-player-price {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

.yir-player-pts {
  color: var(--color-primary);
  font-weight: 600;
}

/* ---- Retro card grid ---- */
.yir-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.yir-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
}

.yir-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--color-text-faint);
}

.yir-card-riser::before    { background: var(--color-primary); }
.yir-card-faller::before   { background: var(--color-danger); }
.yir-card-diff::before     { background: #4da6ff; }
.yir-card-breakout::before { background: #f0883e; }

.yir-card-meta {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.yir-card-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--color-text);
  line-height: 1.1;
}

.yir-card-metric {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1;
  margin-top: var(--space-1);
}

.yir-card-riser    .yir-card-metric { color: var(--color-primary-text); }
.yir-card-faller   .yir-card-metric { color: var(--color-danger); }
.yir-card-diff     .yir-card-metric { color: #2c8bd9; }
body.night .yir-card-diff .yir-card-metric { color: #6cb4ff; }
.yir-card-breakout .yir-card-metric { color: var(--color-warning); }

.yir-card-detail {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.yir-card-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-faint);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}

/* =============================================================
   ===  PROMOTED-CLUB SCOUT  ===================================
   ============================================================= */

.promoted-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-5);
}

.promoted-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.promoted-card-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
}

.promoted-club-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.005em;
  color: var(--color-text);
  flex: 1;
}

.promoted-method {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-text);
  background: var(--color-primary-dim);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.promoted-summary {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
}

.promoted-manager {
  font-size: 0.88rem;
  color: var(--color-text);
  padding: var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
}

.promoted-manager strong {
  font-weight: 600;
}

.promoted-manager-style {
  margin-top: var(--space-2);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.promoted-section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.promoted-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.promoted-player {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}

.promoted-player:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.promoted-player-name {
  font-weight: 500;
  color: var(--color-text);
  font-size: 0.9rem;
}

.promoted-player-stat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-primary-text);
  background: var(--color-primary-dim);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.promoted-player-angle {
  grid-column: 1 / -1;
  margin-top: var(--space-1);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  font-style: italic;
}
