/* ═══════════════════════════════════════════════════════════════
   NEXUS Ranking Command Center — Stylesheet
   Visual identity adopted from VRS Rating System
═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #070b12;
  --bg2: #0d1421;
  --bg3: #111d30;
  --surface: #0d1421;
  --surface2: #111d30;
  --border: #1a2840;
  --border-bright: #243352;
  --text: #e8f0ff;
  --muted: #5a7099;
  --muted2: #3d5175;
  --accent: #4f8cff;
  --accent2: #7b5fff;
  --good: #00e87a;
  --bad: #ff4060;
  --warn: #ffb930;
  --gold: #ffd700;
  --silver: #c0c8d8;
  --bronze: #cd7f32;

  --font-display: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;

  --glow-accent: 0 0 30px rgba(79,140,255,0.15);
  --glow-good: 0 0 20px rgba(0,232,122,0.2);

  --sidebar-width: 260px;
  --sidebar-collapsed: 62px;
}

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

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

/* ─── Ambient background ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 500px at 15% 10%, rgba(79,140,255,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 85% 80%, rgba(123,95,255,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 50% 50%, rgba(0,232,122,0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.3s cubic-bezier(0.4,0,0.2,1);
}

.app-shell.collapsed {
  grid-template-columns: var(--sidebar-collapsed) 1fr;
}

/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar {
  background: linear-gradient(180deg, rgba(13,20,33,0.98) 0%, rgba(7,11,18,0.99) 100%);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: padding 0.3s cubic-bezier(0.4,0,0.2,1), width 0.3s;
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
  width: 3px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(79,140,255,0.25);
  border-radius: 999px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(79,140,255,0.45);
}

/* Scrollable nav area */
.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(79,140,255,0.25);
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(79,140,255,0.45);
}

.collapsed .sidebar {
  padding: 28px 10px;
}

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.collapsed .logo {
  font-size: 18px;
  padding: 0 2px;
  text-align: center;
}

