*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }

:root {
  --bg:          #181e2c;
  --bg-deep:     #131824;
  --panel:       #1f2638;
  --panel-alt:   #252d42;
  --border:      #2e3850;
  --border-sub:  #263044;
  --gold:        #F5C542;
  --gold-glow:   rgba(245,197,66,0.10);
  --green:       #4ADE80;
  --green-dim:   rgba(74,222,128,0.10);
  --red:         #F87171;
  --red-dim:     rgba(248,113,113,0.10);
  --blue:        #7EB8D4;
  --ct:          #131824;
  --ct-bg:       #235a95;
  --t:           #8b4206;
  --t-bg:        #F5C542;
  --text:        #dde3f0;
  --text-sub:    #7a8aaa;
  --text-muted:  #3e4e6a;
  --mono:        'IBM Plex Mono', monospace;
  --sans:        'Barlow', sans-serif;
  --cond:        'Barlow Condensed', sans-serif;
  /* legacy aliases so existing inline JS styles still resolve */
  --accent:      #F5C542;
  --surface:     #1f2638;
  --muted:       #3e4e6a;
  --text-dim:    #7a8aaa;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.25s ease forwards; }

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

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 24px;
  border-bottom: 2px solid var(--gold);
  background: var(--bg-deep);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
}
.logo-diamond {
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.logo-mix {
  color: var(--gold);
  font-family: var(--cond);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.06em;
  line-height: 1;
}
.logo-parser {
  color: var(--text-sub);
  font-family: var(--cond);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.06em;
  line-height: 1;
}
.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 24px;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: var(--text-sub);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  user-select: none;
  background: none;
  text-decoration: none;
}
.nav-link:hover { color: var(--gold); }
.nav-link.active { color: var(--gold); border-bottom-color: var(--gold); }

#back-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 3px 12px;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
#back-btn:hover { border-color: var(--gold); color: var(--gold); }

#admin-btn {
  margin-left: 16px;
  padding: 3px 12px;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.15s;
}
#admin-btn.logged-out {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-sub);
}
#admin-btn.logged-out:hover { border-color: var(--gold); color: var(--gold); }
#admin-btn.logged-in {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
}
#admin-btn.logged-in:hover { background: var(--red-dim); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
#app { padding: 16px 32px; width: 100%; }

/* ── Cards / Panels ──────────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 0;
  margin-bottom: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--border);
  font-family: var(--cond);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}
.card-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 16px;
  background: var(--gold);
  flex-shrink: 0;
}
.card-title.accent-blue::before  { background: var(--blue); }
.card-title.accent-red::before   { background: var(--red); }
.card-title.accent-green::before { background: var(--green); }

.card-body { padding: 14px 16px; }

/* ── Upload ──────────────────────────────────────────────────────────────── */
.upload-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}
.drop-zone {
  flex: 1;
  min-width: 220px;
  border: 1.5px dashed var(--border);
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.drop-zone input { display: none; }
#drop-label {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
}
.drop-zone:hover #drop-label,
.drop-zone.drag-over #drop-label { color: var(--gold); }
.parse-btn {
  padding: 12px 28px;
  background: var(--gold);
  color: #000;
  border: none;
  font-family: var(--cond);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.parse-btn:hover:not(:disabled) { opacity: 0.85; }
.parse-btn:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
#upload-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-sub);
  min-height: 1.2em;
  padding: 0 16px 8px;
}

/* ── Round timeline ──────────────────────────────────────────────────────── */
.rt-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: max-content;
}
.rt-label-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 80px;
  flex-shrink: 0;
}
.rt-label {
  font-family: var(--cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 18px;
}
.rt-label.top { color: var(--ct); }
.rt-label.bot { color: var(--t); }
.rt-score {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}
.rt-divider-space { height: 5px; }

.rt-timeline { display: flex; flex-direction: column; gap: 0; }
.rt-row { display: flex; align-items: flex-end; gap: 0; }
.rt-row.top { align-items: flex-end; }
.rt-row.bot { align-items: flex-start; }

.rt-seg { display: flex; gap: 2px; }
.rt-seg-sep { width: 1px; background: var(--border); margin: 0 4px; }
.rt-seg-sep.top { align-self: flex-end; height: 18px; }
.rt-seg-sep.bot { align-self: flex-start; height: 18px; }

.rt-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 10px;
  width: 18px;
}
.rt-sq {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  flex-shrink: 0;
}
.rt-sq.ct    { background: var(--ct); }
.rt-sq.t     { background: var(--t); }
.rt-sq.empty { background: transparent; }

