/* OutDrafted — Professional Light Analytics Theme */

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

:root {
  /* Depth layers */
  --bg-base: #f8f9fa;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-surface: #f1f3f5;
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-active: rgba(0, 0, 0, 0.05);

  /* Accent colors */
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.08);
  --accent-hover: #1d4ed8;
  --secondary: #64748b;
  --secondary-dim: rgba(100, 116, 139, 0.10);

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Borders */
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);

  /* Row alternation */
  --row-alt: rgba(0, 0, 0, 0.02);

  /* Status */
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.08);
  --error: #dc2626;
  --error-bg: rgba(220, 38, 38, 0.08);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.08);
  --win: #16a34a;
  --draw: #d97706;
  --loss: #dc2626;

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Misc */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-pill: 100px;
  --transition: 150ms ease;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* --- Reset & Base --- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Modal / Setup --- */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  z-index: 1000;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 480px;
  width: 92%;
  box-shadow: var(--shadow-elevated);
}

.modal-content h2 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

.input-group input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition);
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

.input-group button,
.btn-small {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}

.input-group button:hover,
.btn-small:hover {
  background: var(--accent-hover);
}

.input-group button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.status-msg {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

.status-msg.error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

.status-msg.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.15);
}

/* --- Sync Overlay --- */

.sync-log {
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.sync-log::-webkit-scrollbar {
  width: 4px;
}

.sync-log::-webkit-scrollbar-track {
  background: transparent;
}

.sync-log::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.progress-bar {
  height: 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: var(--radius-pill);
}

.hidden {
  display: none !important;
}

/* --- Header --- */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2.5rem;
  height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

header h1 .brand-accent {
  color: var(--accent);
}

.league-info {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-left: 1.25rem;
  font-weight: 500;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.last-sync {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.btn-small {
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  border-radius: var(--radius-pill);
}

.bmc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.bmc-link:hover {
  border-color: #fdba74;
  background: #ffedd5;
}

/* --- Tab Bar --- */

.tab-bar {
  display: flex;
  gap: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  height: 0;
  display: none;
}

.tab {
  padding: 0.85rem 1.25rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* --- Content Area --- */

.content {
  padding: 1.75rem 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.tab-content {
  display: none;
}

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

/* --- Cards --- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.card h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --- Stat Cards --- */

.stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-card .stat-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  font-weight: 400;
}

/* --- Tables --- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.table-wrap::-webkit-scrollbar {
  height: 4px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

thead th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 1rem;
  text-align: left;
  position: sticky;
  top: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-strong);
}

tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--bg-hover);
}

/* --- H2H Matrix --- */

.h2h-table th,
.h2h-table td {
  text-align: center;
  min-width: 85px;
  font-size: 0.82rem;
}

.h2h-table .h2h-cell {
  cursor: pointer;
  transition: background var(--transition);
  padding: 0.6rem;
  border-radius: 0;
}

.h2h-table .h2h-cell:hover {
  background: var(--bg-active);
}

.h2h-cell .h2h-record {
  font-weight: 600;
  font-size: 0.82rem;
}

.h2h-cell .win { color: var(--win); }
.h2h-cell .draw { color: var(--draw); }
.h2h-cell .loss { color: var(--loss); }
.h2h-cell .h2h-sep { color: var(--text-muted); margin: 0 1px; }

.h2h-self {
  background: rgba(0, 0, 0, 0.03);
}

/* --- Charts --- */

.chart-container {
  position: relative;
  height: 380px;
}

/* --- Filter Bar --- */

.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.82rem;
  outline: none;
  transition: all var(--transition);
}

.filter-bar input {
  min-width: 200px;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.filter-bar select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* --- Hint text --- */

.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* --- Squad Lists --- */

.squad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.squad-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.squad-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.squad-card h4 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.squad-card h4 .mgr-sub {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.82em;
}

/* --- Position Badges --- */

.pos-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.pos-gk { background: rgba(217, 119, 6, 0.10); color: #b45309; }
.pos-def { background: rgba(124, 58, 237, 0.10); color: #7c3aed; }
.pos-mid { background: rgba(37, 99, 235, 0.10); color: #2563eb; }
.pos-fwd { background: rgba(220, 38, 38, 0.10); color: #dc2626; }

/* --- Transaction Badges --- */

.tx-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tx-waiver { background: var(--secondary-dim); color: var(--secondary); }
.tx-free { background: var(--success-bg); color: var(--success); }
.tx-accepted { background: var(--success-bg); color: var(--success); }
.tx-declined { background: var(--error-bg); color: var(--error); }

/* --- Power Rankings --- */

.power-ranking-row {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  gap: 1rem;
  border-radius: 0;
}

.power-ranking-row:last-child {
  border-bottom: none;
}

.power-ranking-row:hover {
  background: var(--bg-hover);
}

.pr-rank {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 2.25rem;
  text-align: center;
  letter-spacing: -0.02em;
}

.pr-trend {
  font-size: 0.85rem;
  min-width: 1.5rem;
  text-align: center;
}

.pr-trend.up { color: var(--success); }
.pr-trend.down { color: var(--error); }
.pr-trend.stable { color: var(--text-muted); }

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

.pr-name {
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.pr-team {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.pr-form {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.form-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.form-dot.W { background: var(--success-bg); color: var(--success); }
.form-dot.D { background: var(--warning-bg); color: var(--warning); }
.form-dot.L { background: var(--error-bg); color: var(--error); }

.pr-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.pr-stat-value {
  font-weight: 700;
  color: var(--text-primary);
}

/* --- Prediction Cards --- */

.prediction-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.prediction-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.prediction-matchup {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.prediction-manager {
  flex: 1;
  text-align: center;
}

.prediction-manager .mgr-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.prediction-manager .mgr-avg {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.15rem;
}

.prediction-vs {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.prediction-bar {
  display: flex;
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--bg-surface);
  gap: 2px;
}

.prediction-bar .bar-left {
  background: var(--accent);
  transition: width 0.4s ease;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
}

.prediction-bar .bar-right {
  background: var(--error);
  transition: width 0.4s ease;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
}

.prediction-probs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.prediction-probs .prob-left { color: var(--accent); }
.prediction-probs .prob-right { color: var(--error); }

/* --- Rivalry Stats --- */

.rivalry-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.rivalry-stat {
  text-align: center;
  padding: 1rem 0.75rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.rivalry-stat .label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.rivalry-stat .value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.rivalry-stat .sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* --- Heatmap --- */

.heatmap-grid {
  overflow-x: auto;
}

.heatmap-grid::-webkit-scrollbar {
  height: 4px;
}

.heatmap-grid::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.heatmap-grid table {
  font-size: 0.78rem;
}

.heatmap-grid td {
  text-align: center;
  min-width: 38px;
  padding: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.heatmap-grid th {
  font-size: 0.62rem;
}

.heat-cell {
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* --- Draft Analysis --- */

.draft-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.draft-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.draft-summary-card h4 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.draft-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border);
}

.draft-summary-item:last-child {
  border-bottom: none;
}

.value-positive { color: var(--success); font-weight: 700; }
.value-negative { color: var(--error); font-weight: 700; }

/* --- What-If Analyzer --- */

.whatif-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.whatif-stat {
  text-align: center;
  padding: 1.25rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.whatif-stat .label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.whatif-stat .value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.whatif-stat .sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 400;
}

/* --- Loading States --- */

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 0.6rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   ANIMATIONS & VISUAL ENHANCEMENTS
   ============================================ */

/* --- Tab Transitions --- */

.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(12px);
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.35s ease forwards;
}

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

/* --- Staggered Card Entrance --- */

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

.card {
  animation: cardSlideIn 0.3s ease both;
}

.tab-content.active .card:nth-child(1) { animation-delay: 0ms; }
.tab-content.active .card:nth-child(2) { animation-delay: 50ms; }
.tab-content.active .card:nth-child(3) { animation-delay: 100ms; }
.tab-content.active .card:nth-child(4) { animation-delay: 150ms; }
.tab-content.active .card:nth-child(5) { animation-delay: 200ms; }

/* --- Accent Stat Cards --- */

.stat-card {
  position: relative;
  border-left: 2px solid transparent;
}

.stat-card:nth-child(1) { border-left-color: #2563eb; }
.stat-card:nth-child(2) { border-left-color: #dc2626; }
.stat-card:nth-child(3) { border-left-color: #7c3aed; }
.stat-card:nth-child(4) { border-left-color: #d97706; }

.stat-card:hover {
  border-color: var(--border-strong);
}

/* --- Shimmer Loading Skeletons --- */

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

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    rgba(0, 0, 0, 0.04) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  height: 100px;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}

.skeleton-row {
  height: 44px;
  margin-bottom: 4px;
}

.skeleton-chart {
  height: 380px;
  border-radius: var(--radius);
}

/* --- Animated Number Counters --- */

.stat-value[data-target] {
  transition: color 0.2s ease;
}

/* --- Sortable Table Headers --- */

thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition), background var(--transition);
  position: relative;
  padding-right: 1.5rem;
}

thead th.sortable:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

thead th.sortable::after {
  content: '\21C5';
  position: absolute;
  right: 0.4rem;
  opacity: 0.3;
  font-size: 0.7rem;
}

thead th.sortable.sort-asc::after {
  content: '\2191';
  opacity: 0.8;
  color: var(--accent);
}

thead th.sortable.sort-desc::after {
  content: '\2193';
  opacity: 0.8;
  color: var(--accent);
}

/* --- Tooltip System --- */

.tooltip-wrap {
  position: relative;
  display: inline-block;
}

.tooltip-wrap .tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1a1a2e;
  color: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
  box-shadow: var(--shadow-elevated);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.tooltip-wrap .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a2e;
}

.tooltip-wrap:hover .tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Awards Section --- */

.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.award-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: cardSlideIn 0.4s ease both;
}

.award-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.award-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.award-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.award-winner {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.award-detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Award card stagger */
.awards-grid .award-card:nth-child(1) { animation-delay: 0ms; }
.awards-grid .award-card:nth-child(2) { animation-delay: 60ms; }
.awards-grid .award-card:nth-child(3) { animation-delay: 120ms; }
.awards-grid .award-card:nth-child(4) { animation-delay: 180ms; }
.awards-grid .award-card:nth-child(5) { animation-delay: 240ms; }
.awards-grid .award-card:nth-child(6) { animation-delay: 300ms; }

/* --- Banter Box --- */

.banter-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
  animation: cardSlideIn 0.3s ease both;
  animation-delay: 100ms;
}

.banter-box h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.banter-item {
  padding: 0.4rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
}

.banter-item:last-child {
  border-bottom: none;
}

/* --- Season Superlatives --- */

.superlatives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.superlative-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  animation: cardSlideIn 0.4s ease both;
}

.superlative-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.superlative-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

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

.superlative-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.superlative-winner {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.superlative-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Superlative stagger */
.superlatives-grid .superlative-card:nth-child(1) { animation-delay: 0ms; }
.superlatives-grid .superlative-card:nth-child(2) { animation-delay: 50ms; }
.superlatives-grid .superlative-card:nth-child(3) { animation-delay: 100ms; }
.superlatives-grid .superlative-card:nth-child(4) { animation-delay: 150ms; }
.superlatives-grid .superlative-card:nth-child(5) { animation-delay: 200ms; }
.superlatives-grid .superlative-card:nth-child(6) { animation-delay: 250ms; }
.superlatives-grid .superlative-card:nth-child(7) { animation-delay: 300ms; }
.superlatives-grid .superlative-card:nth-child(8) { animation-delay: 350ms; }
.superlatives-grid .superlative-card:nth-child(9) { animation-delay: 400ms; }
.superlatives-grid .superlative-card:nth-child(10) { animation-delay: 450ms; }

/* --- Manager Profile Cards --- */

.manager-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.manager-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #ffffff;
  flex-shrink: 0;
}

.manager-profile-info {
  flex: 1;
  min-width: 0;
}

.manager-profile-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.manager-profile-team {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.manager-profile-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.manager-profile-stats span {
  font-weight: 600;
  color: var(--text-primary);
}

/* --- H2H Dominance Bar --- */

.dominance-bar-wrap {
  margin: 0.75rem 0;
}

.dominance-bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--bg-surface);
  gap: 2px;
}

.dominance-bar .dom-left {
  background: var(--accent);
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dominance-bar .dom-draw {
  background: var(--warning);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dominance-bar .dom-right {
  background: var(--error);
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dominance-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* --- Smart Player Comparison --- */

.compare-header {
  grid-column: 1 / -1;
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.08), rgba(22, 163, 74, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.25rem;
}

.compare-pill {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.55rem;
  margin-bottom: 0.35rem;
}

.compare-pill.ok {
  color: #0f5132;
  background: rgba(22, 163, 74, 0.14);
}

.compare-pill.cross {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.14);
}

.compare-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.compare-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.compare-stat {
  background: linear-gradient(180deg, #fff, #fafcff);
}

.compare-table-wrap table td:nth-child(2),
.compare-table-wrap table td:nth-child(3) {
  font-weight: 700;
}

/* --- Prediction Bar Animation --- */

.prediction-bar .bar-left,
.prediction-bar .bar-right {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Animated Stats --- */

@keyframes statPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.stat-card .stat-value.counting {
  animation: statPulse 0.3s ease;
}

/* --- Latest Results --- */

.result-row {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  transition: background var(--transition);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row:hover {
  background: var(--bg-hover);
}

.result-manager {
  flex: 1;
  min-width: 0;
}

.result-manager.left {
  text-align: right;
}

.result-manager.right {
  text-align: left;
}

.result-manager-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.result-manager-team {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.result-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 80px;
  justify-content: center;
}

.result-score .score-dash {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.result-score .winner {
  color: var(--success);
}

.result-score .loser {
  color: var(--text-muted);
}

/* --- Live Tracker Pitch --- */

.live-matchup-card {
  overflow: hidden;
}

.live-pitch-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}

.manager-pitch-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: linear-gradient(180deg, #f1f9f1 0%, #e5f6e5 100%);
}

.manager-pitch-title {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #14532d;
}

.manager-pitch {
  border: 1px solid rgba(20, 83, 45, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.35);
}

.pitch-lane {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 0.45rem;
}

.pitch-lane:last-child {
  margin-bottom: 0;
}

.live-player {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  min-width: 96px;
  max-width: 130px;
  padding: 0.35rem 0.45rem;
}

.live-player summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.live-player summary::-webkit-details-marker {
  display: none;
}

.live-player-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}

.live-player-pts {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent);
}

.live-player-meta {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.live-breakdown-grid {
  margin-top: 0.25rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem 0.45rem;
  font-size: 0.64rem;
  color: var(--text-secondary);
}

.live-on {
  border-left: 3px solid var(--success);
}

.live-off {
  border-left: 3px solid var(--text-muted);
  opacity: 0.86;
}

.manager-bench {
  margin-top: 0.6rem;
}

.bench-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* --- Global Scrollbar Styling --- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   NEW CLASSES
   ============================================ */

/* --- Info Explainer --- */

.info-explainer {
  background: var(--accent-dim);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.info-explainer strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Standings Time Machine --- */

.time-machine-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
}

.time-machine-controls button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition);
}

.time-machine-controls button:hover,
.time-machine-controls button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* --- GW Recap --- */

.gw-recap {
  padding: 1.25rem;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  line-height: 1.8;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.gw-recap .recap-highlight {
  color: var(--accent);
  font-weight: 600;
}

.gw-recap .recap-negative {
  color: var(--error);
  font-weight: 600;
}

/* --- Position Wars --- */

.position-wars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.position-wars-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.position-wars-card h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.pos-war-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}

.pos-war-row:last-child {
  border-bottom: none;
}

.pos-war-pts {
  font-weight: 700;
  color: var(--text-primary);
}

/* --- Bench Points Breakdown --- */

.bench-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.bench-stat {
  text-align: center;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.bench-stat .bench-val {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--error);
}

.bench-stat .bench-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* --- Responsive --- */

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    height: auto;
  }

  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .league-info {
    margin-left: 0;
  }

  .content {
    padding: 1rem 1.25rem;
  }

  .tab-bar {
    padding: 0 1rem;
  }

  .tab {
    padding: 0.7rem 0.9rem;
    font-size: 0.76rem;
  }

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

  .draft-summary {
    grid-template-columns: 1fr;
  }

  .prediction-matchup {
    flex-direction: column;
    gap: 0.5rem;
  }

  .pr-stats {
    display: none;
  }

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

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

  .modal-content {
    padding: 1.75rem;
  }

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

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

  .position-wars-grid {
    grid-template-columns: 1fr;
  }

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

  .live-pitch-duo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-cards {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 1.05rem;
  }

  .content {
    padding: 0.85rem 1rem;
  }

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

  .bench-breakdown {
    grid-template-columns: 1fr;
  }
}