.logo-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  padding: 0 8px;
  margin-bottom: 24px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.collapsed .logo-sub {
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.sidebar-section {
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  padding: 8px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s;
  min-height: fit-content;
  flex-shrink: 0;
}

.collapsed .sidebar-section {
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  overflow: visible;
  min-height: fit-content;
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(79,140,255,0.08);
  border-color: rgba(79,140,255,0.15);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(79,140,255,0.1);
  border-color: rgba(79,140,255,0.2);
}

.nav-icon {
  width: 18px;
  min-width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-label {
  transition: opacity 0.2s;
  overflow: visible;
}

.collapsed .nav-label {
  opacity: 0;
  width: 0;
}

.collapsed .nav-item {
  justify-content: center;
  padding: 10px 8px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 8px 0;
  border-top: 1px solid var(--border);
  overflow: hidden;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.collapsed .sidebar-footer {
  opacity: 0;
  height: 0;
  padding: 0;
  border: none;
}

.sidebar-footer-text {
  font-size: 11px;
  color: var(--muted2);
  font-family: var(--font-mono);
}

/* ─── Sidebar toggle ─── */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(79,140,255,0.08);
  border: 1px solid rgba(79,140,255,0.18);
  color: var(--accent);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
  margin-bottom: 8px;
  flex-shrink: 0;
  align-self: flex-end;
}

.collapsed .sidebar-toggle {
  align-self: center;
}

.sidebar-toggle:hover {
  background: rgba(79,140,255,0.15);
  border-color: rgba(79,140,255,0.35);
  transform: scale(1.05);
}

/* ─── Side stats ─── */
.side-stat {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  transition: opacity 0.2s;
}

.collapsed .side-stat {
  opacity: 0;
  height: 0;
  padding: 0;
}

.side-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(7,11,18,0.6);
  border: 1px solid var(--border);
}

.side-pill-label {
  font-size: 10px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: var(--font-mono);
}

.side-pill-value {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
}

.sidebar > * {
  flex-shrink: 0;
}

.sidebar > .sidebar-nav {
  flex-shrink: 1;
}

.side-pill-value.up { color: var(--good); }
.side-pill-value.down { color: var(--bad); }

/* ─── Iframe embedded panels ─── */
.panel-iframe {
  width: 100%;
  height: calc(100vh + 600px);
  min-height: 1200px;
  border: none;
  border-radius: 12px;
  background: var(--bg);
}

/* ═══════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════ */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7,11,18,0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
  gap: 10px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.page-sub {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.top-bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Panels ─── */
.panels {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.2s ease;
}

.panel.active { display: flex; }

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

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: linear-gradient(135deg, rgba(17,29,48,0.9) 0%, rgba(13,20,33,0.95) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.card-subtitle {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.card-body {
  padding: 18px 20px;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79,140,255,0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,140,255,0.4);
}

.btn-ghost {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-bright);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(79,140,255,0.3);
  color: var(--accent);
}

.btn-ai {
  background: linear-gradient(135deg, rgba(123,95,255,0.18), rgba(79,140,255,0.08));
  border-color: rgba(123,95,255,0.4);
  color: var(--accent2);
}

.btn-ai:hover {
  background: linear-gradient(135deg, rgba(123,95,255,0.28), rgba(79,140,255,0.14));
  box-shadow: 0 0 20px rgba(123,95,255,0.25);
}

.btn:disabled { opacity: 0.35; pointer-events: none; }
.btn:active { transform: translateY(1px); }

/* ═══════════════════════════════════════
   FORM CONTROLS
═══════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.form-control {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-bright);
  background: rgba(7,11,18,0.8);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s ease;
  min-width: 160px;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,140,255,0.1);
}

.controls-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* ═══════════════════════════════════════
   STATUS BAR
═══════════════════════════════════════ */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(7,11,18,0.7);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.status-dot.ok { background: var(--good); box-shadow: 0 0 8px var(--good); }
.status-dot.err { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.status-dot.loading {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ═══════════════════════════════════════
   STAT PILLS
═══════════════════════════════════════ */
.stats-row { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(7,11,18,0.6);
  border: 1px solid var(--border);
  min-width: 80px;
}

.stat-label {
  font-size: 10px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: var(--font-mono);
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
}

.stat-value.up { color: var(--good); }
.stat-value.down { color: var(--bad); }
.stat-value.warn { color: var(--warn); }

/* ═══════════════════════════════════════
   TABLE
═══════════════════════════════════════ */
.table-wrapper {
  overflow: auto;
  max-height: 65vh;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(7,11,18,0.95);
  backdrop-filter: blur(8px);
  z-index: 10;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

thead th:hover { color: var(--accent); }
thead th:first-child { border-radius: 12px 0 0 0; }
thead th:last-child { border-radius: 0 12px 0 0; }

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(26,40,64,0.6);
  vertical-align: middle;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover td { background: rgba(79,140,255,0.04); }

.right { text-align: right; }

/* ═══════════════════════════════════════
   RANK ROWS — Animated top positions
═══════════════════════════════════════ */
@keyframes shimmer {
  0% { transform: translateX(-100%) skewX(-12deg); }
  100% { transform: translateX(200%) skewX(-12deg); }
}

@keyframes waveShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.rank-row {
  position: relative;
  isolation: isolate;
  background-size: 300% 300%;
}

.rank-row::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
  transform: translateX(-100%) skewX(-12deg);
  animation: shimmer 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.rank-row > td { position: relative; z-index: 1; }

.rank-1 {
  background: linear-gradient(90deg, rgba(255,215,0,0.12) 0%, rgba(255,180,0,0.06) 50%, rgba(255,215,0,0.04) 100%);
  animation: waveShift 6s ease-in-out infinite;
}

.rank-2 {
  background: linear-gradient(90deg, rgba(192,200,216,0.10) 0%, rgba(160,175,200,0.05) 50%, rgba(192,200,216,0.03) 100%);
  animation: waveShift 7s ease-in-out infinite;
}

.rank-3 {
  background: linear-gradient(90deg, rgba(205,127,50,0.12) 0%, rgba(180,100,30,0.06) 50%, rgba(205,127,50,0.04) 100%);
  animation: waveShift 8s ease-in-out infinite;
}

.rank-top {
  background: linear-gradient(90deg, rgba(79,140,255,0.08) 0%, rgba(123,95,255,0.04) 50%, rgba(79,140,255,0.02) 100%);
  animation: waveShift 9s ease-in-out infinite;
}

/* ─── Team name gradient ─── */
@keyframes textFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.team-name-animated {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  background-size: 200% 100%;
  animation: textFlow 3s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.team-name-1 { background-image: linear-gradient(90deg, #ffd700, #fff7aa, #ffb700, #ffe566, #ffd700); }
.team-name-2 { background-image: linear-gradient(90deg, #a0b8d8, #ffffff, #c8d8f0, #7090b8, #a0b8d8); }
.team-name-3 { background-image: linear-gradient(90deg, #cd7f32, #f0b060, #cd7f32, #e8a050, #cd7f32); }
.team-name-top { background-image: linear-gradient(90deg, #4f8cff, #7b5fff, #4f8cff); }
.team-name-default { font-family: var(--font-body); font-weight: 500; color: var(--text); }

/* ─── Rank badge ─── */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
}

.rank-badge-1 { background: rgba(255,215,0,0.2); color: var(--gold); border: 1px solid rgba(255,215,0,0.3); }
.rank-badge-2 { background: rgba(192,200,216,0.15); color: var(--silver); border: 1px solid rgba(192,200,216,0.25); }
.rank-badge-3 { background: rgba(205,127,50,0.2); color: var(--bronze); border: 1px solid rgba(205,127,50,0.3); }
.rank-badge-n { background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid var(--border); }

/* ─── Delta chips ─── */
.delta {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }
.delta.new { color: var(--warn); }

/* ─── Tier badge ─── */
.tier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
}

.tier-s { background: rgba(255,185,48,0.15); color: #ffb930; border: 1px solid rgba(255,185,48,0.25); }
.tier-1 { background: rgba(79,140,255,0.15); color: #4f8cff; border: 1px solid rgba(79,140,255,0.25); }
.tier-2 { background: rgba(123,95,255,0.15); color: #7b5fff; border: 1px solid rgba(123,95,255,0.25); }
.tier-3 { background: rgba(90,112,153,0.15); color: #8aabcc; border: 1px solid rgba(90,112,153,0.25); }

/* ─── Region tag ─── */
.region-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.region-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.region-am .region-dot { background: #4f8cff; }
.region-eu .region-dot { background: #7b5fff; }
.region-as .region-dot { background: #00e87a; }

/* ─── Streak badge ─── */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.streak-badge.hot { color: var(--warn); }
.streak-badge.cold { color: var(--muted); }

/* ═══════════════════════════════════════
   CHARTS
═══════════════════════════════════════ */
.chart-wrap { position: relative; }
canvas { width: 100% !important; }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.mini-panel {
  background: rgba(7,11,18,0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.15s ease;
}

.mini-panel:hover { border-color: var(--border-bright); }

.mini-panel h4 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.mini-panel canvas { max-height: 260px; }

.state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  color: var(--muted);
  font-size: 12px;
  border: 1px dashed rgba(79,140,255,0.1);
  border-radius: 10px;
  background: rgba(0,0,0,0.15);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(79,140,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

/* ═══════════════════════════════════════
   MATCH PREDICTOR
═══════════════════════════════════════ */
.vs-display {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: rgba(7,11,18,0.6);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.vs-team { flex: 1; text-align: center; }

.vs-team-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}

.vs-team-pts {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.vs-divider {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--muted2);
}

.vs-prob-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--border); }
.vs-prob-a { background: var(--accent); transition: width 0.4s ease; }
.vs-prob-b { background: var(--accent2); transition: width 0.4s ease; }

/* ═══════════════════════════════════════
   AI ANALYSIS
═══════════════════════════════════════ */
.ai-analysis-box {
  background: linear-gradient(135deg, rgba(79,140,255,0.05) 0%, rgba(123,95,255,0.05) 100%);
  border: 1px solid rgba(79,140,255,0.2);
  border-radius: 14px;
  padding: 20px;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ai-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.ai-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.ai-subtitle { font-size: 11px; color: var(--muted); }

.ai-section { margin-bottom: 16px; }

.ai-section-title {
  font-size: 11px;
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(79,140,255,0.2);
}

.ai-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.ai-insight-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(7,11,18,0.7);
  border: 1px solid var(--border);
}

.ai-insight-label {
  font-size: 10px;
  color: var(--muted2);
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.ai-insight-value { font-size: 14px; font-weight: 600; color: var(--text); font-family: var(--font-display); }
.ai-insight-sub { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }

.ai-list { display: flex; flex-direction: column; gap: 6px; }

.ai-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  padding: 6px 0;
  border-bottom: 1px solid rgba(26,40,64,0.4);
}

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

.ai-list-num {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(79,140,255,0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── HLTV-style typewriter output ─── */
.ai-output {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text);
  min-height: 120px;
  white-space: pre-wrap;
  padding: 16px 18px;
}

.ai-output .ai-header-line { color: var(--accent2); font-weight: 700; }

/* ─── Legends table ─── */
.legend-gold td { background: rgba(255,215,0,0.10) !important; color: var(--gold); border-left: 2px solid var(--gold); }
.legend-silver td { background: rgba(192,200,216,0.06) !important; color: #cbd5e1; border-left: 2px solid #94a3b8; }
.legend-bronze td { background: rgba(205,127,50,0.10) !important; color: #f59e0b; border-left: 2px solid #d97706; }
.legend-other td { background: rgba(239,68,68,0.04) !important; }

/* ─── Region badges (HLTV-style) ─── */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-AM { background: rgba(79,140,255,0.12); color: #4f8cff; border: 1px solid rgba(79,140,255,0.3); }
.badge-EU { background: rgba(123,95,255,0.12); color: #7b5fff; border: 1px solid rgba(123,95,255,0.3); }
.badge-AS { background: rgba(0,232,122,0.12); color: var(--good); border: 1px solid rgba(0,232,122,0.3); }

/* ═══════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ═══════════════════════════════════════
   UTILITIES
═══════════════════════════════════════ */
.empty-state { text-align: center; padding: 40px; color: var(--muted); font-size: 13px; }
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--muted); }
.text-xs { font-size: 11px; }
.metric-cell { color: var(--accent); font-weight: 700; }

/* Dashboard active column highlight */
.dash-col-active {
  color: var(--accent) !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(79, 140, 255, 0.3);
}
.dash-cell-active {
  color: var(--accent) !important;
  font-weight: 700;
  background: rgba(79, 140, 255, 0.06);
}
.dash-col-header {
  cursor: default;
  transition: color 0.2s;
}
.dash-sort-btn {
  font-size: 11px !important;
  padding: 4px 10px !important;
  min-width: 70px;
  font-family: var(--font-mono) !important;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr !important; }
  .sidebar { display: none; }
  .panels { padding: 16px; }
  .mini-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .rank-row::after, .rank-1, .rank-2, .rank-3, .rank-top,
  .team-name-animated { animation: none !important; }
}

/* ═══════════════════════════════════════
   PRO ANALYSES — Tabs
═══════════════════════════════════════ */
.pa-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(13,20,33,0.95) 0%, rgba(7,11,18,0.98) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px;
  position: relative;
  overflow: hidden;
}

/* Subtle scan-line effect on the tabs container */
.pa-tabs::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(79,140,255,0.015) 3px,
    rgba(79,140,255,0.015) 4px
  );
  pointer-events: none;
  border-radius: 14px;
}

.pa-tab {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  z-index: 1;
}

.pa-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.pa-tab:hover {
  color: var(--text);
  background: rgba(79,140,255,0.06);
  border-color: rgba(79,140,255,0.12);
}

.pa-tab:hover::before {
  opacity: 1;
  background: radial-gradient(ellipse 80% 60% at 50% 120%, rgba(79,140,255,0.08) 0%, transparent 70%);
}

.pa-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79,140,255,0.14) 0%, rgba(123,95,255,0.1) 100%);
  border-color: rgba(79,140,255,0.35);
  box-shadow:
    0 0 16px rgba(79,140,255,0.12),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.pa-tab.active::before {
  opacity: 1;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(79,140,255,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(123,95,255,0.1) 0%, transparent 70%);
}

/* Bottom accent line for active tab */
.pa-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(79,140,255,0.5);
}

.pa-tab:active {
  transform: scale(0.98);
}

/* Tab icon */
.pa-tab-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(79,140,255,0.08);
  border: 1px solid rgba(79,140,255,0.12);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.pa-tab:hover .pa-tab-icon {
  background: rgba(79,140,255,0.12);
  border-color: rgba(79,140,255,0.2);
}

.pa-tab.active .pa-tab-icon {
  background: rgba(79,140,255,0.2);
  border-color: rgba(79,140,255,0.35);
  box-shadow: 0 0 10px rgba(79,140,255,0.15);
}

/* Tab label */
.pa-tab-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.pa-tab.active .pa-tab-label {
  background: linear-gradient(135deg, #fff 0%, rgba(79,140,255,0.9) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Tab badge (match count) */
.pa-tab-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(79,140,255,0.12);
  border: 1px solid rgba(79,140,255,0.2);
  color: var(--accent);
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  min-width: 18px;
  text-align: center;
}

.pa-tab-badge:empty {
  display: none;
}

.pa-tab.active .pa-tab-badge {
  background: rgba(79,140,255,0.2);
  border-color: rgba(79,140,255,0.4);
  box-shadow: 0 0 8px rgba(79,140,255,0.15);
}

/* Glow decoration element */
.pa-tab-glow {
  display: none;
}

.pa-tab.active .pa-tab-glow {
  display: block;
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 20px;
  background: radial-gradient(ellipse, rgba(79,140,255,0.3) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(6px);
}

.pa-tab-content {
  display: none;
}

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

/* ─── Filters ─── */
.pa-filters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
}

.pa-filter-group {
  min-width: 0;
}

.pa-autocomplete-wrap {
  position: relative;
}

.pa-autocomplete-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.pa-autocomplete-list::-webkit-scrollbar { width: 4px; }
.pa-autocomplete-list::-webkit-scrollbar-thumb { background: rgba(79,140,255,0.3); border-radius: 99px; }

.pa-autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid rgba(26,40,64,0.5);
  transition: background 0.1s;
}

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

.pa-autocomplete-item:hover {
  background: rgba(79,140,255,0.12);
}

.pa-autocomplete-item mark {
  background: rgba(79,140,255,0.3);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}

.pa-match-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  padding: 8px 14px;
  background: rgba(79,140,255,0.08);
  border: 1px solid rgba(79,140,255,0.15);
  border-radius: 8px;
  white-space: nowrap;
}

/* ─── History table styling ─── */
.pa-team-highlight {
  color: var(--accent);
}

.pa-result-win {
  color: var(--good) !important;
  font-weight: 700;
}

.pa-result-loss {
  color: var(--bad) !important;
  font-weight: 700;
}

.pa-outcome-win {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  background: rgba(0,232,122,0.15);
  color: var(--good);
  border: 1px solid rgba(0,232,122,0.3);
}

.pa-outcome-loss {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  background: rgba(255,64,96,0.15);
  color: var(--bad);
  border: 1px solid rgba(255,64,96,0.3);
}

.pa-map-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  background: rgba(123,95,255,0.12);
  color: #b8a5ff;
  border: 1px solid rgba(123,95,255,0.2);
}

.pa-winner-cell {
  font-weight: 700;
  color: var(--good);
}

/* ═══════════════════════════════════════
   H2H ANALYSIS — Report
═══════════════════════════════════════ */
.h2h-report {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.h2h-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(79,140,255,0.06) 0%, rgba(123,95,255,0.06) 100%);
  border: 1px solid var(--border-bright);
  border-radius: 14px;
}

.h2h-team-card {
  text-align: center;
  padding: 12px;
}

.h2h-team-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}

.h2h-team-a .h2h-team-name { color: var(--accent); }
.h2h-team-b .h2h-team-name { color: var(--accent2); }

.h2h-team-record {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 4px;
}

.h2h-team-wr {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.h2h-vs {
  text-align: center;
}

.h2h-vs-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--muted2);
  letter-spacing: 3px;
}

.h2h-vs-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: var(--warn);
  margin: 4px 0;
}

.h2h-vs-sub {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ─── Sections ─── */
.h2h-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.h2h-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ─── Comparison bars ─── */
.h2h-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h2h-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.h2h-bar-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.5px;
}

.h2h-bar-values {
  display: flex;
  align-items: center;
  gap: 8px;
}

.h2h-bar-val-a, .h2h-bar-val-b {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 50px;
}

.h2h-bar-val-a { text-align: right; }
.h2h-bar-val-b { text-align: left; }

.h2h-val-win { color: var(--good); }

.h2h-bar-track {
  flex: 1;
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(26,40,64,0.5);
}

.h2h-bar-a {
  background: linear-gradient(90deg, rgba(79,140,255,0.6), rgba(79,140,255,0.9));
  transition: width 0.4s ease;
}

.h2h-bar-b {
  background: linear-gradient(90deg, rgba(123,95,255,0.9), rgba(123,95,255,0.6));
  transition: width 0.4s ease;
}

.h2h-bar-lead { box-shadow: 0 0 6px rgba(0,232,122,0.3); }

/* ─── Form section ─── */
.h2h-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.h2h-form-card {
  background: rgba(13,20,33,0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.h2h-form-team {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}

.h2h-form-streak {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}

.streak-win { color: var(--good); }
.streak-loss { color: var(--bad); }

.h2h-form-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.h2h-form-dot {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.dot-win {
  background: rgba(0,232,122,0.15);
  color: var(--good);
  border: 1px solid rgba(0,232,122,0.3);
}

.dot-loss {
  background: rgba(255,64,96,0.15);
  color: var(--bad);
  border: 1px solid rgba(255,64,96,0.3);
}

/* ─── Map proficiency ─── */
.h2h-map-prof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.h2h-map-prof-team {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.h2h-map-prof {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.h2h-map-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(13,20,33,0.6);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.h2h-map-chip.pa-map-best {
  border-color: rgba(255,215,0,0.5);
  background: rgba(255,215,0,0.06);
  box-shadow: inset 0 0 12px rgba(255,215,0,0.04);
}

.h2h-map-chip.pa-map-worst {
  border-color: rgba(168,85,247,0.5);
  background: rgba(168,85,247,0.06);
  box-shadow: inset 0 0 12px rgba(168,85,247,0.04);
}

.h2h-map-chip-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
}

.h2h-map-chip-stats {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  flex: 1;
}

.h2h-map-chip-wr {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.pa-map-best .h2h-map-chip-name { color: var(--gold); }
.pa-map-best .h2h-map-chip-wr { color: var(--gold); }
.pa-map-worst .h2h-map-chip-name { color: #a855f7; }
.pa-map-worst .h2h-map-chip-wr { color: #a855f7; }

.h2h-map-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
}

.h2h-legend-best { color: var(--gold); }
.h2h-legend-worst { color: #a855f7; }

/* ─── Recent matches grid ─── */
.h2h-recent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.h2h-recent-team {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.h2h-recent-table th, .h2h-map-table th, .h2h-history-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.h2h-no-data {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  padding: 8px;
}

/* ─── Verdict ─── */
.h2h-verdict {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(79,140,255,0.04) 0%, rgba(123,95,255,0.04) 50%, rgba(255,185,48,0.04) 100%);
  border: 1px solid var(--border-bright);
  border-radius: 14px;
}

.h2h-verdict-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.h2h-verdict-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.h2h-verdict-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 12px;
}

.h2h-verdict-factors {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.h2h-verdict-factors span {
  padding: 4px 10px;
  background: rgba(79,140,255,0.08);
  border: 1px solid rgba(79,140,255,0.15);
  border-radius: 6px;
}

/* ─── Responsive for Pro Analyses ─── */
@media (max-width: 900px) {
  .pa-filters-grid { grid-template-columns: 1fr 1fr; }
  .h2h-header { grid-template-columns: 1fr; text-align: center; }
  .h2h-form-grid, .h2h-map-prof-grid, .h2h-recent-grid { grid-template-columns: 1fr; }
  .h2h-verdict-factors { flex-direction: column; align-items: center; }
  .pa-tab { padding: 11px 12px; gap: 8px; }
  .pa-tab-icon { width: 24px; height: 24px; font-size: 13px; }
  .pa-tab-label { font-size: 12px; }
}

/* ═══════════════════════════════════════
   SEEDING TOOL
═══════════════════════════════════════ */
.seed-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .seed-layout { grid-template-columns: 1fr; }
}

.seed-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.7;
}
.seed-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79,140,255,0.15);
}
.seed-textarea::placeholder {
  color: var(--muted2);
}

.seed-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.seed-info {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  min-height: 18px;
}

/* ─── Seed order header ─── */
.seed-order-header {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(79,140,255,0.06) 0%, rgba(123,95,255,0.04) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.seed-order-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}
.seed-order-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seed-order-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
}
.seed-order-pts {
  color: var(--muted);
  font-size: 10px;
}

/* ─── Matches ─── */
.seed-matches-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 14px;
}

.seed-matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.seed-match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.seed-match-card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--glow-accent);
}

.seed-match-num {
  background: linear-gradient(90deg, rgba(79,140,255,0.12) 0%, transparent 100%);
  padding: 6px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}

.seed-match-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
  padding: 14px;
}

.seed-match-team {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

.seed-team-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.seed-team-pts {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.seed-vs {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--muted2);
  padding: 0 12px;
  text-align: center;
}

/* ─── Wine highlight ─── */
.seed-wine {
  background: linear-gradient(135deg, rgba(128,0,32,0.35) 0%, rgba(100,10,40,0.2) 100%);
  border-color: rgba(160,30,60,0.5);
  box-shadow: inset 0 0 12px rgba(128,0,32,0.15);
}
.seed-wine .seed-team-name {
  color: #f0c0cc;
}
.seed-wine .seed-team-pts {
  color: rgba(240,192,204,0.7);
}

/* ─── BYE card ─── */
.seed-bye-card {
  border-color: rgba(0,232,122,0.25);
  background: var(--surface);
}
.seed-bye-card .seed-match-num {
  background: linear-gradient(90deg, rgba(0,232,122,0.12) 0%, transparent 100%);
  color: var(--good);
}
.seed-bye-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
}
.seed-bye-team {
  flex: 1;
}
.seed-bye-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--good);
  white-space: nowrap;
}

/* ─── Seeding team list (checkboxes) ─── */
.seed-team-list {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.seed-team-list::-webkit-scrollbar {
  width: 4px;
}
.seed-team-list::-webkit-scrollbar-track {
  background: transparent;
}
.seed-team-list::-webkit-scrollbar-thumb {
  background: rgba(79,140,255,0.25);
  border-radius: 999px;
}

.seed-team-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(26,40,64,0.4);
  user-select: none;
}
.seed-team-item:last-child {
  border-bottom: none;
}
.seed-team-item:hover {
  background: rgba(79,140,255,0.06);
}
.seed-team-item.selected {
  background: rgba(79,140,255,0.1);
}

.seed-team-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1.5px solid var(--border-bright);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.seed-team-item input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.seed-team-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.seed-team-name-label {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seed-team-pts-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.seed-team-rank-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted2);
  min-width: 28px;
  text-align: right;
}

.seed-selected-count {
  color: var(--accent);
  font-weight: 500;
}

.seed-quick-select .seed-textarea {
  min-height: 90px;
}

.seed-input-area {
  min-width: 0;
}

/* ═══════════════════════════════════════
   EVENTS PANEL
═══════════════════════════════════════ */
.ev-filters-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.7fr 0.8fr auto;
  gap: 12px;
  align-items: end;
}

@media (max-width: 1100px) {
  .ev-filters-grid { grid-template-columns: 1fr 1fr; }
}

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

@media (max-width: 900px) {
  .ev-grid { grid-template-columns: 1fr; }
}

/* ─── Event Card ─── */
.ev-card {
  background: linear-gradient(135deg, rgba(17,29,48,0.92) 0%, rgba(13,20,33,0.97) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

/* Watermark logo background (uses CSS var: --ev-bg) */
.ev-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--ev-bg);
  background-repeat: no-repeat;
  background-position: center;
  /* Fill the whole card area (requested) */
  background-size: cover;
  /* Keep the original colors (no grayscale) but stay subtle */
  opacity: 0.18;
  filter: saturate(1.05) contrast(1.05);
  pointer-events: none;
  z-index: 0;
}

/* Readability layer above the logo background */
.ev-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,11,18,0.72), rgba(7,11,18,0.88));
  pointer-events: none;
  z-index: 1;
}

