/* ===========================
   PokéELO — Main Stylesheet
   =========================== */

:root {
  --bg:           #0d0f18;
  --bg-2:         #12151f;
  --bg-card:      #181c2a;
  --bg-card-2:    #1e2235;
  --bg-hover:     #222640;
  --border:       #272c42;
  --border-mid:   #30375a;
  --border-hi:    #404878;
  --text:         #e8eaf6;
  --text-sub:     #9ba3c0;
  --text-dim:     #555d7a;
  --accent:       #7c6af7;
  --accent-2:     #9c8df9;
  --accent-dim:   rgba(124,106,247,0.12);
  --accent-glow:  rgba(124,106,247,0.25);
  --green:        #34d399;
  --green-dim:    rgba(52,211,153,0.15);
  --red:          #f87171;
  --red-dim:      rgba(248,113,113,0.15);
  --yellow:       #fbbf24;
  --gold:         #f59e0b;
  --gold-dim:     rgba(245,158,11,0.15);
  --silver:       #94a3b8;
  --silver-dim:   rgba(148,163,184,0.15);
  --bronze:       #c97c3a;
  --bronze-dim:   rgba(201,124,58,0.15);
  --blue:         #60a5fa;
  --blue-dim:     rgba(96,165,250,0.15);
  --purple:       #a78bfa;
  --radius:       14px;
  --radius-sm:    8px;
  --radius-xs:    5px;
  --shadow:       0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm:    0 2px 12px rgba(0,0,0,0.3);
  --font:         'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
img { display: inline-block; vertical-align: middle; }

/* ───────────────────────────
   Scrollbar
────────────────────────────*/
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

/* ───────────────────────────
   Navbar
────────────────────────────*/
.navbar {
  background: rgba(18, 21, 31, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--accent), #4f3de8);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 16px var(--accent-glow);
}

.nav-brand:hover .brand-icon { box-shadow: 0 0 24px var(--accent-glow); }

.nav-tabs { display: flex; gap: 2px; }

.nav-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-tab i { font-size: 0.8rem; }
.nav-tab:hover { color: var(--text); background: var(--bg-card-2); }
.nav-tab.active { color: var(--accent-2); background: var(--accent-dim); }

.nav-right { margin-left: auto; }

/* Navbar search */
.search-mini {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  gap: 8px;
  width: 210px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-mini:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-mini > i { color: var(--text-dim); font-size: 0.78rem; flex-shrink: 0; }

.search-mini input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.85rem;
  width: 100%;
  font-family: var(--font);
}

.search-mini input::placeholder { color: var(--text-dim); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: none;
  z-index: 300;
  overflow: hidden;
  min-width: 240px;
}

.search-dropdown.visible { display: block; }

.search-dropdown-label {
  padding: 7px 12px 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  font-weight: 600;
}

.search-result-item {
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

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

.search-result-name { font-size: 0.875rem; font-weight: 500; }
.search-result-meta { font-size: 0.78rem; color: var(--text-sub); }
.search-result-elo {
  font-size: 0.8rem;
  color: var(--accent-2);
  font-weight: 600;
  font-family: var(--font-display);
}

.search-no-results {
  padding: 14px 12px;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

/* ───────────────────────────
   Page layout
────────────────────────────*/
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px 100px;
}

/* ───────────────────────────
   Hero header
────────────────────────────*/
.page-header {
  padding: 44px 0 28px;
  position: relative;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0; left: -28px; right: -28px;
  height: 200px;
  background: radial-gradient(ellipse 60% 100% at 30% 0%, rgba(124,106,247,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.page-title i { color: var(--accent-2); font-size: 1.6rem; }

.page-subtitle {
  color: var(--text-sub);
  font-size: 0.95rem;
  max-width: 560px;
}

/* ───────────────────────────
   Stats bar
────────────────────────────*/
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-chip i { color: var(--accent-2); font-size: 0.75rem; }
.stat-chip strong { color: var(--text); }

/* ───────────────────────────
   Podium
────────────────────────────*/
.podium-section {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin: 0 0 36px;
}

.podium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 22px;
  text-align: center;
  width: 190px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.podium-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: inherit;
}

.podium-card:hover { transform: translateY(-5px); }
.podium-card:hover::before { opacity: 1; }

.podium-1 {
  width: 210px;
  background: linear-gradient(160deg, rgba(245,158,11,0.06) 0%, var(--bg-card) 60%);
  border-color: rgba(245,158,11,0.25);
  padding-bottom: 30px;
}
.podium-1:hover { box-shadow: 0 12px 40px rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.4); }
.podium-2 { background: linear-gradient(160deg, rgba(148,163,184,0.06) 0%, var(--bg-card) 60%); border-color: rgba(148,163,184,0.2); }
.podium-2:hover { box-shadow: 0 12px 40px rgba(148,163,184,0.1); border-color: rgba(148,163,184,0.4); }
.podium-3 { background: linear-gradient(160deg, rgba(201,124,58,0.06) 0%, var(--bg-card) 60%); border-color: rgba(201,124,58,0.2); }
.podium-3:hover { box-shadow: 0 12px 40px rgba(201,124,58,0.1); border-color: rgba(201,124,58,0.4); }

.podium-crown {
  color: var(--gold);
  font-size: 1.3rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 8px rgba(245,158,11,0.4));
}

.podium-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--bg);
}

