/* ============ MyFlixz design system ============ */

/* Self-hosted Outfit VARIABLE font (wght 100-900 in ONE 32 KB woff2 per
   subset). These two files replace the whole fonts.googleapis.com +
   fonts.gstatic.com round-trip (two extra DNS lookups, two TLS handshakes and
   a third-party stylesheet that the poster requests used to delay by ~300 ms
   on first paint). Same-origin also means the service worker caches them.
   License: Outfit is SIL OFL 1.1 (see /fonts/LICENSE.txt). */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #07070d;
  --bg-soft: #0c0c15;
  --surface: #12121e;
  --surface-2: #181828;
  --line: rgba(255, 255, 255, 0.07);
  --text: #f2f2f7;
  --muted: #9292a8;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --grad: linear-gradient(120deg, #7c5cff 0%, #b04cff 50%, #00d4ff 100%);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  --nav-h: 64px;
}

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

/* The server always SSRs the home view for '/', but never sees the URL hash.
   On a deep link the index.html head script adds this class before the body is
   parsed, so the stale pre-rendered home is never painted while router.js
   (loaded last) swaps in the real view — no home-page flash on refresh. */
html.no-ssr [data-ssr-home] { display: none; }

/* hidden attribute must win over any display:flex rules */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ambient glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 300px at 85% -5%, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(500px 300px at 10% 10%, rgba(0, 212, 255, 0.07), transparent 60%);
  z-index: 0;
}
#app { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ============ Nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  background: rgba(7, 7, 13, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
/* (gradient brand styling removed — Cinephiles Areana rebrand) */

.nav-links { display: flex; gap: 6px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }

.search-box {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}
#navSearch {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}
#navSearch:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}
#navSearch::placeholder { color: var(--muted); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
  display: none;
}
.search-dropdown.open { display: block; }
.search-dropdown .sd-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.search-dropdown .sd-item:hover { background: rgba(255, 255, 255, 0.05); }
.sd-poster {
  width: 40px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface);
  flex-shrink: 0;
}
.sd-info { min-width: 0; }
.sd-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sd-meta { font-size: 0.78rem; color: var(--muted); }
.sd-type {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.16);
  color: #b9a8ff;
  flex-shrink: 0;
}
.sd-type.tv { background: rgba(0, 212, 255, 0.14); color: #7fe3ff; }
.sd-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 0.88rem; }
.sd-loading { padding: 18px; text-align: center; color: var(--muted); }

.icon-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 72px 28px 56px;
  text-align: center;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -140px -20%;
  height: 320px;
  background: radial-gradient(50% 100% at 50% 100%, rgba(124, 92, 255, 0.22), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 14px;
}
/* (hero gradient removed — no hero on the home page) */
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 520px; margin: 0 auto 34px; }

.hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.hero-search input {
  width: 100%;
  padding: 17px 60px 17px 24px;
  font-size: 1.02rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  outline: none;
  box-shadow: var(--shadow);
  transition: border 0.2s, box-shadow 0.2s;
}
.hero-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.2), var(--shadow); }
.hero-search input::placeholder { color: var(--muted); }
.hero-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  cursor: pointer;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  transition: filter 0.2s, transform 0.1s;
}
.hero-search button:hover { filter: brightness(1.15); }
.hero-search button:active { transform: translateY(-50%) scale(0.96); }

/* ============ Sections & rows ============ */
.section { padding: 8px 28px 40px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.section-head a.see-all {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
}
.section-head a.see-all:hover { color: var(--accent-2); }

.row {
  position: relative;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 2px 14px;
  scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }
.row-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(12, 12, 21, 0.85);
  backdrop-filter: blur(8px);
  color: var(--text);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.row:hover .row-arrow { display: flex; }
.row-arrow:hover { background: var(--surface-2); }
.row-arrow.prev { left: -14px; }
.row-arrow.next { right: -14px; }

/* ============ Cards ============ */
.card {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: 168px;
  cursor: pointer;
  position: relative;
  border-radius: var(--radius-sm);
  transition: transform 0.25s ease;
}
.card:hover { transform: translateY(-6px); }
.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.card:hover .poster-wrap img { transform: scale(1.07); }
.poster-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 7, 13, 0.85), transparent 45%);
  opacity: 0;
  transition: opacity 0.25s;
}
.card:hover .poster-wrap::after { opacity: 1; }

