:root {
  --bg: #050505;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f6f6f6;
  --brand: #ffffff;
  --panel-soft: rgba(14, 14, 14, 0.82);
  --panel-strong: rgba(10, 10, 10, 0.96);
  --shadow: 0 28px 120px rgba(0, 0, 0, 0.55);
  --range-fill: 100%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 22%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #000 0%, #070707 50%, #000 100%);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.gate-active {
  overflow: hidden;
}

body.gate-active .page-shell {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Gate and cold-open overlays share the same full-screen shell. */
.arrival-gate,
.cold-open {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.arrival-gate {
  z-index: 1100;
  cursor: none;
}

.arrival-gate.hidden,
.cold-open.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.arrival-trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.trail-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.35),
    0 0 24px rgba(255, 255, 255, 0.12);
  transform: translate(-50%, -50%);
  opacity: 0;
}

.arrival-prompt {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  font: inherit;
  font-size: clamp(1.2rem, 2.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  cursor: pointer;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.18),
    0 0 32px rgba(255, 255, 255, 0.08);
  animation: enter-pulse 2.4s ease-in-out infinite;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.arrival-prompt:hover {
  opacity: 1;
}

.arrival-prompt:focus-visible {
  outline: none;
  opacity: 1;
}

.cold-open-terminal {
  display: grid;
  gap: 16px;
  width: min(760px, calc(100vw - 48px));
  font-family: "Consolas", "Courier New", monospace;
  text-align: left;
  transition: opacity 180ms ease, transform 180ms ease;
}

.cold-open-terminal.hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.cold-open-lines {
  display: grid;
  gap: 10px;
}

.cold-open-line {
  position: relative;
  margin: 0;
  opacity: 0;
  min-height: 1.4em;
  padding-left: 1.2em;
  padding-right: 0.32em;
  transform: none;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--text);
}

.cold-open-line.is-visible {
  opacity: 1;
}

.cold-open-line::before {
  content: ">";
  position: absolute;
  left: 0;
  top: 0;
  color: rgba(255, 255, 255, 0.72);
}

.typing-caret {
  display: inline-block;
  width: 1px;
  height: 1.05em;
  margin-left: 0.16em;
  vertical-align: -0.14em;
  background: rgba(255, 255, 255, 0.9);
}

/* Keep the question visually separate without changing the layout cadence. */
.binge-prompt {
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: none;
  pointer-events: none;
}

.binge-prompt.is-visible {
  pointer-events: auto;
  animation: prompt-fade-in 520ms ease forwards;
}

.binge-prompt-text {
  position: relative;
  margin: 0;
  min-height: 1.4em;
  padding-left: 1.2em;
  padding-right: 0.32em;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #7dff9b;
  text-shadow:
    0 0 10px rgba(125, 255, 155, 0.28),
    0 0 24px rgba(125, 255, 155, 0.12);
}

.binge-prompt-text::before {
  content: ">";
  position: absolute;
  left: 0;
  top: 0;
  color: rgba(125, 255, 155, 0.82);
}

.binge-prompt-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding-left: 1.2em;
  opacity: 0;
  pointer-events: none;
}

.binge-prompt-actions.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.binge-prompt-button {
  min-width: 72px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 400;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.binge-prompt-button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.rejection-cutscene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.rejection-cutscene.hidden {
  display: none;
}

.rejection-cutscene-video {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  background: #000;
}

.page-shell {
  width: min(1180px, calc(100% - 24px));
  padding: 16px 0;
  margin: auto 0;
}

.season-header {
  margin: 0 0 20px;
}

.season-kicker {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.season-header h1,
.episode-panel h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  letter-spacing: -0.03em;
}

.player-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(7, 7, 7, 0.98));
  box-shadow: var(--shadow);
  animation: fade-up 900ms ease;
}

.episode-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(8, 8, 8, 0.96));
  box-shadow: var(--shadow);
}

.episode-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.episode-panel-copy {
  display: grid;
  gap: 12px;
}

.season-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.season-tab {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.season-tab:hover,
.season-tab:focus {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
  outline: none;
}

.season-tab.active {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

#episodeMeta {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.95rem;
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.episode-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.episode-card:hover,
.episode-card:focus {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  outline: none;
}

.episode-card.active {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.episode-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  background: #111;
}

.episode-label {
  font-size: 0.96rem;
  font-weight: 700;
}

.card-glow {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12), transparent 22%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.08), transparent 18%);
  pointer-events: none;
}

.video-frame {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.72)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(135deg, #151515, #020202);
  aspect-ratio: 16 / 9;
}

#playerContainer:fullscreen,
#playerContainer:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  background: #000;
}

#playerContainer:fullscreen .video,
#playerContainer:-webkit-full-screen .video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#playerContainer:fullscreen .bottom-gradient,
#playerContainer:-webkit-full-screen .bottom-gradient {
  height: 30%;
}

#playerContainer:fullscreen .controls,
#playerContainer:-webkit-full-screen .controls {
  left: 24px;
  right: 24px;
  bottom: 24px;
}

.video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

.controls {
  position: absolute;
  left: 18px;
  right: 18px;
  z-index: 3;
}

