/* ============================================================
   KÖRFUBOLTASTJÓRI - Stylesheet
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --bg-sidebar: #0d1321;
  --border: #1e293b;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-bright: #f8fafc;
  --accent: #f97316;
  --accent2: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --purple: #a855f7;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-w: 220px;
  --topbar-h: 50px;
  --radius: 8px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* --- Layout --- */
#layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#layout.has-sidebar {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
}

#layout.has-sidebar #topbar {
  grid-column: 1 / -1;
}

#topbar {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  height: var(--topbar-h);
}

.topbar-team { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }

/* --- Team logos (all circles with white background) --- */
.team-logo {
  display: inline-block;
  object-fit: contain;
  vertical-align: middle;
  background: #fff;
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.team-logo-xs { padding: 1px; box-shadow: none; }
.team-logo-sm { padding: 2px; }
.team-logo-md { padding: 3px; }
.team-logo-lg { padding: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.team-logo-xl { padding: 6px; box-shadow: 0 3px 12px rgba(0,0,0,0.4); }

.team-logo-emoji { display: inline-block; vertical-align: middle; }

/* Table cells with logos should vertical-align middle */
.league-table td, .player-table td, .stats-table td, .mini-table td {
  vertical-align: middle;
}
.mini-table td .team-logo-xs,
.league-table td .team-logo-xs,
.player-table td .team-logo-xs,
.stats-table td .team-logo-xs {
  margin-right: 4px;
}
.topbar-info { display: flex; gap: 12px; color: var(--text-dim); font-size: 13px; }
.topbar-money { color: var(--green); font-weight: 600; }

#sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 12px 20px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-dim);
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--bg-card-hover); color: var(--text); }
.nav-item.active { background: rgba(249, 115, 22, 0.1); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.nav-icon { font-size: 18px; width: 24px; text-align: center; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}

.nav-action {
  margin: 8px 16px;
}

#app {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

#layout.has-sidebar #app {
  max-height: calc(100vh - var(--topbar-h));
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ea670c; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger { background: var(--red); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 4px; border: none; cursor: pointer; font-weight: 600; }
.btn-xs.btn-primary { background: var(--accent); color: #fff; }
.btn-xs.btn-danger { background: var(--red); color: #fff; }
.btn-link { background: none; border: none; color: var(--accent); padding: 4px 0; }
.btn-disabled { opacity: 0.4; cursor: not-allowed; }

.btn-tactic {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-tactic.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-tactic:hover:not(.active) { background: var(--bg-card-hover); }

/* --- Menu Screen --- */
.menu-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.menu-logo { margin-bottom: 48px; }
.menu-ball { font-size: 80px; margin-bottom: 16px; animation: bounce 2s infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.menu-logo h1 {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--accent), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.menu-sub { font-size: 20px; color: var(--text-dim); margin-top: 4px; }
.menu-season { font-size: 16px; color: var(--accent); margin-top: 4px; font-weight: 600; }

.menu-buttons { display: flex; flex-direction: column; gap: 12px; width: 280px; }
.menu-buttons .btn { width: 100%; justify-content: center; }

.menu-footer { margin-top: 48px; color: var(--text-dim); font-size: 12px; }

/* --- Team Select --- */
.team-select-screen { max-width: 900px; margin: 0 auto; }
.team-select-screen h2 { text-align: center; font-size: 28px; margin-bottom: 8px; }
.subtitle { text-align: center; color: var(--text-dim); margin-bottom: 32px; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.team-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.team-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 8px 32px rgba(249, 115, 22, 0.15); }

.team-card-logo {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.team-card-logo .team-logo {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.team-card-name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.team-card-city { color: var(--text-dim); font-size: 13px; margin-bottom: 8px; }
.star-rating { color: var(--yellow); font-size: 14px; letter-spacing: 2px; }

/* --- Dashboard --- */
.dashboard h2 { font-size: 24px; margin-bottom: 20px; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.dash-card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.dash-stat-big { font-size: 28px; font-weight: 800; color: var(--text-bright); margin-bottom: 4px; }
.dash-stat { font-size: 14px; color: var(--text-dim); margin-bottom: 2px; }

.form-display { display: flex; gap: 4px; margin-top: 8px; }
.form-w { background: var(--green); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.form-l { background: var(--red); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }

.next-match { text-align: center; }
.nm-teams { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 16px; font-size: 16px; }
.nm-vs { color: var(--text-dim); font-size: 12px; }
.nm-us { font-weight: 700; color: var(--accent); }

.dash-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-news { min-height: 200px; }

.news-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  gap: 10px;
}
.news-week {
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}

.mini-table { width: 100%; font-size: 13px; }
.mini-table th { color: var(--text-dim); font-weight: 600; text-align: left; padding: 4px 8px; }
.mini-table td { padding: 4px 8px; }

/* --- Tables --- */
.league-table, .player-table, .stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.league-table th, .player-table th, .stats-table th {
  background: var(--bg-card);
  color: var(--text-dim);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.league-table td, .player-table td, .stats-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.league-table tr:hover, .player-table tr:hover, .stats-table tr:hover {
  background: var(--bg-card-hover);
}

.highlight-row { background: rgba(249, 115, 22, 0.08) !important; }
.playoff-zone { border-left: 3px solid var(--green); }

.player-link { color: var(--accent); font-weight: 600; }
.player-link.foreign { color: var(--accent2); }

.pos-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.pos-pg { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.pos-sg { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.pos-sf { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.pos-pf { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.pos-c { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.ovr-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 13px;
}
.ovr-elite { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.ovr-good { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.ovr-avg { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.ovr-below { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.ovr-low { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.energy-bar {
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.energy-bar.big { width: 120px; height: 10px; border-radius: 5px; }
.energy-fill { height: 100%; border-radius: inherit; transition: width 0.3s; }

.positive { color: var(--green); }
.negative { color: var(--red); }
.winner { font-weight: 700; }

.injured-row { opacity: 0.6; }
.starter-row td:first-child { border-left: 3px solid var(--accent); }
.not-gameday { opacity: 0.4; }
.not-gameday:hover { opacity: 0.7; }

.squad-info-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 14px;
}
.text-dim { color: var(--text-dim); }

.btn-gameday {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-gameday:hover { border-color: var(--accent); color: var(--accent); }
.btn-gameday.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.table-legend { margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.legend-playoff { color: var(--green); }

.form-cell { display: flex; gap: 3px; }
.empty { color: var(--text-dim); font-style: italic; padding: 20px 0; }

/* --- Match View --- */
.match-view { max-width: 800px; margin: 0 auto; }

.match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.match-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.match-team, .match-score { position: relative; z-index: 1; text-align: center; }
.match-logo { font-size: 48px; margin-bottom: 8px; }
.match-team-name { font-weight: 700; font-size: 18px; }

.score-big { font-size: 48px; font-weight: 900; letter-spacing: 4px; }
.score-label { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 4px; }

.match-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.match-log {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.log-entry {
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  gap: 12px;
}

.log-time {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  min-width: 60px;
}

.log-score2 .log-text { color: var(--green); }
.log-score3 .log-text { color: var(--yellow); font-weight: 600; }
.log-steal .log-text { color: var(--red); }
.log-block .log-text { color: var(--purple); }
.log-final .log-text { color: var(--accent); font-weight: 800; font-size: 16px; }
.log-quarter .log-text { color: var(--accent2); font-weight: 700; }
.log-quarterEnd .log-text { color: var(--accent); font-weight: 600; }

.match-actions { margin-top: 20px; text-align: center; }

/* --- Tactics --- */
.tactics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tactics-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.tactics-card h3 { font-size: 16px; margin-bottom: 16px; }

.tactic-option { margin-bottom: 16px; }
.tactic-option label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.tactic-buttons { display: flex; gap: 8px; }

.court-display { position: relative; }
.court {
  background: linear-gradient(to bottom, #1a3a1a, #0d2b0d);
  border: 2px solid #2d5a2d;
  border-radius: var(--radius);
  padding: 30px 20px;
  min-height: 300px;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  gap: 12px;
}

.court::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 50%;
}

.court-pos { text-align: center; z-index: 1; }
.court-pos-label { font-size: 11px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }

.starter-select {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font);
  max-width: 160px;
}

/* --- Results --- */
.results-list { max-width: 600px; }

.result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 14px;
}

.result-ours { border-left: 3px solid var(--accent); }
.result-week { color: var(--text-dim); font-size: 12px; min-width: 40px; }
.result-home { flex: 1; text-align: right; }
.result-score { font-weight: 800; color: var(--text-bright); min-width: 60px; text-align: center; }
.result-away { flex: 1; }

/* --- Transfers --- */
.transfer-window-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
}
.tw-open { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--green); }
.tw-urgent { background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.3); color: var(--yellow); animation: twPulse 2s infinite; }
.tw-closed { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--red); }
@keyframes twPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.tw-icon { font-size: 18px; }

.transfer-budget {
  background: var(--bg-card);
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 15px;
}

/* --- Finances --- */
.finance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.finance-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.finance-card h3 { font-size: 13px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.finance-total .finance-big { font-size: 32px; font-weight: 900; color: var(--green); }
.finance-line { padding: 4px 0; font-size: 14px; }

/* --- Player Detail --- */
.pd-header {
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}
.pd-header::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.4); border-radius: var(--radius); }
.pd-info, .pd-ovr { position: relative; z-index: 1; }
.pd-info h2 { font-size: 28px; font-weight: 800; }
.pd-meta { color: rgba(255,255,255,0.8); font-size: 14px; margin-top: 4px; }

.ovr-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900;
  margin: 0 auto;
}
.ovr-circle.ovr-elite { background: rgba(34, 197, 94, 0.3); border: 3px solid var(--green); }
.ovr-circle.ovr-good { background: rgba(59, 130, 246, 0.3); border: 3px solid var(--accent2); }
.ovr-circle.ovr-avg { background: rgba(234, 179, 8, 0.3); border: 3px solid var(--yellow); }
.ovr-circle.ovr-below { background: rgba(249, 115, 22, 0.3); border: 3px solid var(--accent); }
.ovr-circle.ovr-low { background: rgba(239, 68, 68, 0.3); border: 3px solid var(--red); }

.pd-potential { font-size: 12px; color: rgba(255,255,255,0.7); text-align: center; margin-top: 4px; }

.pd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.pd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.pd-card h3 { font-size: 14px; margin-bottom: 12px; color: var(--text-dim); text-transform: uppercase; }

.pd-bar-group {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.pd-bar-group label { min-width: 60px; font-size: 12px; color: var(--text-dim); }
.pd-bar-group span { font-size: 12px; font-weight: 600; }

.pd-status { padding: 8px 0; font-size: 14px; }
.pd-contract { font-size: 13px; color: var(--text-dim); margin-top: 8px; }

.stats-grid-sm {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-item { text-align: center; }
.stat-val { font-size: 20px; font-weight: 800; color: var(--text-bright); }
.stat-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; }

.ability-bars { display: flex; flex-direction: column; gap: 10px; }
.ability { display: flex; align-items: center; gap: 10px; }
.ability label { min-width: 90px; font-size: 12px; color: var(--text-dim); }
.ability-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.ability-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.5s; }

/* --- Playoffs --- */
.bracket { display: flex; gap: 32px; overflow-x: auto; padding: 20px 0; }
.bracket-round { min-width: 220px; }
.bracket-round h3 { font-size: 14px; color: var(--text-dim); margin-bottom: 12px; text-transform: uppercase; }

.bracket-series {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}
.bracket-series.series-done { opacity: 0.7; }
.bracket-series.series-active { border-color: var(--accent); }

.bracket-team {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}
.series-winner { color: var(--green); font-weight: 700; }

/* --- News --- */
.news-view h2 { margin-bottom: 20px; }
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: start;
  font-size: 14px;
}
.news-week-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--red); color: #fff; }
.toast-info { background: var(--accent2); color: #fff; }

/* --- Live Match --- */
.live-match {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: calc(100vh - var(--topbar-h) - 48px);
  position: relative;
}

.live-scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.live-scoreboard::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.live-sb-team, .live-sb-center { position: relative; z-index: 1; }

.live-sb-team {
  display: flex;
  align-items: center;
  gap: 10px;
}
.live-sb-logo { font-size: 36px; }
.live-sb-name { font-weight: 700; font-size: 18px; color: #fff; }

.live-sb-center { text-align: center; }

.live-sb-score {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.live-sb-pts {
  font-size: 48px;
  font-weight: 900;
  color: rgba(255,255,255,0.7);
  transition: all 0.3s;
  min-width: 60px;
  text-align: center;
}
.live-sb-pts.leading {
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.5);
}
.live-sb-dash {
  font-size: 32px;
  color: rgba(255,255,255,0.4);
}

.live-sb-info {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 4px;
}
.live-sb-quarter {
  background: rgba(255,255,255,0.2);
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}
.live-sb-time {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.live-sb-timeouts {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 6px;
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 2px;
}

.score-flash {
  animation: scoreFlash 0.5s ease-out;
}
@keyframes scoreFlash {
  0% { transform: scale(1.3); color: var(--yellow); }
  100% { transform: scale(1); }
}

.live-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.live-body.dimmed { opacity: 0.3; pointer-events: none; }

.live-log {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-right: none;
  padding: 12px;
  overflow-y: auto;
  min-height: 0;
}

.live-log .log-entry {
  padding: 5px 8px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  gap: 10px;
  border-radius: 4px;
}

.log-new {
  animation: logSlideIn 0.4s ease-out;
  background: rgba(249, 115, 22, 0.1);
}
@keyframes logSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.log-turnover .log-text { color: var(--red); font-style: italic; }
.log-substitution .log-text { color: var(--accent2); font-weight: 600; }
.log-timeout .log-text { color: var(--yellow); font-weight: 600; }

.live-sidebar-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow-y: auto;
  min-height: 0;
}

.live-lineup {
  padding: 12px;
}
.live-lineup h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 8px;
  margin-top: 12px;
}
.live-lineup h3:first-child { margin-top: 0; }

.live-lineup-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-player-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: rgba(255,255,255,0.02);
  transition: all 0.2s;
}
.live-player-row:hover { background: rgba(255,255,255,0.06); }

.live-player-row.sub-target {
  cursor: pointer;
  border: 1px dashed var(--accent);
}
.live-player-row.sub-target:hover {
  background: rgba(249, 115, 22, 0.2);
}

.live-p-name {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-p-stats { color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; }
.live-p-ovr { color: var(--text-dim); font-size: 11px; font-weight: 700; }
.live-p-fouls { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.live-p-fouls.foul-danger { color: var(--red); font-weight: 700; }

.player-hot {
  background: rgba(234, 179, 8, 0.15) !important;
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.3);
  animation: hotGlow 2s ease-in-out infinite alternate;
}
@keyframes hotGlow {
  from { box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.2), 0 0 6px rgba(234, 179, 8, 0.1); }
  to { box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.5), 0 0 12px rgba(234, 179, 8, 0.25); }
}

.live-bench {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-bench-player {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.live-bench-player:hover { background: rgba(255,255,255,0.06); }
.live-bench-player.selected {
  background: rgba(249, 115, 22, 0.25);
  border: 1px solid var(--accent);
}
.live-bench-player.sub-source {
  border: 1px dashed var(--accent2);
}

.live-controls {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px 16px;
  flex-shrink: 0;
}

.live-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.live-speed-btns {
  display: flex;
  gap: 4px;
}

.btn-speed {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  transition: all 0.15s;
}
.btn-speed.active {
  background: var(--accent2);
  color: #fff;
  border-color: var(--accent2);
}
.btn-speed:hover:not(.active) { background: var(--bg-card-hover); }

.sub-mode-active {
  background: var(--accent) !important;
  color: #fff !important;
}

.live-tactics-row {
  margin-top: 8px;
  gap: 16px;
}

.live-tactic-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.live-tactic-group label {
  font-size: 11px;
  color: var(--text-dim);
  margin-right: 4px;
  white-space: nowrap;
}
.live-tactic-group .btn-tactic {
  padding: 4px 10px;
  font-size: 11px;
}

/* --- Quarter Break Overlay --- */
.quarter-break {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 23, 0.92);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
  overflow-y: auto;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.qb-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}
.qb-content h2 {
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--accent);
}
.qb-content h3 {
  font-size: 16px;
  color: var(--yellow);
  margin-bottom: 12px;
}

.qb-scores { margin: 20px 0; }
.qb-table {
  width: 100%;
  font-size: 14px;
  border-collapse: collapse;
}
.qb-table th, .qb-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.qb-table th { color: var(--text-dim); font-size: 12px; text-transform: uppercase; }

/* --- Game End Overlay --- */
.game-end-overlay { z-index: 60; }

.game-end-content {
  max-width: 800px !important;
}

.ge-final-score {
  font-size: 32px;
  font-weight: 900;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.ge-dash { color: var(--text-dim); }

.ge-mvp {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(249, 115, 22, 0.2));
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px auto;
  max-width: 400px;
}
.ge-mvp-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--yellow);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.ge-mvp-name {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-bright);
}
.ge-mvp-stats {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

.ge-boxscore {
  text-align: left;
  margin-top: 20px;
}
.ge-boxscore h3 {
  text-align: center;
  color: var(--text-dim);
}
.ge-boxscore .stats-table {
  font-size: 12px;
}
.ge-boxscore .stats-table th {
  position: static;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* --- Responsive --- */
@media (max-width: 768px) {
  #layout { grid-template-columns: 1fr; }
  #sidebar { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-bottom { grid-template-columns: 1fr; }
  .tactics-grid { grid-template-columns: 1fr; }
  .match-header { flex-direction: column; gap: 16px; padding: 20px; }
  .menu-logo h1 { font-size: 28px; }
  .stats-grid-sm { grid-template-columns: repeat(2, 1fr); }

  .live-match { height: auto; min-height: calc(100vh - var(--topbar-h) - 48px); }
  .live-body { grid-template-columns: 1fr; }
  .live-sidebar-panel { max-height: 250px; }
  .live-scoreboard { flex-direction: column; gap: 8px; padding: 12px; }
  .live-sb-pts { font-size: 32px; }
  .live-controls-row { flex-wrap: wrap; }
  .live-tactics-row { flex-direction: column; gap: 8px; }
  .ge-boxscore .stats-table { font-size: 10px; }
  .ge-boxscore .stats-table th, .ge-boxscore .stats-table td { padding: 4px 6px; }
}