.card-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  color: #ffd54f; /* gold star — score chip is the one color accent */
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.28);
  backdrop-filter: blur(6px);
  color: #cfc4ff;
}
.card-badge.tv { background: rgba(0, 212, 255, 0.24); color: #a5e9ff; }

.card-hover {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 12px 12px 10px;
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}
.card:hover .card-hover { opacity: 1; transform: translateY(0); }
.card-hover .ch-title {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.card-hover .ch-meta { font-size: 0.74rem; color: var(--muted); }
.card-hover .ch-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-title {
  margin-top: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.card-year { font-size: 0.74rem; color: var(--muted); margin-top: 1px; }

/* ============ Grid (browse/search) ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 22px 16px;
}
.grid .card { width: auto; }
.load-more {
  display: block;
  margin: 30px auto 0;
  padding: 13px 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: border 0.2s, background 0.2s;
}
.load-more:hover { border-color: var(--accent); background: var(--surface-2); }
.load-more:disabled { opacity: 0.5; cursor: default; }

.page-head { padding: 36px 28px 24px; }
.page-head h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 0.95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

/* ============ Detail page ============ */
.detail-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  padding: 60px 28px 40px;
}
.detail-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  z-index: -2;
}
.detail-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 2%, rgba(7, 7, 13, 0.55) 55%, rgba(7, 7, 13, 0.35));
}
.detail-main { display: flex; gap: 32px; max-width: 1080px; margin: 0 auto; width: 100%; align-items: flex-end; }
.detail-poster {
  width: 210px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  aspect-ratio: 2/3;
  background: var(--surface);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.chip-static {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip-static.rating { color: #ffd166; border-color: rgba(255, 209, 102, 0.3); background: rgba(255, 209, 102, 0.08); }
.chip-static.hd { color: #8affd1; border-color: rgba(138, 255, 209, 0.3); background: rgba(138, 255, 209, 0.07); }
.detail-desc { color: #c7c7d8; font-size: 0.97rem; line-height: 1.6; max-width: 640px; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; color: var(--muted); font-size: 0.84rem; }
.detail-facts b { color: var(--text); font-weight: 600; display: block; font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.7; margin-bottom: 2px; }

.play-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 28px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { filter: brightness(1.15); }
.btn-ghost { background: rgba(255, 255, 255, 0.1); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }

.cast-row { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 10px; scrollbar-width: none; }
.cast-row::-webkit-scrollbar { display: none; }
.cast-item { flex-shrink: 0; width: 84px; text-align: center; }
.cast-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 1.3rem;
}
.cast-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cast-name { font-size: 0.76rem; font-weight: 600; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-role { font-size: 0.68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* episodes */
.season-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.season-bar h3 { font-size: 1.05rem; font-weight: 700; }
.season-select {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.episodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.episode {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border 0.2s, background 0.2s, transform 0.15s;
}
.episode:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-2px); }
.ep-thumb {
  width: 96px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}
.ep-body { min-width: 0; }
.ep-title { font-size: 0.88rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-num { font-size: 0.72rem; color: var(--muted); margin: 3px 0 5px; }
.ep-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ Watch page ============ */
.watch { max-width: 1160px; margin: 0 auto; padding: 24px 28px 50px; }
.watch-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.watch-head h1 { font-size: 1.25rem; font-weight: 700; }
.watch-head .sub { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.watch-head .back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: color 0.2s, border 0.2s;
}
.watch-head .back:hover { color: var(--text); border-color: var(--accent); }

.player-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.player-shell video { width: 100%; height: 100%; background: #000; }

/* The custom Subtitles dropdown (+ Sync widget) is the app's ONLY subtitle
   switcher. Chrome auto-shows its native CC button on <video controls> the
   moment a text track is added via addTextTrack(), which duplicates the
   control and can fight with our track management (mode showing/hidden, cue
   re-rendering on sync). Hide it; Firefox never renders one, so this covers
   every browser. */
.player-shell video::-webkit-media-controls-toggle-closed-captions-button,
.player-shell video::-webkit-media-controls-closed-captions-container {
  display: none !important;
}


.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(60% 60% at 50% 45%, rgba(124, 92, 255, 0.1), transparent), #050508;
  color: var(--muted);
  font-size: 0.92rem;
}
.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0a0a12;
  color: #ff7d7d;
  font-size: 0.95rem;
  padding: 20px;
  text-align: center;
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.server-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.server-btn:hover { color: var(--text); }
.server-btn.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}
.server-btn.loading { opacity: 0.6; pointer-events: none; }

.subs-select {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  max-width: 280px;
}
.subs-select:disabled { opacity: 0.5; cursor: default; }

/* subtitle sync widget: − / offset value / + next to the Subtitles dropdown */
.subs-sync { display: inline-flex; align-items: center; gap: 4px; }
.subs-sync .ctl-btn { padding: 9px 12px; min-width: 36px; }
.subs-sync #subSyncVal { min-width: 92px; text-align: center; }

.skip-intro {
  position: absolute;
  right: 16px;
  bottom: 70px;
  z-index: 20;
  padding: 11px 20px;
  border-radius: 999px;
  border: none;
  background: rgba(124, 92, 255, 0.92);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.4);
  display: none;
  animation: rise 0.3s ease;
}
.skip-intro.show { display: inline-block; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

/* "Next episode" — appears up to 5 min before the end, so it must NOT compete
   with the picture: compact, translucent corner tag; gains full prominence
   only on hover. Stacked above skip-intro so the two never collide. */
.next-ep {
  position: absolute;
  right: 14px;
  bottom: 118px;
  z-index: 20;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(12, 12, 20, 0.55);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(4px);
  opacity: 0.62;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s ease,
    color 0.2s ease, border-color 0.2s ease, padding 0.2s ease;
  display: none;
}
.next-ep.show { display: inline-block; animation: fadein 0.8s ease; }
.next-ep:hover {
  opacity: 1;
  transform: translateY(0);
  padding: 9px 16px;
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  font-size: 0.84rem;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.4);
}
@keyframes fadein { from { opacity: 0; } }

/* ============ Skeletons ============ */
.skel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: rise 0.3s ease;
}

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--line);
  padding: 36px 28px 44px;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}
.footer .brand { display: block; font-size: 1.2rem; margin-bottom: 8px; }
.footer .disclaimer { margin-top: 8px; font-size: 0.76rem; opacity: 0.7; }

/* ============ Empty state ============ */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}
.empty .big { font-size: 3rem; margin-bottom: 14px; }
.empty h3 { color: var(--text); font-size: 1.2rem; margin-bottom: 8px; }

