:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: #000;
  color: #f5f5f7;
  font-synthesis: none;
  --edge: clamp(18px, 4vw, 64px);
  --edge-left: max(var(--edge), env(safe-area-inset-left));
  --edge-right: max(var(--edge), env(safe-area-inset-right));
}
:root, [data-theme="dark"] { --lg-fill: #59b3ff; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { min-width: 44px; min-height: 44px; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:not(.lg-button):focus-visible, a:focus-visible, input:not(.lg-input input):focus-visible, video:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
h1:focus { outline: none; }
::selection { background: #ffffff35; }
#app { min-height: 100svh; }
.hero { min-height: calc(550px + env(safe-area-inset-top)); position: relative; display: flex; align-items: end; isolation: isolate; background: var(--hero-tone, #171719); }
.hero-art, .hero-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art { object-fit: cover; object-position: center 25%; z-index: -2; }
.hero-shade { z-index: -1; background: linear-gradient(180deg, #0003 0%, transparent 25%, #0002 45%, color-mix(in srgb, var(--hero-tone), transparent 20%) 72%, var(--hero-tone) 92%); }
.hero-toolbar { position: absolute; top: max(18px, calc(env(safe-area-inset-top) + 8px)); left: max(18px, env(safe-area-inset-left)); right: max(18px, env(safe-area-inset-right)); }
.hero-information { width: min(100%, 880px); margin: 0 auto; padding: calc(clamp(300px, 86vw, 400px) + env(safe-area-inset-top)) var(--edge-right) 14px var(--edge-left); text-align: center; }
.hero h1 { font-size: clamp(32px, 5.5vw, 64px); font-weight: 750; line-height: 1.05; letter-spacing: -.035em; margin: 0; text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 2px 18px #0009; }
.genre-line { margin: 8px 0 0; font-size: 14px; line-height: 20px; color: #f5f5f7; }
.episode-line { margin: 4px 0 0; font-size: 13px; line-height: 18px; color: #e1e1e5; }
.hero-actions { display: flex; justify-content: center; gap: 12px; margin: 12px 0; align-items: center; }
.lg-button.play-action { color: #0b0b0d; font-size: 17px; font-weight: 650; }
.hero-actions .play-action { min-width: 167px; }
.play-runtime { margin-left: 9px; font-variant-numeric: tabular-nums; }
.cast-action { font-weight: 600; }
.synopsis { text-align: left; font-size: 14px; line-height: 19px; color: #e3e3e7; position: relative; }
.synopsis p { margin: 0; }
.synopsis p.clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.synopsis.is-expanded { padding-bottom: 30px; }
.synopsis-fade { position: absolute; bottom: 0; right: 0; width: 90px; height: 19px; background: linear-gradient(90deg, transparent, var(--hero-tone) 42%); }
.more-button { position: absolute; bottom: -12px; right: -6px; border: 0; color: #f5f5f7; background: transparent; padding: 0 6px; font-size: 13px; font-weight: 650; text-transform: uppercase; }
.more-button span { display: block; border-radius: 99px; padding: 1px 7px; background: #ffffff24; line-height: 20px; }
.media-facts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 10px; margin-top: 10px; color: #d2d2d7; font-size: 13px; line-height: 17px; }
.format-badge { border: 1.5px solid currentColor; border-radius: 3px; padding: 0 4px; line-height: 1.1; font-weight: 750; font-size: 11px; }
.player-status { min-height: 0; margin: 0; font-size: 14px; line-height: 1.5; }
.player-status:not(:empty) { margin-top: 12px; }
.content-section { padding: 17px var(--edge-right) 120px var(--edge-left); }
.content-section h2 { font-size: 20px; letter-spacing: -.025em; line-height: 1.2; margin: 0 0 14px; }
.content-rail { display: flex; gap: 12px; overflow-x: auto; padding: 3px 0 10px; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.episode-card, .video-card { padding: 0; text-align: left; border: 0; color: inherit; background: transparent; cursor: pointer; flex: 0 0 min(72vw, 420px); }
.episode-card { flex-basis: min(63vw, 420px); }
.episode-image { display: block; position: relative; aspect-ratio: 16/10; overflow: hidden; border-radius: 15px; background: #1c1c1e; }
.episode-image > img { width: 100%; height: 100%; object-fit: cover; }
.episode-image > svg { width: 48px; height: 48px; margin: 30px; color: #86868b; }
.episode-caption { position: absolute; inset: auto 0 0; padding: 45px 16px 14px; background: linear-gradient(transparent, #000c); }
.episode-caption strong { font-size: 17px; line-height: 1.3; display: block; }
.episode-caption > span { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13px; color: #dddde1; }
.episode-caption svg { width: 15px; height: 15px; }
.bottom-navigation { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: calc((100% + env(safe-area-inset-left) - env(safe-area-inset-right)) / 2); transform: translateX(-50%); width: max-content; max-width: calc(100% - var(--edge-left) - var(--edge-right)); z-index: 5; }
.library-page { padding: 0 var(--edge-right) 120px var(--edge-left); min-height: 100svh; }
.library-header { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding-top: env(safe-area-inset-top); }
.wordmark { font-size: 16px; font-weight: 650; letter-spacing: -.025em; }
.library-page > h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -.035em; margin: 18px 0 22px; }
.empty-library { min-height: 48svh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.empty-library > svg { width: 54px; height: 54px; color: #8e8e93; }
.empty-library h2 { font-size: 22px; letter-spacing: -.02em; margin: 24px 0 8px; }
.empty-library p { font-size: 16px; color: #aaaab2; line-height: 1.5; max-width: 28ch; margin: 0 0 22px; }
.library-note { font-size: 14px; color: #aaaab2; margin: 0 0 22px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 28px 20px; }
.card-image { position: relative; display: block; aspect-ratio: 16/10; border-radius: 14px; overflow: hidden; background: #1c1c1e; }
.card-image > img { width: 100%; height: 100%; object-fit: cover; }
.card-image > svg { width: 46px; height: 46px; margin: 30px; color: #8e8e93; }
.card-play { position: absolute; bottom: 12px; left: 12px; }
.card-play svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 4px #000); }
.card-title { display: block; font-weight: 650; font-size: 17px; margin-top: 12px; }
.card-caption { display: block; color: #aaaab2; font-size: 14px; margin-top: 4px; }
.library-search { margin-bottom: 24px; }
label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 10px; }
input { font-size: 16px; }
.open-action { width: 100%; margin-top: 18px; }
.form-status { min-height: 1.5em; color: #dddde1; font-size: 14px; line-height: 1.5; margin-bottom: 0; }
.cast-option + .cast-option { margin-top: 24px; }
.cast-option h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.cast-option p, .cast-help { font-size: 15px; color: #dddde1; line-height: 1.5; }
.cast-option button { width: 100%; }
.cast-help { min-height: 1.5em; }
.player-dialog { padding: 0; border: 0; margin: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; background: #000; color: #fff; }
.player-dialog::backdrop { background: #000; }
.player-dialog video { width: 100%; height: 100%; display: block; object-fit: contain; }
.player-toolbar { position: absolute; top: max(18px, env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); right: max(18px, env(safe-area-inset-right)); display: flex; justify-content: space-between; z-index: 1; }
@media (min-width: 800px) {
  .hero { min-height: max(720px, min(85svh, 980px)); }
  .hero-information { padding-top: 280px; padding-bottom: 36px; }
  .genre-line { font-size: 18px; }
  .episode-line { font-size: 16px; }
  .hero-actions { margin-top: 24px; }
  .media-facts { justify-content: center; }
  .synopsis { text-align: left; max-width: 65ch; margin: auto; font-size: 16px; line-height: 1.45; }
  .synopsis-fade { height: 1.45em; }
  .content-section h2 { font-size: 28px; }
  .library-page { max-width: 1500px; margin: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-information { animation: reveal-content .45s cubic-bezier(.16,1,.3,1) both; }
  .episode-image img, .card-image img { transition: transform .2s ease-out; }
  .episode-card:hover img, .video-card:hover img { transform: scale(1.025); }
  @keyframes reveal-content { from { opacity: .55; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
}