.rt-pips {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 14px;
}
.rt-pip {
  width: 14px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
}
.rt-pip.ct       { background: var(--ct); }
.rt-pip.t        { background: var(--t); }
.rt-pip.ct.loser { background: color-mix(in srgb, var(--ct) 40%, transparent); }
.rt-pip.t.loser  { background: color-mix(in srgb, var(--t) 40%, transparent); }
.rt-pip.dead     { background: var(--border); }
.rt-rnum {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-muted);
  margin-top: 1px;
  line-height: 1;
}

.rt-mid-line {
  height: 3px;
  background: var(--border);
  margin: 1px 0;
}

.rt-row.icons {
  align-items: center;
}
.rt-icon-col {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 13px;
  flex-shrink: 0;
}

.rt-seg-labels {
  display: flex;
  align-items: center;
  margin-top: 4px;
  padding-left: 88px;
  min-width: max-content;
}
.rt-seg-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
}
.rt-seg-label-gap { width: 9px; flex-shrink: 0; }

.rt-sq {
  position: relative;
}

.rt-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  pointer-events: none;
}

/* ── Upload progress ─────────────────────────────────────────────────────── */
#upload-progress-wrap {
  padding: 0 16px 12px;
  display: none;
}
#upload-progress-wrap.visible { display: block; }

.upload-progress-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-sub);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--gold);
  transition: width 0.15s ease;
}
.progress-bar.phase-parse {
  background: var(--green);
}

/* parsing pulse on the bar */
.progress-bar.parsing {
  width: 100% !important;
  animation: parse-pulse 1.4s ease-in-out infinite;
}
@keyframes parse-pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.35; }
  100% { opacity: 1; }
}

.parse-dots::after {
  content: '';
  animation: dots 1.4s steps(3, end) infinite;
}
@keyframes dots {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}

.parse-spinner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-sub);
}
.parse-spinner.visible { display: flex; }

.spinner-ring {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Team Picker ─────────────────────────────────────────────────────────── */
.tp-counter { font-family: var(--mono); font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.tp-counter span { color: var(--gold); font-weight: 700; }
.tp-player-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 0 12px; }
@media (max-width: 600px) { .tp-player-list { grid-template-columns: repeat(2, 1fr); } }
.tp-row {
  display: flex; align-items: center;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  cursor: pointer; font-size: 0.82rem;
  transition: background 0.12s, border-color 0.12s;
  user-select: none; gap: 0.5rem;
}
.tp-row:hover { background: var(--panel-alt); }
.tp-row.selected { background: var(--panel-alt); border-color: var(--gold); }
.tp-row-check { width: 1rem; font-size: 0.72rem; color: var(--gold); visibility: hidden; flex-shrink: 0; }
.tp-row.selected .tp-row-check { visibility: visible; }
.tp-row-name { flex: 1; font-family: var(--sans); }
.tp-row.selected .tp-row-name { color: var(--gold); font-weight: 600; }
.tp-row-rating { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); min-width: 2.5rem; text-align: right; }
.tp-row.selected .tp-row-rating { color: var(--gold); opacity: 0.8; }
.tp-row-maps { display: none; }
.tp-row-remove { font-size: 0.72rem; color: var(--text-muted); opacity: 0; padding: 0 0.15rem; flex-shrink: 0; }
.tp-row:hover .tp-row-remove { opacity: 0.5; }
.tp-row-remove:hover { opacity: 1 !important; color: var(--text); }
.tp-action-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.tp-generate-btn {
  padding: 0.5rem 1.5rem; background: var(--gold); color: #000;
  border: none; font-family: var(--cond); font-weight: 900; font-size: 13px;
  letter-spacing: 0.1em; cursor: pointer; transition: opacity 0.15s;
}
.tp-generate-btn:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.tp-generate-btn:not(:disabled):hover { opacity: 0.85; }
.tp-captain-btn {
  padding: 0.5rem 1.5rem; background: transparent; color: var(--gold);
  border: 1px solid var(--gold); font-family: var(--cond); font-weight: 700; font-size: 13px;
  letter-spacing: 0.1em; cursor: pointer; transition: all 0.15s;
}
.tp-captain-btn:disabled { border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }
.tp-captain-btn:not(:disabled):hover { background: var(--gold); color: #000; }
.tp-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.5rem; }
@media (max-width: 600px) { .tp-teams { grid-template-columns: 1fr; } }
.tp-team { background: var(--bg-deep); padding: 1rem 1.25rem; border: 1px solid var(--border); }
.tp-team-title { font-family: var(--cond); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; margin-bottom: 0.75rem; }
.tp-team-a .tp-team-title { color: var(--ct); }
.tp-team-b .tp-team-title { color: var(--gold); }
.tp-team-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border-sub); font-size: 0.85rem; }
.tp-team-row-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-team-row-rating { min-width: 2.8rem; text-align: right; flex-shrink: 0; }
.tp-team-row:last-child { border-bottom: none; }
.tp-team-row-movable { cursor: pointer; padding-left: 0.25rem; padding-right: 0.25rem; transition: background 0.12s; }
.tp-team-row-movable:hover { background: var(--panel-alt); }
.tp-move-arrow { font-size: 0.7rem; color: var(--text-muted); opacity: 0; transition: opacity 0.12s; margin-left: 0.3rem; flex-shrink: 0; }
.tp-team-row-movable:hover .tp-move-arrow { opacity: 0.7; }
.tp-reset-btn { margin-left: auto; padding: 3px 10px; background: transparent; border: 1px solid var(--border); color: var(--text-muted); font-family: var(--cond); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; cursor: pointer; transition: all 0.15s; }
.tp-reset-btn:hover { border-color: var(--gold); color: var(--gold); }
.tp-manual-tag { color: var(--gold); font-size: 0.75em; margin-left: 0.4rem; opacity: 0.8; }
.tp-team-avg { margin-top: 0.6rem; font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); text-align: right; }
.tp-team-avg strong { color: var(--text); }
.tp-diff { text-align: center; margin-top: 1rem; font-family: var(--mono); font-size: 0.8rem; color: var(--text-muted); }
.tp-diff strong { color: var(--gold); }

