/* ═══════════════ HSFlix — premium dark cinematic theme ═══════════════ */
:root {
  --red: #e50914;
  --red-bright: #f6121d;
  --red-dark: #a8060f;
  --bg: #0b0b0d;
  --bg-soft: #141417;
  --bg-card: #1a1a1f;
  --bg-elev: #222228;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f6f6f8;
  --text-dim: #b9b9c2;
  --text-faint: #7d7d88;
  --radius: 10px;
  --shadow-card: 0 18px 44px rgba(0, 0, 0, 0.65);
  --font: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-color: #3d3d46 var(--bg); scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}
::selection { background: var(--red); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3d3d46; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #55555f; }

/* ── Navbar ─────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4%;
  height: 72px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}
#navbar.solid {
  background: rgba(11, 11, 13, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line), 0 12px 32px rgba(0, 0, 0, 0.45);
}
.nav-left { display: flex; align-items: center; gap: 44px; }
.logo {
  font-size: 31px; font-weight: 900; letter-spacing: -1.5px;
  background: linear-gradient(135deg, var(--red-bright) 10%, var(--red) 55%, var(--red-dark) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-transform: uppercase; font-style: italic; line-height: 1;
  filter: drop-shadow(0 2px 10px rgba(229, 9, 20, 0.35));
}
.logo span { -webkit-text-fill-color: #fff; color: #fff; font-style: normal; }
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  position: relative; font-size: 14.5px; font-weight: 500; color: var(--text-dim);
  padding: 6px 2px; transition: color 0.2s; letter-spacing: 0.1px;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: var(--red); border-radius: 2px; transition: right 0.25s ease;
}
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; font-weight: 700; }
.nav-links a.active::after { right: 0; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  background: rgba(255, 255, 255, 0.06); border: 1px solid transparent; color: #fff;
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); transform: scale(1.06); }
.search-box {
  display: flex; align-items: center; gap: 9px;
  background: rgba(10, 10, 12, 0.9); border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 9px 14px; border-radius: 999px; color: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  animation: searchIn 0.25s ease;
}
@keyframes searchIn { from { opacity: 0; transform: translateX(10px); } }
.search-box.hidden { display: none; }
.search-box input {
  background: none; border: none; outline: none; color: #fff;
  font-size: 14px; width: 210px; font-family: inherit;
}
.search-box input::placeholder { color: #8a8a94; }

/* ── Hero billboard ─────────────────────── */
.hero {
  position: relative;
  height: 94vh; min-height: 580px;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: #060607;
}
.hero-bg {
  position: absolute; inset: -3%;
  background-size: cover; background-position: center 18%;
  animation: kenburns 9.5s ease-out forwards;
  will-change: transform;
}
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.1); } }
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, var(--bg) 1%, rgba(11, 11, 13, 0.55) 22%, transparent 46%),
    linear-gradient(to right, rgba(6, 6, 8, 0.88) 0%, rgba(6, 6, 8, 0.35) 42%, transparent 68%),
    linear-gradient(to bottom, rgba(6, 6, 8, 0.55) 0%, transparent 20%);
}
.hero-content { position: relative; z-index: 2; padding: 0 4% 13vh; max-width: 680px; animation: heroRise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes heroRise { from { opacity: 0; transform: translateY(26px); } }
.hero-kicker {
  font-size: 14px; font-weight: 700; letter-spacing: 5px; color: var(--text-dim);
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.hero-kicker b {
  color: var(--red); font-size: 24px; font-style: italic; font-weight: 900;
  text-shadow: 0 0 18px rgba(229, 9, 20, 0.65);
}
.hero-title {
  font-size: clamp(38px, 5.4vw, 72px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.02;
  margin-bottom: 18px; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.75);
}
.hero-meta { display: flex; align-items: center; gap: 13px; font-size: 15.5px; margin-bottom: 16px; color: #d7d7de; font-weight: 500; }
.match { color: #4ade80; font-weight: 700; }
.maturity {
  border: 1px solid rgba(255, 255, 255, 0.4); padding: 2px 9px; font-size: 12px; border-radius: 4px;
  color: #e8e8ec; background: rgba(0, 0, 0, 0.35); letter-spacing: 0.4px;
}
.hd {
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 4px; font-size: 11px; font-weight: 700;
  padding: 2px 7px; color: #fff; letter-spacing: 0.6px; background: rgba(0, 0, 0, 0.35);
}
.hero-overview {
  font-size: 16.5px; line-height: 1.6; color: #ececf1; margin-bottom: 28px; font-weight: 400;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85); max-width: 58ch;
}
.hero-actions { display: flex; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: none; border-radius: 8px; padding: 13px 30px;
  font-size: 16.5px; font-weight: 700; letter-spacing: 0.1px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:active { transform: scale(0.97); }
.btn-play { background: #fff; color: #0a0a0a; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.btn-play:hover { background: rgba(255, 255, 255, 0.85); transform: translateY(-2px); box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55); }
.btn-info {
  background: rgba(255, 255, 255, 0.14); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-info:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-2px); }
.hero-maturity {
  position: absolute; z-index: 2; right: 0; bottom: 16vh;
  border-left: 3px solid #fff; background: rgba(10, 10, 12, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 9px 46px 9px 14px; font-size: 14px; font-weight: 600; letter-spacing: 0.5px; color: #eee;
}
.hero-dots { position: absolute; z-index: 2; right: 4%; bottom: 13vh; display: flex; gap: 8px; }
.hero-dots button { width: 28px; height: 4px; border: none; border-radius: 3px; background: rgba(255, 255, 255, 0.28); padding: 0; transition: background 0.25s, width 0.25s; }
.hero-dots button.on { background: var(--red); width: 40px; box-shadow: 0 0 12px rgba(229, 9, 20, 0.7); }

/* ── Rows ───────────────────────────────── */
.rows { position: relative; z-index: 3; margin-top: -15vh; padding-bottom: 70px; }
.row { margin-bottom: 10px; padding-left: 4%; }
.row.flat { margin-top: 96px; }
.row-title {
  font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 26px 0 14px;
  display: flex; align-items: center; gap: 10px; color: #f2f2f5;
}
.row-title .explore { font-size: 13px; color: #6cb8ff; opacity: 0; transform: translateX(-6px); transition: opacity 0.25s, transform 0.25s; font-weight: 500; }
.row:hover .row-title .explore { opacity: 1; transform: none; }
.scroller-wrap { position: relative; }
.scroller { display: flex; gap: 10px; overflow-x: auto; scroll-behavior: smooth; padding: 8px 4% 22px 2px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.scroll-btn {
  position: absolute; top: 0; bottom: 22px; width: 4%; min-width: 46px; z-index: 5;
  background: rgba(8, 8, 10, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  border: none; color: #fff; font-size: 34px;
  opacity: 0; transition: opacity 0.2s, background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.scroller-wrap:hover .scroll-btn { opacity: 1; }
.scroll-btn:hover { background: rgba(8, 8, 10, 0.85); }
.scroll-btn.left { left: -4%; border-radius: 0 10px 10px 0; }
.scroll-btn.right { right: 0; border-radius: 10px 0 0 10px; }

/* ── Cards ──────────────────────────────── */
.card {
  position: relative; flex: 0 0 auto;
  width: 176px; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card); cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: #1c1c21; transition: transform 0.35s ease; }
.card:hover {
  transform: translateY(-8px) scale(1.05); z-index: 10;
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.1);
}
.card:hover img { transform: scale(1.04); }
.card .progress { position: absolute; bottom: 0; left: 0; height: 4px; background: linear-gradient(90deg, var(--red-dark), var(--red-bright)); border-radius: 0 2px 2px 0; z-index: 3; }
.card .card-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(4, 4, 6, 0.92) 0%, rgba(4, 4, 6, 0.25) 46%, transparent 68%);
  opacity: 0; transition: opacity 0.25s;
}
.card:hover .card-shade { opacity: 1; }
.card .card-hover-info { position: absolute; bottom: 12px; left: 12px; right: 12px; opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; }
.card:hover .card-hover-info { opacity: 1; transform: none; }
.card .card-hover-title { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; line-height: 1.3; }
.card .card-hover-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-dim); font-weight: 500; }
.card .card-hover-meta .match { font-size: 11.5px; }

/* Top 10 */
.top10 { display: flex; align-items: flex-end; }
.top10 .rank {
  font-size: 210px; font-weight: 900; line-height: 0.76; letter-spacing: -20px;
  background: linear-gradient(180deg, #3a3a42, #101013);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 3px #6a6a76; margin-right: -16px; margin-bottom: -6px; user-select: none;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
}
.top10 .card { width: 152px; }

/* ── Grids (movies / tv / search / mylist) ── */
.page { padding: 116px 4% 90px; min-height: 100vh; }
.page h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 20px; }
.genre-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--text-dim);
  padding: 9px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 500; transition: all 0.2s;
}
.chip:hover { border-color: rgba(255, 255, 255, 0.35); color: #fff; transform: translateY(-1px); }
.chip.on { background: #fff; color: #0a0a0a; border-color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(255, 255, 255, 0.12); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.grid .card { width: 100%; }
.empty { color: var(--text-faint); font-size: 17px; padding: 70px 0; text-align: center; }
.search-meta { color: var(--text-faint); font-size: 14px; margin-bottom: 22px; }
.sentinel { height: 40px; }

/* skeleton */
.skel-row { display: flex; gap: 10px; padding: 8px 4% 22px 0; overflow: hidden; }
.skel {
  flex: 0 0 auto; width: 176px; aspect-ratio: 2/3; border-radius: var(--radius);
  background: linear-gradient(100deg, #191920 40%, #23232b 50%, #191920 60%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Detail modal ───────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 4, 6, 0.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  overflow-y: auto; padding: 40px 0;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  position: relative; width: min(900px, 94vw); margin: 0 auto;
  background: #131316; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.85);
  animation: popIn 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes popIn { from { transform: translateY(18px) scale(0.98); opacity: 0; } }
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(10, 10, 12, 0.72); color: #fff; font-size: 17px; line-height: 1;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}
.modal-close:hover { background: var(--red); transform: rotate(90deg); }
.modal-hero { position: relative; aspect-ratio: 16/8.4; background-size: cover; background-position: center 18%; background-color: #0c0c0e; }
.modal-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, #131316 3%, rgba(19, 19, 22, 0.4) 45%, transparent 70%); }
.modal-hero-content { position: absolute; z-index: 2; left: 48px; bottom: 30px; right: 48px; }
.modal-title { font-size: 44px; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 20px; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.85); line-height: 1.05; }
.modal-actions { display: flex; gap: 12px; align-items: center; }
.btn-round {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45); background: rgba(10, 10, 12, 0.5); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 19px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: all 0.2s;
}
.btn-round:hover { border-color: #fff; transform: scale(1.08); }
.btn-round.on { border-color: #fff; background: #fff; color: #0a0a0a; }
.modal-body { padding: 10px 48px 48px; display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.modal-meta { display: flex; align-items: center; gap: 11px; font-size: 15px; margin-bottom: 16px; flex-wrap: wrap; font-weight: 500; }
.modal-overview { font-size: 16px; line-height: 1.65; color: #e8e8ed; }
.modal-side { font-size: 13.5px; color: var(--text-faint); line-height: 1.75; }
.modal-side b { color: var(--text-dim); font-weight: 500; }
.modal-side .val { color: #dcdce2; }
.section-label { font-size: 13px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-faint); margin: 28px 0 12px; }
.cast-row { display: flex; gap: 12px; overflow-x: auto; padding: 6px 0 14px; scrollbar-width: none; }
.cast-row::-webkit-scrollbar { display: none; }
.cast { flex: 0 0 auto; width: 88px; text-align: center; }
.cast img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: #23232b; border: 2px solid rgba(255, 255, 255, 0.07); transition: border-color 0.2s; }
.cast:hover img { border-color: rgba(255, 255, 255, 0.3); }
.cast .n { font-size: 11.5px; margin-top: 8px; color: #e2e2e8; font-weight: 600; }
.cast .c { font-size: 10.5px; color: var(--text-faint); }
.trailer-wrap { margin: 6px 0 8px; }
.trailer-wrap iframe { width: 100%; aspect-ratio: 16/9; border: none; border-radius: 12px; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5); }
.episodes-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 10px; }
.episodes-head h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.season-select {
  background: #1e1e24; color: #fff; border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 10px 14px; border-radius: 8px; font-size: 14px; font-family: inherit; font-weight: 500;
}
.episode {
  display: flex; gap: 18px; padding: 16px 12px; border-top: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer; border-radius: 10px; align-items: center; transition: background 0.2s;
}
.episode:hover { background: rgba(255, 255, 255, 0.045); }
.episode .num { font-size: 24px; font-weight: 700; color: var(--text-faint); width: 32px; text-align: center; flex: 0 0 auto; }
.episode img { width: 136px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: #23232b; flex: 0 0 auto; }
.episode .ep-info { flex: 1; min-width: 0; }
.episode .ep-title { font-size: 15px; font-weight: 700; margin-bottom: 7px; display: flex; justify-content: space-between; gap: 10px; letter-spacing: -0.01em; }
.episode .ep-title .dur { color: var(--text-faint); font-weight: 500; font-size: 13px; white-space: nowrap; }
.episode .ep-overview { font-size: 13px; color: var(--text-dim); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.episode .ep-play {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55); background: none; color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.episode:hover .ep-play { background: #fff; color: #0a0a0a; border-color: #fff; }
.similar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.similar-card { background: #1c1c22; border-radius: 10px; overflow: hidden; cursor: pointer; border: 1px solid transparent; transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s; }
.similar-card:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.1); box-shadow: var(--shadow-card); }
.similar-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #23232b; }
.similar-card .sc-body { padding: 14px; }
.similar-card .sc-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.similar-card .sc-meta { display: flex; gap: 9px; font-size: 12px; color: var(--text-dim); margin-bottom: 9px; font-weight: 500; }
.similar-card .sc-overview { font-size: 12.5px; color: var(--text-faint); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Player ─────────────────────────────── */
.player-backdrop { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; flex-direction: column; }
.player-top {
  display: flex; align-items: center;
  padding: 20px 3%; position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
}
.player-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.player-title small { display: block; font-size: 13px; color: var(--text-dim); font-weight: 500; margin-top: 4px; }
.player-video-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.player-video-wrap video { width: 100%; height: 100%; max-height: 100vh; background: #000; outline: none; }
.player-video-wrap video::cue { background: rgba(0, 0, 0, 0.65); color: #fff; font-family: var(--font); text-shadow: 0 1px 3px #000; }
.player-loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 20px; align-items: center; justify-content: center; background: #000; z-index: 4; }
.spinner {
  width: 58px; height: 58px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.12); border-top-color: var(--red);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-loading p { color: var(--text-dim); font-size: 15px; font-weight: 500; letter-spacing: 0.2px; }
.player-controls {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
  padding: 12px 3% 26px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.player-backdrop:hover .player-controls, .player-controls.show { opacity: 1; }
.progress-wrap { height: 5px; background: rgba(255, 255, 255, 0.22); border-radius: 4px; cursor: pointer; margin-bottom: 16px; position: relative; transition: height 0.15s; }
.progress-wrap:hover { height: 9px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--red-dark), var(--red-bright)); border-radius: 4px; width: 0%; position: relative; box-shadow: 0 0 12px rgba(229, 9, 20, 0.55); }
.progress-fill::after {
  content: ''; position: absolute; right: -8px; top: 50%; transform: translateY(-50%) scale(0.7);
  width: 16px; height: 16px; border-radius: 50%; background: var(--red-bright);
  box-shadow: 0 0 14px rgba(229, 9, 20, 0.8);
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
}
.progress-wrap:hover .progress-fill::after { opacity: 1; transform: translateY(-50%) scale(1); }
.controls-row { display: flex; align-items: center; gap: 20px; }
.ctl-btn { background: none; border: none; color: #fff; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 7px; padding: 6px; transition: transform 0.15s, opacity 0.15s; }
.ctl-btn:hover { opacity: 0.75; transform: scale(1.08); }
.ctl-btn svg { display: block; }
.time { font-size: 13.5px; color: #e2e2e8; margin-left: 4px; font-variant-numeric: tabular-nums; font-weight: 500; }
.controls-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.menu-pop {
  position: absolute; bottom: 92px; right: 3%;
  background: rgba(16, 16, 20, 0.97); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
  min-width: 220px; max-height: 330px; overflow-y: auto; z-index: 8; padding: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  animation: popIn 0.2s ease;
}
.menu-pop.hidden { display: none; }
.menu-pop .mp-title { font-size: 11.5px; font-weight: 700; color: var(--text-faint); padding: 10px 14px 6px; text-transform: uppercase; letter-spacing: 1.5px; }
.menu-pop button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: #dcdce2; font-size: 14.5px; font-weight: 500; padding: 11px 14px; border-radius: 8px;
}
.menu-pop button:hover { background: rgba(255, 255, 255, 0.08); }
.menu-pop button.on { color: #fff; font-weight: 700; }
.menu-pop button.on::before { content: '✓ '; color: var(--red); }
.next-ep-btn {
  position: absolute; right: 3%; bottom: 118px; z-index: 6;
  background: rgba(16, 16, 20, 0.92); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff;
  padding: 13px 22px; border-radius: 8px; font-size: 15px; font-weight: 700;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background 0.2s, transform 0.2s;
}
.next-ep-btn:hover { background: #26262e; transform: translateY(-2px); }
.player-error { color: #ff7b7b; max-width: 540px; text-align: center; line-height: 1.65; font-size: 15.5px; padding: 0 24px; }
.player-error button { margin-top: 18px; }

/* ── Toast ──────────────────────────────── */
.toast {
  position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%); z-index: 400;
  background: #f4f4f6; color: #0a0a0a; font-size: 14.5px; font-weight: 600;
  padding: 14px 28px; border-radius: 999px; box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
  animation: toastIn 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex; align-items: center; gap: 10px;
}
.toast.hidden { display: none; }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: 0 0 auto; }
@keyframes toastIn { from { transform: translate(-50%, 14px); opacity: 0; } }

/* ── Footer ─────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 44px 4% 54px; margin-top: 10px;
  color: var(--text-faint); font-size: 13.5px;
}
.footer .f-logo { font-size: 22px; font-weight: 900; font-style: italic; letter-spacing: -1px; color: var(--red); margin-bottom: 14px; }
.footer .f-logo span { color: #fff; font-style: normal; }
.footer p { max-width: 640px; line-height: 1.7; margin-bottom: 8px; }
.footer .f-note { font-size: 12.5px; opacity: 0.75; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero { height: 80vh; }
  .hero-maturity { display: none; }
  .card { width: 132px; }
  .top10 .card { width: 114px; }
  .top10 .rank { font-size: 150px; letter-spacing: -14px; }
  .modal-body { grid-template-columns: 1fr; padding: 10px 26px 34px; }
  .modal-hero-content { left: 26px; right: 26px; }
  .modal-title { font-size: 32px; }
  .similar-grid { grid-template-columns: repeat(2, 1fr); }
  .scroll-btn { display: none; }
  .search-box input { width: 150px; }
}

/* ═══════════════ Motion & premium transitions ═══════════════ */

/* view transitions — every route change glides in */
.page { animation: viewIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); }
.rows { animation: viewIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(16px); } }

/* hero backdrop crossfade */
.hero-bg { transition: opacity 1s ease; }
.hero-bg-next { opacity: 0; }
.hero-bg-next.show { opacity: 1; }
.hero-content { transition: opacity 0.32s ease; }
.hero-content.hero-swap { opacity: 0; }

/* images fade in instead of popping */
.card img, .similar-card img, .episode img, .cast img {
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.35s ease;
}
.card img.loaded, .similar-card img.loaded, .episode img.loaded, .cast img.loaded { opacity: 1; }

/* grid cards cascade in */
.grid .card { animation: cardIn 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.grid .card:nth-child(2) { animation-delay: 0.04s; }
.grid .card:nth-child(3) { animation-delay: 0.08s; }
.grid .card:nth-child(4) { animation-delay: 0.12s; }
.grid .card:nth-child(5) { animation-delay: 0.16s; }
.grid .card:nth-child(6) { animation-delay: 0.2s; }
.grid .card:nth-child(7) { animation-delay: 0.24s; }
.grid .card:nth-child(8) { animation-delay: 0.28s; }
.grid .card:nth-child(9) { animation-delay: 0.32s; }
.grid .card:nth-child(10) { animation-delay: 0.36s; }
.grid .card:nth-child(11) { animation-delay: 0.4s; }
.grid .card:nth-child(12) { animation-delay: 0.44s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } }

/* row entrance */
.row { animation: viewIn 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }

/* ── hover preview card (Netflix-style) ── */
.preview-card {
  position: fixed; z-index: 150; width: 340px;
  background: #17171c; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.4);
  animation: pvIn 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-origin: center top;
}
@keyframes pvIn { from { opacity: 0; transform: scale(0.9) translateY(10px); } }
.pv-media {
  aspect-ratio: 16/9; background-size: cover; background-position: center 20%;
  background-color: #202028; position: relative;
}
.pv-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, #17171c 2%, transparent 45%);
}
.pv-body { padding: 4px 18px 18px; position: relative; }
.pv-actions { display: flex; gap: 10px; margin-bottom: 13px; }
.pv-play {
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: #fff; color: #0a0a0a;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.16s ease, background 0.16s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.pv-play:hover { transform: scale(1.1); background: rgba(255, 255, 255, 0.85); }
.pv-round { width: 46px; height: 46px; }
.pv-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 9px; line-height: 1.3; }
.pv-meta { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--text-dim); font-weight: 500; }

/* modal extra polish */
.modal { transition: transform 0.25s ease; }

/* buttons: tactile press */
.btn, .chip, .icon-btn { transition: transform 0.16s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.btn:active, .chip:active, .icon-btn:active { transform: scale(0.96); }

/* reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
