:root {
  --background: #090b0f;
  --foreground: #f7f7f5;
  --surface: #12151b;
  --surface-2: #1a1e26;
  --primary: #e8ff59;
  --muted: #9299a4;
  --border: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }
html { background: var(--background); color-scheme: dark; }
body {
  background:
    radial-gradient(circle at 50% -10%, rgba(232, 255, 89, 0.1), transparent 33rem),
    var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(232, 255, 89, 0.5);
  outline-offset: 2px;
}
.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1240px;
  padding: 24px 28px;
}
.brand {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 1.05rem;
  font-weight: 800;
  gap: 10px;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.brand-mark {
  align-items: center;
  background: var(--primary);
  border-radius: 10px;
  color: #080a0d;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  transform: rotate(-3deg);
  width: 34px;
}
.brand-mark svg {
  fill: none;
  height: 21px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 21px;
}
.header-note { color: #8e949e; font-size: 0.875rem; }

.search-stage {
  margin: 0 auto;
  max-width: 840px;
  padding: clamp(76px, 11vw, 136px) 24px 88px;
  text-align: center;
}
.eyebrow {
  align-items: center;
  color: #a7adb7;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.12em;
  margin: 0;
  text-transform: uppercase;
}
.eyebrow span {
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(232, 255, 89, 0.55);
  height: 7px;
  width: 7px;
}
h1 {
  font-size: clamp(3rem, 8vw, 5.8rem);
  letter-spacing: -0.075em;
  line-height: 0.95;
  margin: 22px 0 42px;
}
.search-panel {
  background: rgba(20, 23, 29, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  padding: 8px;
}
.search-row {
  align-items: center;
  background: #f6f6f2;
  border-radius: 15px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 7px 8px 7px 17px;
}
.search-row > svg {
  fill: none;
  height: 20px;
  stroke: #70747d;
  stroke-width: 2;
  width: 20px;
}
.search-row input {
  background: transparent;
  border: 0;
  color: #101116;
  font-size: 1rem;
  min-width: 0;
  outline: 0;
  padding: 10px 0;
}
.search-row input::placeholder { color: #7f838b; }
.search-row button {
  align-items: center;
  background: #101216;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  min-width: 104px;
  padding: 0 20px;
}
.search-row button:hover { background: #292d35; }
.search-row button:disabled { cursor: wait; opacity: 0.75; }

.featured { margin: 0 auto; max-width: 1240px; padding: 0 28px 80px; }
.section-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-heading p, .results-header > p {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 7px;
  text-transform: uppercase;
}
.section-heading h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.045em;
  margin: 0;
}
.section-heading > span { color: #7d838e; font-size: 0.84rem; }
.poster-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.poster-card, .result-card {
  animation: card-in 500ms both;
  background: transparent;
  border: 0;
  cursor: pointer;
  min-width: 0;
  padding: 0;
  text-align: left;
}
.poster-art, .result-poster {
  aspect-ratio: 2 / 2.75;
  background: #181b21;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}
.poster-art::after, .result-poster::after {
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.7));
  content: "";
  inset: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 180ms ease;
}
.poster-art img, .result-poster img {
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
  width: 100%;
}
.poster-card:hover img, .result-card:hover img { transform: scale(1.035); }
.poster-card:hover .poster-art::after,
.poster-card:focus-visible .poster-art::after,
.result-card:hover .result-poster::after,
.result-card:focus-visible .result-poster::after,
.poster-card:hover .play-button,
.poster-card:focus-visible .play-button,
.result-card:hover .play-button,
.result-card:focus-visible .play-button { opacity: 1; }
.play-button {
  align-items: center;
  background: var(--primary);
  border-radius: 50%;
  bottom: 14px;
  color: #0b0d10;
  display: flex;
  font-size: 0.9rem;
  height: 42px;
  justify-content: center;
  opacity: 0;
  padding-left: 2px;
  position: absolute;
  right: 14px;
  transition: opacity 180ms ease;
  width: 42px;
  z-index: 1;
}
.poster-copy { display: flex; flex-direction: column; gap: 6px; padding-top: 13px; }
.poster-copy strong {
  display: block;
  font-size: 0.96rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poster-copy > span { color: #858b95; font-size: 0.78rem; }
.poster-fallback {
  align-items: center;
  background: linear-gradient(145deg, rgba(232, 255, 89, 0.16), transparent 45%), #1b1f26;
  color: #b7bdc6;
  display: flex;
  flex-direction: column;
  font-weight: 800;
  gap: 14px;
  height: 100%;
  justify-content: center;
  padding: 20px;
  text-align: center;
  width: 100%;
}
.poster-fallback b { color: var(--primary); font-size: 2.2rem; }

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #6f7680;
  display: flex;
  font-size: 0.76rem;
  gap: 20px;
  justify-content: center;
  margin: 0 auto;
  max-width: 1184px;
  padding: 25px;
}

.media-dialog {
  background: transparent;
  border: 0;
  color: var(--foreground);
  height: auto;
  max-height: min(90vh, 880px);
  max-width: min(1000px, calc(100vw - 32px));
  overflow: visible;
  padding: 0;
  width: 100%;
}
.media-dialog::backdrop {
  backdrop-filter: blur(12px);
  background: rgba(3, 4, 7, 0.84);
}
.dialog-inner {
  background: #11141a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.65);
  max-height: min(90vh, 880px);
  overflow: auto;
  padding: 12px;
  position: relative;
}
.close-button {
  align-items: center;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  font-size: 1.35rem;
  height: 38px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 24px;
  top: 24px;
  width: 38px;
  z-index: 4;
}
.results-header { padding: 34px 32px 24px; }
.results-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin: 0 0 8px;
}
.results-header > span { color: var(--muted); font-size: 0.9rem; }
.dialog-search-row {
  align-items: center;
  background: #f6f6f2;
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  margin-top: 20px;
  max-width: 580px;
  padding: 0 14px;
}
.dialog-search-row svg {
  fill: none;
  height: 18px;
  stroke: #70747d;
  stroke-width: 2;
  width: 18px;
}
.dialog-search-row input {
  background: transparent;
  border: 0;
  color: #101116;
  font-size: 0.95rem;
  outline: 0;
  padding: 13px 0;
  width: 100%;
}
.results-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px 32px 34px;
}
.result-card .poster-copy { padding-top: 10px; }
.result-card .poster-copy strong { font-size: 0.88rem; }
.result-card .poster-copy > span { font-size: 0.75rem; }
.result-poster { border-radius: 12px; }
.loading-grid {
  display: contents;
}
.loading-grid span {
  animation: pulse 1.4s ease-in-out infinite;
  aspect-ratio: 2 / 2.75;
  background: #1b1e25;
  border-radius: 12px;
}
.empty-state {
  align-items: center;
  color: #89909b;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 330px;
  padding: 40px;
  text-align: center;
}
.empty-state[hidden] { display: none; }
.empty-state h3 { color: #fff; margin: 14px 0 6px; }
.empty-state p { font-size: 0.9rem; margin: 0; }
.status-icon { color: var(--primary); font-size: 2.2rem; }

.back-button {
  background: rgba(10, 11, 15, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  left: 24px;
  padding: 9px 13px;
  position: absolute;
  top: 24px;
  z-index: 4;
}
.player-shell {
  aspect-ratio: 16 / 9;
  background: #050608;
  border-radius: 14px;
  overflow: hidden;
}
.player-shell iframe { border: 0; height: 100%; width: 100%; }
.episode-controls {
  align-items: end;
  background: #181b22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
}
.episode-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}
.episode-select > span {
  color: #8f96a1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.episode-select select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #7f8791 50%) calc(100% - 17px) 18px / 5px 5px no-repeat,
    linear-gradient(135deg, #7f8791 50%, transparent 50%) calc(100% - 12px) 18px / 5px 5px no-repeat,
    #0e1015;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  height: 42px;
  padding: 0 36px 0 12px;
  width: 100%;
}
.episode-select select:disabled { cursor: wait; opacity: 0.55; }
.now-playing {
  color: #8f96a1;
  font-size: 0.82rem;
  margin: 0 0 13px auto;
  white-space: nowrap;
}
.now-playing strong { color: var(--primary); margin-left: 5px; }
.detail-header { padding: 25px 24px 20px; }
.detail-meta {
  align-items: center;
  color: #959ca7;
  display: flex;
  font-size: 0.79rem;
  gap: 11px;
}
.media-badge {
  background: rgba(232, 255, 89, 0.12);
  border: 1px solid rgba(232, 255, 89, 0.23);
  border-radius: 999px;
  color: var(--primary);
  font-weight: 700;
  padding: 5px 8px;
}
.rating { color: #ffcc4a; }
.detail-header h2 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  letter-spacing: -0.055em;
  line-height: 1;
  margin: 14px 0 12px;
}
.detail-header p {
  color: #9aa1ac;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  max-width: 730px;
}
.noscript {
  background: #e8ff59;
  bottom: 20px;
  color: #090b0f;
  font-weight: 700;
  left: 50%;
  padding: 12px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 10;
}
[hidden] { display: none !important; }

@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
}

@media (max-width: 760px) {
  .header-note, .section-heading > span { display: none; }
  .search-stage { padding-bottom: 64px; padding-top: 70px; }
  h1 { margin-bottom: 34px; }
  .poster-grid { gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 16px;
    padding-right: 16px;
  }
  .results-header { padding-left: 16px; padding-right: 58px; }
}
@media (max-width: 520px) {
  .site-header { padding: 18px 20px; }
  .search-stage { padding-left: 16px; padding-right: 16px; }
  .search-panel { border-radius: 18px; }
  .search-row { grid-template-columns: auto minmax(0, 1fr); }
  .search-row button { grid-column: 1 / -1; width: 100%; }
  .featured { padding-left: 16px; padding-right: 16px; }
  .media-dialog { max-height: calc(100vh - 16px); max-width: calc(100vw - 16px); }
  .dialog-inner { max-height: calc(100vh - 16px); padding: 8px; }
  .back-button { left: 16px; top: 16px; }
  .close-button { right: 16px; top: 16px; }
  .episode-controls { align-items: stretch; flex-wrap: wrap; padding: 11px; }
  .episode-select { flex: 1 1 calc(50% - 6px); min-width: 120px; }
  .now-playing { margin: 0; text-align: center; width: 100%; }
  .detail-header { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
