:root {
  --cyan: #00aeef;
  --cyan-2: #0077c8;
  --cyan-soft: rgba(0, 174, 239, 0.16);
  --cyan-glow: rgba(0, 174, 239, 0.45);
  --red: #ff3b4d;
  --orange: #ff9f1c;
  --bg: #05070c;
  --panel: rgba(8, 14, 22, 0.78);
  --panel-2: rgba(12, 20, 32, 0.82);
  --line: rgba(0, 174, 239, 0.18);
  --text: #f4f8fc;
  --muted: #8ea0b5;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Manrope", sans-serif;
  --display: "Outfit", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  min-height: 100%;
  background-color: #04060b;
  background-image: url("/assets/bg-stadium.jpg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
html, body { min-height: 100%; color: var(--text); font-family: var(--font); overflow-x: hidden; }
body { background: transparent; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
img { max-width: 100%; }

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    linear-gradient(90deg,
      rgba(4, 8, 14, 0.04) 0%,
      rgba(4, 8, 14, 0.28) 12%,
      rgba(4, 8, 14, 0.70) 30%,
      rgba(4, 8, 14, 0.80) 50%,
      rgba(4, 8, 14, 0.70) 70%,
      rgba(4, 8, 14, 0.28) 88%,
      rgba(4, 8, 14, 0.04) 100%),
    linear-gradient(180deg, rgba(4, 8, 14, 0.30) 0%, rgba(4, 8, 14, 0.06) 40%, rgba(4, 8, 14, 0.38) 100%);
}

.topbar, .ticker, .shell, .foot { position: relative; z-index: 1; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 8, 14, 0.58);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.topbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 46px; width: auto; max-width: 220px; object-fit: contain; filter: drop-shadow(0 0 16px var(--cyan-glow)); }
.topbar-inner .live-chip { margin-left: 4px; }
.brand-tv {
  font-family: var(--display); font-weight: 800; letter-spacing: 0.12em;
  color: #061018; background: linear-gradient(135deg, var(--cyan), #5ad4ff);
  border-radius: 8px; padding: 4px 8px; font-size: 0.78rem;
  box-shadow: 0 0 18px var(--cyan-glow);
}
.nav { display: flex; gap: 8px; margin-left: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 0.9rem;
  background: rgba(255,255,255,0.03); border: 1px solid transparent;
}
.nav-link i { color: var(--cyan); }
.nav-link:hover, .nav-link.is-active {
  color: #fff; border-color: var(--line); background: var(--cyan-soft);
}
.topbar-meta { display: flex; align-items: center; gap: 10px; }
.live-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 59, 77, 0.12); border: 1px solid rgba(255, 59, 77, 0.35);
  color: #fff; border-radius: 999px; padding: 7px 12px; font-size: 0.82rem; font-weight: 700;
}
.live-chip .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 59, 77, 0.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 77, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(255, 59, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 77, 0); }
}
.nav-toggle {
  display: none; background: transparent; border: 0; color: #fff; font-size: 1.3rem; padding: 6px;
}

