* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #0b0b0f;
  color: #f5f5f5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.hidden { display: none !important; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: rgba(11,11,15,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #222;
}
.logo { font-size: 22px; font-weight: 900; letter-spacing: 1px; color: #fff; white-space: nowrap; }
.logo span { color: #e50914; }
.nav { display: flex; gap: 6px; }
.nav-btn {
  background: transparent; color: #ccc; border: none;
  padding: 8px 12px; border-radius: 8px; font-size: 15px; cursor: pointer;
}
.nav-btn.active { background: #222; color: #fff; }
.search-wrap { margin-left: auto; }
.search-wrap input {
  background: #1a1a20; color: #fff; border: 1px solid #333;
  border-radius: 999px; padding: 9px 14px; font-size: 15px;
  width: 210px; outline: none;
}
.search-wrap input:focus { border-color: #e50914; }

/* Hero */
.hero {
  min-height: 300px;
  display: flex; align-items: flex-end;
  padding: 28px 20px;
  background: linear-gradient(135deg, #7b0d16, #1c0a2e 55%, #0b0b0f);
  border-bottom: 1px solid #222;
}
.hero-kicker { color: #ffb3b8; letter-spacing: 3px; font-size: 12px; font-weight: 700; }
.hero h1 { font-size: 42px; margin: 6px 0 8px; }
.hero p { color: #ddd; max-width: 560px; font-size: 16px; line-height: 1.5; }
.btn-play {
  margin-top: 16px; background: #e50914; color: #fff; border: none;
  padding: 12px 22px; border-radius: 8px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-play:active { transform: scale(.98); }

/* Rows and cards */
.row { padding: 22px 20px 4px; }
.row h2 { font-size: 20px; margin-bottom: 12px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.card {
  background: #16161c; border: 1px solid #26262e; border-radius: 12px;
  overflow: hidden; cursor: pointer; text-align: left; color: #fff; padding: 0;
}
.card:hover { border-color: #e50914; }
.poster {
  position: relative; overflow: hidden;
  height: 200px; display: flex; align-items: flex-end; padding: 10px;
  font-weight: 800; font-size: 17px; line-height: 1.2;
  background: linear-gradient(160deg, #3b0764, #7b0d16);
}
.poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster span { position: relative; z-index: 1; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.poster.has-img span { display: none; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-size: 15px; font-weight: 700; }
.card-meta { color: #aaa; font-size: 13px; margin-top: 4px; }
.card-desc { color: #bbb; font-size: 13px; margin-top: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { color: #999; padding: 12px 4px; }

/* Detail */
.detail { padding: 20px; max-width: 900px; margin: 0 auto; }
.detail-hero { border-radius: 12px; padding: 18px; }
.btn-back {
  background: #1a1a20; color: #fff; border: 1px solid #333;
  padding: 9px 14px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.detail-hero { margin-top: 16px; }
.detail-hero h1 { font-size: 32px; margin-bottom: 8px; }
.detail-meta { color: #aaa; font-size: 14px; margin-bottom: 10px; }
.detail-hero p { color: #ddd; line-height: 1.6; }
.episodes { margin-top: 22px; }
.episodes h3 { font-size: 18px; margin-bottom: 10px; }
.episode {
  display: flex; gap: 12px; align-items: center;
  background: #16161c; border: 1px solid #26262e; border-radius: 10px;
  padding: 12px; margin-bottom: 10px; cursor: pointer; width: 100%;
  color: #fff; text-align: left;
}
.episode:hover { border-color: #e50914; }
.ep-num {
  min-width: 38px; height: 38px; border-radius: 50%;
  background: #e50914; display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.ep-title { font-weight: 700; }
.ep-meta { color: #aaa; font-size: 13px; }

/* Player */
.player-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.player-box { width: 100%; max-width: 900px; }
.player-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.player-head span { font-weight: 700; font-size: 17px; }
.btn-close {
  background: #222; color: #fff; border: 1px solid #444;
  width: 38px; height: 38px; border-radius: 50%; font-size: 17px; cursor: pointer;
}
.player-box video { width: 100%; max-height: 70vh; background: #000; border-radius: 12px; }
.skip-row {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 12px;
}
.skip-btn {
  background: #1a1a20; color: #fff; border: 1px solid #444;
  padding: 12px 22px; border-radius: 999px; font-size: 16px; font-weight: 700;
  cursor: pointer; min-width: 130px;
}
.skip-btn:active { background: #e50914; border-color: #e50914; transform: scale(.97); }
.skip-flash {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.75); color: #fff; border: 2px solid #e50914;
  border-radius: 999px; padding: 14px 26px; font-size: 22px; font-weight: 800;
  pointer-events: none; z-index: 60;
}
.player-error {
  margin-top: 10px; background: #2a1215; border: 1px solid #7b0d16;
  color: #ffc9cd; padding: 12px; border-radius: 10px; font-size: 14px; line-height: 1.5;
}

.footer { padding: 26px 20px 34px; color: #888; font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .search-wrap { width: 100%; }
  .search-wrap input { width: 100%; }
  .hero h1 { font-size: 32px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .poster { height: 170px; }
}
