:root {
  --bg: #eef0f4;
  --surface: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --glass-soft: rgba(255, 255, 255, 0.58);
  --line: rgba(18, 22, 30, 0.1);
  --text: #08090b;
  --muted: #6e727a;
  --red: #e50914;
  --red-soft: rgba(229, 9, 20, 0.14);
  --shadow: 0 28px 80px rgba(20, 24, 32, 0.16);
  --radius: 18px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  overflow: hidden;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 240, 244, 0.88)),
    linear-gradient(120deg, rgba(229, 9, 20, 0.06), rgba(15, 23, 42, 0.04));
  color: var(--text);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1200px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  margin: 16px auto;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--surface);
  backdrop-filter: blur(28px) saturate(140%);
  box-shadow: var(--shadow);
}

.site-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(24px) saturate(150%);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: baseline;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 850;
}

.brand span {
  color: var(--red);
}

.brand em {
  color: rgba(15, 23, 42, 0.42);
  font-style: normal;
}

.brand strong {
  font-weight: 850;
}

.share-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.share-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.09);
}

.share-button:active {
  transform: scale(0.97);
}

.share-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.app-layout {
  height: calc(100% - 64px);
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  min-height: 0;
}

.season-panel {
  min-height: 0;
  padding: 22px 26px 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.42);
}

.media-label {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}

.season-panel h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0;
}

.season-panel h2 {
  margin: 10px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.meta-row span:not(:last-child)::after {
  content: "";
  width: 3px;
  height: 3px;
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  border-radius: 50%;
  background: #b6bac1;
}

.meta-row .quality {
  padding: 2px 7px 3px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.56);
}

.meta-row .quality::after {
  display: none;
}

.lead {
  margin: 20px 0 18px;
  color: #20242b;
  font-size: 13px;
  line-height: 1.46;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.facts {
  margin: 0;
  padding-top: 18px;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  color: #252932;
  font-size: 13px;
}

.facts div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  min-width: 0;
}

.poster-card {
  margin: 18px 0 0;
  flex: 1;
  min-height: 188px;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  box-shadow: 0 16px 34px rgba(10, 14, 20, 0.14);
  transition:
    transform 240ms ease,
    box-shadow 240ms ease;
}

.poster-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(10, 14, 20, 0.18);
}

.poster-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: rgba(5, 7, 12, 0.96);
}

.watch-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 18px 24px 18px;
  display: grid;
  grid-template-rows: 332px 66px minmax(0, 1fr);
  gap: 10px;
}

.video-frame {
  width: 100%;
  height: 100%;
  max-height: 350px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: #000;
  box-shadow: 0 16px 34px rgba(10, 14, 20, 0.12);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.video-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(10, 14, 20, 0.18);
}

.video-frame video,
.video-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.video-frame video {
  object-fit: cover;
  object-position: center;
}

.quality-panel {
  position: absolute;
  top: 30px;
  right: 36px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.34);
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 750;
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.quality-buttons {
  display: flex;
  gap: 6px;
}

.quality-buttons button {
  height: 26px;
  min-width: 48px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.quality-buttons button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.quality-buttons button.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 22px rgba(229, 9, 20, 0.22);
}

.play-overlay {
  display: none;
}

.selector-panel {
  display: grid;
  gap: 8px;
  align-content: center;
}

.selector-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.selector-row p {
  margin: 0;
  color: #17191f;
  font-size: 15px;
  font-weight: 800;
}

.season-buttons,
.episode-buttons {
  min-width: 0;
  display: flex;
  gap: 10px;
}

.season-buttons button,
.episode-buttons button {
  min-width: 42px;
  height: 30px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(16px);
  color: #151820;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.season-buttons button:hover,
.episode-buttons button:hover {
  transform: translateY(-2px);
  border-color: rgba(229, 9, 20, 0.3);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.08);
}

.season-buttons button:active,
.episode-buttons button:active {
  transform: scale(0.95);
}

.season-buttons button.is-active,
.episode-buttons button.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 12px 26px rgba(229, 9, 20, 0.28);
}

.episode-summary {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 0.85fr);
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(20px) saturate(145%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.episode-kicker {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 850;
}

.episode-summary h2 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.15;
}

.episode-date {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.episode-description {
  margin: 0;
  color: #252932;
  font-size: 12px;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-gallery {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.gallery-card {
  height: 100%;
  min-height: 116px;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.gallery-card:hover {
  transform: translateY(-2px) scale(1.015);
  filter: saturate(1.08) contrast(1.04);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: rgba(5, 7, 12, 0.96);
}

@media (max-width: 980px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    width: 100%;
    min-height: 100vh;
    height: auto;
    margin: 0;
    border-radius: 0;
    border: 0;
  }

  .app-layout {
    height: auto;
    display: block;
  }

  .season-panel {
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .poster-card {
    flex: none;
    height: 300px;
  }

  .watch-panel {
    display: block;
  }

  .video-frame {
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: none;
  }

  .video-frame video {
    object-fit: cover;
  }

  .quality-panel {
    position: static;
    margin-top: 12px;
    justify-content: flex-start;
    width: max-content;
    max-width: 100%;
    background: rgba(8, 10, 14, 0.5);
  }

  .selector-panel,
  .episode-summary {
    margin-top: 22px;
  }

  .episode-summary {
    grid-template-columns: 1fr;
  }

  .episode-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 0 16px;
  }

  .share-button {
    font-size: 0;
  }

  .brand {
    gap: 7px;
    font-size: 14px;
  }

  .brand strong {
    max-width: 178px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .season-panel,
  .watch-panel {
    padding: 20px 16px;
  }

  .season-panel h1 {
    font-size: 31px;
  }

  .poster-card {
    height: 220px;
  }

  .selector-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .season-buttons,
  .episode-buttons {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 4px;
  }

  .season-buttons button,
  .episode-buttons button {
    min-width: 64px;
    height: 42px;
  }

  .episode-summary {
    padding: 18px;
  }

  .episode-gallery {
    grid-template-columns: 1fr;
  }

  .gallery-card {
    height: 180px;
  }
}
