:root {
  color-scheme: light;
  --burgundy: #65001d;
  --burgundy-bright: #93002e;
  --wine: #3a0a18;
  --gold: #f2bd43;
  --gold-pale: #ffe29a;
  --cream: #fff8e8;
  --paper: #fffdf8;
  --ink: #3c1620;
  --muted: #75666a;
  --panel: rgba(255, 253, 248, 0.96);
  --line: rgba(101, 0, 29, 0.17);
  font-family: Montserrat, Avenir, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 300px; background: #f4ede8; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 4%, rgba(177, 20, 66, 0.11), transparent 34rem),
    linear-gradient(150deg, #fffaf2, #f6ede7 58%, #fffdf8);
}
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 20px 55px rgba(76, 25, 39, 0.12);
  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(--burgundy-bright); 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: #75001f; border-color: rgba(117, 0, 31, 0.28); background: #fff0f2; }
.episode-list { max-height: calc(100vh - 225px); min-height: 310px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--burgundy) #f2e8e3; }
.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(101, 0, 29, 0.1);
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.episode:hover, .episode:focus-visible { outline: 0; background: #f9eee9; }
.episode[aria-current="true"] { color: var(--cream); background: linear-gradient(100deg, #7f0027, #5d001c); box-shadow: inset 4px 0 var(--gold); }
.episode-number { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(101, 0, 29, 0.34); border-radius: 50%; color: var(--burgundy-bright); font: 800 0.85rem Georgia, serif; }
.episode[aria-current="true"] .episode-number { color: var(--gold); border-color: rgba(242, 189, 67, 0.68); }
.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; }
.episode[aria-current="true"] .episode-copy small { color: #eadde0; }
.play-mark { color: var(--burgundy-bright); font-size: 0.8rem; transform: translateX(0); transition: transform 150ms ease; }
.episode[aria-current="true"] .play-mark { color: var(--gold); }
.episode:hover .play-mark { transform: translateX(3px); }

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

dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 1px solid rgba(101, 0, 29, 0.25); border-radius: 24px; color: var(--ink); background: var(--paper); box-shadow: 0 28px 100px rgba(55, 12, 25, 0.34); }
dialog::backdrop { background: rgba(42, 15, 23, 0.55); backdrop-filter: blur(8px); }
.about-card { position: relative; padding: 34px 36px 30px; text-align: center; background: radial-gradient(circle at 50% 0, rgba(177, 20, 66, 0.1), transparent 23rem); }
.close-button { position: absolute; top: 13px; right: 16px; width: 40px; height: 40px; border: 0; color: var(--burgundy); 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(--burgundy); 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(--burgundy); 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: #867479; 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; }
}