.ev-card > * {
  position: relative;
  z-index: 2;
}

.ev-card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--glow-accent);
  transform: translateY(-2px);
}

.ev-card-live {
  border-color: rgba(255,185,48,0.35);
  box-shadow: 0 0 18px rgba(255,185,48,0.08);
}

.ev-card-major {
  border-color: rgba(255,215,0,0.28);
  box-shadow: 0 0 18px rgba(255,215,0,0.06);
}

.ev-card-finished {
  border-color: rgba(0,232,122,0.18);
}

.ev-card-live:hover {
  border-color: rgba(255,185,48,0.55);
  box-shadow: 0 0 28px rgba(255,185,48,0.15);
}

.ev-card-top {
  display: flex;
  gap: 14px;
  padding: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  min-height: 92px;
}

.ev-card-logo-wrap {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 10px;
  background: rgba(7,11,18,0.7);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ev-card-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ─── Event Modal: logo upload UI ─── */
.ev-logo-upload {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(79,140,255,0.25);
  background: rgba(7,11,18,0.35);
}

.ev-logo-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ev-logo-preview {
  margin-top: 10px;
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(79,140,255,0.18);
  background: rgba(7,11,18,0.55);
}

.ev-logo-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.35;
}

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

.ev-card-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ev-card-name a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.ev-card-name a:hover {
  color: var(--accent);
}