.control-button,
.center-play {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  backdrop-filter: blur(18px);
  color: var(--text);
  transition: border-color 180ms ease, background 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.control-button,
.center-play,
.progress,
.volume {
  cursor: pointer;
}

.control-button:hover,
.center-play:hover {
  border-color: var(--line-strong);
  background: rgba(28, 28, 28, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.bottom-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
  pointer-events: none;
  z-index: 1;
}

.controls {
  bottom: 18px;
}

.progress-wrap {
  margin-bottom: 16px;
}

.progress,
.volume {
  appearance: none;
  background: transparent;
}

.progress,
.volume {
  width: 100%;
}

.progress::-webkit-slider-runnable-track,
.volume::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.94) 0, rgba(255, 255, 255, 0.94) var(--range-fill), rgba(255, 255, 255, 0.18) var(--range-fill), rgba(255, 255, 255, 0.18) 100%);
}

.progress::-webkit-slider-thumb,
.volume::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  margin-top: -5px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.progress::-moz-range-track,
.volume::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.progress::-moz-range-thumb,
.volume::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.controls-row,
.controls-group,
.volume-wrap,
.settings-wrap {
  display: flex;
  align-items: center;
}

.controls-row {
  justify-content: space-between;
}

.controls-group {
  gap: 12px;
}

.controls-group-right {
  justify-content: flex-end;
  gap: 10px;
}

.control-button,
.center-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.center-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 82px;
  height: 82px;
  z-index: 2;
}

.center-play.hidden {
  opacity: 0;
  pointer-events: none;
}

.center-play-icon {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid white;
}

.time-readout {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
}

.time-separator {
  margin: 0 6px;
  color: rgba(255, 255, 255, 0.5);
}

.settings-wrap {
  position: relative;
}

.settings-wrap.open #settingsButton {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(34, 34, 34, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.settings-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  min-width: 180px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--panel-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
  transform-origin: bottom right;
  animation: menu-pop 180ms ease;
}

.settings-menu.hidden {
  display: none;
}

.settings-title {
  padding: 4px 8px 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-status {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.settings-options {
  display: grid;
  gap: 4px;
}

.settings-option {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.settings-option:hover,
.settings-option:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.settings-option.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.16);
}

.settings-option.active::after {
  content: "Selected";
  float: right;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.76rem;
}

.settings-option:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.settings-empty {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.volume-wrap {
  gap: 12px;
  min-width: 180px;
  padding: 0 14px 0 8px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.volume-wrap:hover,
.volume-wrap:focus-within {
  border-color: var(--line-strong);
  background: rgba(28, 28, 28, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.volume-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.volume-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.volume {
  width: 100%;
}

.icon,
.icon-holder {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
}

.icon-holder {
  line-height: 0;
}

.icon-holder svg {
  width: 18px;
  height: 18px;
  display: block;
}

.icon-play::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid currentColor;
}

.icon-pause::before,
.icon-pause::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: currentColor;
}

.icon-pause::before {
  left: 3px;
}

.icon-pause::after {
  right: 3px;
}

.icon-fullscreen::before,
.icon-fullscreen::after,
.icon-fullscreen span::before,
.icon-fullscreen span::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
}

.icon-fullscreen::before {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
}

.icon-fullscreen::after {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
}

.icon-fullscreen span::before {
  bottom: 0;
  left: 0;
  border-right: 0;
  border-top: 0;
}

.icon-fullscreen span::after {
  right: 0;
  bottom: 0;
  border-left: 0;
  border-top: 0;
}

.icon-pip::before,
.icon-pip::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.icon-pip::before {
  inset: 2px 1px 2px 1px;
}

.icon-pip::after {
  width: 7px;
  height: 5px;
  right: 1px;
  bottom: 1px;
  background: currentColor;
}

.icon-gear::before,
.icon-gear::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
}

.icon-gear::before {
  border: 2px solid currentColor;
}

.icon-gear::after {
  inset: 0;
  background:
    linear-gradient(currentColor, currentColor) center 0 / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) center 100% / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 0 center / 4px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 100% center / 4px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 15% 15% / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 85% 15% / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 15% 85% / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 85% 85% / 2px 4px no-repeat;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes enter-pulse {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.995);
    text-shadow:
      0 0 8px rgba(255, 255, 255, 0.1),
      0 0 20px rgba(255, 255, 255, 0.05);
  }

  50% {
    opacity: 1;
    transform: scale(1);
    text-shadow:
      0 0 16px rgba(255, 255, 255, 0.22),
      0 0 44px rgba(255, 255, 255, 0.1);
  }
}

@keyframes prompt-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes menu-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 840px) {
  .page-shell {
    width: min(100%, calc(100% - 16px));
    padding: 8px 0;
  }

  .cold-open-terminal {
    width: min(100vw - 28px, 640px);
  }

  .cold-open-lines {
    gap: 12px;
  }

  .cold-open-line {
    font-size: clamp(0.98rem, 4.6vw, 1.12rem);
  }

  .binge-prompt-text {
    font-size: clamp(0.95rem, 4.3vw, 1.05rem);
  }

  .season-header {
    margin-bottom: 14px;
  }

  .episode-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .season-switcher {
    width: 100%;
  }

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

  .controls-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .controls-group-right {
    width: 100%;
    justify-content: space-between;
  }

  .settings-wrap {
    align-self: stretch;
  }

  .volume-wrap {
    min-width: 0;
    width: 100%;
  }

  .volume {
    width: 100%;
  }

  .controls {
    left: 12px;
    right: 12px;
  }
}
