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

:root {
  --bg1: #0f2027;
  --bg2: #203a43;
  --bg3: #2c5364;
  --card: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: #d2dde3;
  --accent: #e50914;
  --accent-hover: #f6121d;
  --button-dark: #111;
  --button-dark-hover: #1b1b1b;
  --top-button-bg: rgba(255, 255, 255, 0.12);
  --top-button-border: rgba(255, 255, 255, 0.16);
}

body.light-mode {
  --bg1: #f4f7fb;
  --bg2: #e8eef5;
  --bg3: #dce7f1;
  --card: rgba(255, 255, 255, 0.72);
  --card-border: rgba(0, 0, 0, 0.08);
  --text: #16202a;
  --muted: #52606d;
  --accent: #c8102e;
  --accent-hover: #b20e28;
  --button-dark: #ffffff;
  --button-dark-hover: #f3f6f9;
  --top-button-bg: rgba(255, 255, 255, 0.75);
  --top-button-border: rgba(0, 0, 0, 0.08);
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.background {
  position: fixed;
  inset: 0;
  background: linear-gradient(270deg, var(--bg1), var(--bg2), var(--bg3));
  background-size: 600% 600%;
  animation: gradientMove 14s ease infinite;
  z-index: -1;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 40px;
  text-align: center;
}

.top-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.top-button {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--top-button-border);
  background: var(--top-button-bg);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.glow-button {
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: var(--accent);
  color: white;
  box-shadow: 0 0 24px rgba(229, 9, 20, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.glow-button:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 34px rgba(229, 9, 20, 0.7);
  background: var(--accent-hover);
}

.card {
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  text-align: left;
  padding: 22px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  animation: fadeIn 0.45s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  touch-action: pan-y;
}

.episode-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.episode-image.loaded {
  opacity: 1;
}

.image-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.95rem;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.12), transparent 40%),
    rgba(255,255,255,0.04);
}

.meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge {
  color: #ffd0d3;
  font-size: 0.9rem;
  margin-bottom: 10px;
  font-weight: 600;
}

body.light-mode .badge {
  color: #8b2332;
}

.episode-title {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.12;
  margin-bottom: 18px;
}

.swipe-hint {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.netflix-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  background: var(--button-dark);
  border: 1px solid var(--card-border);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease;
}

.netflix-link:hover {
  transform: translateY(-1px);
  background: var(--button-dark-hover);
}

.credit {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .container {
    padding-top: 40px;
  }

  .card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding-top: 24px;
  }

  .title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .glow-button {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
  }

  .card {
    padding: 16px;
    gap: 16px;
    border-radius: 18px;
  }

  .episode-title {
    font-size: 1.4rem;
  }

  .badge {
    font-size: 0.8rem;
  }

  .top-bar {
    flex-direction: column;
  }

  .top-button {
    width: 100%;
  }
}

.github-float {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  border-radius: 50%;
  border: 1px solid var(--top-button-border);
  background: var(--top-button-bg);
  color: var(--text);

  backdrop-filter: blur(10px);

  transition: transform 0.2s ease, background 0.2s ease;
}

.github-float {
  animation: fadeIn 0.6s ease;
}

.github-float:hover {
  transform: scale(1.1);
  background: var(--button-dark-hover);
  box-shadow: 0 0 12px rgba(255,255,255,0.15);
}

@media (max-width: 480px) {
  .github-float {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}

.episode-summary {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
  margin-bottom: 16px;
}