.podium-name {
  font-weight: 600;
  font-size: 0.925rem;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-elo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.podium-elo.champ-pts { font-size: 1.25rem; }
.podium-elo small { font-size: 0.65rem; color: var(--text-sub); font-weight: 400; margin-left: 1px; }

.podium-meta { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; }

/* ───────────────────────────
   Season selector
────────────────────────────*/
.season-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.season-label {
  color: var(--text-dim);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.season-chip {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-sub);
  transition: all 0.15s;
}

.season-chip:hover { border-color: var(--accent); color: var(--text); }
.season-chip.active { background: var(--accent-dim); border-color: rgba(124,106,247,0.4); color: var(--accent-2); font-weight: 600; }

/* ───────────────────────────
   Table section wrapper
────────────────────────────*/
.table-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Controls row */
.table-controls {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  gap: 8px;
  flex: 1;
  max-width: 340px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-field > i { color: var(--text-dim); font-size: 0.78rem; flex-shrink: 0; }

.search-field input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.875rem;
  width: 100%;
  font-family: var(--font);
}

.search-field input::placeholder { color: var(--text-dim); }

.search-clear {
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s;
}
.search-clear:hover { color: var(--text); background: var(--border); }

.type-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--font);
  outline: none;
}

.type-filter:focus { border-color: var(--accent); }

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: var(--font);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary:hover { background: var(--accent-2); }
.btn-primary:active { transform: scale(0.97); }

.table-meta {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ───────────────────────────
   Table
────────────────────────────*/
.table-wrapper { overflow-x: auto; }

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.leaderboard-table th {
  padding: 9px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-2);
}

.leaderboard-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.leaderboard-table tbody tr:last-child td { border-bottom: none; }

.player-row { transition: background 0.1s; cursor: pointer; }
.player-row:hover { background: var(--bg-hover); }

/* Rank column */
.col-rank { width: 56px; text-align: center; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.82rem;
  font-family: var(--font-display);
}

.rank-1 { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(245,158,11,0.35); }
.rank-2 { background: var(--silver-dim); color: var(--silver); border: 1px solid rgba(148,163,184,0.35); }
.rank-3 { background: var(--bronze-dim); color: var(--bronze); border: 1px solid rgba(201,124,58,0.35); }
.rank-num { color: var(--text-dim); font-size: 0.82rem; }

/* Player cell */
.player-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: color 0.15s;
}
.player-link:hover { color: var(--accent-2) !important; }

.flag {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  opacity: 0.9;
}

/* ELO value */
.elo-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.peak-value { color: var(--text-sub); font-size: 0.875rem; }
.peak-value.at-peak { color: var(--gold); font-weight: 600; }

/* Record */
.record { display: flex; align-items: center; gap: 3px; font-size: 0.82rem; }
.wins { color: var(--green); font-weight: 600; }
.losses { color: var(--red); font-weight: 600; }
.ties { color: var(--text-sub); }
.sep { color: var(--border-mid); margin: 0 1px; }

/* Win rate */
.wr-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 64px; }
.wr-bar {
  width: 64px; height: 5px;
  background: var(--border-mid);
  border-radius: 3px;
  overflow: hidden;
}
.wr-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #6ee7b7);
  border-radius: 3px;
}
.wr-label { font-size: 0.76rem; color: var(--text-sub); }

/* Championship points */
.pts-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-2);
  letter-spacing: -0.01em;
}

.best-pts { color: var(--yellow); font-weight: 600; font-size: 0.875rem; }

/* Event chips */
.event-chips { display: flex; flex-wrap: wrap; gap: 4px; }

.event-chip {
  background: var(--accent-dim);
  border: 1px solid rgba(124,106,247,0.2);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
  font-size: 0.74rem;
  color: var(--accent-2);
  font-weight: 600;
}

.event-chip.more {
  background: var(--bg-card-2);
  border-color: var(--border);
  color: var(--text-dim);
  font-weight: 400;
}