.ev-card-location {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.ev-card-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
}

.ev-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ev-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ev-badge-major {
  background: rgba(255,215,0,0.15);
  color: var(--gold);
  border: 1px solid rgba(255,215,0,0.3);
}

.ev-badge-live {
  background: rgba(255,185,48,0.15);
  color: var(--warn);
  border: 1px solid rgba(255,185,48,0.3);
  animation: pulse 1.5s ease-in-out infinite;
}

.ev-badge-finished {
  background: rgba(0,232,122,0.1);
  color: var(--good);
  border: 1px solid rgba(0,232,122,0.25);
}

.ev-badge-stars {
  background: rgba(255,185,48,0.1);
  color: var(--warn);
  border: 1px solid rgba(255,185,48,0.2);
  letter-spacing: 1px;
}

.ev-badge-teams {
  background: rgba(79,140,255,0.1);
  color: var(--accent);
  border: 1px solid rgba(79,140,255,0.2);
}

.ev-badge-prize {
  background: rgba(0,232,122,0.08);
  color: var(--good);
  border: 1px solid rgba(0,232,122,0.2);
}

.ev-badge-region {
  font-size: 10px;
}

.ev-badge-region-global {
  background: rgba(168,130,255,0.12);
  color: #a882ff;
  border: 1px solid rgba(168,130,255,0.25);
}

