/* ========== Theme — World of Tanks Blitz inspired ========== */
:root {
  --bg-0: #0a0e14;
  --bg-1: #11171f;
  --bg-2: #1a232f;
  --bg-3: #243042;
  --line: #2a3548;
  --text: #e8edf2;
  --text-dim: #8a96a8;
  --muted: #6a7588;
  --accent: #f0c040;       /* gold */
  --accent-dim: #c79a2a;
  --accent-glow: rgba(240, 192, 64, 0.25);
  --team-a: #4aa8ff;
  --team-b: #e84a5f;
  --ok: #5fcf6a;
  --warn: #f0a040;
  --bad: #e84a5f;
  --shadow: 0 8px 28px rgba(0,0,0,0.45);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Subtle pattern in background */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse at top, rgba(240,192,64,0.05), transparent 60%),
    linear-gradient(180deg, var(--bg-0), #050709);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.accent { color: var(--accent); }

/* ========== Brand / header ========== */
.brand {
  text-align: center;
  padding: 36px 20px 12px;
  position: relative;
}
.brand h1 {
  font-size: 2.2rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: 0;
  font-weight: 800;
}
.brand h1 .accent {
  background: linear-gradient(180deg, #ffd76a, #c79a2a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand p { margin: 4px 0 0; color: var(--text-dim); letter-spacing: 1px; font-size: 0.9rem; }
.brand-mark {
  display: inline-flex; gap: 4px; margin-bottom: 12px;
}
.brand-mark-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ========== Layout ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px; }
.footer { text-align: center; padding: 28px 16px; font-size: 0.85rem; }

/* ========== Cards ========== */
.card {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 16px;
  font-size: 1.3rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}
.card h3 {
  margin: 16px 0 10px; font-size: 1rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim);
}

/* ========== Forms ========== */
.row { display: flex; gap: 16px; margin-bottom: 16px; }
.row.two-cols > label { flex: 1; }
label > span {
  display: block;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-dim); margin-bottom: 6px;
}
input[type="text"], select {
  width: 100%; padding: 10px 12px;
  background: var(--bg-0); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary, .btn-secondary, .btn-link {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 12px 22px;
  transition: transform 0.05s, filter 0.15s, box-shadow 0.15s;
}
.btn-primary {
  background: linear-gradient(180deg, #ffd76a, #c79a2a);
  color: #1a1100;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { filter: grayscale(0.7); cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--line); }
.btn-link {
  background: none; color: var(--accent); padding: 4px 8px;
  font-size: 0.8rem; text-transform: none; letter-spacing: 0;
}
.btn-link:hover { text-decoration: underline; }

.error-msg { color: var(--bad); margin-top: 8px; font-size: 0.9rem; min-height: 1.2em; }

/* ========== Pool selection (home page) ========== */
.pool-header {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.pool-meta { color: var(--text-dim); font-size: 0.85rem; }
.pool-meta span { color: var(--accent); font-weight: 700; }

.map-pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.pool-cell {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--line);
  height: 90px;
  display: flex;
  align-items: flex-end;
  transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
}
.pool-cell .map-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.pool-cell .map-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.85));
}
.pool-cell .map-name {
  position: relative; padding: 8px 10px; font-weight: 700; font-size: 0.85rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.pool-cell.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.pool-cell.selected::after {
  content: '✓';
  position: absolute; top: 6px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #1a1100;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 900;
}

/* ========== Result links ========== */
.link-list { list-style: none; padding: 0; margin: 16px 0; }
.link-list li {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--bg-0); border: 1px solid var(--line);
  border-radius: 6px;
}
.link-list .role-tag {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 700; padding: 4px 8px; border-radius: 4px;
  text-align: center;
}
.role-tag.team-a { background: rgba(74,168,255,0.15); color: var(--team-a); border: 1px solid var(--team-a); }
.role-tag.team-b { background: rgba(232,74,95,0.15); color: var(--team-b); border: 1px solid var(--team-b); }
.role-tag.spectator { background: rgba(106,168,168,0.15); color: #6aa8a8; border: 1px solid #6aa8a8; }
.role-tag.admin { background: rgba(240,192,64,0.15); color: var(--accent); border: 1px solid var(--accent); }

.link-list .link-url {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.78rem; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ========== Match page ========== */
.match-page { background: var(--bg-0); }
.match-shell {
  max-width: 1400px; margin: 0 auto; padding: 16px 20px 40px;
  display: grid; grid-template-columns: 1fr 320px; gap: 20px;
}
.match-shell-main { min-width: 0; }

.match-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  padding: 16px 20px; margin-bottom: 16px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.match-header .teams { display: flex; align-items: center; gap: 16px; }
.match-header .team {
  display: flex; flex-direction: column; align-items: center;
}
.match-header .team-name {
  font-weight: 800; font-size: 1.1rem; letter-spacing: 1px; text-transform: uppercase;
}
.match-header .team.A .team-name { color: var(--team-a); }
.match-header .team.B .team-name { color: var(--team-b); }
.match-header .team-role {
  font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px;
}
.match-header .vs {
  font-size: 1.4rem; font-weight: 900; color: var(--accent);
  padding: 0 8px;
}
.match-header .format-pill {
  background: var(--bg-3); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 100px;
  font-size: 0.78rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent);
}
.role-banner {
  text-align: center; padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.78rem; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 700;
}
.role-banner.A { background: rgba(74,168,255,0.15); color: var(--team-a); border: 1px solid var(--team-a); }
.role-banner.B { background: rgba(232,74,95,0.15); color: var(--team-b); border: 1px solid var(--team-b); }
.role-banner.spectator { background: rgba(106,168,168,0.15); color: #6aa8a8; border: 1px solid #6aa8a8; }
.role-banner.admin { background: rgba(240,192,64,0.15); color: var(--accent); border: 1px solid var(--accent); }

/* Status / current step */
.status {
  background: linear-gradient(90deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  padding: 14px 18px; margin-bottom: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.status .step-num {
  display: inline-block; min-width: 30px; padding: 4px 8px;
  background: var(--accent); color: #1a1100; border-radius: 4px;
  font-weight: 900; margin-right: 10px;
}
.status .step-text { font-size: 0.95rem; }
.status .your-turn-pill {
  font-size: 0.78rem; padding: 4px 12px; border-radius: 100px;
  background: var(--ok); color: #001a04;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  animation: pulse 1.6s infinite;
}
.status .wait-pill {
  font-size: 0.78rem; padding: 4px 12px; border-radius: 100px;
  background: var(--bg-3); color: var(--muted);
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(95,207,106,0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(95,207,106,0); }
}

/* Maps grid (in-match) */
.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.map-card {
  position: relative;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--line);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s, filter 0.15s;
  display: flex; align-items: flex-end;
}
.map-card .map-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.map-card .map-shade {
  position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.85));
}
.map-card .map-name {
  position: relative; padding: 8px 10px;
  font-weight: 700; font-size: 0.92rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.85);
  width: 100%;
}
.map-card.selectable:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.map-card.dim { filter: grayscale(0.4) brightness(0.6); cursor: default; }