/* Event type badges */
.event-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-worlds        { background: rgba(124,106,247,0.15); color: var(--accent-2); border: 1px solid rgba(124,106,247,0.3); }
.badge-international { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96,165,250,0.3); }
.badge-regional      { background: var(--gold-dim); color: var(--yellow); border: 1px solid rgba(251,191,36,0.3); }
.badge-special       { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,0.3); }
.badge-open          { background: rgba(251,146,60,0.12); color: #fb923c; border: 1px solid rgba(251,146,60,0.3); }
.badge-cup           { background: var(--silver-dim); color: var(--silver); border: 1px solid rgba(148,163,184,0.3); }
.badge-unknown, .badge-  { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }

/* Source badges */
.source-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.68rem;
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.source-rk9 { border-color: rgba(248,113,113,0.3); color: #fca5a5; background: rgba(248,113,113,0.06); }
.source-limitless { border-color: rgba(124,106,247,0.3); color: var(--accent-2); background: var(--accent-dim); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-sub);
}
.empty-state i { font-size: 2.2rem; margin-bottom: 14px; display: block; opacity: 0.25; }
.empty-state p { font-size: 0.975rem; margin-bottom: 12px; color: var(--text-sub); }
.empty-state a { color: var(--accent-2); }

/* Events table specific */
.event-name-cell { max-width: 300px; }
.event-link { display: inline-flex; align-items: center; gap: 5px; }
.ext-icon { font-size: 0.65rem; color: var(--text-dim); }

/* ───────────────────────────
   Pagination
────────────────────────────*/
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--bg-2);
}

.page-btn, .page-num {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  border: 1px solid var(--border);
  color: var(--text-sub);
  transition: all 0.15s;
}

.page-btn:hover, .page-num:hover {
  background: var(--bg-card-2);
  color: var(--text);
  border-color: var(--border-mid);
}

.page-num.active {
  background: var(--accent-dim);
  color: var(--accent-2);
  border-color: rgba(124,106,247,0.35);
  font-weight: 600;
}

.page-numbers { display: flex; gap: 3px; }
.page-ellipsis { padding: 5px 3px; color: var(--text-dim); font-size: 0.82rem; }

/* ───────────────────────────
   Player profile
────────────────────────────*/
.player-header {
  border-bottom: 1px solid var(--border);
  padding: 36px 0;
  margin: 0 -28px 0;
  padding-left: 28px;
  padding-right: 28px;
  background: linear-gradient(180deg, rgba(124,106,247,0.05) 0%, transparent 100%);
}

.player-header-inner { max-width: 1440px; margin: 0 auto; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 22px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent-2); }
.back-link i { font-size: 0.75rem; }

.player-hero { display: flex; align-items: center; gap: 22px; }

.player-avatar-lg {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #4f3de8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 32px var(--accent-glow);
}

.player-name-lg {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.flag-lg { width: 24px; height: 18px; border-radius: 2px; object-fit: cover; }

.player-stats-hero { display: flex; gap: 28px; flex-wrap: wrap; }

.hero-stat { }
.hero-stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.hero-stat-value.elo-big { color: var(--accent-2); }
.hero-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 5px;
}

.record-inline { display: flex; align-items: center; gap: 4px; font-size: 1.2rem; }

/* Player content */
.player-content { padding: 32px 0; }

.player-cols {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

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

.section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.section-title i { color: var(--accent-2); }

/* Event history list */
.event-history { display: flex; flex-direction: column; gap: 6px; }

.event-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.event-row:hover { border-color: var(--border-mid); background: var(--bg-card-2); }

.event-row-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.event-row-name { font-weight: 500; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 3px;
  flex-wrap: wrap;
}
.event-row-meta i { font-size: 0.65rem; }

.event-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }

.placement-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 2px 9px;
  border-radius: var(--radius-xs);
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.place-1 { background: var(--gold-dim); color: var(--gold); border-color: rgba(245,158,11,0.35); }
.place-2 { background: var(--silver-dim); color: var(--silver); border-color: rgba(148,163,184,0.35); }
.place-3 { background: var(--bronze-dim); color: var(--bronze); border-color: rgba(201,124,58,0.35); }

.event-record { font-size: 0.78rem; }
.ev-champ-pts { font-size: 0.78rem; color: var(--accent-2); font-weight: 600; }
.ev-champ-pts small { font-weight: 400; color: var(--text-dim); font-size: 0.68rem; }

/* Side cards */
.side-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.champ-seasons { display: flex; flex-direction: column; gap: 6px; }

.champ-season-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.season-name { font-weight: 600; font-size: 0.875rem; flex: 1; }
.season-events { font-size: 0.75rem; color: var(--text-dim); }
.season-pts { font-family: var(--font-display); font-weight: 700; color: var(--accent-2); font-size: 1rem; }

/* H2H */
.h2h-list { display: flex; flex-direction: column; gap: 10px; }

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

