:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --panel: #14151b;
  --panel-2: #1d1f27;
  --line: #2a2c36;
  --text: #f5f5f7;
  --muted: #9b9eaa;
  --gold: #d6b36a;
  --gold-2: #f0d59a;
  --danger: #ff5f68;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: radial-gradient(ellipse at top, #191923 0, var(--bg) 55%);
  color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
.topbar {
  height: 78px; padding: 0 clamp(16px, 4vw, 56px); display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--line); background: #101116eF;
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--gold); color: #17130a; font-size: 20px; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: var(--gold); letter-spacing: 2px; font-size: 10px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.status { color: var(--muted); font-size: 12px; }
.status.ok { color: #6cdaa0; }
.status.bad { color: #ff8388; }
.icon-button { border: 1px solid var(--line); background: var(--panel-2); color: var(--gold); border-radius: 12px; width: 40px; height: 40px; font-size: 25px; }
.page { width: min(1200px, calc(100% - 32px)); margin: 28px auto 48px; }
.player-panel, .library { background: linear-gradient(145deg, #171820, #111218); border: 1px solid var(--line); border-radius: 22px; padding: clamp(14px, 2.5vw, 24px); box-shadow: 0 16px 45px #0003; }
.player-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.eyebrow { color: var(--gold); font-size: 11px; letter-spacing: 1.5px; }
h1 { font-size: clamp(19px, 3vw, 27px); margin: 5px 0 16px; }
h2 { font-size: 22px; margin: 5px 0 0; }
h3 { font-size: 17px; margin: 0; }
.live-badge { color: white; background: #d92d3b; border-radius: 7px; padding: 5px 9px; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.video-wrap { position: relative; background: #030304; aspect-ratio: 16 / 9; border-radius: 15px; overflow: hidden; }
video { width: 100%; height: 100%; display: block; background: #000; }
.player-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; background: radial-gradient(circle, #1c1c22, #050506 72%); pointer-events: none; }
.player-placeholder p { margin: 0; font-weight: 600; }
.player-placeholder small { color: var(--muted); font-size: 12px; }
.play-symbol { display: grid; place-items: center; width: 68px; height: 68px; border: 1px solid #d6b36a88; background: #d6b36a16; color: var(--gold); border-radius: 50%; font-size: 25px; padding-left: 4px; }
.player-error { position: absolute; inset: auto 12px 12px; background: #4b151bdc; color: #fff; border: 1px solid #a93d47; padding: 12px; border-radius: 10px; font-size: 13px; }
.hidden { display: none !important; }
.player-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; padding-top: 14px; }
.secondary-button { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 9px 12px; border-radius: 10px; }
.library { margin-top: 22px; }
.count-pill { color: var(--gold-2); border: 1px solid #d6b36a55; background: #d6b36a12; border-radius: 99px; padding: 7px 11px; font-size: 12px; white-space: nowrap; }
.search-row { display: flex; align-items: center; gap: 10px; margin: 22px 0 16px; padding: 0 13px; background: #0d0e13; border: 1px solid var(--line); border-radius: 13px; color: var(--gold); }
.search-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); padding: 14px 0; }
.clear-button { border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.category-list { display: flex; flex-wrap: wrap; gap: 9px; }
.category-button { border: 1px solid var(--line); color: #c7c8cf; background: #1b1c24; border-radius: 11px; padding: 10px 15px; transition: .15s; }
.category-button:hover, .category-button.active { color: #17130a; background: var(--gold); border-color: var(--gold); }
.channels-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 25px 0 13px; }
#channelsSubtitle { color: var(--muted); font-size: 12px; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
.channel-card { min-width: 0; text-align: right; border: 1px solid var(--line); background: linear-gradient(145deg, #20212a, #171820); color: var(--text); border-radius: 15px; padding: 13px; transition: transform .15s, border-color .15s; }
.channel-card:hover { transform: translateY(-2px); border-color: #d6b36a99; }
.channel-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px #d6b36a22; }
.channel-logo { display: grid; place-items: center; height: 75px; margin-bottom: 10px; border-radius: 10px; background: #101116; overflow: hidden; color: var(--gold); font-size: 28px; }
.channel-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.channel-name { display: block; font-weight: 650; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.channel-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.loading, .empty { color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: 12px; width: 100%; }
footer { width: min(1200px, calc(100% - 32px)); margin: -22px auto 32px; color: #777b87; font-size: 11px; line-height: 1.8; text-align: center; }
footer p { margin: 4px 0; }
@media (max-width: 600px) {
  .topbar { height: 66px; }
  .status { max-width: 145px; text-align: left; }
  .page { margin-top: 16px; }
  .player-panel, .library { border-radius: 17px; }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-footer { align-items: flex-start; }
}
