* {
  margin: 0;
  box-sizing: border-box;
}

/* Splash intro overlay */
#splash-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s ease;
}

#splash-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

#splash-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#main-content {
  opacity: 0;
  transition: opacity 1.2s ease;
}

#main-content.fade-in {
  opacity: 1;
}

body {
  font-family: Arial, sans-serif;
  background-color: #111;
  color: white;
  min-height: 100vh;
}

.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;
}

.hidden {
  display: none !important;
}

/* ─── Top nav (logo only, sits inside hero) ──────────────────────── */
.top-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 30px;
  z-index: 3;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  height: 80px;
  width: auto;
}

/* ─── Hero (100vh, rotating) ─────────────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 0 40px 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 50% 10%;
  background-repeat: no-repeat;
  transition: opacity 400ms ease;
  opacity: 1;
  z-index: 0;
}

.hero-bg.is-fading {
  opacity: 0;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0) 40%,
    rgba(17, 17, 17, 0.85) 85%,
    #111 100%
  );
  pointer-events: none;
}

.hero-contents {
  position: relative;
  z-index: 2;
  max-width: 55%;
  transition: opacity 300ms ease;
  opacity: 1;
}

.hero-contents.is-fading {
  opacity: 0;
}

.hero-title {
  font-size: 3.5rem;
  color: #e9e7e7;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-series-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #e0e0e0;
  margin-bottom: 10px;
}

.hero-series-logo {
  height: 30px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}

.hero-summary {
  font-size: 1.2rem;
  color: #e0e0e0;
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.8);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Shared page nav (under hero / top of episodes) ─────────────── */
.page-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 40px;
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.page-nav-left,
.page-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.page-nav-right {
  margin-left: auto;
  justify-content: flex-end;
}

.shows-nav {
  padding-left: 40px;
  padding-right: 40px;
}

.shows-nav .page-nav-right {
  width: 60%;
  max-width: 60%;
  margin-left: auto;
  justify-content: flex-end;
}

.shows-nav .nav-input {
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}

.nav-button {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}

.nav-button:hover {
  background: rgba(229, 9, 20, 0.85);
  border-color: transparent;
  transform: translateX(-2px);
}

.nav-button:focus,
.nav-input:focus,
.nav-select:focus,
footer a:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.nav-input,
.nav-select {
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.95rem;
  height: 42px;
  min-width: 180px;
}

.nav-input {
  min-width: 260px;
  max-width: 380px;
}

.nav-select {
  cursor: pointer;
}

.nav-select option {
  background: #111;
  color: white;
  padding: 10px;
}

.nav-input:focus,
.nav-select:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.65);
}

.nav-count {
  color: #e0e0e0;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 110px;
  text-align: right;
}

/* ─── Genre rows (Netflix-style horizontal scroll) ──────────────── */
.genre-rows {
  padding: 20px 0 40px;
}

.genre-row {
  margin: 28px 0;
}

.genre-row-title {
  font-size: 1.4rem;
  font-weight: 600;
  padding: 0 40px 12px;
  color: #fff;
}

.genre-row-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 6px 40px 16px;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.genre-row-scroll::-webkit-scrollbar {
  height: 8px;
}
.genre-row-scroll::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

/* ─── Show card ─────────────────────────────────────────────────── */
.show-card {
  flex: 0 0 240px;
  background: #1e1e1e;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 250ms ease, box-shadow 250ms ease;
  position: relative;
}

.show-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.show-card-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-size: cover;
  background-position: center;
  background-color: #000;
}

.show-card-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.show-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.show-card-meta {
  display: flex;
  gap: 10px;
  font-size: 0.8rem;
  color: #bbb;
  flex-wrap: wrap;
}

.show-card-meta .rating {
  color: #ffcb3c;
  font-weight: 600;
}

.show-card-summary {
  font-size: 0.8rem;
  color: #aaa;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Flat grid for search results */
.shows-flat {
  padding: 30px 40px 60px;
}

#shows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

#shows-grid .show-card {
  flex: initial;
}

.no-results {
  padding: 40px;
  text-align: center;
  color: #888;
  font-size: 1.1rem;
}

/* ─── Episodes view header ──────────────────────────────────────── */
.episodes-header {
  padding: 30px 40px 10px;
}

.episodes-header h2 {
  font-size: 2rem;
  font-weight: 600;
}

/* Episode grid layout */
#episode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 30px 40px;
}

.episode-card {
  background-color: #1e1e1e;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 300ms;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 360px;
}

.episode-card:hover {
  transform: scale(1.04);
  z-index: 1;
}

.episode-card img {
  width: 100%;
  display: block;
}
.episode-card h2 {
  font-size: 15px;
  padding: 14px 16px 8px;
  min-height: 60px;
}

.episode-card p {
  font-size: 13px;
  padding: 8px 8px 20px;
  color: #aaa;
  line-height: 1.6;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer */
footer {
  padding: 30px;
  text-align: center;
  color: #d0d0d0;
  font-size: 13px;
  margin-top: 40px;
}

footer a {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
footer a:hover {
  color: #ffb3b3;
}