.h2h-name {
  font-size: 0.845rem;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h2h-name:hover { color: var(--accent-2); }

.h2h-record { font-size: 0.78rem; white-space: nowrap; }

.h2h-bar {
  width: 52px; height: 4px;
  background: var(--border-mid);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.h2h-win-fill { height: 100%; background: var(--green); border-radius: 2px; }

/* ───────────────────────────
   Live banner & delta badges
────────────────────────────*/
.live-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 0;
}

.live-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: 0.02em;
  transition: all 0.15s;
  animation: liveglow 2.5s ease-in-out infinite;
}

.live-btn:hover { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.6); color: #fca5a5; }

@keyframes liveglow {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 12px 2px rgba(239,68,68,0.15); }
}

.live-dot {
  width: 7px; height: 7px;
  background: #ef4444;
  border-radius: 50%;
  display: inline-block;
  animation: livepulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes livepulse { 0%,100%{opacity:1;} 50%{opacity:0.25;} }

.season-title-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(124,106,247,0.3);
  border-radius: 6px;
  color: var(--accent-2);
  vertical-align: middle;
  margin-left: 8px;
}

.delta-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}

.delta-pos { color: var(--green); background: var(--green-dim); }
.delta-neg { color: var(--red); background: var(--red-dim); }
.delta-zero-txt { color: var(--text-dim); font-size: 0.8rem; }

.ev-elo-delta {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.ev-elo-delta.delta-pos { color: var(--green); background: var(--green-dim); }
.ev-elo-delta.delta-neg { color: var(--red); background: var(--red-dim); }
.ev-elo-delta.delta-zero { color: var(--text-dim); }

/* Admin live event styles */
.btn-live {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.35);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-live:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.6); }

.live-events-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.live-event-item { display: flex; align-items: center; justify-content: space-between; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; gap: 10px; }
.live-event-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.live-status-open { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); border-radius: 4px; padding: 1px 7px; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }
.live-status-closed { background: var(--bg-card-2); color: var(--text-dim); border: 1px solid var(--border); border-radius: 4px; padding: 1px 7px; font-size: 0.72rem; font-weight: 600; flex-shrink: 0; }
.live-event-name { font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-event-name:hover { color: var(--accent-2); }
.live-event-id { font-size: 0.72rem; color: var(--text-dim); font-family: monospace; flex-shrink: 0; }
.btn-close-live { background: transparent; border: 1px solid var(--border); color: var(--text-dim); border-radius: 4px; padding: 3px 10px; font-size: 0.78rem; cursor: pointer; font-family: var(--font); transition: all 0.15s; }
.btn-close-live:hover { border-color: rgba(248,113,113,0.4); color: var(--red); }

/* ───────────────────────────
   Footer
────────────────────────────*/
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 22px 28px;
  text-align: center;
}

.footer-inner { max-width: 1440px; margin: 0 auto; }
.site-footer p { font-size: 0.82rem; color: var(--text-dim); line-height: 1.8; }
.footer-sub a { color: var(--text-sub); }
.footer-sub a:hover { color: var(--accent-2); }
.footer-sync { font-size: 0.74rem; margin-top: 2px; }

/* ───────────────────────────
   Error page
────────────────────────────*/
.error-page { text-align: center; padding: 100px 20px; }
.error-icon { font-size: 3rem; margin-bottom: 16px; }
.error-page h1 { font-family: var(--font-display); font-size: 6rem; font-weight: 700; color: var(--accent-2); margin-bottom: 12px; letter-spacing: -0.05em; line-height: 1; }
.error-page p { font-size: 1.05rem; color: var(--text-sub); margin-bottom: 28px; }

/* ───────────────────────────
   Responsive
────────────────────────────*/
@media (max-width: 768px) {
  .nav-inner { padding: 0 16px; gap: 12px; }
  .nav-tab span { display: none; }
  .nav-tab { padding: 6px 10px; }
  .search-mini { width: 130px; }

  .main-content { padding: 0 16px 60px; }
  .page-header { padding: 28px 0 20px; }
  .page-title { font-size: 1.5rem; }

  .podium-section { gap: 6px; }
  .podium-card { width: 110px; padding: 12px 8px 14px; }
  .podium-1 { width: 128px; }
  .podium-avatar { width: 40px; height: 40px; font-size: 1rem; }
  .podium-elo { font-size: 1.1rem; }
  .podium-name { font-size: 0.8rem; }

  .col-peak, .col-events, .col-wr { display: none; }

  .player-header { margin: 0 -16px; padding: 24px 16px; }
  .player-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .player-name-lg { font-size: 1.4rem; }
  .player-stats-hero { gap: 18px; }
  .hero-stat-value { font-size: 1.3rem; }
}