/* ── Captain picker ──────────────────────────────────────────────────────── */
.tp-cap-header { display: flex; align-items: center; gap: 0.5rem; margin: 1.25rem 0 0.6rem; flex-wrap: wrap; }
.tp-cap-header-label { font-family: var(--mono); font-size: 0.82rem; color: var(--text-muted); flex: 1; }
.tp-cap-header .tp-reset-btn { margin-left: 0; }
.tp-cap-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 0.5rem; }
.tp-cap-row {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.65rem;
  border: 1px solid var(--border); background: var(--bg-deep);
  cursor: pointer; transition: background 0.12s, border-color 0.12s; font-size: 0.85rem;
}
.tp-cap-row:hover { background: var(--panel-alt); }
.tp-cap-row.cap-a { border-color: var(--ct); background: var(--ct-bg); }
.tp-cap-row.cap-b { border-color: var(--gold); background: rgba(245,197,66,0.05); }
.tp-cap-badge { width: 1.2rem; font-family: var(--cond); font-size: 0.7rem; font-weight: 700; text-align: center; flex-shrink: 0; color: var(--gold); }
.tp-cap-name { flex: 1; font-family: var(--sans); }

/* ── Draft board ─────────────────────────────────────────────────────────── */
.tp-draft-board { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
@media (max-width: 700px) { .tp-draft-board { grid-template-columns: 1fr; } }
.tp-draft-zone, .tp-draft-pool {
  background: var(--bg-deep); padding: 0.85rem 1rem;
  border: 2px dashed var(--border); min-height: 180px; transition: border-color 0.15s, background 0.15s;
}
.tp-draft-zone-a { border-color: rgba(126,184,212,0.2); }
.tp-draft-zone-b { border-color: rgba(245,197,66,0.12); }
.tp-draft-zone.drag-over { border-color: var(--gold); background: var(--gold-glow); }
.tp-draft-pool.drag-over { border-color: var(--text-muted); background: var(--panel-alt); }
.tp-draft-card {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem;
  font-size: 0.83rem; margin-bottom: 2px;
  border: 1px solid transparent; transition: background 0.1s, border-color 0.1s;
}
.tp-draft-card[draggable="true"] { cursor: grab; }
.tp-draft-card[draggable="true"]:hover { background: var(--panel-alt); border-color: var(--border); }
.tp-draft-card[draggable="true"]:active { cursor: grabbing; }
.tp-draft-captain { border-color: var(--border) !important; background: var(--panel); cursor: default; }
.tp-cap-label { font-family: var(--cond); font-size: 0.6rem; font-weight: 700; color: var(--gold); background: rgba(245,197,66,0.08); border: 1px solid var(--gold); padding: 0 0.25rem; flex-shrink: 0; }
.tp-draft-name { flex: 1; font-family: var(--sans); }
.tp-draft-count { font-weight: 400; opacity: 0.55; text-transform: none; letter-spacing: 0; font-size: 0.75em; margin-left: 0.3rem; }
.tp-draft-empty { color: var(--text-muted); font-family: var(--mono); font-size: 0.78rem; text-align: center; padding: 1rem 0; }
.tp-draft-pool-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.tp-draft-pool-header .tp-team-title { margin-bottom: 0; }
.tp-spin-btn { padding: 2px 8px; background: transparent; border: 1px solid var(--gold); color: var(--gold); font-family: var(--cond); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; cursor: pointer; transition: all 0.15s; }
.tp-spin-btn:hover { background: var(--gold); color: #000; }

/* ── Spinning wheel modal ────────────────────────────────────────────────── */
#tp-wheel-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.tp-wheel-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(3px); }
.tp-wheel-dialog {
  position: relative; z-index: 1; background: var(--panel); border: 1px solid var(--border);
  padding: 1.25rem 1.5rem; width: 360px; max-width: calc(100vw - 2rem);
  display: flex; flex-direction: column; gap: 1rem;
}
.tp-wheel-header { display: flex; align-items: center; justify-content: space-between; font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.tp-wheel-wrap { position: relative; display: flex; justify-content: center; align-items: flex-start; }
.tp-wheel-pointer {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 2;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--gold);
  filter: drop-shadow(0 0 4px var(--gold));
}
#tp-wheel-canvas { display: block; border-radius: 50%; }
.tp-wheel-result { min-height: 2rem; display: flex; align-items: center; justify-content: center; }
.tp-wheel-winner { font-family: var(--cond); font-size: 1.25rem; font-weight: 700; color: var(--gold); text-align: center; animation: tp-pop 0.3s ease-out; }
@keyframes tp-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.tp-nav-card {
  background: var(--panel); border: 1px solid var(--border);
  padding: 1.25rem 1.5rem; margin-bottom: 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.tp-nav-card:hover { border-color: var(--gold); background: var(--panel-alt); transform: translateY(-2px); }
.tp-nav-card:hover .tp-nav-icon,
.tp-nav-card:hover .tp-nav-label { color: var(--gold); }
.tp-nav-icon { font-size: 1.5rem; color: var(--text-muted); transition: color 0.2s; }
.tp-nav-label { font-family: var(--cond); font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); transition: color 0.2s; }
.tp-tabs { display: flex; gap: 4px; margin-top: 1.5rem; flex-wrap: wrap; align-items: center; }
.tp-tab {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.4rem 0.9rem; border: 1px solid var(--border);
  background: var(--bg-deep); color: var(--text-muted);
  font-family: var(--cond); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em;
  cursor: pointer; transition: all 0.15s; line-height: 1.3;
}
.tp-tab:hover { border-color: var(--gold); color: var(--text); }
.tp-tab.active { background: var(--gold); color: #000; border-color: var(--gold); }
.tp-tab-diff { font-size: 0.65rem; font-weight: 400; opacity: 0.7; }
.tp-tab.active .tp-tab-diff { opacity: 0.6; }
.tp-add-guest { margin: 0.75rem 0 1rem; padding: 0.5rem 0.75rem; background: var(--bg-deep); border: 1px solid var(--border); }
.tp-add-title { font-family: var(--cond); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--text-muted); margin-bottom: 0.4rem; }
.tp-add-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tp-add-row input[type="text"] { flex: 1; min-width: 100px; padding: 0.3rem 0.5rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); font-family: var(--mono); font-size: 0.78rem; }
.tp-slider-wrap { display: flex; align-items: center; gap: 0.4rem; }
.tp-slider-wrap input[type="range"] { width: 90px; accent-color: var(--gold); }
.tp-slider-wrap span { min-width: 2rem; font-family: var(--mono); font-size: 0.78rem; font-weight: 700; color: var(--gold); }
.tp-add-btn { padding: 0.3rem 0.75rem; background: var(--gold); color: #000; border: none; font-family: var(--cond); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; cursor: pointer; }
.tp-add-btn:hover { opacity: 0.85; }

/* ── Leaderboard table ───────────────────────────────────────────────────── */
.lb-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.lb-table thead tr { background: var(--bg-deep); }
.lb-table th {
  background: var(--bg-deep);
  color: var(--text-muted);
  padding: 8px 14px;
  text-align: left;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.lb-table th.right, .lb-table td.right { text-align: right; }
.lb-table th.sortable { cursor: pointer; user-select: none; }
.lb-table th.sortable:hover { color: var(--text-sub); }
.lb-table th.sort-active { color: var(--text-sub); }
.lb-sort-arrow { margin-left: 0.3em; opacity: 0.7; }
.stat-sub { color: var(--text-muted); font-size: 0.75em; }
.lb-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-sub); }
.lb-table tr:last-child td { border-bottom: none; }
.lb-table tbody tr:hover td { background: var(--panel-alt); }
.lb-table .rank { color: var(--text-muted); font-weight: 400; width: 2.5rem; }
.lb-table .player-name { font-family: var(--sans); font-weight: 600; }
.player-avatar-sm { width: 20px; height: 20px; border-radius: 3px; margin-right: 7px; vertical-align: middle; object-fit: cover; flex-shrink: 0; }
.player-avatar-md { width: 36px; height: 36px; border-radius: 4px; margin-right: 10px; vertical-align: middle; object-fit: cover; flex-shrink: 0; }
.player-avatar-full { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.lb-table .matches-count { font-family: var(--mono); color: var(--text-muted); font-size: 0.78rem; }
.lb-table .kd { font-size: 0.78rem; color: var(--text-sub); }

/* ── Match grid ──────────────────────────────────────────────────────────── */
.grid-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.75rem; }
.section-title { font-family: var(--cond); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text); }
.matches-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.matches-day-group { margin-bottom: 1.75rem; }
.matches-day-group:last-child { margin-bottom: 0; }
.matches-day-label {
  display: flex; align-items: baseline; gap: 0.6rem;
  margin-bottom: 0.65rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.matches-day-name { font-family: var(--cond); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text); }
