/* ---- Theme variables (blue default) ---- */
:root {
  --t-body: #172554;
  --t-panel: #1e3a8a;
  --t-card: rgba(30,58,138,0.6);
  --t-border: #1e40af;
  --t-divider: #1d4ed8;
  --t-accent: #60a5fa;
  --t-dim: #93c5fd;
  --t-muted: #bfdbfe;
  --t-subtle: #3b82f6;
  --t-ring: #2563eb;
  --t-hover: #1e3a5f;
  --t-flash-rgb: 96,165,250;
  --t-dark: #1e3a5f;
  --t-scrollbar: #1e40af;
  --t-scrollbar-h: #3b82f6;
}

/* ---- Theme utility classes ---- */
.bg-theme-body { background-color: var(--t-body); }
.bg-theme-panel { background-color: var(--t-panel); }
.bg-theme-card { background-color: var(--t-card); }
.bg-theme-border { background-color: var(--t-border); }
.bg-theme-divider { background-color: var(--t-divider); }
.bg-theme-accent { background-color: var(--t-accent); }
.bg-theme-badge-h { background-color: var(--t-ring); }
.bg-theme-badge-u { background-color: var(--t-border); }
.bg-theme-bar-bg { background-color: var(--t-divider); }
.text-theme-accent { color: var(--t-accent); }
.text-theme-dim { color: var(--t-dim); }
.text-theme-muted { color: var(--t-muted); }
.text-theme-subtle { color: var(--t-subtle); }
.border-theme-accent { border-color: var(--t-accent); }
.border-theme-border { border-color: var(--t-border); }
.border-theme-divider { border-color: var(--t-divider); }
.border-l-theme-accent { border-left-color: var(--t-accent); }
.border-l-theme-border { border-left-color: var(--t-border); }
.border-l-theme-divider { border-left-color: var(--t-divider); }
.divide-theme-border > :not([hidden]) ~ :not([hidden]) { border-color: var(--t-border); }
.ring-theme-ring { --tw-ring-color: var(--t-ring); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes valueFlash {
  0% { background-color: rgba(var(--t-flash-rgb), 0.35); }
  100% { background-color: transparent; }
}

.animate-fade-in { animation: fadeIn 0.6s ease-out; }
.animate-slide-up { animation: slideUp 0.4s ease-out both; }
.value-changed { animation: valueFlash 1.2s ease-out; border-radius: 3px; }

/* Card-level highlight when player stats changed */
@keyframes cardFlash {
  0% { box-shadow: inset 0 0 0 2px rgba(var(--t-flash-rgb),0.7), 0 0 12px rgba(var(--t-flash-rgb),0.3); }
  100% { box-shadow: none; }
}
.card-changed { animation: cardFlash 1.5s ease-out; }

/* Goalaandelen row highlight */
@keyframes rowFlash {
  0% { background-color: rgba(var(--t-flash-rgb),0.25); }
  100% { background-color: transparent; }
}
.row-changed { animation: rowFlash 1.5s ease-out; }

/* Stagger children */
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.stagger-children > *:nth-child(6) { animation-delay: 250ms; }

/* Mini gauge (used for header stats) */
.gauge-mini {
  position: relative;
  width: 56px;
  height: 56px;
}

.gauge-mini svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.gauge-mini .gauge-bg { fill: none; stroke: var(--t-dark); stroke-width: 3.5; }
.gauge-mini .gauge-fill { fill: none; stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }

.gauge-mini .gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Player card */
.player-card {
  transition: all 0.2s ease;
}

.player-card:hover {
  background: var(--t-hover);
}

/* Stat bar inside player cards */
.stat-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--t-dark);
  overflow: hidden;
  margin-top: 3px;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

/* Photo loading fallback */
.player-photo {
  background: linear-gradient(135deg, var(--t-dark), var(--t-scrollbar));
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--t-scrollbar); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--t-scrollbar-h); }

/* Tabular numbers for stats */
.tabular-nums { font-variant-numeric: tabular-nums; }