.ev-badge-region-americas {
  background: rgba(255,120,80,0.12);
  color: #ff7850;
  border: 1px solid rgba(255,120,80,0.25);
}

.ev-badge-region-asia {
  background: rgba(255,185,48,0.12);
  color: var(--warn);
  border: 1px solid rgba(255,185,48,0.25);
}

.ev-badge-region-europe {
  background: rgba(79,140,255,0.12);
  color: var(--accent);
  border: 1px solid rgba(79,140,255,0.25);
}

/* ─── Card Body (finished/live details) ─── */
.ev-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ev-card-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(7,11,18,0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ev-card-trophy-wrap {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ev-card-trophy-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ev-result-label {
  font-size: 10px;
  color: var(--muted2);
  font-family: var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ev-result-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.ev-result-value.gold-text { color: var(--gold); }
.ev-result-value.silver-text { color: var(--silver); }

.ev-card-medals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(7,11,18,0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ev-medal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.ev-medal-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted2);
  min-width: 32px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ev-medal-value {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

/* ─── Live details ─── */
.ev-card-live-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ev-live-stage {
  padding: 8px 12px;
  background: rgba(255,185,48,0.06);
  border: 1px solid rgba(255,185,48,0.15);
  border-radius: 8px;
}

.ev-live-stage-label {
  font-size: 10px;
  color: var(--warn);
  font-family: var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ev-live-stage-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.ev-live-matches {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ev-live-match-item {
  padding: 6px 10px;
  background: rgba(7,11,18,0.5);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ev-live-match-item::before {
  content: '▸';
  color: var(--warn);
  font-size: 10px;
}

/* ─── Card actions ─── */
.ev-card-actions {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.ev-btn-edit {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-bright);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s;
}

.ev-btn-edit:hover {
  background: rgba(79,140,255,0.1);
  border-color: rgba(79,140,255,0.3);
  color: var(--accent);
}

.ev-btn-delete {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,64,96,0.2);
  background: rgba(255,64,96,0.06);
  color: rgba(255,64,96,0.6);
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s;
}

.ev-btn-delete:hover {
  background: rgba(255,64,96,0.15);
  border-color: rgba(255,64,96,0.4);
  color: var(--bad);
}

/* ═══════════════════════════════════════
   EVENT MODAL
═══════════════════════════════════════ */
.ev-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ev-modal-overlay.visible {
  display: flex;
}

.ev-modal {
  background: linear-gradient(135deg, rgba(17,29,48,0.98) 0%, rgba(13,20,33,0.99) 100%);
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: fadeIn 0.2s ease;
}

.ev-modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ev-modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
}

.ev-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,64,96,0.08);
  border: 1px solid rgba(255,64,96,0.2);
  color: var(--bad);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.ev-modal-close:hover {
  background: rgba(255,64,96,0.2);
  border-color: rgba(255,64,96,0.4);
}

.ev-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.ev-modal-body::-webkit-scrollbar { width: 4px; }
.ev-modal-body::-webkit-scrollbar-thumb { background: rgba(79,140,255,0.25); border-radius: 999px; }

.ev-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 600px) {
  .ev-modal-grid { grid-template-columns: 1fr; }
}

.ev-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   CHANGE HISTORY
═══════════════════════════════════════ */
.change-history-card {
  max-width: 100%;
}

.change-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.change-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(79, 140, 255, 0.04);
  border: 1px solid rgba(79, 140, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
  transition: background 0.15s;
}

.change-history-item:hover {
  background: rgba(79, 140, 255, 0.08);
}

.change-history-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.change-history-file {
  font-weight: 600;
  color: var(--accent);
  min-width: 110px;
}

.change-history-date {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
}

.change-history-label {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 232, 122, 0.1);
  color: var(--good);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.change-history-label.reload {
  background: rgba(255, 183, 77, 0.1);
  color: var(--warn);
}

/* ─── H2H Map Filter indicator ─── */
.h2h-map-filter-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(79, 140, 255, 0.1);
  border: 1px solid rgba(79, 140, 255, 0.2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

/* ════════════════════════════════════════════════════════
   EVENT DETAILS MODAL
════════════════════════════════════════════════════════ */

.ev-detail-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(6, 8, 15, 0.85);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.ev-detail-overlay.visible { opacity: 1; pointer-events: all; }

.ev-detail-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(900px, 96vw);
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  overflow: hidden;
}

.ev-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg3);
}
.ev-detail-header-left { display: flex; align-items: center; gap: 14px; }
.ev-detail-logo {
  width: 52px; height: 52px; object-fit: contain;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg);
}
.ev-detail-title {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--fg); letter-spacing: 0.3px;
}
.ev-detail-subtitle {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  margin-top: 3px;
}
.ev-detail-body {
  overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px;
}
.ev-detail-body::-webkit-scrollbar { width: 4px; }
.ev-detail-body::-webkit-scrollbar-thumb { background: rgba(79,140,255,.25); border-radius: 999px; }