.matches-day-count { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.matches-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 1rem; flex-wrap: wrap; }
.pg-btn {
  padding: 3px 12px; border: 1px solid var(--border); background: transparent;
  color: var(--text-sub); font-family: var(--cond); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; cursor: pointer; transition: border-color 0.15s, color 0.15s;
  min-width: 2rem; text-align: center;
}
.pg-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.pg-btn.active { border-color: var(--gold); color: var(--gold); }
.pg-btn:disabled { opacity: 0.3; cursor: default; }
.pg-info { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); margin: 0 0.5rem; }

.match-tile {
  background: var(--panel); border: 1px solid var(--border);
  padding: 1.1rem 1.5rem; cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  display: flex; flex-direction: column; gap: 0.5rem;
  position: relative; overflow: hidden;
}
.match-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.tile-map-img {
  position: absolute; top: 0; right: 0; bottom: 0; width: 45%;
  object-fit: cover; opacity: 0.7; pointer-events: none;
  mask-image: linear-gradient(to right, transparent, black 40%);
  -webkit-mask-image: linear-gradient(to right, transparent, black 40%);
}
.match-tile:hover .tile-map-img { opacity: 1; transition: opacity 0.2s; }
.tile-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.map-name { font-family: var(--cond); font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: 0.04em; text-transform: uppercase; }
.tile-date { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
.tile-sides { display: flex; gap: 0.5rem; align-items: center; font-family: var(--mono); font-size: 0.8rem; }
.side-ct { color: var(--ct); font-weight: 600; }
.side-t  { color: var(--t);  font-weight: 600; }
.side-sep { color: var(--text-muted); }
.tile-rounds { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); }
.tile-mvp {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.25rem; padding-top: 0.5rem;
  border-top: 1px solid var(--border); font-size: 0.8rem;
}
.mvp-label { color: var(--text-muted); font-family: var(--cond); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; }
.mvp-name { flex: 1; font-family: var(--sans); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-state { font-family: var(--mono); color: var(--text-muted); font-size: 0.9rem; padding: 2rem 0; text-align: center; }

.delete-btn {
  background: none; border: none; color: var(--border); cursor: pointer;
  font-size: 1rem; padding: 0.1rem 0.25rem; line-height: 1;
  transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.delete-btn:hover { color: var(--red); background: var(--red-dim); }

/* ── Rating colours ──────────────────────────────────────────────────────── */
.r-disaster  { color: #4a1111; font-weight: 800; text-shadow: 0 0 2px rgba(0,0,0,.9); }
.r-very-low  { color: #ff4d4d; font-weight: 700; }
.r-low       { color: #ff7a1a; font-weight: 700; }
.r-mid       { color: #ffbf00; font-weight: 700; }
.r-high      { color: #7dff8a; font-weight: 700; }
.r-very-high { color: #00e676; font-weight: 700; }
.r-elite     { color: #6cc8ff; font-weight: 800; text-shadow: 0 0 6px rgba(108,200,255,.25); }

/* ── Rating legend ───────────────────────────────────────────────────────── */
.rating-legend {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-left: auto;
  white-space: nowrap;
  flex-wrap: wrap;
}
.rating-legend span { display: inline-flex; gap: 0.4rem; align-items: center; }
.legend-name { color: var(--text-sub); }
.legend-label { color: var(--text-muted); }
.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.45);
}
.rating-legend .dot.r-elite      { background: #6cc8ff; box-shadow: 0 0 4px rgba(108,200,255,0.2); }
.rating-legend .dot.r-very-high  { background: #00e676; }
.rating-legend .dot.r-high       { background: #7dff8a; }
.rating-legend .dot.r-mid        { background: #ffbf00; }
.rating-legend .dot.r-low        { background: #ff7a1a; }
.rating-legend .dot.r-very-low   { background: #ff4d4d; }
.rating-legend .dot.r-disaster   { background: #4a1111; box-shadow: inset 0 0 4px rgba(0,0,0,0.6); }

/* ── Match detail ────────────────────────────────────────────────────────── */
.rating-board { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .rating-board { grid-template-columns: 1fr; } }
.rating-team h3 {
  font-family: var(--cond); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.3rem 0.75rem; margin-bottom: 0.5rem;
}
.rating-team.ct h3 { background: var(--ct-bg); color: var(--ct); }
.rating-team.t  h3 { background: var(--t-bg);  color: var(--t); }
.rating-row {
  display: flex; align-items: center;
  padding: 0.45rem 0.75rem; margin-bottom: 2px;
  background: var(--bg-deep); gap: 0.5rem;
}
.rating-row-name { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rating-row-meta { display: flex; gap: 0.6rem; font-family: var(--mono); font-size: 0.72rem; color: var(--text-sub); flex-wrap: wrap; }
.rating-row-meta b { color: var(--text); }
.rating-num { font-family: var(--mono); font-size: 1.05rem; font-weight: 800; min-width: 3rem; text-align: right; }
.formula-note { margin-top: 0.75rem; font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted); }

/* ── Collapsible sections ────────────────────────────────────────────────── */
.collapsible-hdr { cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; margin-bottom: 0 !important; }
.collapsible-hdr:hover { opacity: 0.8; }
.collapsible-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
.collapsible-body.open { grid-template-rows: 1fr; }
.collapsible-inner { overflow: hidden; }
.collapsible-inner > *:first-child { margin-top: 0.75rem; }
.chevron { font-size: 0.65rem; color: var(--text-muted); display: inline-block; transition: transform 0.25s ease; }
.collapsible-hdr.open .chevron { transform: rotate(90deg); }

.detail-tabs { display: flex; gap: 4px; margin-bottom: 1rem; }
.detail-tab {
  padding: 3px 12px; border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-family: var(--cond); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; cursor: pointer; transition: all 0.15s;
}
.detail-tab:hover { border-color: var(--gold); color: var(--text); }
.detail-tab.active { border-color: var(--gold); color: var(--gold); }
.ov-row {
  display: flex; align-items: center;
  padding: 0.65rem 0.75rem; margin-bottom: 2px;
  background: var(--bg-deep); gap: 0.5rem;
  transition: background 0.15s ease;
}
.ov-row:hover { background: color-mix(in srgb, var(--bg-deep) 88%, white); }
.ov-row-name { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-stat { display: flex; flex-direction: column; align-items: center; min-width: 3rem; }
.ov-stat-val { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; }
.ov-stat-lbl { font-family: var(--cond); font-size: 0.75rem; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.06em; }

.kv-grid { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1.25rem; font-family: var(--mono); font-size: 0.85rem; }
.kv-grid dt { color: var(--text-sub); }
.kv-grid dd { word-break: break-all; }

/* ── Match hero ──────────────────────────────────────────────────────────── */
.match-hero {
  position: relative; overflow: hidden;
  margin-bottom: 16px; min-height: 240px;
  display: flex; flex-direction: column; justify-content: center;
}
.match-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.match-hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, rgba(0,0,0,0.20) 0%, rgba(0,0,0,0.40) 60%, var(--bg) 100%);
}
.match-hero-content { position: relative; z-index: 2; padding: 1.5rem 1.75rem 1.75rem; }
.match-hero-map {
  font-family: var(--cond); font-size: 1.2rem; font-weight: 800; color: #fff;
  letter-spacing: 0.1em; margin-bottom: 0.75rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8); text-transform: uppercase;
  opacity: 0.7;
}
.match-hero-admin { float: right; }
.match-hero .kv-grid { font-size: 0.82rem; }
.match-hero .kv-grid dt { color: rgba(255,255,255,0.45); }
.match-hero .kv-grid dd { color: rgba(255,255,255,0.85); }
.match-hero-score {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; margin-top: 0.5rem;
  font-family: var(--cond); font-size: 5.5rem; font-weight: 900; line-height: 1;
  text-shadow: 0 3px 12px rgba(0,0,0,0.9);
}
.match-hero-score-sep { color: rgba(255,255,255,0.35); font-weight: 300; }
.score-win  { color: #fff; text-shadow: 0 0 16px rgba(245,197,66,0.25); }
.score-lose { color: rgba(255,255,255,0.38); }

.tag { display: inline-block; padding: 0.15rem 0.5rem; font-family: var(--cond); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.tag.ct  { background: var(--ct-bg); color: var(--ct); }
.tag.t   { background: var(--t-bg);  color: var(--t); }
.tag.hs  { background: var(--red-dim); color: var(--red); }

.table-wrap { overflow-x: auto; max-height: 340px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.82rem; }
th { background: var(--bg-deep); color: var(--text-muted); padding: 0.5rem 0.75rem; text-align: left; font-family: var(--cond); font-weight: 600; position: sticky; top: 0; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
td { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border-sub); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--panel-alt); }

.events-list { display: flex; flex-wrap: wrap; gap: 4px; }
.ev-badge { background: var(--bg-deep); border: 1px solid var(--border); padding: 0.2rem 0.5rem; font-family: var(--mono); font-size: 0.75rem; color: var(--text-sub); }

.stat-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stat {
  text-align: center;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  min-width: 4rem;
  cursor: default;
  transition: border-color 0.2s, transform 0.15s;
  position: relative;
}
.stat:hover { border-color: var(--gold); transform: translateY(-2px); }
.stat:hover .lbl { opacity: 1; }
.stat .num { font-family: var(--cond); font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat .lbl { font-family: var(--cond); font-size: 0.72rem; color: var(--gold); opacity: 0.65; margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.1em; display: flex; justify-content: center; align-items: center; gap: 4px; transition: opacity 0.2s; }

/* ── Charts ──────────────────────────────────────────────────────────────── */
.charts-row { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 720px) { .charts-row { grid-template-columns: 1fr; } }
.chart-wrap { position: relative; padding: 0 16px 14px; }
.chart-wrap canvas { display: block; max-width: 100%; }

.loading { font-family: var(--mono); color: var(--text-muted); text-align: center; padding: 4rem; font-size: 0.9rem; }
.error   { font-family: var(--mono); color: var(--red); text-align: center; padding: 2rem; }

.download-btn {
  padding: 3px 12px; font-family: var(--cond); font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  background: transparent; color: var(--gold); border: 1px solid var(--gold); cursor: pointer; transition: opacity 0.15s;
}
.download-btn:hover { opacity: 0.85; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--border); padding: 2rem 2.25rem; min-width: 320px; display: flex; flex-direction: column; gap: 1rem; }
.modal h2 { font-family: var(--cond); font-size: 14px; font-weight: 800; color: var(--gold); letter-spacing: 0.12em; text-transform: uppercase; }
.modal input[type=password],
.modal input[type=text] {
  width: 100%; padding: 0.55rem 0.8rem;
  background: var(--bg-deep); border: 1px solid var(--border);
  color: var(--text); font-family: var(--mono); font-size: 0.9rem;
}
.modal input:focus { outline: none; border-color: var(--gold); }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }
.modal-actions button { padding: 0.45rem 1.1rem; font-family: var(--cond); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; cursor: pointer; transition: all 0.15s; }
.btn-cancel { background: none; border: 1px solid var(--border); color: var(--text-sub); }
.btn-cancel:hover { border-color: var(--gold); color: var(--gold); }
.btn-login  { background: var(--gold); border: none; color: #000; }
.btn-login:hover { opacity: 0.85; }
#login-error { font-family: var(--mono); font-size: 0.8rem; color: var(--red); min-height: 1em; }

/* ── Post-parse date confirm modal ───────────────────────────────────────── */
.btn-confirm { background: var(--green); border: none; color: #000; }
.btn-confirm:hover { opacity: 0.85; }
#date-modal .modal { min-width: 360px; }
#date-modal .match-summary {
  font-family: var(--mono); font-size: 11px; color: var(--text-sub);
  background: var(--bg-deep); border: 1px solid var(--border);
  padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.25rem;
}
#date-modal .match-summary strong { color: var(--text); }
#date-modal input[type=date] {
  width: 100%; padding: 0.55rem 0.8rem;
  background: var(--bg-deep); border: 1px solid var(--border);
  color: var(--text); font-family: var(--mono); font-size: 0.9rem;
  cursor: pointer;
}
#date-modal input[type=date]:focus { outline: none; border-color: var(--gold); }
#date-modal label { font-family: var(--mono); font-size: 10px; color: var(--text-sub); }

/* ── Season tabs ─────────────────────────────────────────────────────────── */
.season-tabs { display: flex; gap: 4px; padding: 10px 16px 0; flex-wrap: wrap; align-items: center; }
.season-tab {
  padding: 3px 12px; border: 1px solid var(--border); background: transparent;
  color: var(--text-sub); font-family: var(--cond); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap; text-transform: uppercase;
}
.season-tab:hover { border-color: var(--gold); color: var(--text); }
.season-tab.active { background: var(--gold); color: #000; border-color: var(--gold); }
.season-tab.live::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  background: var(--green); border-radius: 50%; margin-left: 5px; vertical-align: middle;
}
.season-summary-link { font-family: var(--mono); font-size: 0.72rem; color: var(--gold); cursor: pointer; margin-left: auto; opacity: 0.8; white-space: nowrap; }
.season-summary-link:hover { opacity: 1; text-decoration: underline; }

/* ── Title badges ────────────────────────────────────────────────────────── */
.title-badge {
  display: inline-block; font-size: 0.75rem; padding: 0.05rem 0.2rem;
  border: 1px solid var(--border); margin-left: 0.25rem; cursor: default;
  white-space: nowrap; transition: border-color 0.15s; vertical-align: middle; line-height: 1.3;
}
.title-badge:hover { border-color: var(--gold); }

/* ── Player title badges ─────────────────────────────────────────────────── */
.player-title-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
  padding: 0.25rem 0.6rem; border: 1px solid var(--border);
  background: var(--bg-deep); color: var(--text); cursor: default;
  white-space: nowrap; transition: border-color 0.15s;
}
.player-title-badge:hover { border-color: var(--gold); }
.player-title-season { font-size: 0.65rem; font-weight: 400; color: var(--text-muted); border-left: 1px solid var(--border); padding-left: 0.35rem; }

/* ── Season summary page ─────────────────────────────────────────────────── */
.awards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.9rem; margin-top: 0.5rem; }
.award-card { background: var(--bg-deep); border: 1px solid var(--border); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.award-label { font-family: var(--cond); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); }
.award-player { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--text); cursor: pointer; }
.award-player:hover { color: var(--gold); }
.award-flavor { font-family: var(--mono); font-size: 0.75rem; color: var(--text-sub); line-height: 1.45; }
.award-stat { font-family: var(--mono); font-size: 0.85rem; font-weight: 700; color: var(--gold); margin-top: 0.15rem; }
.season-hero { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.season-hero-meta { font-family: var(--mono); color: var(--text-sub); font-size: 0.85rem; margin-top: 0.2rem; }
.season-hero-stats { display: flex; gap: 2rem; }
.season-hero-stat-num { font-family: var(--cond); font-size: 1.6rem; font-weight: 700; color: var(--gold); line-height: 1; }
.season-hero-stat-lbl { font-family: var(--cond); font-size: 0.72rem; color: var(--text-sub); margin-top: 0.15rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* ── Seasons list page ───────────────────────────────────────────────────── */
.seasons-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.seasons-list-card { background: var(--bg-deep); border: 1px solid var(--border); padding: 1rem 1.1rem; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.seasons-list-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.seasons-list-live { font-family: var(--cond); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; background: var(--green-dim); color: var(--green); border: 1px solid var(--green); padding: 0.05rem 0.35rem; }

/* ── Maps page ───────────────────────────────────────────────────────────── */
.maps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.map-card { background: var(--bg-deep); border: 1px solid var(--border); overflow: hidden; transition: border-color 0.15s, transform 0.15s; }
.map-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.map-card-img-wrap { height: 120px; overflow: hidden; }
.map-card-img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; transition: opacity 0.2s; }
.map-card:hover .map-card-img { opacity: 1; }
.map-card-body { padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.map-card-name { font-family: var(--cond); font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); margin-bottom: 0.3rem; }
.map-stat-row { display: flex; align-items: baseline; gap: 0.4rem; font-size: 0.8rem; }
.map-stat-label { font-family: var(--cond); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); width: 6rem; flex-shrink: 0; }
.map-stat-value { font-family: var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.map-stat-aside { font-family: var(--mono); font-size: 0.75rem; color: var(--text-sub); flex-shrink: 0; }
.map-king { cursor: pointer; color: var(--gold) !important; font-weight: 600; }
.map-king:hover { text-decoration: underline; }
.map-side-bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin-top: 0.5rem; background: var(--border); }
.map-side-ct { background: var(--ct-bg); height: 100%; transition: width 0.3s; }
.map-side-t  { background: var(--t-bg);  height: 100%; transition: width 0.3s; }
.map-side-labels { display: flex; justify-content: space-between; margin-top: 0.2rem; }
.map-side-label { font-family: var(--mono); font-size: 0.68rem; }
.map-side-label.ct { color: var(--ct-bg); }
.map-side-label.t  { color: var(--t-bg); }

/* ── Players list page ───────────────────────────────────────────────────── */
.players-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; }
.players-table thead tr { background: var(--bg-deep); }
.players-table th { padding: 8px 16px; text-align: left; font-family: var(--cond); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-sub); border-bottom: 1px solid var(--border); white-space: nowrap; }
.players-table td { padding: 10px 16px; border-bottom: 1px solid var(--border-sub); }
.players-table tr:last-child td { border-bottom: none; }
.players-row { cursor: pointer; }
.players-row:hover td { background: var(--panel-alt); }
.players-name { font-family: var(--sans); font-weight: 600; color: var(--accent); display: flex; align-items: center; }
.players-maps { color: var(--text-sub); }

/* ── Admin season management ─────────────────────────────────────────────── */
.admin-season-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.admin-season-row:last-of-type { border-bottom: none; }
.admin-season-btn { padding: 3px 12px; border: 1px solid var(--border); background: transparent; color: var(--text-sub); font-family: var(--cond); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; cursor: pointer; transition: border-color 0.15s, color 0.15s; white-space: nowrap; }
.admin-season-btn:hover { border-color: var(--gold); color: var(--gold); }
.admin-season-btn.danger { border-color: rgba(248,113,113,0.3); color: var(--red); }
.admin-season-btn.danger:hover { border-color: var(--red); }
.admin-season-btn:disabled { opacity: 0.4; cursor: not-allowed; }
