/* ==========================================================================
   TSUFM — Broadcast Stadium + Sports Manga Design System
   ========================================================================== */

:root {
  --bg-void: #060a12;
  --bg-base: #0a101d;
  --bg-surface: #10192b;
  --bg-surface-2: #16223a;
  --bg-surface-3: #1d2d4d;
  --bg-glass: rgba(16, 25, 43, 0.86);

  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-med: rgba(148, 163, 184, 0.26);
  --border-bright: rgba(56, 189, 248, 0.45);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-pitch: #10b981;
  --accent-pitch-bright: #34d399;
  --accent-cyan: #06b6d4;
  --accent-cyan-bright: #38bdf8;
  --accent-gold: #f59e0b;
  --accent-gold-bright: #fbbf24;
  --accent-fire: #ef4444;
  --accent-fire-bright: #fb7185;
  --accent-violet: #8b5cf6;

  --captain-color: #38bdf8;
  --egoist-color: #f43f5e;
  --zone-gradient: linear-gradient(90deg, #06b6d4, #38bdf8, #fbbf24);
  --fire-gradient: linear-gradient(135deg, #f59e0b, #ef4444);
  --pitch-gradient: linear-gradient(135deg, #059669, #10b981);

  --font-display: 'Barlow Condensed', 'Impact', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.42);
  --shadow-glow-cyan: 0 0 24px rgba(6, 182, 212, 0.32);
  --shadow-glow-gold: 0 0 26px rgba(245, 158, 11, 0.36);
  --shadow-glow-fire: 0 0 26px rgba(239, 68, 68, 0.4);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 80% 45% at 50% -10%, rgba(16, 185, 129, 0.14), transparent 65%),
    radial-gradient(ellipse 60% 40% at 95% 15%, rgba(6, 182, 212, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 5% 85%, rgba(245, 158, 11, 0.08), transparent 60%),
    linear-gradient(180deg, #070b14 0%, #090f1d 100%);
  background-attachment: fixed;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.5);
}

/* Typography Utilities */
.font-display {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-gold { color: var(--accent-gold-bright); }
.text-cyan { color: var(--accent-cyan-bright); }
.text-pitch { color: var(--accent-pitch-bright); }
.text-fire { color: var(--accent-fire-bright); }

.mono-num {
  font-variant-numeric: tabular-nums;
}

/* SVG icon baseline */
.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
}
.ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-med);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--bg-surface-3);
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 14px;
}

.btn-lg {
  min-height: 50px;
  padding: 12px 24px;
  font-size: 19px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: rgba(52, 211, 153, 0.55);
  color: #03150e;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.28);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  border-color: #6ee7b7;
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.42);
}

.btn-cyan {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  border-color: rgba(56, 189, 248, 0.6);
  color: #03141f;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.28);
}
.btn-cyan:hover:not(:disabled) {
  background: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);
  box-shadow: 0 8px 26px rgba(6, 182, 212, 0.42);
}

.btn-gold {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 55%, #fbbf24 100%);
  border-color: rgba(251, 191, 36, 0.7);
  color: #1c1002;
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.34);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.48);
}

.btn-fire {
  background: linear-gradient(135deg, #dc2626 0%, #f43f5e 100%);
  border-color: rgba(251, 113, 133, 0.65);
  color: #fff;
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.34);
}
.btn-fire:hover:not(:disabled) {
  background: linear-gradient(135deg, #ef4444 0%, #fb7185 100%);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge-pitch { background: rgba(16, 185, 129, 0.16); color: #34d399; border-color: rgba(16, 185, 129, 0.35); }
.badge-cyan { background: rgba(6, 182, 212, 0.16); color: #38bdf8; border-color: rgba(6, 182, 212, 0.38); }
.badge-gold { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border-color: rgba(245, 158, 11, 0.4); }
.badge-fire { background: rgba(239, 68, 68, 0.18); color: #fb7185; border-color: rgba(239, 68, 68, 0.42); }
.badge-violet { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.42); }

/* Cards / Panels */
.panel {
  background: linear-gradient(180deg, rgba(20, 31, 54, 0.92) 0%, rgba(13, 21, 38, 0.96) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.panel-highlight {
  border-color: rgba(56, 189, 248, 0.38);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(56, 189, 248, 0.18);
}

.panel-rival {
  border-color: rgba(244, 63, 94, 0.5);
  background: linear-gradient(145deg, rgba(48, 14, 28, 0.92) 0%, rgba(15, 22, 39, 0.96) 65%);
  box-shadow: var(--shadow-card), 0 0 28px rgba(244, 63, 94, 0.16);
}

.panel-gold {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(145deg, rgba(46, 33, 12, 0.88) 0%, rgba(14, 22, 39, 0.96) 65%);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Progress Bars */
.bar-track {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.bar-track.bar-lg {
  height: 12px;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--pitch-gradient);
}
.bar-fill.cyan { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.bar-fill.gold { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bar-fill.fire { background: linear-gradient(90deg, #dc2626, #fb7185); }
.bar-fill.zone { background: var(--zone-gradient); }
.bar-fill.violet { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

/* Inputs */
.input, .select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-med);
  background: rgba(8, 14, 26, 0.9);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .select:focus {
  border-color: var(--accent-cyan-bright);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

/* Animations */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(251, 191, 36, 0.35); }
  50% { box-shadow: 0 0 28px rgba(251, 191, 36, 0.78); }
}

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

@keyframes mangaSlash {
  0% { transform: translateX(-110%) skewX(-18deg); opacity: 0; }
  20% { transform: translateX(0%) skewX(-18deg); opacity: 1; }
  82% { transform: translateX(0%) skewX(-18deg); opacity: 1; }
  100% { transform: translateX(115%) skewX(-18deg); opacity: 0; }
}

@keyframes flashPulse {
  0% { opacity: 0; }
  25% { opacity: 0.7; }
  100% { opacity: 0; }
}

.animate-in {
  animation: slideUp 0.25s ease-out both;
}

.hidden {
  display: none !important;
}
