:root {
  --bg: #111318;
  --surface: #15171c;
  --surface-2: #1c1f26;
  --surface-3: #22262f;
  --border: #232529;
  --accent: #00b4ff;
  --accent-dim: rgba(0,180,255,0.12);
  --hot: #ff3f5c;
  --hot-dim: rgba(255,63,92,0.15);
  --muted: #8b909e;
  --text: #dce0ea;
  --nav-h: 48px;
  --radius: 8px;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ---- HEADER — identical to index ---- */
header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 0;
  background: #0c0d10;
  border-bottom: 1px solid var(--border);
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #9299a8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-right: 12px;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s;
  line-height: 1;
}
.back-link:hover { color: #fff; border-color: #444; }

/* Brand */
.brand {
  text-decoration: none;
  flex-shrink: 0;
  margin-right: auto;
}
.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.accent { color: var(--accent); }

/* Discord — same as index */
.header-discord {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 10px;
  height: 32px;
  padding: 0 12px;
  background: #5865F2;
  color: #fff;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.14);
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.header-discord:hover { background: #4752c4; }
.header-discord svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---- MAIN ---- */
main {
  max-width: 1380px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 16px) 16px 24px;
  position: relative;
  z-index: 1;
}

/* ---- MATCH HEADER ---- */
.match-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  margin-bottom: 12px;
}

.match-teams-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.match-teams-row .team-name {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
  text-align: center;
}

.vs-sep {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ---- WATCH LAYOUT ---- */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}

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

/* ---- PLAYER ---- */
.player-side { position: sticky; top: calc(var(--header-h) + 8px); }

.iframe-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  transition: opacity 0.3s;
}

.player-overlay.hidden { opacity: 0; pointer-events: none; }

.overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

/* ---- SOURCES ---- */
.sources-side { display: flex; flex-direction: column; gap: 12px; }

.sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sources-header h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}

.sources-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}

.sources-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 500px;
  overflow-y: auto;
}

.sources-list::-webkit-scrollbar { width: 4px; }
.sources-list::-webkit-scrollbar-track { background: transparent; }
.sources-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

.source-group { border-bottom: 1px solid var(--border); }
.source-group:last-child { border-bottom: none; }

.source-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
}

.source-name {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.source-note {
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
}

.source-note::before { content: '✦ '; font-size: 9px; }

.stream-count {
  font-size: 11px;
  color: var(--hot);
  background: var(--hot-dim);
  border: 1px solid rgba(255,61,90,0.25);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.stream-buttons { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 6px; }

.stream-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.stream-item:hover {
  background: var(--surface-3);
  border-color: rgba(255,255,255,0.12);
}

.stream-item.active {
  background: var(--accent-dim);
  border-color: rgba(0,229,255,0.35);
}

.stream-quality {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.stream-quality.hd { background: var(--hot); color: #fff; }
.stream-quality.sd { background: var(--surface-3); color: var(--muted); }

.stream-info { flex: 1; min-width: 0; }
.stream-label { font-size: 13px; font-weight: 600; color: #fff; display: block; }
.stream-lang { font-size: 11px; color: var(--muted); margin-top: 1px; display: block; }

/* ---- INFO PANEL ---- */
.info-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.info-panel h4 {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.info-panel p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.disclaimer {
  font-size: 11px !important;
  font-style: italic;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-bottom: 0 !important;
}

/* ---- STATES ---- */
.loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 32px;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner.lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.no-match {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.no-match-inner {
  text-align: center;
  color: var(--muted);
}

.no-match-inner span { font-size: 40px; display: block; margin-bottom: 16px; }
.no-match-inner h2 { color: #fff; font-family: 'Oswald', sans-serif; margin-bottom: 8px; font-size: 24px; }
.no-match-inner p { margin-bottom: 20px; font-size: 14px; }

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.back-home:hover { border-color: var(--accent); color: var(--accent); }

/* ---- MOBILE ---- */
@media (max-width: 640px) {
  header { padding: 0 10px; gap: 8px; }
  .back-link span { display: none; }
  .back-link { flex-shrink: 0; }
  .brand { margin-right: auto; }
  .brand-name { font-size: 16px; }
  .header-discord span { display: none; }
  .header-discord { height: 32px; padding: 0 9px; flex-shrink: 0; }

  main { padding: calc(var(--nav-h) + 10px) 10px 20px; }

  .match-header { padding: 12px; }
  .team-name { font-size: 13px; }

  .player-side { position: static; }
  .sources-list { max-height: 340px; }
}