.map-card.excluded { cursor: default; border-color: var(--bad); }
.ban-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; letter-spacing: 3px;
  background: rgba(232,74,95,0.55);
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.ban-overlay::before { content: '✕'; margin-right: 8px; }

.map-card.picked-A {
  cursor: default; border-color: var(--team-a);
  box-shadow: 0 0 0 2px rgba(74,168,255,0.4);
}
.map-card.picked-B {
  cursor: default; border-color: var(--team-b);
  box-shadow: 0 0 0 2px rgba(232,74,95,0.4);
}
.overlay-tag {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 0.7rem; font-weight: 900; letter-spacing: 1.5px;
  padding: 3px 7px; border-radius: 3px;
}
.overlay-tag.pick-tag-A { background: var(--team-a); color: #fff; }
.overlay-tag.pick-tag-B { background: var(--team-b); color: #fff; }
.overlay-tag.decider-tag { background: var(--accent); color: #1a1100; }
.overlay-tag.decider-tag::before { content: '⚑ '; }

.map-card.decider {
  cursor: default; border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.map-card .side-badge {
  position: absolute; bottom: 38px; right: 6px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 7px; border-radius: 3px;
  letter-spacing: 1px;
}

/* Action mode highlight */
.maps-grid[data-mode="exclude"] .map-card.selectable:hover {
  border-color: var(--bad);
  box-shadow: 0 4px 16px rgba(232,74,95,0.4);
}
.maps-grid[data-mode="exclude"] .map-card.selectable::after {
  content: '✕'; position: absolute; top: 6px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(232,74,95,0.85); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  opacity: 0; transition: opacity 0.1s;
}
.maps-grid[data-mode="exclude"] .map-card.selectable:hover::after { opacity: 1; }

.maps-grid[data-mode="pick"] .map-card.selectable:hover {
  border-color: var(--ok);
  box-shadow: 0 4px 16px rgba(95,207,106,0.4);
}
.maps-grid[data-mode="pick"] .map-card.selectable::after {
  content: '✓'; position: absolute; top: 6px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ok); color: #001a04;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  opacity: 0; transition: opacity 0.1s;
}
.maps-grid[data-mode="pick"] .map-card.selectable:hover::after { opacity: 1; }

/* ========== Sidebar (history / progression) ========== */
.sidebar {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  height: max-content;
  position: sticky; top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.sidebar h3 {
  margin: 0 0 10px; font-size: 0.85rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-dim);
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.sidebar h3:not(:first-child) { margin-top: 18px; }

.progression { display: flex; flex-direction: column; gap: 4px; }
.progression-step {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  align-items: center;
}
.progression-step .ps-num {
  text-align: center; font-weight: 700; color: var(--muted);
  font-family: 'Consolas', monospace;
}
.progression-step.done { background: rgba(255,255,255,0.03); }
.progression-step.done .ps-num { color: var(--text); }
.progression-step.current {
  background: var(--accent-glow);
  border-left: 2px solid var(--accent);
}
.progression-step.current .ps-num { color: var(--accent); }
.progression-step.upcoming { color: var(--muted); }
.ps-actor.A { color: var(--team-a); font-weight: 700; }
.ps-actor.B { color: var(--team-b); font-weight: 700; }
.ps-action { color: var(--text-dim); }
.ps-action.exclude { color: var(--bad); }
.ps-action.pick { color: var(--ok); }
.ps-action.decider { color: var(--accent); }

/* Log */
.log {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.82rem;
}
.log li { padding: 6px 8px; border-radius: 4px; background: rgba(255,255,255,0.02); }
.log .l-step { color: var(--muted); font-family: 'Consolas', monospace; margin-right: 6px; }
.log .l-empty { color: var(--muted); font-style: italic; padding: 8px; }

/* ========== Modal (side selection) ========== */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(5,8,12,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px; max-width: 540px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}
.modal-content h2 {
  margin: 0 0 6px; font-size: 1.4rem; letter-spacing: 2px; text-transform: uppercase;
}
.side-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px;
}
.side-btn {
  font-family: inherit;
  padding: 18px;
  background: var(--bg-0); border: 2px solid var(--line);
  border-radius: 8px; color: var(--text);
  font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.side-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.side-visual {
  width: 130px; height: 80px; border-radius: 6px;
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #2a3548, #11171f);
  display: flex; align-items: center; justify-content: center;
}
.side-visual .compass {
  font-size: 1.6rem; font-weight: 900;
  color: var(--text); letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(240,192,64,0.4);
}
.side-visual.side-north {
  background:
    linear-gradient(180deg, rgba(74,168,255,0.35), transparent 60%),
    linear-gradient(135deg, #2a3548, #11171f);
}
.side-visual.side-north::before {
  content: '▲'; position: absolute; top: 6px; right: 8px;
  color: var(--team-a); font-size: 0.8rem;
}
.side-visual.side-south {
  background:
    linear-gradient(0deg, rgba(232,74,95,0.35), transparent 60%),
    linear-gradient(135deg, #2a3548, #11171f);
}
.side-visual.side-south::before {
  content: '▼'; position: absolute; bottom: 6px; right: 8px;
  color: var(--team-b); font-size: 0.8rem;
}

/* ========== Toast ========== */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--bad); color: #fff;
  padding: 10px 18px; border-radius: 6px;
  font-size: 0.9rem; font-weight: 600;
  z-index: 2000;
  box-shadow: var(--shadow);
}

/* ========== Admin extras ========== */
.admin-controls {
  background: rgba(240,192,64,0.06);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 12px 16px; margin-bottom: 16px;
  font-size: 0.85rem; color: var(--text-dim);
}
.admin-controls strong { color: var(--accent); }

/* ========== Spectator OBS mode ========== */
body.obs {
  background: transparent !important;
}
body.obs .bg-grid { display: none; }
body.obs .match-shell {
  display: block;
  max-width: 100%;
  padding: 16px;
}
body.obs .match-header {
  background: rgba(10,14,20,0.85);
  backdrop-filter: blur(8px);
}
body.obs .sidebar { display: none; }
body.obs .status, body.obs .maps-grid, body.obs .card {
  background: rgba(10,14,20,0.8);
}

/* ========== Finished badge ========== */
.finished-banner {
  background: linear-gradient(90deg, var(--ok), #2a8a3a);
  color: #001a04;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(95,207,106,0.3);
}

/* ========== End-of-ban animation overlay ========== */
.endgame-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: radial-gradient(ellipse at center, rgba(10,14,20,0.95), rgba(2,4,6,0.98));
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
  overflow-y: auto;
  animation: endgameFadeIn 0.4s ease-out;
  backdrop-filter: blur(8px);
}
@keyframes endgameFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.endgame-shell {
  max-width: 1200px; width: 100%;
  text-align: center;
}
.endgame-header { margin-bottom: 28px; position: relative; }
.endgame-header h2 {
  font-size: 1.8rem; letter-spacing: 4px; text-transform: uppercase;
  margin: 0 0 6px;
  background: linear-gradient(180deg, #ffd76a, #c79a2a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 28px rgba(240,192,64,0.35);
}
.endgame-close {
  position: absolute; top: 0; right: 0;
}
.endgame-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.endgame-card {
  position: relative;
  height: 230px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-1);
  display: flex; flex-direction: column; justify-content: flex-end;
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  animation: endgameCardIn 0.55s cubic-bezier(0.2, 0.85, 0.3, 1.05) var(--reveal-delay, 0ms) forwards;
}
@keyframes endgameCardIn {
  0%   { opacity: 0; transform: translateY(28px) scale(0.96); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}
.endgame-card.decider {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(240,192,64,0.2), 0 8px 30px rgba(240,192,64,0.25);
}
.endgame-card-num {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #1a1100;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.95rem;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.4);
}
.endgame-card-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: saturate(1.05) brightness(0.85);
}
.endgame-card-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(10,14,20,0.4) 45%, rgba(10,14,20,0.92) 100%);
}
.endgame-card-tag {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  font-size: 0.65rem; font-weight: 900; letter-spacing: 1.5px;
  padding: 4px 9px; border-radius: 100px;
  text-transform: uppercase;
}
.endgame-card-tag.tag-A { background: var(--team-a); color: #fff; }
.endgame-card-tag.tag-B { background: var(--team-b); color: #fff; }
.endgame-card-tag.tag-decider {
  background: var(--accent); color: #1a1100;
}
.endgame-card-body {
  position: relative; z-index: 2;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.endgame-card-name {
  font-weight: 800; font-size: 1.1rem; letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
}
.endgame-card-hint {
  font-size: 0.75rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
  margin-top: -4px;
}
.endgame-card-spawns {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 6px;
  background: rgba(0,0,0,0.45);
  border-radius: 6px;
  padding: 6px 8px;
  backdrop-filter: blur(2px);
}
.endgame-card-spawns .es-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem;
}
.endgame-card-spawns .es-A .es-team { color: var(--team-a); }
.endgame-card-spawns .es-B .es-team { color: var(--team-b); }
.endgame-card-spawns .es-team {
  font-weight: 700; letter-spacing: 0.5px;
  max-width: 60%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.endgame-card-spawns .es-side {
  font-weight: 900; letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(240,192,64,0.12);
  border: 1px solid rgba(240,192,64,0.4);
}

#replay-anim-btn { margin-left: 8px; }

/* Picked / decider table (admin / spectator) */
.match-table {
  width: 100%; border-collapse: collapse; margin-top: 8px;
  font-size: 0.85rem;
}
.match-table th, .match-table td {
  padding: 8px 10px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.match-table th {
  text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1.5px;
  color: var(--text-dim); font-weight: 600;
}
.match-table td.actor-A { color: var(--team-a); font-weight: 700; }
.match-table td.actor-B { color: var(--team-b); font-weight: 700; }
.match-table td.actor-decider { color: var(--accent); font-weight: 700; }

/* Responsive */
@media (max-width: 980px) {
  .match-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
}
@media (max-width: 600px) {
  .row.two-cols { flex-direction: column; }
  .brand h1 { font-size: 1.6rem; letter-spacing: 2px; }
  .link-list li { grid-template-columns: 1fr; }
}

/* Copy feedback */
.copy-btn { font-size: 0.75rem; padding: 6px 10px; }
.copy-btn.copied { background: var(--ok); color: #001a04; }
.open-btn { font-size: 0.75rem; padding: 6px 10px; }

/* ========== Language switcher (top-right) ========== */
.lang-switcher-host {
  position: fixed; top: 12px; right: 12px; z-index: 200;
}
.lang-switcher {
  display: inline-flex;
  background: rgba(17, 23, 31, 0.92);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.lang-switcher button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 1.2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-right: 1px solid var(--line);
}
.lang-switcher button:last-child { border-right: none; }
.lang-switcher button:hover { background: var(--bg-2); color: var(--text); }
.lang-switcher button.active {
  background: linear-gradient(180deg, #ffd76a, #c79a2a);
  color: #1a1100;
}
body.obs .lang-switcher-host { display: none; }

/* ========== Pool sections (competitive vs other) ========== */
.pool-section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 8px; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--text-dim);
}
.pool-section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.pool-section-title .badge-comp {
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 8px; border-radius: 100px;
  font-size: 0.68rem; letter-spacing: 1px;
}
.pool-section-title .badge-other {
  background: var(--bg-3); color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 100px;
  font-size: 0.68rem; letter-spacing: 1px;
}
.pool-cell.non-comp { opacity: 0.85; }
.pool-cell .comp-badge {
  position: absolute; top: 5px; right: 5px;
  background: var(--accent); color: #1a1100;
  font-size: 0.6rem; font-weight: 900;
  padding: 2px 5px; border-radius: 3px;
  letter-spacing: 1px;
  z-index: 2;
}
.pool-cell.selected .comp-badge { display: none; }

.pool-cell .no-decider-badge {
  position: absolute; bottom: 30px; right: 4px;
  background: rgba(232,74,95,0.85); color: #fff;
  font-size: 0.58rem; font-weight: 900;
  padding: 2px 5px; border-radius: 3px;
  letter-spacing: 1px;
  z-index: 2; cursor: help;
}

.pool-hint {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ========== Games sequence table ========== */
.games-table {
  width: 100%; border-collapse: collapse; margin-top: 8px;
  font-size: 0.85rem;
}
.games-table th, .games-table td {
  padding: 8px 10px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.games-table th {
  text-transform: uppercase; font-size: 0.72rem; letter-spacing: 1.5px;
  color: var(--text-dim); font-weight: 600;
}
.games-table .game-num {
  display: inline-block; min-width: 22px; padding: 2px 6px;
  background: var(--bg-3); color: var(--accent);
  border-radius: 3px; font-weight: 700; font-family: 'Consolas', monospace;
  font-size: 0.78rem; text-align: center;
}
.games-table .game-pair-marker {
  font-size: 0.68rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
  font-family: inherit; margin-left: 6px;
}
.games-table tr.pair-second td:first-child { padding-left: 22px; }
.games-table .actor-A { color: var(--team-a); font-weight: 700; }
.games-table .actor-B { color: var(--team-b); font-weight: 700; }
.games-table .actor-decider { color: var(--accent); font-weight: 700; }