/* Drive link */
.evd-drive-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px;
  background: rgba(79,140,255,0.1); border: 1px solid rgba(79,140,255,0.25);
  color: var(--accent); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: background 0.15s;
}
.evd-drive-link:hover { background: rgba(79,140,255,0.18); }

/* Section */
.evd-section { display: flex; flex-direction: column; gap: 10px; }
.evd-section-title {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  color: var(--muted); letter-spacing: 1px; text-transform: uppercase;
  border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 6px;
}

/* Results row */
.evd-results-row { display: flex; gap: 12px; flex-wrap: wrap; }
.evd-result-pill {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 18px; border-radius: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  flex: 1; min-width: 140px;
}
.evd-result-place { font-size: 11px; color: var(--muted); font-weight: 600; }
.evd-result-team { font-family: var(--font-display); font-size: 17px; font-weight: 700; }

/* Medal cards */
.evd-medals-row { display: flex; gap: 10px; flex-wrap: wrap; }
.evd-medal-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 16px; border-radius: 10px;
  background: var(--bg3); border: 1px solid var(--border);
  min-width: 100px; flex: 1;
}
.evd-medal-icon { font-size: 22px; }
.evd-medal-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.evd-medal-name { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--fg); text-align: center; }
.evd-medal-prize { font-family: var(--font-mono); font-size: 11px; color: var(--accent); margin-top: 2px; }