/* ============ Responsive ============ */
@media (max-width: 760px) {
  .nav { padding: 0 16px; gap: 14px; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0; background: rgba(7,7,13,0.97); flex-direction: column; padding: 12px; gap: 4px; border-bottom: 1px solid var(--line); }
  .search-box { position: static; }
  .search-box.hidden { display: none; }
  .search-box.mobile-open { display: block; position: absolute; top: var(--nav-h); left: 0; right: 0; padding: 12px 16px; background: rgba(7,7,13,0.97); border-bottom: 1px solid var(--line); }
  .search-box.mobile-open .search-dropdown { position: fixed; top: 120px; left: 16px; right: 16px; }
  .icon-btn { display: block; }
  .hero { padding: 48px 16px 40px; }
  .section { padding: 8px 16px 32px; }
  .card { width: 136px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px 12px; }
  .detail-hero { padding: 40px 16px 28px; min-height: auto; }
  .detail-main { flex-direction: column; align-items: flex-start; gap: 18px; }
  .detail-poster { width: 160px; }
  .watch { padding: 16px 12px 40px; }
  .episodes { grid-template-columns: 1fr; }
  .row-arrow { display: none !important; }
}

/* ---- player polish: speed/PiP buttons, progress bars ---- */
.ctl-btn { cursor: pointer; font: inherit; line-height: 1.2; }
.ctl-btn:hover { color: var(--text); border-color: var(--accent); }
.card-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  z-index: 2;
}
.card-progress i { display: block; height: 100%; background: var(--accent); }


/* Volume boost popup (Web Audio gain > 100%) */
.vol-wrap { position: relative; }
.vol-pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  white-space: nowrap;
  min-width: 200px;
}
.vol-pop input[type="range"] { flex: 1; accent-color: var(--accent); cursor: pointer; }
.vol-pop span { font-size: 0.8rem; font-weight: 700; color: var(--text); min-width: 46px; text-align: right; }

