:root {
  color-scheme: dark;
  --background: #0d111b;
  --sidebar: #111723;
  --surface: #151d2b;
  --surface-raised: #1b2738;
  --line: #263246;
  --ink: #f3f6fc;
  --muted: #a0aec2;
  --accent: #71eddf;
  font-family: Inter, Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: 230px;
  padding: 28px 17px;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid #222c3d;
}
.brand { display: flex; align-items: center; gap: 12px; margin: 0 5px 42px; text-decoration: none; font-size: 15px; letter-spacing: -.025em; white-space: nowrap; }
.brand strong { color: var(--ink); font-weight: 750; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #0b2025; }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 2; }
.navigation, #regions { display: grid; gap: 5px; }
.navigation button, #regions button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 590;
}
.navigation button:hover, #regions button:hover { background: var(--surface-raised); color: var(--ink); }
.navigation button[aria-current], #regions button[aria-pressed="true"] { color: var(--accent); border-color: #28524e; background: #172e36; }
.regions { border-top: 1px solid var(--line); margin-top: 25px; padding-top: 20px; }
.regions h2 { margin: 0 12px 8px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.region-code { display: grid; place-items: center; width: 21px; height: 15px; font-size: .56rem; font-weight: 750; color: var(--ink); border-radius: 3px; background: #28374a; }
.mobile-region { display: none; }

main { margin-left: 230px; padding: 0 clamp(22px, 3.25vw, 58px) 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 91px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 2vw, 1.86rem); letter-spacing: -.035em; font-weight: 740; }
.search { display: flex; align-items: center; gap: 10px; min-height: 42px; width: min(305px, 46%); padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--sidebar); }
.search:focus-within { border-color: var(--accent); }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .89rem; }
.search input:focus-visible { outline: none; }
.search input::placeholder { color: var(--muted); }

.feature {
  display: flex;
  align-items: flex-end;
  min-height: clamp(300px, 30vw, 420px);
  isolation: isolate;
  position: relative;
  overflow: hidden;
  border: 1px solid #33466d;
  border-radius: 19px;
  background: #173567 url("./tennis-hero.webp") 55% 28% / cover no-repeat;
}
.feature::before { content: ""; z-index: -1; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,13,30,.97) 0%, rgba(5,13,30,.8) 29%, rgba(5,13,30,.25) 64%, transparent 100%), linear-gradient(0deg, rgba(5,13,30,.55), transparent 52%); }
.feature-copy { padding: clamp(28px, 4.2vw, 66px); }
.feature-kicker { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: .74rem; font-weight: 750; text-transform: uppercase; letter-spacing: .11em; }
.feature-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px #71eddf8c; }
.feature h2 { margin: 13px 0 25px; font-size: clamp(2.8rem, 5.6vw, 5.7rem); line-height: .94; letter-spacing: -.07em; font-weight: 780; }
.primary, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; font-size: .88rem; font-weight: 710; }
.primary { min-height: 45px; padding: 0 17px; color: #0b2227; background: var(--accent); }
.primary:hover { background: #a0fff3; }
.text-button { min-height: 39px; padding: 0 10px; color: var(--accent); background: transparent; white-space: nowrap; }
.text-button:hover { background: #172e36; }

.channel-section { margin-top: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 15px; }
.section-heading h2 { font-size: clamp(1.18rem, 1.8vw, 1.48rem); letter-spacing: -.028em; font-weight: 740; }
.section-heading p, #empty { color: var(--muted); font-size: .86rem; }
.section-heading p:not(:empty) { margin-top: 5px; }
.genre-filter { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; font-size: .86rem; color: var(--muted); }
select { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; color: var(--ink); background: var(--sidebar); }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr)); gap: 10px; }
.channel { display: flex; align-items: center; min-width: 0; min-height: 76px; border-radius: 11px; border: 1px solid #263246; background: var(--surface); }
.channel:hover, .channel:focus-within { border-color: #49677f; background: var(--surface-raised); }
.channel-main { display: flex; align-items: center; flex: 1; gap: 12px; min-width: 0; min-height: 74px; padding: 10px 0 10px 10px; background: transparent; border: 0; text-align: left; border-radius: 10px; }
.channel-logo { position: relative; display: grid; place-items: center; width: 50px; height: 50px; flex: none; overflow: hidden; border-radius: 7px; background: #213044; color: var(--accent); font-weight: 700; font-size: .84rem; }
.channel-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.channel-details { min-width: 0; display: grid; gap: 4px; }
.channel-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 690; }
.channel-details small { color: var(--muted); font-size: .72rem; }
.channel-actions { display: flex; gap: 1px; padding: 0 6px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; padding: 0; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--ink); background: #2b3c51; }
.favorite[aria-pressed="true"] { color: var(--accent); }
.favorite[aria-pressed="true"] svg { fill: var(--accent); }
.channel-actions svg { width: 17px; height: 17px; }
#empty { border: 1px dashed var(--line); border-radius: 11px; padding: 28px 20px; line-height: 1.5; }
.load-more { display: flex; margin: 18px auto 0; border-color: var(--line); }

dialog { width: min(900px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; background: var(--sidebar); border: 1px solid #3b506b; border-radius: 15px; color: var(--ink); }
dialog::backdrop { background: rgba(3, 7, 14, .8); }
body:has(dialog[open]) { overflow: hidden; }
.dialog-header, .player-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; }
.dialog-header h2 { font-size: 1.18rem; }
.dialog-header p, .player-footer p { font-size: .84rem; line-height: 1.4; color: var(--muted); }
.dialog-header p { margin-top: 3px; }
.player-footer p { flex: 1 1 250px; }
.player-footer { flex-wrap: wrap; justify-content: flex-end; }
video { display: block; width: 100%; max-height: 65dvh; aspect-ratio: 16 / 9; background: #05070c; }
#channel-options { max-width: 410px; }
.option { display: block; margin: 0 18px 18px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); text-align: left; }
.option:hover { background: var(--surface-raised); }

@media (max-width: 860px) {
  .sidebar { position: static; width: 100%; padding: 14px 18px 10px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0; }
  .navigation { display: flex; gap: 4px; overflow-x: auto; padding: 3px; margin: -3px; }
  .navigation button { width: auto; min-height: 39px; white-space: nowrap; gap: 7px; }
  .navigation svg { width: 16px; height: 16px; }
  .regions { display: none; }
  .mobile-region { display: flex; align-items: center; gap: 5px; color: var(--muted); }
  .mobile-region select { min-height: 42px; }
  main { margin-left: 0; padding: 0 18px 36px; }
  .topbar { min-height: 76px; gap: 10px; }
  .search { margin-left: auto; }
}
@media (max-width: 540px) {
  .navigation button { flex: 1 0 auto; justify-content: center; padding-inline: 6px; font-size: .79rem; }
  .navigation svg { display: none; }
  .topbar { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 15px 0; }
  .search { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .feature { min-height: 300px; background-position: 62% 54%; }
  .feature::before { background: linear-gradient(90deg, #071225 0%, #071225b0 43%, #0712251a 100%), linear-gradient(0deg, #0712259c, transparent 60%); }
  .feature-copy { padding: 24px; }
  .channel-grid { grid-template-columns: 1fr; }
}
