:root {
  color-scheme: dark;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #000;
  color: #f5f5f5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #0b0b0b;
  --muted: #aaa;
  --focus: #d9bd70;
  --purple: #7b2ff7;
  --red: #c91923;
  --red-hot: #e01b3c;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #000; }
body { min-width: 320px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.shell { width: 100%; height: 100%; }
.login-panel {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #000 url("/assets/welcome/wind_bg.webp") center / cover no-repeat;
}
.login-card {
  width: min(430px, calc(100vw - 36px));
  padding: 36px 40px 24px;
  background: rgba(0, 0, 0, .78);
  border-top: 3px solid var(--red);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .58);
}
.eyebrow { margin: 0 0 12px; color: #d9d9d9; font-size: 13px; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
.login-card h1 { margin-bottom: 28px; font-size: 29px; font-weight: 500; }
label { display: block; margin-bottom: 8px; color: #ddd; font-size: 15px; }
input, select {
  min-width: 0;
  padding: 12px 14px;
  color: #fff;
  background: #121212;
  border: 1px solid #555;
  border-radius: 2px;
}
.login-card input { width: 100%; margin-bottom: 16px; }
.primary, .quiet-button {
  min-height: 42px;
  padding: 9px 20px;
  border: 0;
  border-radius: 2px;
  font-weight: 700;
}
.primary { color: #fff; background: linear-gradient(100deg, var(--purple), var(--red) 72%, var(--red-hot)); }
.primary:hover { filter: brightness(1.14); }
.login-card .primary { width: 100%; }
.status { min-height: 1.3em; margin: 8px 0 0; color: #d0d0d0; font-size: 14px; }

.app-panel { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--bg); }
.topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  width: 100%;
  height: 76px;
  padding: 0 30px;
  background: #090909;
}
.wordmark {
  color: #f4f4f4;
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-title {
  position: absolute;
  left: 50%;
  margin: 0;
  color: #ccc;
  font-size: 14px;
  transform: translateX(-50%);
}
.topbar-actions { display: flex; gap: 12px; margin-left: auto; }
.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  color: #ddd;
  background: #292929;
  border: 0;
  border-radius: 50%;
}
.icon-button:hover { color: #fff; background: #414141; }
.icon-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.side-nav {
  position: absolute;
  z-index: 12;
  top: 76px;
  bottom: 0;
  left: 0;
  width: 222px;
  padding: 58px 0 28px 26px;
  overflow-y: auto;
  background: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .96) 73%, rgba(0, 0, 0, 0) 100%);
  scrollbar-width: none;
}
.side-nav::-webkit-scrollbar { display: none; }
.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 190px;
  height: 52px;
  margin: 0 0 8px;
  padding: 0 12px;
  color: #aaa;
  text-align: left;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: clamp(15px, 1.3vw, 20px);
  transition: color .14s ease, background .14s ease;
}
.nav-button.active { color: #fff; background: linear-gradient(100deg, var(--purple), var(--red) 72%, var(--red-hot)); }
.nav-button:hover { color: #fff; }
.nav-icon { display: grid; flex: 0 0 22px; place-items: center; width: 22px; height: 22px; color: currentColor; }
.nav-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-button.active .nav-icon { color: #fff; }

.section-heading {
  position: absolute;
  top: 89px;
  right: 34px;
  left: 252px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  z-index: 2;
}
.section-heading h1 { margin: 0; font-size: 23px; font-weight: 500; }
.section-heading .status { text-align: right; }
.search-panel, .live-panel {
  position: absolute;
  z-index: 3;
  top: 138px;
  right: 34px;
  left: 252px;
  padding: 12px;
  background: rgba(20, 20, 20, .96);
  border-bottom: 1px solid #494949;
}
#search-form { display: flex; gap: 12px; }
#search-input { flex: 1; }
.live-panel { top: 136px; padding: 0; background: transparent; border: 0; }
.live-panel select { width: min(340px, 100%); }

.live-layout {
  position: absolute;
  top: 146px;
  right: 32px;
  bottom: 30px;
  left: 252px;
}
.app-panel.is-live-view .live-layout { top: 184px; }
.app-panel.is-search-view .live-layout { top: 214px; }
.live-preview { display: none; }
.live-layout.is-live {
  display: grid;
  grid-template-columns: minmax(0, 3.25fr) minmax(250px, 1fr);
  align-items: start;
  gap: 22px;
}
.live-layout.is-live .live-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: calc(100% - 80px);
  background: #000 url("/assets/welcome/wind_bg.webp") center / cover no-repeat;
  border: 2px solid var(--focus);
  box-shadow: 0 0 12px rgba(217, 189, 112, .2);
}
.live-preview img { width: 150px; height: 120px; object-fit: contain; opacity: .82; }
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  align-content: start;
  gap: 22px 16px;
  width: 100%;
  max-height: 100%;
  padding: 4px 4px 22px;
  overflow: auto;
  scrollbar-color: #555 #151515;
  scrollbar-width: thin;
}
.results.is-live { display: flex; flex-direction: column; gap: 9px; padding: 0 4px 16px; overflow-y: auto; }
.result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 80px;
  padding: 0;
  color: #f5f5f5;
  text-align: left;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 2px;
  transition: transform .15s ease, border-color .15s ease;
}
.result-card:hover, .result-card:focus-visible { z-index: 1; border-color: var(--focus); transform: scale(1.035); }
.card-artwork {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #181818;
}
.result-card strong {
  display: block;
  padding: 10px 9px 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.32;
  text-overflow: ellipsis;
}
.result-card span, .result-card .channel-category {
  display: block;
  padding: 5px 9px 8px;
  color: #aaa;
  font-size: 12px;
  line-height: 1.25;
}
.result-card span[hidden] { display: none; }
.results.is-featured { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(160px, 1fr); }
.results.is-featured .result-card--hero { grid-column: span 2; grid-row: span 2; }
.results.is-featured .result-card--hero .card-artwork { aspect-ratio: auto; height: 100%; min-height: 350px; }
.results.is-featured .result-card--hero strong {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 38px 18px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.88));
  font-size: clamp(20px, 2vw, 34px);
}
.results.is-featured .result-card--hero span { display: none; }
.results.is-live .result-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 76px;
  background: rgba(25,25,25,.58);
  border: 1px solid transparent;
}
.results.is-live .result-card:hover, .results.is-live .result-card:focus-visible { border-color: var(--focus); background: linear-gradient(90deg, #373636, var(--red)); transform: none; }
.results.is-live .card-artwork { grid-row: span 2; width: 62px; height: 52px; margin: auto; aspect-ratio: auto; object-fit: contain; }
.results.is-live .result-card strong { padding: 8px 10px 0; }
.results.is-live .result-card span, .results.is-live .result-card .channel-category { padding: 3px 10px 8px; }
.empty-state { grid-column: 1 / -1; padding: 24px 0; color: #c5c5c5; text-align: center; }

.detail-panel {
  position: absolute;
  z-index: 6;
  top: 78px;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 36px 5vw 40px 14vw;
  overflow: auto;
  background: #080808;
}
.back-button { margin-bottom: 26px; padding: 9px 14px; color: #ddd; background: #292929; border: 0; }
.detail-layout { display: grid; grid-template-columns: minmax(220px, 30%) minmax(0, 1fr); align-items: start; gap: 5vw; }
.detail-artwork { display: block; width: 100%; max-height: 67vh; object-fit: contain; }
.detail-copy h2 { margin: 0 0 12px; font-size: clamp(28px, 3vw, 48px); font-weight: 500; }
.detail-copy p { max-width: 850px; font-size: 16px; line-height: 1.55; }
.muted { color: #aaa; }
.detail-copy .primary { min-width: 180px; margin-top: 16px; }

.player-panel {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 28px;
  background: #000;
}
.player-heading { position: absolute; top: 18px; right: 28px; left: 28px; display: flex; align-items: center; justify-content: space-between; }
.player-heading h2 { margin: 0; font-size: 18px; font-weight: 500; }
video { display: block; width: 100%; height: calc(100vh - 90px); max-height: 100%; background: #000; object-fit: contain; }
.player-panel .status { position: absolute; right: 20px; bottom: 10px; left: 20px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 900px) {
  .topbar { height: 60px; padding: 0 16px; }
  .side-nav { top: 60px; bottom: auto; width: 100%; height: 54px; padding: 3px 8px; overflow-x: auto; overflow-y: hidden; background: #050505; }
  .side-nav .nav-button { display: inline-flex; width: auto; height: 44px; margin: 2px; padding: 0 12px; font-size: 14px; }
  .section-heading { top: 126px; right: 16px; left: 16px; }
  .search-panel, .live-panel { top: 172px; right: 16px; left: 16px; }
  .live-layout { top: 184px; right: 16px; bottom: 14px; left: 16px; }
  .live-layout.is-live { grid-template-columns: minmax(0, 1.7fr) minmax(220px, 1fr); gap: 12px; }
  .results { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 16px 10px; }
  .results.is-featured { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .wordmark { font-size: 15px; }
  .topbar-title { display: none; }
  .icon-button { width: 38px; height: 38px; }
  .section-heading { top: 119px; }
  .live-layout { top: 170px; }
  .live-layout.is-live { display: flex; flex-direction: column; }
  .live-layout.is-live .live-preview { display: none; }
  .results.is-live { width: 100%; }
  .results.is-featured { grid-template-columns: repeat(2, minmax(0,1fr)); grid-auto-rows: auto; }
  .results.is-featured .result-card--hero { grid-column: span 2; grid-row: auto; }
  .results.is-featured .result-card--hero .card-artwork { min-height: 210px; }
  .detail-panel { padding: 24px 18px; }
  .detail-layout { grid-template-columns: 1fr; gap: 20px; }
  .detail-artwork { width: min(70vw, 300px); margin: auto; }
}