/* Prize distribution */
.evd-prize-grid { display: flex; flex-direction: column; gap: 6px; }
.evd-prize-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
}
.evd-prize-place { font-size: 13px; font-weight: 600; }
.evd-prize-amount { font-family: var(--font-mono); font-size: 14px; color: var(--accent); font-weight: 700; }

/* Playoff teams list (view mode) */
.evd-playoff-teams-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.evd-pt-chip {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  cursor: default; transition: border-color 0.15s;
}
.evd-pt-chip:hover { border-color: var(--accent); }
.evd-pt-logo { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; }
.evd-pt-seed { font-family: var(--font-mono); font-size: 10px; color: var(--muted2); }
.evd-pt-name { font-size: 13px; font-weight: 600; color: var(--fg); }

/* Players tooltip on hover */
.evd-pt-players {
  position: absolute; top: 100%; left: 0; z-index: 200;
  min-width: 160px; margin-top: 4px;
  background: #111d30; border: 1px solid var(--accent);
  border-radius: 8px; padding: 8px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.7);
  display: none; flex-direction: column;
}
.evd-pt-chip:hover .evd-pt-players { display: flex; }
.evd-pt-player {
  padding: 4px 12px; font-size: 12px; color: var(--fg);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.evd-pt-player:last-child { border-bottom: none; }

/* ════════════════════════════════════════════════════════
   PLAYOFF BRACKET (view mode)
════════════════════════════════════════════════════════ */
.bk-bracket {
  display: flex; gap: 0; overflow-x: auto;
  background: var(--bg); border-radius: 12px;
  border: 1px solid var(--border); padding: 16px;
}
.bk-col {
  display: flex; flex-direction: column; gap: 0;
  flex-shrink: 0;
}
.bk-col-title {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
  text-align: center; padding: 0 16px 10px;
}
.bk-match {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin: 6px 8px;
  background: var(--bg2);
}
.bk-team {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.bk-team:last-child { border-bottom: none; }
.bk-team-winner {
  background: rgba(79,140,255,0.08);
  color: var(--fg); font-weight: 700;
}
.bk-team-logo { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; flex-shrink: 0; }
.bk-team-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.bk-team-score {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--muted2); min-width: 20px; text-align: right;
}
.bk-team-winner .bk-team-score { color: var(--accent); }

/* SF + Final columns: vertically centered */
.bk-col:not(:first-child) {
  justify-content: space-around;
}
.bk-col-champion {
  justify-content: center; align-items: center;
  min-width: 130px;
}
.bk-champion {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 24px; border-radius: 12px;
  background: rgba(255,215,0,0.07); border: 2px solid rgba(255,215,0,0.3);
}
.bk-champion-icon { font-size: 28px; }
.bk-champion-name {
  font-family: var(--font-display); font-size: 15px; font-weight: 800;
  color: #FFD700; text-align: center;
}
.bk-champion-name.muted { color: var(--muted); font-weight: 400; }

/* ════════════════════════════════════════════════════════
   EDIT MODAL: new sections
════════════════════════════════════════════════════════ */
.ev-section-divider {
  grid-column: 1/-1; margin: 16px 0 4px;
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}

/* Playoff team rows in edit */
.ev-playoff-teams-grid { display: flex; flex-direction: column; gap: 6px; }
.ev-playoff-team-row {
  display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px; align-items: center;
}
.ev-pt-logo-wrap {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0;
}
.ev-pt-logo-wrap .ev-pt-logo {
  flex: 1; min-width: 0;
}
.ev-pt-upload-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
  background: var(--bg2); border: 1px solid var(--border);
  font-size: 14px; flex-shrink: 0; transition: background .15s, border-color .15s;
}
.ev-pt-upload-btn:hover {
  background: var(--bg3); border-color: var(--accent);
}
.ev-pt-clear-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 4px; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--muted2);
  font-size: 12px; flex-shrink: 0; transition: color .15s, border-color .15s;
  padding: 0;
}
.ev-pt-clear-btn:hover {
  color: var(--danger, #e74c3c); border-color: var(--danger, #e74c3c);
}
.ev-pt-logo-preview {
  width: 24px; height: 24px; object-fit: contain; border-radius: 4px;
  border: 1px solid var(--border); flex-shrink: 0; background: var(--bg);
}
.ev-playoff-seed {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted2); font-weight: 600;
}

