:root {
  --bg: #0a0c0a;
  --bg-2: #0d100d;
  --panel: #12151250;
  --card: #14181450;
  --card-solid: #141814;
  --line: #1e241e;
  --green: #22e06a;
  --green-soft: #2ecc71;
  --green-dim: #1a7a45;
  --text: #e8f0e8;
  --muted: #8a938a;
  --muted-2: #5f665f;
  --star: #ffcb45;
  --radius: 14px;
  --sidebar-w: 224px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; text-decoration: none; }
img { display: block; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1f261f; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
  background: rgba(10,12,10,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  background: transparent; border: 0; color: var(--muted);
  cursor: pointer; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px; position: relative;
}
.icon-btn:hover { color: var(--text); background: #ffffff08; }
.menu-toggle { display: none; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: .5px; }
.logo-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--green); }
.logo-mark svg { width: 16px; height: 16px; fill: #04120a; stroke: none; }
.logo-accent { color: var(--green); }

.search {
  flex: 1; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center;
  background: #10131044; border: 1px solid var(--line);
  border-radius: 12px; padding: 0 6px 0 16px;
}
.search input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--text); font-size: 14px; height: 40px;
}
.search input::placeholder { color: var(--muted-2); }
.search .icon-btn { width: 32px; height: 32px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.premium-pill {
  display: flex; align-items: center; gap: 7px;
  background: transparent; color: var(--green);
  border: 1px solid #2a3a2a; border-radius: 10px;
  padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.premium-pill:hover { border-color: var(--green); background: #22e06a12; }
.crown { width: 16px; height: 16px; fill: var(--green); stroke: none; }
.bell .dot { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; background: var(--green); color: #04120a;
  border-radius: 9px; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; border: 2px solid #2a3a2a; cursor: pointer; }
.avatar img { width: 100%; height: 100%; }

/* ---------- Layout ---------- */
.layout { display: flex; align-items: flex-start; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; padding: 18px 14px 30px;
  border-right: 1px solid var(--line);
}
.nav-primary, .nav-categories { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 500;
}
.nav-item .ic { font-size: 16px; width: 20px; text-align: center; filter: grayscale(.3); }
.nav-item:hover { background: #ffffff08; color: var(--text); }
.nav-item.active { background: var(--green); color: #04120a; font-weight: 700; }
.nav-item.active .ic { filter: none; }
.nav-section-title { color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin: 22px 12px 10px; }
.nav-categories .nav-item { padding: 8px 12px; font-size: 13px; }
.show-more { color: var(--muted); font-size: 13px; background: none; border: 0; text-align: left; padding: 8px 12px; cursor: pointer; }
.show-more:hover { color: var(--text); }

.upsell {
  margin: 22px 4px 18px; padding: 20px 16px; text-align: center;
  border: 1px solid #234023; border-radius: var(--radius);
  background: linear-gradient(180deg, #12251530, #0d140d10);
}
.crown-lg { font-size: 26px; }
.upsell-title { font-weight: 700; margin: 8px 0 6px; font-size: 14px; }
.upsell p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 0 14px; }
.go-premium {
  width: 100%; background: var(--green); color: #04120a;
  border: 0; border-radius: 10px; padding: 10px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.go-premium:hover { background: #2ff079; }
.socials { display: flex; gap: 16px; padding: 4px 12px; font-size: 18px; opacity: .6; }
.socials a:hover { opacity: 1; }
.copyright { color: var(--muted-2); font-size: 11px; padding: 14px 12px 0; }

/* ---------- Content ---------- */
.content { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.loading-splash { display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 44px; height: 44px; border: 3px solid #1e261e; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero ---------- */
.hero {
  position: relative; border-radius: 18px; overflow: hidden;
  min-height: 430px; display: flex; align-items: center;
  background: #060806; border: 1px solid var(--line); margin-bottom: 34px;
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; opacity: .55; }
.hero-code { position: absolute; inset: 0; opacity: .35; mix-blend-mode: screen;
  background-image: radial-gradient(circle at 70% 40%, #0d3a1e88, transparent 60%); }
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #060806 0%, #060806cc 42%, #06080622 70%, transparent 100%); }
.hero-inner { position: relative; z-index: 2; padding: 0 48px; max-width: 620px; }
.hero h1 { font-size: 52px; line-height: 1.02; margin: 0 0 20px; font-family: "Courier New", monospace; font-weight: 800; letter-spacing: -1px; }
.hero h1 .g { color: var(--green); }
.hero .sub { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0 0 26px; max-width: 420px; }
.hero-btns { display: flex; gap: 14px; margin-bottom: 30px; }
.btn { display: inline-flex; align-items: center; gap: 10px; border-radius: 12px; padding: 14px 26px; font-weight: 700; font-size: 15px; cursor: pointer; border: 0; }
.btn-primary { background: var(--green); color: #04120a; box-shadow: 0 8px 30px -8px #22e06a99; }
.btn-primary:hover { background: #2ff079; }
.btn-primary svg { fill: #04120a; stroke: none; width: 15px; height: 15px; }
.btn-ghost { background: #ffffff0a; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: #ffffff14; }
.hero-features { display: flex; gap: 34px; }
.hero-feature { text-align: center; }
.hero-feature .hf-ic { color: var(--green); font-size: 20px; }
.hero-feature .hf-t { font-weight: 700; font-size: 14px; margin-top: 4px; }
.hero-feature .hf-s { color: var(--muted); font-size: 11px; }
.hero-status {
  position: absolute; right: 26px; top: 26px; z-index: 3;
  width: 190px; padding: 16px; border-radius: 14px;
  background: #0a0e0acc; border: 1px solid var(--line); backdrop-filter: blur(6px);
}
.hero-status .lbl { color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.hero-status .online { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 6px 0 14px; }
.hero-status .online::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.hero-status .count { font-size: 22px; font-weight: 800; margin-top: 4px; }
.hero-spark { height: 34px; margin-top: 8px; }
.hero-spark svg { width: 100%; height: 100%; stroke: var(--green); }
.hero-dots { position: absolute; bottom: 18px; left: 48px; z-index: 3; display: flex; gap: 7px; }
.hero-dots span { width: 7px; height: 7px; border-radius: 50%; background: #ffffff30; }
.hero-dots span.on { background: var(--green); width: 20px; border-radius: 4px; }

/* ---------- Rows ---------- */
.row { margin-bottom: 40px; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.row-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; }
.row-title .fire { color: var(--green); }
.view-all { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.view-all:hover { color: var(--green); }

.rail-wrap { position: relative; }
.rail { display: flex; gap: 16px; overflow-x: auto; scroll-behavior: smooth; padding-bottom: 6px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-btn {
  position: absolute; top: 38%; z-index: 5; width: 42px; height: 42px; border-radius: 50%;
  background: #0d120dcc; border: 1px solid var(--line); color: var(--text);
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px);
}
.rail-btn:hover { background: var(--green); color: #04120a; }
.rail-btn.prev { left: -10px; } .rail-btn.next { right: -10px; }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px; }
.card { flex: 0 0 172px; cursor: pointer; }
.grid .card { flex: none; }
.poster { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 2/3; background: #101410; border: 1px solid var(--line); }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .poster img { transform: scale(1.06); }
.poster .rating { position: absolute; top: 8px; left: 8px; display: flex; align-items: center; gap: 4px;
  background: #0a0e0acc; color: var(--star); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; backdrop-filter: blur(4px); }
.poster .rating svg { width: 12px; height: 12px; fill: var(--star); stroke: none; }
.poster .play-ov { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; background: #04120a55; transition: opacity .25s; }
.card:hover .play-ov { opacity: 1; }
.poster .play-ov .pbtn { width: 52px; height: 52px; border-radius: 50%; background: var(--green); display: grid; place-items: center; }
.poster .play-ov .pbtn svg { fill: #04120a; stroke: none; width: 20px; height: 20px; }
.card-title { font-size: 14px; font-weight: 600; margin: 10px 2px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { color: var(--muted); font-size: 12px; margin: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Genres strip ---------- */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.genre-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 12px; border-radius: 14px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); transition: .2s;
}
.genre-card:hover { border-color: var(--green); background: #12251540; transform: translateY(-3px); }
.genre-card .gic { font-size: 26px; }
.genre-card .gname { color: var(--green); font-weight: 600; font-size: 14px; }

/* ---------- Feature footer ---------- */
.feature-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 26px;
  padding: 26px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.feature { display: flex; gap: 14px; }
.feature .fic { color: var(--green); font-size: 22px; }
.feature h4 { margin: 0 0 4px; font-size: 15px; }
.feature p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.section-head { margin: 6px 0 22px; }
.section-head h1 { margin: 0 0 6px; font-size: 26px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 60px 20px; }
.empty .big { font-size: 40px; margin-bottom: 12px; }

/* ---------- Modal / Player ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: #04070499; backdrop-filter: blur(6px); }
.modal-body { position: relative; z-index: 2; width: min(1000px, 96vw); max-height: 92vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; }
.player-frame { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 16px 16px 0 0; overflow: hidden; }
.player-frame iframe { width: 100%; height: 100%; border: 0; }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 6; width: 40px; height: 40px; border-radius: 50%;
  background: #0a0e0acc; border: 1px solid var(--line); color: #fff; cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: var(--green); color: #04120a; }
.detail { padding: 22px 26px 30px; }
.detail-top { display: flex; gap: 22px; }
.detail-poster { width: 150px; flex-shrink: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.detail-poster img { width: 100%; }
.detail h2 { margin: 0 0 8px; font-size: 26px; }
.detail .d-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 14px; align-items: center; }
.chip { background: #ffffff0d; border: 1px solid var(--line); padding: 4px 10px; border-radius: 20px; font-size: 12px; color: var(--text); }
.d-rating { color: var(--star); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.d-rating svg { width: 14px; height: 14px; fill: var(--star); stroke: none; }
.detail .overview { color: #c4ccc4; line-height: 1.6; font-size: 14px; margin: 4px 0 18px; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.ep-controls { display: flex; gap: 12px; margin: 18px 0 4px; flex-wrap: wrap; }
.ep-controls select { background: var(--card-solid); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; min-width: 130px; }
.src-tabs { display: flex; gap: 8px; margin: 16px 0 0; flex-wrap: wrap; }
.src-tab { background: #ffffff0d; border: 1px solid var(--line); color: var(--muted); padding: 7px 14px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.src-tab.active { background: var(--green); color: #04120a; border-color: var(--green); font-weight: 700; }

/* API key warning */
.apikey-banner { background: #2a1d0a; border: 1px solid #7a5a1a; color: #ffd98a; padding: 14px 18px; border-radius: 12px; margin-bottom: 24px; font-size: 13px; line-height: 1.6; }
.apikey-banner code { background: #00000055; padding: 2px 6px; border-radius: 5px; }

/* ==========================================================================
   21st.dev-inspired effects (adapted to vanilla CSS)
   Border Beam · Aurora · Meteors · Shimmer text · Spotlight cards · Gradient btn
   ========================================================================== */
@property --beam-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* Shiny / shimmer text (logo accent + hero heading) */
.shimmer {
  background: linear-gradient(110deg, var(--green) 35%, #eafff2 50%, var(--green) 65%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: shimmer 4.5s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

/* Aurora glow behind hero */
.aurora { position: absolute; inset: -30%; z-index: 0; pointer-events: none; filter: blur(70px); opacity: .55; mix-blend-mode: screen; }
.aurora::before, .aurora::after { content: ""; position: absolute; border-radius: 50%; }
.aurora::before { width: 55%; height: 70%; left: 30%; top: 5%; background: radial-gradient(circle, #22e06a 0%, transparent 62%); animation: aurora1 13s ease-in-out infinite alternate; }
.aurora::after  { width: 48%; height: 60%; right: 2%; top: -6%; background: radial-gradient(circle, #0c8a48 0%, transparent 62%); animation: aurora2 16s ease-in-out infinite alternate; }
@keyframes aurora1 { from { transform: translate(-6%, 0) scale(1); } to { transform: translate(10%, 8%) scale(1.25); } }
@keyframes aurora2 { from { transform: translate(0, 0) scale(1.1); } to { transform: translate(-12%, 6%) scale(.9); } }

/* Meteors */
.meteors { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.meteors i { position: absolute; top: -10%; width: 2px; height: 2px; border-radius: 50%; background: #b6ffce; box-shadow: 0 0 0 1px #22e06a55; }
.meteors i::after { content: ""; position: absolute; top: 50%; left: 0; width: 70px; height: 1px; transform: translateY(-50%); background: linear-gradient(90deg, #22e06a, transparent); }
.meteors i { animation: meteor 5s linear infinite; transform: rotate(215deg); }
.meteors i:nth-child(1) { left: 30%; animation-delay: 0s; }
.meteors i:nth-child(2) { left: 45%; animation-delay: 1.2s; }
.meteors i:nth-child(3) { left: 58%; animation-delay: 2.4s; }
.meteors i:nth-child(4) { left: 70%; animation-delay: .6s; }
.meteors i:nth-child(5) { left: 82%; animation-delay: 3.1s; }
.meteors i:nth-child(6) { left: 92%; animation-delay: 1.8s; }
.meteors i:nth-child(7) { left: 64%; animation-delay: 4s; }
@keyframes meteor { 0% { transform: rotate(215deg) translateX(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: rotate(215deg) translateX(-700px); opacity: 0; } }

/* Border beam — animated conic border traveling around the hero */
.beam { position: absolute; inset: 0; z-index: 4; border-radius: 18px; pointer-events: none; padding: 1.5px;
  background: conic-gradient(from var(--beam-a), transparent 0 72%, #22e06a 84%, #eafff2 90%, #22e06a 94%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: beam 6s linear infinite; }
@keyframes beam { to { --beam-a: 360deg; } }

/* Spotlight cards — radial glow follows the cursor */
.poster::before { content: ""; position: absolute; inset: 0; z-index: 2; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), #22e06a30, transparent 62%); }
.card:hover .poster::before { opacity: 1; }
.card:hover .poster { border-color: #2f6b45; box-shadow: 0 0 28px -8px #22e06a80; }
.poster .rating { z-index: 4; }
.poster .play-ov { z-index: 3; }

/* Animated gradient primary button */
.btn-primary {
  background: linear-gradient(90deg, #1fd968, #2ff079, #b6ffce, #2ff079, #1fd968);
  background-size: 220% 100%; animation: btnflow 5s linear infinite;
}
.btn-primary:hover { filter: brightness(1.05); }
@keyframes btnflow { to { background-position: 220% 0; } }

/* Spotlight on genre cards too */
.genre-card { position: relative; overflow: hidden; }
.genre-card::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: radial-gradient(140px circle at 50% 0%, #22e06a22, transparent 60%); }
.genre-card:hover::before { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .shimmer, .aurora::before, .aurora::after, .meteors i, .beam, .btn-primary { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); z-index: 45; background: var(--bg-2); transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .hero-status { display: none; }
  .hero h1 { font-size: 38px; }
}
@media (max-width: 1180px) { .hero-featured { display: none; } }
@media (max-width: 640px) {
  .content { padding: 16px; }
  .hero-inner { padding: 0 22px; }
  .hero-features { flex-wrap: wrap; gap: 18px; }
  .search-kbd { display: none; }
  .bento { grid-template-columns: repeat(2, 1fr) !important; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
}

/* ==========================================================================
   v2 — full-site polish
   ========================================================================== */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }

/* Film-grain texture (no blend-mode: avoids full-page recomposite every frame) */
.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Contain animated regions so they don't repaint siblings */
.marquee { contain: content; }
.marquee-track { will-change: transform; }
.hero { contain: layout paint; }
.beam { will-change: filter; }

/* Search upgrades */
.search { position: relative; gap: 8px; }
.search-ic { width: 18px; height: 18px; color: var(--muted-2); flex-shrink: 0; }
.search:focus-within { border-color: #2f6b45; box-shadow: 0 0 0 3px #22e06a12; }
.search-kbd { border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 11px; color: var(--muted-2); background: #ffffff08; margin-right: 6px; }
.search-suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 24px 60px -20px #000; z-index: 60; max-height: 72vh; overflow-y: auto; }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; cursor: pointer; }
.suggest-item:hover { background: #ffffff0d; }
.suggest-item img { width: 40px; height: 58px; object-fit: cover; border-radius: 7px; flex-shrink: 0; background: #101410; }
.sg-title { font-size: 13px; font-weight: 600; }
.sg-meta { font-size: 11px; color: var(--muted); }
.suggest-item .d-rating { margin-left: auto; font-size: 12px; }
.suggest-all { padding: 10px 8px 6px; font-size: 12px; color: var(--muted); text-align: center; }

/* Promo (surprise) card */
.promo-card { position: relative; overflow: hidden; margin: 22px 4px 18px; padding: 20px 16px; text-align: center; border: 1px solid #234023; border-radius: 14px; background: linear-gradient(180deg, #12251530, #0d140d10); }
.promo-card .beam { border-radius: 14px; }
.promo-ic { font-size: 26px; }
.promo-title { font-weight: 700; margin: 8px 0 6px; font-size: 14px; }
.promo-card p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 0 14px; }
.promo-btn { position: relative; z-index: 2; width: 100%; background: var(--green); color: #04120a; border: 0; border-radius: 10px; padding: 10px; font-weight: 700; font-size: 13px; cursor: pointer; }
.promo-btn:hover { background: #2ff079; }

/* Hero carousel */
.hero-slides { position: absolute; inset: 0; z-index: 0; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center 12%; opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.on { opacity: .5; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: #0e160e99; border: 1px solid var(--line); padding: 6px 12px; border-radius: 20px; font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.hero-badge b { color: var(--green); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.hero-featured { position: absolute; right: 30px; bottom: 34px; z-index: 3; width: 340px; display: flex; gap: 14px; padding: 14px; border-radius: 16px; background: #0a0e0adf; border: 1px solid var(--line); backdrop-filter: blur(12px); box-shadow: 0 24px 60px -24px #000; }
.hf-poster { width: 84px; flex-shrink: 0; border-radius: 10px; overflow: hidden; cursor: pointer; border: 1px solid var(--line); }
.hf-poster img { width: 100%; display: block; }
.hf-body { min-width: 0; display: flex; flex-direction: column; }
.hf-eyebrow { color: var(--green); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.hf-name { font-weight: 700; font-size: 16px; margin: 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }
.hf-play { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: var(--green); color: #04120a; border: 0; border-radius: 9px; padding: 8px 13px; font-weight: 700; font-size: 12px; cursor: pointer; }
.hf-play svg { width: 12px; height: 12px; fill: #04120a; stroke: none; }
.hf-play:hover { background: #2ff079; }
.hero-dots { position: absolute; bottom: 18px; left: 48px; z-index: 3; display: flex; gap: 8px; }
.hero-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: #ffffff30; cursor: pointer; transition: .25s; }
.hero-dots button.on { background: var(--green); width: 22px; border-radius: 4px; }

/* Marquee */
.marquee { overflow: hidden; margin-bottom: 34px; padding: 13px 0; border-block: 1px solid var(--line);
  -webkit-mask: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marq 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.mq-pill { white-space: nowrap; color: var(--muted); font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--card); padding: 6px 14px; border-radius: 20px; }
@keyframes marq { to { transform: translateX(-50%); } }

/* Bento genres */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 118px; grid-auto-flow: dense; gap: 16px; }
.bento-card { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 18px; border-radius: 16px; cursor: pointer; text-align: left; color: var(--text); border: 1px solid var(--line); background: linear-gradient(150deg, hsl(calc(var(--gh) * 1deg) 55% 11%), var(--card-solid)); transition: transform .2s, border-color .2s; }
.bento-card.big { grid-column: span 2; grid-row: span 2; }
.bento-card.wide { grid-column: span 2; }
.bento-card:hover { transform: translateY(-3px); border-color: var(--green); }
.bento-glow { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; background: radial-gradient(220px circle at 30% 15%, #22e06a2a, transparent 60%); }
.bento-card:hover .bento-glow { opacity: 1; }
.bento-ic { font-size: 30px; position: relative; }
.bento-card.big .bento-ic { font-size: 44px; }
.bento-name { font-weight: 700; font-size: 16px; color: var(--green); position: relative; }
.bento-cta { font-size: 12px; color: var(--muted); position: relative; }

/* Skeletons */
.sk { position: relative; overflow: hidden; background: #12161250; border-radius: 10px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, #ffffff0d, transparent); animation: sksh 1.4s infinite; }
@keyframes sksh { to { transform: translateX(100%); } }
.sk-poster { aspect-ratio: 2/3; }
.sk-line { height: 12px; margin-top: 10px; width: 80%; }
.sk-line.sm { width: 50%; height: 10px; margin-top: 6px; }
.sk-head { height: 22px; width: 210px; }
.sk-hero { height: 430px; border-radius: 18px; margin-bottom: 34px; }

/* Card additions */
.type-badge { position: absolute; top: 8px; right: 8px; z-index: 4; font-size: 10px; font-weight: 700; letter-spacing: .5px; background: #0a0e0acc; color: var(--muted); padding: 3px 7px; border-radius: 6px; backdrop-filter: blur(4px); text-transform: uppercase; }
.play-ov { flex-direction: column; }
.quick-add { position: absolute; bottom: 8px; right: 8px; z-index: 6; width: 34px; height: 34px; border-radius: 50%; background: #0a0e0acc; border: 1px solid var(--line); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transform: translateY(6px); transition: .2s; backdrop-filter: blur(4px); }
.card:hover .quick-add { opacity: 1; transform: none; }
.quick-add svg { width: 16px; height: 16px; }
.quick-add:hover, .quick-add.added { background: var(--green); color: #04120a; border-color: var(--green); }
.rail-btn { transition: opacity .2s, background .2s, color .2s; }
.rail-btn.hide { opacity: 0; pointer-events: none; }

/* Toasts */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; background: #0e140ef2; border: 1px solid var(--line); border-left: 3px solid var(--green); color: var(--text); padding: 12px 16px; border-radius: 12px; font-size: 13px; box-shadow: 0 14px 34px -12px #000; transform: translateX(130%); opacity: 0; transition: .3s; max-width: 340px; }
.toast.show { transform: none; opacity: 1; }
.toast-ic { font-size: 15px; }

/* Modal / player v2 */
.modal-body { scrollbar-width: thin; }
.modal-loading { display: grid; place-items: center; min-height: 340px; }
.modal-close { font-size: 18px; font-weight: 700; }
.player-frame { position: relative; }
.player-loading { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #000; color: var(--muted); font-size: 13px; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.src-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.src-label { color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-right: 2px; }
.src-tab { background: #ffffff0d; border: 1px solid var(--line); color: var(--muted); padding: 7px 13px; border-radius: 8px; font-size: 12px; cursor: pointer; transition: .15s; }
.src-tab:hover { color: var(--text); }
.src-tab.active { background: var(--green); color: #04120a; border-color: var(--green); font-weight: 700; }
.player-actions { display: flex; gap: 10px; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; background: #ffffff0d; border: 1px solid var(--line); color: var(--text); padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.pill-btn svg { width: 15px; height: 15px; }
.pill-btn:hover { background: #ffffff16; }
.pill-btn.on { background: var(--green); color: #04120a; border-color: var(--green); }
.ep-controls { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; margin: 0; }
.ep-controls select { background: var(--card-solid); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; min-width: 130px; }
.ep-nav { width: 38px; height: 38px; border-radius: 10px; background: #ffffff0d; border: 1px solid var(--line); color: var(--text); font-size: 20px; cursor: pointer; line-height: 1; }
.ep-nav:hover { background: var(--green); color: #04120a; }
.ep-now { color: var(--green); font-weight: 700; font-size: 13px; margin-left: 4px; }
.detail { padding: 0; }
.detail-hero { display: flex; gap: 22px; padding: 26px; background-size: cover; background-position: center; }
.genre-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sub-section { padding: 6px 26px 12px; }
.sub-section h3 { font-size: 16px; margin: 14px 0; }
.sub-section .row-head { display: none; }
.sub-section .row { margin-bottom: 0; }
.cast-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.cast-row::-webkit-scrollbar { display: none; }
.cast { width: 86px; flex: 0 0 86px; text-align: center; }
.cast-img { width: 86px; height: 86px; border-radius: 50%; background: #121612; background-size: cover; background-position: center; display: grid; place-items: center; font-size: 28px; border: 1px solid var(--line); margin-bottom: 8px; }
.cast-name { font-size: 12px; font-weight: 600; line-height: 1.3; }
.cast-char { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .detail-hero { flex-direction: column; }
  .detail-poster { width: 120px; }
  .player-bar { padding: 12px 16px; }
  .ep-controls, .sub-section, .detail-hero { padding-left: 16px; padding-right: 16px; }
}

/* ==========================================================================
   Auth gate (Supabase)
   ========================================================================== */
body.locked { overflow: hidden; }
body.locked .topbar,
body.locked .layout,
body.locked .toasts { display: none; }

.auth-gate { position: fixed; inset: 0; z-index: 300; display: none; place-items: center; overflow: hidden; padding: 20px;
  background: radial-gradient(1100px 560px at 50% -12%, #0f2418, var(--bg) 70%); }
.auth-gate.on { display: grid; }
.auth-gate .aurora { opacity: .4; }

.auth-card { position: relative; z-index: 2; width: min(420px, 100%); padding: 34px 30px; border-radius: 20px;
  background: #0b0f0bdd; border: 1px solid var(--line); backdrop-filter: blur(14px); box-shadow: 0 40px 90px -30px #000; }
.auth-card .beam { border-radius: 20px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 22px; letter-spacing: .5px; margin-bottom: 22px; }
.auth-card h1 { font-size: 24px; margin: 0 0 6px; text-align: center; }
.auth-sub { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 24px; }

.fld { display: block; margin-bottom: 14px; }
.fld span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.fld input { width: 100%; background: #10131055; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--text); font-size: 14px; outline: none; transition: .15s; }
.fld input::placeholder { color: var(--muted-2); }
.fld input:focus { border-color: #2f6b45; box-shadow: 0 0 0 3px #22e06a12; }

.auth-btn { position: relative; width: 100%; margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(90deg, #1fd968, #2ff079, #b6ffce, #2ff079, #1fd968); background-size: 220% 100%; animation: btnflow 5s linear infinite;
  color: #04120a; border: 0; border-radius: 11px; padding: 13px; font-weight: 800; font-size: 14px; cursor: pointer; }
.auth-btn:disabled { cursor: not-allowed; opacity: .75; }
.auth-btn .spin { width: 15px; height: 15px; border: 2px solid #04120a3a; border-top-color: #04120a; border-radius: 50%; animation: spin .7s linear infinite; }

.auth-msg { font-size: 12.5px; padding: 10px 12px; border-radius: 9px; margin-bottom: 12px; line-height: 1.5; }
.auth-msg.err { background: #2a1010; border: 1px solid #6b2020; color: #ffb4b4; }
.auth-msg.ok { background: #0f2418; border: 1px solid #23603c; color: #a9f5c8; }
.auth-note { background: #2a1d0a; border: 1px solid #7a5a1a; color: #ffd98a; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.6; margin-bottom: 18px; }
.auth-note code { background: #00000055; padding: 1px 5px; border-radius: 4px; }

.auth-switch { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.auth-switch button { background: none; border: 0; color: var(--green); font-weight: 700; cursor: pointer; font-size: 13px; }
.auth-switch button:hover { text-decoration: underline; }
.auth-foot { text-align: center; color: var(--muted-2); font-size: 11px; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }

/* Notifications */
.notif-menu { position: relative; }
.notif-pop { position: absolute; top: calc(100% + 10px); right: 0; width: 336px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 22px 55px -18px #000; z-index: 70; overflow: hidden; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.np-head button { background: none; border: 0; color: var(--green); font-size: 11px; font-weight: 600; cursor: pointer; }
.np-head button:hover { text-decoration: underline; }
.np-list { max-height: 390px; overflow-y: auto; padding: 6px; }
.np-item { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; cursor: pointer; }
.np-item:hover { background: #ffffff0d; }
.np-item img { width: 38px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #101410; }
.np-body { min-width: 0; flex: 1; }
.np-title { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-item.new .np-title { color: var(--text); }
.np-meta { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.np-new { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; box-shadow: 0 0 8px var(--green); }
.np-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .notif-pop { width: min(336px, calc(100vw - 32px)); right: -60px; } }

/* User menu */
.user-menu { position: relative; }
.user-pop { position: absolute; top: calc(100% + 10px); right: 0; width: 226px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 22px 55px -18px #000; z-index: 70; }
.up-label { font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .5px; }
.up-email { font-size: 13px; font-weight: 600; margin: 4px 0 12px; word-break: break-all; }
.up-signout { width: 100%; background: #ffffff0d; border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.up-signout:hover { background: #3a1414; border-color: #6b2020; color: #ffb4b4; }
