:root,
:root[data-theme="dark"] {
  --bg: #070b14;
  --panel: #0d1424;
  --panel-2: #111a2e;
  --border: #1b2539;
  --text: #eef1f7;
  --muted: #8b95a9;
  --red: #e5202b;
  --red-hover: #c91a24;
  --demo: #f2b705;
  --ico-filter: none;
  --ico-active-filter: none;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f1f4f9;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --border: #dde3ee;
  --text: #121826;
  --muted: #5d687e;
  --ico-filter: none;
  --ico-active-filter: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.4;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.ico { filter: var(--ico-filter); font-size: 1.15rem; line-height: 1; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark { position: relative; width: 52px; height: 56px; flex: none; }
.logo-mark img { display: block; width: 52px; height: 52px; border-radius: 50%; }
.logo-live {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1;
}
.logo-live i { width: 4px; height: 4px; border-radius: 50%; background: #fff; display: inline-block; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; line-height: 1.1; }
.logo-tag { font-size: 0.62rem; letter-spacing: 0.16em; color: var(--muted); margin-top: 3px; }

.search {
  flex: 1;
  max-width: 720px;
  margin-left: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--red); }
.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 0.95rem;
  padding: 11px 0;
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  background: none;
  border: 0;
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: var(--panel-2); }
.multi-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  white-space: nowrap;
}
.multi-btn:hover { background: var(--red-hover); }

/* ---------- Sport tabs ---------- */
.tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.tab {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 18px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  color: var(--text);
}
.tab:hover { background: var(--panel-2); }
.tab.active { border-bottom-color: var(--red); }
.tab-sep { width: 1px; background: var(--border); margin: 14px 12px; flex: none; }

/* ---------- Page shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 330px;
  gap: 24px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

/* Left menu */
.sidenav { display: flex; flex-direction: column; gap: 4px; }
.sidenav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.sidenav a:hover { background: var(--panel-2); }
.sidenav a.active { background: var(--red); color: #fff; }
.sidenav a.active .ico { filter: var(--ico-active-filter); }
.sidenav .chev { margin-left: auto; width: 16px; height: 16px; opacity: 0.6; }

.promo {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 96px 16px 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(229, 32, 43, 0.35), transparent 65%),
    linear-gradient(180deg, #0b1020, var(--panel));
}
.promo strong { display: block; font-size: 1.15rem; line-height: 1.25; color: #fff; }
.promo span { display: block; margin-top: 6px; font-size: 0.85rem; color: #a9b2c6; }

/* Center */
.center { min-width: 0; }

.featured-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.featured-head h1 { margin: 0; font-size: 1.5rem; }
.tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}

/* ---------- Player ---------- */
.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% 115%, #123222 0%, rgba(18, 50, 34, 0) 55%),
    radial-gradient(ellipse at 50% -10%, #1a2540 0%, rgba(26, 37, 64, 0) 50%),
    #04070d;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: #fff;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge-demo {
  background: var(--demo);
  color: #111;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 5px 9px;
  border-radius: 4px;
}
.badge-league {
  background: rgba(10, 14, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 4px;
}
.player-msg { padding: 16px; }
.play-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  opacity: 0.8;
}
.play-ring svg { width: 30px; height: 30px; fill: #fff; stroke: none; margin-left: 4px; }
.player-msg strong { display: block; font-size: 1.35rem; margin-bottom: 6px; }
.player-msg small { color: #b4bdd0; font-size: 0.92rem; }
.player-link { display: inline-block; margin-top: 10px; color: var(--red); font-size: 0.9rem; }
.player-link:hover { text-decoration: underline; }

/* ---------- Matches ---------- */
.matches { margin-top: 28px; }
.matches-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}
.matches-head h2 { margin: 0; font-size: 1.5rem; display: flex; align-items: center; gap: 12px; }
.matches-head h2 svg { width: 30px; height: 30px; color: var(--red); }
.day-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.day-nav .step { background: none; border: 0; color: var(--text); padding: 6px; border-radius: 6px; display: inline-flex; }
.day-nav .step:hover { background: var(--panel-2); }
.day-nav .step svg { width: 16px; height: 16px; }
.day-tab {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 8px 10px;
  border-bottom: 2px solid transparent;
}
.day-tab:hover { color: var(--text); }
.day-tab.active { color: var(--text); border-bottom-color: var(--red); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.match-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--muted); }
.mc-league { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-league span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star { background: none; border: 0; color: var(--muted); font-size: 1.15rem; padding: 2px 4px; line-height: 1; }
.star:hover, .star[aria-pressed="true"] { color: var(--demo); }
.mc-teams { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.team { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; text-align: center; font-size: 0.82rem; }
.team span.n { max-width: 100%; overflow-wrap: anywhere; }
.team-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.vs { color: var(--muted); font-size: 0.8rem; margin-top: 18px; }
.mc-time { text-align: center; font-size: 0.9rem; }
.watch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  padding: 9px;
  font-weight: 700;
}
.watch-btn:hover { background: var(--red); color: #fff; }
.watch-btn svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.empty { color: var(--muted); padding: 18px 0; }

/* ---------- Multi-stream ---------- */
.page-title { margin: 0 0 16px; font-size: 1.5rem; }
.layout-picker { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.layout-picker button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 700;
}
.layout-picker button.active { background: var(--red); border-color: var(--red); color: #fff; }
.stream-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stream-grid .slot-wide { grid-column: 1 / -1; }

/* ---------- Right sidebar ---------- */
.right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.support-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 14px 16px;
}
.support-btn:hover { background: var(--red-hover); }
.support-btn svg { width: 30px; height: 30px; }
.support-btn strong { display: block; font-size: 1.05rem; }
.support-btn small { opacity: 0.9; font-size: 0.78rem; }

.chat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.chat-head .flag { margin-left: auto; font-size: 0.7rem; font-weight: 700; color: #111; background: var(--demo); padding: 3px 7px; border-radius: 4px; letter-spacing: 0.05em; }
.chat-messages { height: 440px; overflow-y: auto; padding: 4px 0; }
.chat-msg { display: flex; gap: 12px; padding: 12px 16px; align-items: flex-start; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  flex: none;
}
.chat-body { flex: 1; min-width: 0; font-size: 0.9rem; }
.chat-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-user { font-weight: 700; }
.chat-time { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.chat-text { color: var(--muted); overflow-wrap: anywhere; }
.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
}
.chat-form input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); padding: 11px 0; font-size: 0.9rem; }
.chat-form button { background: none; border: 0; color: var(--text); display: inline-flex; padding: 6px; }
.chat-form:focus-within { border-color: var(--red); }
#chatango-box { padding: 8px; min-height: 200px; }

footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 4px 16px 32px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: minmax(0, 1fr) 320px; }
  .left { display: none; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .tabs { padding: 0 8px; }
  .chat-messages { height: 340px; }
}

@media (max-width: 560px) {
  .logo-tag { display: none; }
  .play-ring { width: 48px; height: 48px; margin-bottom: 8px; }
  .play-ring svg { width: 20px; height: 20px; }
  .player-msg { padding-top: 40px; }
  .player-msg strong { font-size: 1.1rem; }
  .player-msg small { font-size: 0.8rem; }
  .multi-btn span { display: none; }
  .stream-grid { grid-template-columns: minmax(0, 1fr); }
  .featured-head h1 { font-size: 1.2rem; }
  .day-nav { margin-left: 0; }
}