/* Bracket edit */
.ev-bracket-edit { display: flex; flex-direction: column; gap: 12px; }
.ev-bracket-edit-section { display: flex; flex-direction: column; gap: 6px; }
.ev-bracket-edit-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px;
}
.ev-bracket-edit-matches { display: flex; flex-direction: column; gap: 6px; }
.ev-bk-match-row {
  display: grid; grid-template-columns: 1fr 50px 20px 50px 1fr;
  gap: 6px; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
}
.ev-bk-team-label {
  font-size: 12px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ev-bk-team-input {
  font-size: 12px; color: var(--text); padding: 4px 8px !important;
  min-width: 0; background: var(--bg2) !important; border-color: var(--border-bright) !important;
}
.ev-bk-team-input::placeholder { color: var(--muted2); }
.ev-bk-score { text-align: center; padding: 4px 8px !important; min-width: 0; }
.ev-bk-vs { font-family: var(--font-mono); font-size: 13px; color: var(--muted2); text-align: center; }

/* Players edit */
.ev-players-team-block {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; background: var(--bg); margin-bottom: 8px;
}
.ev-players-team-name {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  margin-bottom: 8px;
}
.ev-players-team-ref { color: var(--fg); font-weight: 700; }
.ev-players-inputs { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; }
@media (max-width: 600px) { .ev-players-inputs { grid-template-columns: 1fr 1fr; } }

/* Details button style */
.ev-btn-details {
  background: rgba(79,140,255,0.1); border: 1px solid rgba(79,140,255,0.25);
  color: var(--accent); padding: 6px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.15s; font-family: var(--font-display);
}
.ev-btn-details:hover { background: rgba(79,140,255,0.2); }

/* EV Modal body scrollable for new sections */
.ev-modal-body { max-height: 80vh; }

/* ═══════════════════════════════════════════════════════════════
   TEAM LOGOS
═══════════════════════════════════════════════════════════════ */
.team-logo {
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 2px;
}

.team-logo-sm {
  width: 20px;
  height: 20px;
  margin-right: 6px;
}

.team-logo-md {
  width: 28px;
  height: 28px;
  margin-right: 8px;
}

.team-logo-lg {
  width: 38px;
  height: 38px;
  margin-right: 10px;
}

.team-name-with-logo {
  display: inline-flex;
  align-items: center;
}

/* Ensure VS display team names accommodate logos */
.vs-team-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.h2h-team-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