.ticker {
  display: flex; align-items: center; gap: 12px;
  max-width: 1360px; margin: 10px auto 0; padding: 0 18px;
  overflow: hidden;
}
.ticker-label {
  flex: 0 0 auto; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.08em;
  color: #fff; background: var(--red); border-radius: 6px; padding: 5px 8px;
}
.ticker-track { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.ticker-track::-webkit-scrollbar { display: none; }
.ticker-item { color: #d7e6f3; font-size: 0.84rem; font-weight: 600; }
.ticker-item span { color: var(--cyan); }

.shell {
  max-width: 1360px; margin: 16px auto 24px; padding: 0 18px;
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas:
    "player channels"
    "matches channels";
  align-items: start;
}
.player-col { grid-area: player; min-width: 0; }
.channels-col { grid-area: channels; min-width: 0; position: sticky; top: 84px; }
.matches-col { grid-area: matches; min-width: 0; }

.stage {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  overflow: hidden; box-shadow: var(--shadow);
}
.stage-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(0,174,239,0.08), transparent 55%);
}
.stage-titles h1 { font-family: var(--display); font-size: 1.15rem; font-weight: 700; margin: 6px 0 4px; }
.stage-titles p { color: var(--muted); font-size: 0.82rem; }
.stage-titles p i { color: var(--cyan); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #2a3344, #1a2230);
  border-radius: 999px; padding: 4px 10px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
}
.badge.is-live { background: linear-gradient(135deg, #ff3b4d, #c81e3a); }
.badge.is-soon { background: linear-gradient(135deg, #ff9f1c, #c77700); }
.stage-clock {
  font-variant-numeric: tabular-nums; color: var(--cyan); font-weight: 800; font-size: 0.95rem;
  background: rgba(0,0,0,0.28); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px;
}

.viewport {
  position: relative; aspect-ratio: 16/9; background: #000;
  margin: 10px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  max-height: min(56vh, 560px); width: calc(100% - 20px);
}
.player-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.placeholder, .skeleton {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 20px; gap: 12px;
}
.placeholder { background: radial-gradient(circle at 50% 30%, rgba(0,174,239,0.18), rgba(0,0,0,0.86) 62%); color: #c9d7e4; }
.placeholder-logo {
  width: 128px; height: 128px; object-fit: contain; border-radius: 50%;
  box-shadow: 0 0 40px var(--cyan-glow);
}
.skeleton { display: none; background: rgba(0,0,0,0.55); color: var(--cyan); font-size: 2rem; z-index: 3; }
.skeleton.is-on { display: flex; }

.panel-title {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  border-left: 3px solid var(--cyan); padding-left: 10px;
}
.panel-title i { color: var(--cyan); }

.channel-grid {
  list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  max-height: 640px; overflow: auto; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: var(--cyan) transparent;
}
.channel-item {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  min-height: 92px; padding: 10px 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.channel-item img { width: 104px; height: 38px; object-fit: contain; }
.channel-item span { font-size: 0.68rem; font-weight: 700; color: #d5e2ee; text-align: center; line-height: 1.2; }
.channel-item:hover, .channel-item.is-active {
  transform: translateY(-3px); border-color: var(--cyan); background: var(--cyan-soft);
}

.filters { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.search { position: relative; display: block; margin-bottom: 12px; }
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--cyan); }
.search input {
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,0.04);
  color: #fff; border-radius: 999px; padding: 12px 16px 12px 40px; outline: none;
}
.search input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tab {
  border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: #d7e4f0;
  border-radius: 12px; padding: 10px 6px; font-weight: 700; font-size: 0.78rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
}
.tab i { color: var(--cyan); }
.tab.is-active { background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); color: #041018; }
.tab.is-active i { color: #041018; }

.match-list {
  margin-top: 12px; display: flex; flex-direction: column; gap: 8px;
  max-height: 520px; overflow: auto; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: var(--cyan) transparent;
}
.match-empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.match-item {
  display: grid; grid-template-columns: 68px minmax(0,1fr) auto minmax(0,1fr) minmax(90px, auto);
  align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.match-item:hover, .match-item.is-active { border-color: var(--cyan); background: var(--cyan-soft); transform: translateX(3px); }
.match-time {
  text-align: center; font-size: 0.72rem; font-weight: 800; border-radius: 8px; padding: 6px 4px;
  background: rgba(0,0,0,0.35); color: var(--cyan);
}
.match-time.live { background: var(--red); color: #fff; }
.match-time.upcoming { background: var(--orange); color: #111; }
.team { font-weight: 700; font-size: 0.88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.left { text-align: right; }
.team.right { text-align: left; }
.vs { color: rgba(255,255,255,0.28); font-size: 0.7rem; font-weight: 800; }
.meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.league, .ch {
  font-size: 0.68rem; color: var(--muted); background: rgba(255,255,255,0.05);
  border-radius: 999px; padding: 2px 8px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch { color: var(--cyan); font-weight: 800; }

.foot {
  text-align: center; padding: 28px 16px 36px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.82rem; line-height: 1.6;
  background: rgba(4, 8, 14, 0.28);
}
.foot-logo { height: 42px; width: auto; margin: 0 auto 12px; display: block; filter: drop-shadow(0 0 12px var(--cyan-glow)); }
.muted { opacity: 0.75; font-size: 0.75rem; }

@media (max-width: 1080px) {
  html { background-attachment: scroll; background-position: center 18%; }
  .bg-glow {
    background: linear-gradient(180deg, rgba(4, 8, 14, 0.55) 0%, rgba(4, 8, 14, 0.78) 100%);
  }
  .shell {
    grid-template-columns: 1fr;
    grid-template-areas: "player" "channels" "matches";
  }
  .channels-col { position: static; }
  .channel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: 280px; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav { display: none; width: 100%; flex-direction: column; margin-left: 0; }
  .nav.is-open { display: flex; }
  .nav-toggle { display: block; }
  .brand img { height: 38px; }
  .tabs { grid-template-columns: 1fr 1fr; }
  .channel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .match-item { grid-template-columns: 58px 1fr; }
  .team.left, .team.right { text-align: left; grid-column: 2; }
  .vs { display: none; }
  .meta { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}
