:root {
  color-scheme: dark;
  --burgundy: #65001d;
  --burgundy-bright: #93002e;
  --wine: #2a0612;
  --gold: #f2bd43;
  --gold-pale: #ffe29a;
  --cream: #fff8e8;
  --muted: #cabfc1;
  --panel: rgba(39, 9, 19, 0.9);
  --line: rgba(242, 189, 67, 0.22);
  font-family: Montserrat, Avenir, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 300px; background: #140209; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 72% 3%, rgba(177, 20, 66, 0.24), transparent 34rem),
    linear-gradient(150deg, #140209, #2a0612 55%, #170209);
}
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(20px, calc((100vw - 1280px) / 2));
  background: linear-gradient(100deg, #520017, #7a0025 58%, #530018);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 9px 30px rgba(0, 0, 0, 0.32);
}
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--cream); text-decoration: none; }
.brand-name { font: italic 600 clamp(1.65rem, 3vw, 2.45rem) Georgia, serif; letter-spacing: -0.04em; }
.brand-tv { color: var(--gold); font: 800 1.55rem Georgia, serif; letter-spacing: 0.08em; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.edition { color: var(--gold-pale); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.about-button {
  border: 1px solid rgba(255, 226, 154, 0.56);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.08);
  font: 700 0.9rem inherit;
  cursor: pointer;
}
.about-button:hover, .about-button:focus-visible { border-color: var(--gold); background: rgba(242, 189, 67, 0.14); }

main {
  width: min(1280px, calc(100% - 40px));
  margin: 28px auto 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(320px, 0.88fr);
  gap: 24px;
  align-items: start;
}
.player-panel, .library {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.video-frame { aspect-ratio: 16 / 9; background: #000; }
video { display: block; width: 100%; height: 100%; background: #000; object-fit: contain; }
.now-playing { min-height: 156px; padding: 24px 26px 28px; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 0.75rem; font-weight: 850; letter-spacing: 0.16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font: 600 clamp(1.55rem, 3vw, 2.35rem) Georgia, serif; line-height: 1.12; }
h2 { margin-bottom: 0; font: 600 1.6rem Georgia, serif; }
.now-playing > p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.55; }

.library { position: sticky; top: 100px; }
.library-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding: 22px 22px 17px; border-bottom: 1px solid var(--line); }
.episode-count { margin: 0; color: var(--muted); font-size: 0.84rem; white-space: nowrap; }
.status { margin: 16px 18px; padding: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; }
.status.error { color: #ffd2d8; border-color: rgba(255, 116, 136, 0.45); background: rgba(115, 0, 26, 0.28); }
.episode-list { max-height: calc(100vh - 225px); min-height: 310px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--gold) transparent; }
.episode {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 13px;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid rgba(242, 189, 67, 0.12);
  color: var(--cream);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.episode:hover, .episode:focus-visible { outline: 0; background: rgba(242, 189, 67, 0.09); }
.episode[aria-current="true"] { background: linear-gradient(90deg, rgba(147, 0, 46, 0.8), rgba(89, 0, 28, 0.45)); box-shadow: inset 3px 0 var(--gold); }
.episode-number { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(242, 189, 67, 0.46); border-radius: 50%; color: var(--gold); font: 800 0.85rem Georgia, serif; }
.episode-copy { min-width: 0; display: grid; gap: 5px; }
.episode-copy strong { font-size: 0.92rem; line-height: 1.25; }
.episode-copy small { color: var(--muted); font-size: 0.75rem; }
.play-mark { color: var(--gold); font-size: 0.8rem; transform: translateX(0); transition: transform 150ms ease; }
.episode:hover .play-mark { transform: translateX(3px); }

footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; padding: 0 20px 28px; color: #9f9094; font-size: 0.78rem; }

dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 1px solid rgba(242, 189, 67, 0.5); border-radius: 24px; color: var(--cream); background: #260711; box-shadow: 0 28px 100px rgba(0, 0, 0, 0.62); }
dialog::backdrop { background: rgba(10, 0, 4, 0.8); backdrop-filter: blur(8px); }
.about-card { position: relative; padding: 34px 36px 30px; text-align: center; background: radial-gradient(circle at 50% 0, rgba(147, 0, 46, 0.36), transparent 23rem); }
.close-button { position: absolute; top: 13px; right: 16px; width: 40px; height: 40px; border: 0; color: var(--cream); background: transparent; font-size: 1.8rem; cursor: pointer; }
.about-logo-wrap { width: 122px; height: 122px; margin: 0 auto 20px; padding: 6px; border: 2px solid var(--gold); border-radius: 50%; background: white; box-shadow: 0 9px 28px rgba(0, 0, 0, 0.3); overflow: hidden; }
.about-logo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.about-card h2 { margin-bottom: 12px; color: var(--gold-pale); font-size: 2rem; }
.about-copy { max-width: 390px; margin: 0 auto 20px; color: var(--muted); line-height: 1.55; }
.qr-link { display: inline-grid; justify-items: center; gap: 8px; color: var(--gold-pale); font-weight: 800; text-decoration: none; }
.qr-link img { width: 126px; height: 126px; padding: 8px; border-radius: 10px; background: white; }
.producer { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: #a99a9d; font-size: 0.8rem; letter-spacing: 0.04em; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  .library { position: static; }
  .episode-list { max-height: min(620px, 65vh); }
}
@media (max-width: 560px) {
  .site-header { min-height: 68px; padding: 10px 14px; }
  .brand-name { font-size: 1.5rem; }
  .brand-tv { font-size: 1.2rem; }
  .edition { display: none; }
  main { width: min(100% - 20px, 1280px); margin-top: 12px; gap: 14px; }
  .player-panel, .library { border-radius: 15px; }
  .now-playing { min-height: 138px; padding: 19px 18px 22px; }
  .library-heading { padding: 18px 16px 14px; }
  .episode { padding: 13px 14px; grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 10px; }
  .episode-number { width: 36px; height: 36px; }
  .about-card { padding: 30px 20px 25px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
