/* ==========================================================================
   SnapReels PHP Edition - front-end styles
   Palette: #0a0a0a background, #f8298c primary, #4db2ff accent
   ========================================================================== */

:root {
  --bg: #0a0a0a;
  --bg-soft: #111113;
  --card: rgba(255, 255, 255, 0.04);
  --card-strong: #151517;
  --fg: #fafafa;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --primary: #f8298c;
  --primary-2: #ff5858;
  --primary-soft: rgba(248, 41, 140, 0.12);
  --primary-soft-2: rgba(248, 41, 140, 0.24);
  --accent: #4db2ff;
  --amber: #fbbf24;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 1.25rem;
  --radius-sm: 0.85rem;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 45% at 85% 0%, rgba(248, 41, 140, 0.07), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(77, 178, 255, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
main, .site-footer, .site-header { position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0c0c0e; }
::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a40; }

.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.icon.xs { width: 16px; height: 16px; }
.icon.sm { width: 18px; height: 18px; }
.icon.lg { width: 26px; height: 26px; }
.ml-auto { margin-left: auto; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Buttons, badges, avatars
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.01em;
  padding: 10px 20px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 10px 30px rgba(248, 41, 140, 0.28);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 14px 36px rgba(248, 41, 140, 0.38); }
.btn-outline { border-color: var(--border-strong); background: rgba(255,255,255,.04); color: var(--fg); }
.btn-outline:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--fg); background: rgba(255,255,255,.06); }
.btn-danger { background: rgba(239,68,68,.14); color: #fca5a5; border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.24); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; color: var(--fg);
  transition: background .18s ease, color .18s ease;
}
.icon-btn:hover { background: rgba(255,255,255,.08); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 3px 9px;
  font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid transparent; line-height: 1.4;
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-premium { background: var(--amber); color: #111; }
.badge-ok { background: rgba(34,197,94,.12); color: #4ade80; border-color: rgba(34,197,94,.25); }
.badge-warn { background: rgba(251,191,36,.12); color: #fcd34d; border-color: rgba(251,191,36,.25); }
.badge-danger { background: rgba(239,68,68,.12); color: #fca5a5; border-color: rgba(239,68,68,.25); }
.badge-muted { background: rgba(255,255,255,.06); color: var(--muted); border-color: var(--border); }

.avatar {
  border-radius: 999px; overflow: hidden; display: inline-flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 900; flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.15);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 30px; height: 30px; font-size: 12px; }
.avatar-sm { width: 38px; height: 38px; font-size: 14px; }
.avatar-lg { width: 96px; height: 96px; font-size: 32px; }

.coin-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  color: var(--amber); font-size: 11px; font-weight: 900;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 40;
  background: linear-gradient(to bottom, rgba(0,0,0,.82), rgba(0,0,0,0));
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-logo { height: 32px; width: auto; max-width: 140px; object-fit: contain; }
.brand-name { font-weight: 900; font-size: 18px; letter-spacing: -.03em; font-style: italic; }
.main-nav { display: none; gap: 26px; font-size: 14px; font-weight: 600; }
.main-nav a { color: rgba(255,255,255,.72); transition: color .18s; }
.main-nav a:hover { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.mobile-menu-btn { display: inline-flex; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 999px; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary:hover { background: rgba(255,255,255,.08); }
.dropdown[open] > summary { background: rgba(255,255,255,.1); }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 190px; padding: 6px;
  background: #121214; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); z-index: 100;
  animation: pop .15s ease;
}
.dropdown-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; border-radius: 10px; font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.8); text-align: left;
}
.dropdown-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.dropdown-item.text-danger { color: #fca5a5; }
.dropdown-item form, form .dropdown-item { width: 100%; }
.lang-dropdown img { border-radius: 3px; }
.user-dropdown > summary { padding: 3px; }
.user-menu { min-width: 250px; padding: 8px; }
.user-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu-name { font-weight: 900; font-size: 14px; }
.user-menu-email { font-size: 11px; color: var(--muted); margin-top: 3px; }
.user-menu-id { font-size: 10px; color: var(--muted-2); margin-top: 3px; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 92px 0 26px; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.25); filter: blur(60px); opacity: 0; transition: opacity .8s ease;
}
.hero-bg img.is-active { opacity: .5; }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,10,10,.35), rgba(10,10,10,.8), var(--bg)); }
.hero-track {
  position: relative; z-index: 2;
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 max(20px, calc((100vw - 1280px) / 2 + 20px)) 10px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide { flex: 0 0 76%; scroll-snap-align: center; transition: transform .5s ease, opacity .5s ease; transform: scale(.94); opacity: .55; }
.hero-slide.is-active { transform: scale(1); opacity: 1; }
.hero-poster {
  position: relative; aspect-ratio: 2/3; border-radius: 1.75rem; overflow: hidden;
  border: 1px solid var(--border); background: #141416; box-shadow: 0 40px 90px rgba(0,0,0,.6);
}
.hero-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.hero-slide:hover .hero-poster img { transform: scale(1.04); }
.hero-poster-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.45), transparent 55%); }
.hero-play {
  position: absolute; inset: 0; margin: auto; width: 58px; height: 58px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,.45); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.hero-slide:hover .hero-play { opacity: 1; transform: scale(1.05); }
.hero-dots { position: relative; z-index: 2; display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.hero-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.35); transition: width .25s ease, background .25s ease; }
.hero-dot.is-active { width: 28px; background: var(--primary); box-shadow: 0 0 14px rgba(248,41,140,.55); }
.hero-empty { min-height: 380px; display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* --------------------------------------------------------------------------
   Sections and rows
   -------------------------------------------------------------------------- */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-title { font-size: clamp(22px, 3vw, 30px); font-weight: 900; text-transform: uppercase; font-style: italic; letter-spacing: -.03em; }
.section-sub { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .18em; color: var(--muted-2); margin-top: 5px; }
.section-kicker { display: flex; align-items: center; gap: 12px; }
.section-kicker .kicker-icon { width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.section-kicker .kicker-icon.amber { background: rgba(251,191,36,.12); color: var(--amber); }
.section-kicker .kicker-bar { width: 5px; height: 30px; border-radius: 4px; background: var(--primary); }

.row-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: 46%;
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 8px; margin: 0 -20px; padding-left: 20px; padding-right: 20px;
  scrollbar-width: none;
}
.row-scroll::-webkit-scrollbar { display: none; }
.row-scroll > * { scroll-snap-align: start; }

.series-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.catalog-box {
  background: rgba(255,255,255,.025); border: 1px solid var(--border);
  border-radius: 3rem; padding: clamp(20px, 4vw, 40px); position: relative; overflow: hidden;
}
.catalog-box::after {
  content: ""; position: absolute; top: -80px; right: -80px; width: 260px; height: 260px;
  background: var(--primary-soft); border-radius: 50%; filter: blur(90px); pointer-events: none;
}

.empty-state {
  text-align: center; padding: 70px 20px; border: 2px dashed var(--border);
  border-radius: 2rem; background: rgba(255,255,255,.015);
}
.empty-state .empty-icon {
  width: 78px; height: 78px; border-radius: 999px; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; color: var(--primary);
}
.empty-state h2 { font-size: 26px; font-weight: 900; }
.empty-state p { color: var(--muted); margin-top: 8px; max-width: 420px; margin-left: auto; margin-right: auto; }
.empty-state .btn { margin-top: 24px; }

/* --------------------------------------------------------------------------
   Series card
   -------------------------------------------------------------------------- */
.series-card { position: relative; display: flex; flex-direction: column; }
.card-link { position: absolute; inset: 0; z-index: 5; }
.card-media {
  position: relative; aspect-ratio: 2/3; border-radius: 2rem; overflow: hidden;
  background: #17171a; border: 1px solid rgba(255,255,255,.05);
  box-shadow: 0 22px 50px rgba(0,0,0,.45);
  transition: transform .45s ease, border-color .45s ease, box-shadow .45s ease;
}
.series-card:hover .card-media { transform: translateY(-6px); border-color: rgba(248,41,140,.5); box-shadow: 0 26px 60px rgba(248,41,140,.18); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease, opacity .3s; opacity: .92; }
.series-card:hover .card-media img { transform: scale(1.08); opacity: 1; }
.card-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.95), rgba(0,0,0,.2) 55%, transparent); opacity: .8; transition: opacity .3s; }
.series-card:hover .card-shade { opacity: 1; }
.card-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; z-index: 2; }
.card-title { font-size: 14px; font-weight: 900; text-transform: uppercase; font-style: italic; letter-spacing: -.02em; line-height: 1.2; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.card-play {
  position: absolute; inset: 0; margin: auto; width: 42px; height: 42px; border-radius: 999px;
  background: var(--primary-soft-2); border: 1px solid rgba(248,41,140,.4);
  display: flex; align-items: center; justify-content: center; color: #fff;
  opacity: 0; transform: scale(1.4); transition: opacity .3s, transform .4s; z-index: 3; pointer-events: none;
}
.card-play .icon { width: 16px; height: 16px; fill: currentColor; }
.series-card:hover .card-play { opacity: 1; transform: scale(1); }
.card-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; z-index: 6; }
.fav-btn {
  width: 30px; height: 30px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(8px); transition: background .2s, color .2s, transform .2s;
}
.fav-btn:hover { background: var(--primary); transform: scale(1.05); }
.fav-btn.is-active { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(248,41,140,.4); }
.fav-btn.is-active .icon { fill: currentColor; }

/* --------------------------------------------------------------------------
   Page headers, auth, forms
   -------------------------------------------------------------------------- */
.page-wrap { padding: 120px 0 60px; }
.page-head { margin-bottom: 30px; }
.page-head h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 900; text-transform: uppercase; font-style: italic; letter-spacing: -.04em; }
.page-head p { color: var(--muted); margin-top: 8px; }
.page-title-bar { display: flex; align-items: center; gap: 14px; }
.page-title-bar::before { content: ""; width: 5px; height: 36px; border-radius: 4px; background: var(--primary); }

.auth-page { max-width: 460px; margin: 0 auto; }
.auth-card {
  background: #121214; border: 1px solid var(--border); border-radius: 2rem;
  padding: 34px 30px; box-shadow: var(--shadow); position: relative;
}
.auth-card h1 { font-size: 28px; font-weight: 900; text-align: center; }
.auth-card > p { text-align: center; color: var(--muted); margin-top: 6px; font-size: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(255,255,255,.05); padding: 4px; border-radius: 999px; margin: 22px 0; }
.auth-tab { padding: 9px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--muted); }
.auth-tab.is-active { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(248,41,140,.3); }
.auth-panel { display: none; }
.auth-panel.is-active { display: block; animation: fade .2s ease; }
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 7px; }
.field input, .field select, .field textarea, .input, .select, .textarea {
  width: 100%; background: rgba(255,255,255,.05); border: 1px solid var(--border);
  border-radius: 13px; padding: 12px 14px; color: var(--fg); outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(248,41,140,.14);
}
.field input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; border-radius: 12px; padding: 11px 14px; font-size: 13px; margin-bottom: 16px; }
.form-ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; border-radius: 12px; padding: 11px 14px; font-size: 13px; margin-bottom: 16px; }
.hint { color: var(--muted-2); font-size: 12px; margin-top: 7px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.check-row input { accent-color: var(--primary); width: 17px; height: 17px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.switch-row strong { display: block; font-size: 14px; }
.switch-row small { display: block; color: var(--muted-2); font-size: 12px; margin-top: 3px; }
.switch-row input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  width: 46px; height: 26px; border-radius: 999px; background: rgba(255,255,255,.12);
  position: relative; transition: background .2s; flex: 0 0 auto;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 999px; background: #fff; transition: transform .2s;
}
.switch-row input:checked + .switch { background: var(--primary); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }

/* --------------------------------------------------------------------------
   Dialogs, search, auth
   -------------------------------------------------------------------------- */
dialog.modal, dialog.sheet {
  border: 0; padding: 0; background: transparent; color: var(--fg); max-width: none;
}
dialog.modal::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
dialog.modal > *:first-child { animation: rise .22s ease; }
.modal { width: min(92vw, 480px); }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 5; }
.modal-panel, .modal > .auth-card, .modal > .share-panel, .modal > .unlock-panel {
  background: #121214; border: 1px solid var(--border); border-radius: 2rem;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.auth-modal { width: min(92vw, 440px); background: #121214; border: 1px solid var(--border); border-radius: 2rem; padding: 30px 28px; box-shadow: var(--shadow); }
.auth-head { text-align: center; padding: 4px 12px 0; }
.auth-head h2 { font-size: 25px; font-weight: 900; }
.auth-head p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.auth-panel .btn { margin-top: 4px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.social-buttons { display: grid; gap: 9px; }
.social-g, .social-f, .social-a { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; font-weight: 900; }
.social-f { color: #3b82f6; }
.social-a { color: #fff; }

.search-modal { width: min(94vw, 680px); background: #101012; border: 1px solid var(--border); border-radius: 1.6rem; box-shadow: var(--shadow); overflow: hidden; }
.search-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.search-head input { flex: 1; background: none; border: 0; outline: none; font-size: 17px; }
.search-body { padding: 12px; max-height: 60vh; overflow-y: auto; }
.search-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.search-empty-icon { width: 66px; height: 66px; border-radius: 999px; background: rgba(255,255,255,.05); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.search-empty p { font-weight: 700; color: var(--fg); }
.search-empty span { font-size: 12px; color: var(--muted-2); }
.search-result { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 14px; transition: background .18s; }
.search-result:hover { background: rgba(255,255,255,.06); }
.search-result img { width: 46px; height: 66px; object-fit: cover; border-radius: 8px; background: #1b1b1f; }
.search-result .r-title { font-weight: 800; font-size: 14px; }
.search-result .r-genres { font-size: 11px; color: var(--muted); }
.search-result .icon { margin-left: auto; opacity: .3; }

dialog.sheet {
  width: min(86vw, 300px); height: 100vh; max-height: 100vh; margin: 0 0 0 auto;
  border-radius: 0; background: #101012; border-left: 1px solid var(--border);
}
dialog.sheet::backdrop { background: rgba(0,0,0,.6); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--border); }
.sheet-nav { display: flex; flex-direction: column; padding: 14px; }
.sheet-nav a { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border-radius: 12px; font-weight: 700; font-size: 16px; }
.sheet-nav a:hover { background: rgba(255,255,255,.06); }

/* --------------------------------------------------------------------------
   Series detail
   -------------------------------------------------------------------------- */
.detail-wrap { padding: 100px 0 70px; position: relative; }
.detail-bg { position: absolute; top: 0; left: 0; width: 100%; height: 60vh; overflow: hidden; opacity: .3; pointer-events: none; }
.detail-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(70px); transform: scale(1.25); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); gap: 30px; align-items: start; position: relative; z-index: 2; }
.player-col { max-width: 330px; margin: 0 auto; width: 100%; }
.player {
  position: relative; aspect-ratio: 9/16; border-radius: 2rem; overflow: hidden;
  background: #050506; border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 40px 100px rgba(0,0,0,.8); user-select: none;
}
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-poster { position: absolute; inset: 0; cursor: pointer; }
.player-poster img { width: 100%; height: 100%; object-fit: cover; }
.player-poster-shade { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.player-poster .big-play {
  position: absolute; inset: 0; margin: auto; width: 82px; height: 82px; border-radius: 999px;
  border: 2px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(12px);
  transition: transform .3s;
}
.player-poster:hover .big-play { transform: scale(1.08); }
.player-poster .ep-label {
  position: absolute; bottom: 20px; left: 0; right: 0; text-align: center;
}
.player-poster .ep-label span { background: rgba(248,41,140,.9); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px;
  background: linear-gradient(to top, rgba(0,0,0,.95), rgba(0,0,0,.35), transparent);
  z-index: 6; transition: opacity .35s; pointer-events: none;
}
.player-controls.is-visible { pointer-events: auto; }
.player-controls.is-hidden { opacity: 0; pointer-events: none; }
.player-bar { width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); position: relative; cursor: pointer; margin-bottom: 12px; }
.player-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--primary); width: 0; }
.player-bar-handle { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 999px; background: #fff; transform: translate(-50%, -50%); left: 0; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.player-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.player-row .left, .player-row .right { display: flex; align-items: center; gap: 10px; }
.player-time { font-size: 10px; font-weight: 900; letter-spacing: .08em; font-family: ui-monospace, monospace; background: rgba(0,0,0,.4); padding: 5px 9px; border-radius: 999px; border: 1px solid rgba(255,255,255,.1); }
.player-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 999px; color: #fff; }
.player-btn:hover { background: rgba(255,255,255,.12); }
.quality-menu { position: absolute; right: 12px; bottom: 70px; background: rgba(10,10,12,.95); border: 1px solid var(--border); border-radius: 14px; padding: 6px; display: none; z-index: 8; min-width: 120px; }
.quality-menu.is-open { display: block; }
.quality-menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; font-size: 12px; font-weight: 700; }
.quality-menu button:hover { background: rgba(255,255,255,.08); }
.player-center-play {
  position: absolute; inset: 0; margin: auto; width: 92px; height: 92px; border-radius: 999px;
  background: rgba(0,0,0,.4); border: 2px solid rgba(255,255,255,.2); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 5;
  animation: pop .25s ease;
}
.player-center-play .icon { width: 44px; height: 44px; fill: #fff; }
.player-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; background: #0f0f12; z-index: 9; }
.player-error h3 { font-size: 19px; font-weight: 900; margin-top: 16px; }
.player-error .actions { display: flex; gap: 10px; margin-top: 20px; }
.player-end { position: absolute; inset: 0; background: rgba(0,0,0,.95); z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.player-end h3 { font-size: 22px; font-weight: 900; text-transform: uppercase; font-style: italic; }
.player-end .end-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 280px; margin-top: 18px; }
.player-end .end-grid .series-card .card-title { font-size: 11px; }
.player-rate { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); background: var(--primary-soft-2); border: 1px solid rgba(248,41,140,.35); color: #fff; padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; z-index: 7; animation: pulse 1.2s infinite; }
.player-seek-hint { position: absolute; top: 0; bottom: 0; width: 34%; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 7; }
.player-seek-hint.forward { right: 0; }
.player-seek-hint.backward { left: 0; }
.player-seek-hint span { display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(0,0,0,.5); padding: 16px 22px; border-radius: 999px; border: 1px solid var(--border); backdrop-filter: blur(6px); }
.player-seek-hint strong { font-size: 16px; font-weight: 900; font-style: italic; }

.player-nav { display: flex; gap: 10px; margin-top: 14px; }
.player-nav .btn { flex: 1; height: 50px; font-size: 12px; }
.player-nav .btn-next { height: 56px; font-size: 14px; border-radius: 1.4rem; }

.detail-info h1 { font-size: clamp(24px, 3.4vw, 38px); font-weight: 900; text-transform: uppercase; font-style: italic; letter-spacing: -.04em; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.detail-meta .dot { width: 4px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.2); }
.detail-meta .views { color: var(--primary); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.action-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px;
  border-radius: 13px; border: 2px solid var(--border); background: rgba(255,255,255,.05);
  font-size: 12px; font-weight: 900; color: rgba(255,255,255,.65); transition: all .18s;
}
.action-btn:hover { border-color: var(--border-strong); color: #fff; background: rgba(255,255,255,.09); }
.action-btn.is-active { background: rgba(244,63,94,.1); border-color: rgba(244,63,94,.35); color: #fb7185; box-shadow: 0 6px 18px rgba(244,63,94,.12); }
.action-btn.is-active .icon { fill: currentColor; transform: scale(1.08); }
.action-btn.is-fav { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.35); color: #fcd34d; box-shadow: 0 6px 18px rgba(251,191,36,.12); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.synopsis { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); border-radius: 1.2rem; padding: 18px; margin-top: 20px; backdrop-filter: blur(8px); }
.synopsis-label { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .18em; color: rgba(255,255,255,.4); margin-bottom: 10px; }
.synopsis p { font-size: 13px; line-height: 1.7; color: var(--muted); }
.episodes-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.episodes-head h2 { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 900; text-transform: uppercase; }
.episodes-head h2::before { content: ""; width: 5px; height: 24px; border-radius: 4px; background: var(--primary); }
.episode-pager { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 900; color: var(--muted); }
.episode-pager button { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.episode-pager button:hover { background: rgba(255,255,255,.07); }
.episode-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.ep-btn {
  position: relative; height: 62px; border-radius: 1.1rem; border: 2px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.05); font-weight: 900; font-size: 15px; color: rgba(255,255,255,.6);
  transition: all .18s;
}
.ep-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.ep-btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.05); box-shadow: 0 10px 24px rgba(248,41,140,.35); z-index: 2; }
.ep-btn.is-locked { background: rgba(0,0,0,.22); }
.ep-btn .icon { position: absolute; top: 6px; right: 6px; opacity: .55; width: 12px; height: 12px; }
.ep-btn.is-active .icon { display: none; }
.similar { margin-top: 60px; padding-top: 36px; border-top: 1px solid var(--border); }
.similar .series-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px 14px; }

/* unlock dialog */
.unlock-panel { background: #121214; border: 1px solid var(--border); border-radius: 2rem; padding: 28px; width: min(92vw, 430px); box-shadow: var(--shadow); }
.unlock-panel h2 { font-size: 22px; font-weight: 900; }
.unlock-panel > p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.unlock-options { display: grid; gap: 10px; margin-top: 20px; }
.unlock-option { display: flex; align-items: center; gap: 12px; padding: 15px; border-radius: 1rem; border: 1px solid var(--border); background: rgba(255,255,255,.04); text-align: left; transition: all .18s; }
.unlock-option:hover { border-color: var(--primary); background: var(--primary-soft); }
.unlock-option .opt-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.unlock-option strong { display: block; font-size: 14px; }
.unlock-option small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.unlock-balance { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }
.ad-stage { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 1rem; overflow: hidden; margin-top: 16px; }
.ad-stage iframe { width: 100%; height: 100%; border: 0; }
.ad-stage .ad-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted-2); }
.ad-countdown { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 1rem; background: rgba(255,255,255,.05); border: 1px solid var(--border); margin-top: 14px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.4); }

/* share */
.share-panel { background: #121214; border: 1px solid var(--border); border-radius: 2rem; padding: 26px; width: min(92vw, 440px); }
.share-panel h2 { font-size: 20px; font-weight: 900; }
.share-panel > p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.share-target { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 1rem; border: 1px solid var(--border); background: rgba(255,255,255,.04); font-size: 11px; font-weight: 700; }
.share-target:hover { border-color: var(--primary); background: var(--primary-soft); }

/* --------------------------------------------------------------------------
   Wallet, rewards, profile
   -------------------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 1.6rem; padding: 20px; position: relative; overflow: hidden; }
.stat-card.primary { background: var(--primary-soft); border-color: rgba(248,41,140,.25); }
.stat-card.vip { border-color: rgba(251,191,36,.25); background: rgba(251,191,36,.06); }
.stat-label { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: clamp(30px, 6vw, 44px); font-weight: 900; margin-top: 8px; display: flex; align-items: baseline; gap: 8px; }
.stat-value small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.stat-vip { font-size: 24px; font-weight: 900; font-style: italic; margin-top: 8px; color: var(--amber); }
.stat-vip.off { color: rgba(255,255,255,.35); font-style: normal; }

.wallet-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; margin-top: 40px; align-items: start; }
.pack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pack-card { background: var(--card); border: 1px solid var(--border); border-radius: 1.8rem; overflow: hidden; transition: border-color .2s, transform .2s; }
.pack-card:hover { border-color: rgba(248,41,140,.5); transform: translateY(-2px); }
.pack-card.vip-pack { border-color: rgba(251,191,36,.2); background: linear-gradient(145deg, #17130b, #0d0d0f); }
.pack-head { padding: 18px 18px 0; }
.pack-head h3 { font-size: 17px; font-weight: 900; text-transform: uppercase; font-style: italic; }
.pack-head p { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }
.pack-body { padding: 26px 18px; text-align: center; }
.pack-amount { font-size: 40px; font-weight: 900; color: var(--amber); display: flex; align-items: center; justify-content: center; gap: 10px; }
.pack-amount .icon { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(251,191,36,.45)); }
.pack-price { font-size: 30px; font-weight: 900; }
.pack-desc { color: var(--muted); font-size: 12px; margin-top: 8px; }
.pack-foot { padding: 0 18px 18px; }
.tx-list { display: flex; flex-direction: column; gap: 14px; }
.tx-row { display: flex; align-items: center; gap: 12px; }
.tx-icon { width: 34px; height: 34px; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tx-icon.plus { background: rgba(34,197,94,.12); color: #4ade80; }
.tx-icon.minus { background: rgba(239,68,68,.12); color: #fca5a5; }
.tx-main { flex: 1; min-width: 0; }
.tx-main p { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main small { font-size: 11px; color: var(--muted-2); }
.tx-amount { font-family: ui-monospace, monospace; font-size: 13px; font-weight: 800; }
.tx-amount.plus { color: #4ade80; }
.tx-amount.minus { color: #fca5a5; }

.reward-card { background: #121212; border: 1px solid var(--border); border-radius: 2.2rem; padding: 24px; position: relative; overflow: hidden; }
.reward-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 900; text-transform: uppercase; font-style: italic; }
.reward-title .kicker-icon { width: 38px; height: 38px; border-radius: 11px; background: rgba(249,115,22,.12); color: #fb923c; display: flex; align-items: center; justify-content: center; }
.reward-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0; }
.reward-day { aspect-ratio: 1; border-radius: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.reward-day .icon { width: 16px; height: 16px; color: rgba(251,191,36,.4); }
.reward-day span { font-size: 10px; font-weight: 900; color: rgba(255,255,255,.2); }
.reward-day.past { background: var(--amber); border-color: var(--amber); }
.reward-day.past .icon, .reward-day.past span { color: #111; }
.reward-day.today { background: rgba(251,191,36,.18); border-color: var(--amber); box-shadow: 0 0 18px rgba(251,191,36,.25); transform: scale(1.04); }
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-row { display: flex; align-items: center; gap: 12px; background: #121212; border: 1px solid var(--border); border-radius: 1.4rem; padding: 14px; }
.task-icon { width: 52px; height: 52px; border-radius: 1rem; background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.2); display: flex; align-items: center; justify-content: center; color: var(--amber); flex: 0 0 auto; }
.task-icon.link { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.2); color: #60a5fa; }
.task-main { flex: 1; min-width: 0; }
.task-main strong { display: block; font-size: 13px; }
.task-main small { display: block; font-size: 10px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.task-tag { font-size: 9px; font-weight: 900; color: var(--primary); background: var(--primary-soft); border: 1px solid var(--primary-soft-2); border-radius: 5px; padding: 2px 5px; margin-left: 6px; }

.profile-card { background: #121214; border: 1px solid var(--border); border-radius: 2rem; padding: 28px; }
.profile-top { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.profile-avatar { position: relative; }
.profile-avatar input { display: none; }
.profile-avatar label { position: absolute; inset: 0; border-radius: 999px; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; cursor: pointer; }
.profile-avatar:hover label { opacity: 1; }
.profile-name { font-size: 22px; font-weight: 900; }
.profile-email { color: var(--muted); font-size: 13px; margin-top: 3px; }

.tabs { display: flex; gap: 4px; background: rgba(255,255,255,.05); padding: 4px; border-radius: 999px; width: fit-content; }
.tab { padding: 9px 20px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.tab.is-active { background: var(--primary); color: #fff; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fade .2s ease; }

/* --------------------------------------------------------------------------
   Cards, tables, pagination, misc
   -------------------------------------------------------------------------- */
.card { background: #121214; border: 1px solid var(--border); border-radius: 1.6rem; padding: 24px; }
.card-title { font-size: 18px; font-weight: 900; }
.card-desc { color: var(--muted); font-size: 12px; margin-top: 4px; }
.alert { display: flex; align-items: flex-start; gap: 10px; border-radius: 1rem; padding: 13px 16px; font-size: 13px; }
.alert-danger { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.28); color: #fca5a5; }
.alert-info { background: rgba(77,178,255,.08); border: 1px solid rgba(77,178,255,.25); color: #93c5fd; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.page-link { min-width: 36px; height: 36px; padding: 0 12px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; border: 1px solid var(--border); background: rgba(255,255,255,.03); }
.page-link:hover { border-color: var(--primary); }
.page-link.is-active { background: var(--primary); border-color: var(--primary); }

/* prose for custom pages */
.prose { color: var(--muted); font-size: 15px; line-height: 1.85; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--fg); font-weight: 900; text-transform: uppercase; font-style: italic; letter-spacing: -.02em; margin: 30px 0 12px; }
.prose h1 { font-size: 30px; } .prose h2 { font-size: 24px; } .prose h3 { font-size: 19px; }
.prose p { margin-bottom: 14px; }
.prose ul { list-style: disc; padding-left: 22px; margin-bottom: 14px; }
.prose ol { list-style: decimal; padding-left: 22px; margin-bottom: 14px; }
.prose a { color: var(--accent); }
.prose code { background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 5px; font-size: 13px; }
.prose blockquote { border-left: 3px solid var(--primary); padding-left: 16px; margin: 20px 0; }
.prose img { border-radius: 1rem; margin: 18px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }

/* --------------------------------------------------------------------------
   Toasts, PWA prompt
   -------------------------------------------------------------------------- */
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 9px; align-items: center; width: min(92vw, 420px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: #17171a; border: 1px solid var(--border); color: var(--fg); padding: 11px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); animation: rise .25s ease; pointer-events: auto; }
.toast-success { border-color: rgba(34,197,94,.35); }
.toast-success .icon { color: #4ade80; }
.toast-error { border-color: rgba(239,68,68,.4); }
.toast-error .icon { color: #fca5a5; }
.toast-info .icon { color: var(--accent); }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: all .3s; }
.pwa-prompt { position: fixed; bottom: 20px; left: 20px; right: 20px; z-index: 190; background: #17171a; border: 1px solid var(--border); border-radius: 1.4rem; padding: 16px 18px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.pwa-prompt > div { flex: 1; }
.pwa-prompt strong { display: block; font-size: 14px; }
.pwa-prompt span { display: block; font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .series-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row-scroll { grid-auto-columns: 33.333%; }
  .hero-slide { flex-basis: 54%; }
  .form-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .main-nav { display: flex; }
  .mobile-menu-btn { display: none; }
  .series-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .row-scroll { grid-auto-columns: 25%; }
  .hero-slide { flex-basis: 40%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .episode-grid { grid-template-columns: repeat(5, 1fr); }
  .similar .series-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .detail-grid { gap: 40px; }
  .player-col { max-width: none; }
}
@media (min-width: 1024px) {
  .series-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .row-scroll { grid-auto-columns: 20%; }
  .hero-slide { flex-basis: 31%; }
  .similar .series-grid { grid-template-columns: repeat(5, minmax(0,1fr)); }
}
@media (min-width: 1280px) {
  .series-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .row-scroll { grid-auto-columns: 16.666%; }
  .hero-slide { flex-basis: 25%; }
  .similar .series-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
}
@media (max-width: 1023px) {
  .detail-grid { grid-template-columns: 1fr; }
  .player-col { max-width: 330px; }
  .detail-info { margin-top: 10px; }
  .wallet-grid { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .container { padding: 0 14px; }
  .page-wrap { padding: 96px 0 40px; }
  .episode-grid { grid-template-columns: repeat(4, 1fr); }
  .pack-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding-top: 84px; }
  .catalog-box { border-radius: 2rem; }
  .detail-actions .action-btn span { display: none; }
  .detail-actions .action-btn { width: 40px; justify-content: center; padding: 0; }
}

/* RTL tweaks */
[dir="rtl"] .row-scroll, [dir="rtl"] .hero-track { direction: rtl; }
[dir="rtl"] .card-top, [dir="rtl"] .card-caption { direction: rtl; }
[dir="rtl"] .dropdown-menu { right: auto; left: 0; }

/* --------------------------------------------------------------------------
   Utility classes
   -------------------------------------------------------------------------- */
.flex-1 { flex: 1; min-width: 0; }
.text-danger { color: #fca5a5; }
.space-y-12 > * + * { margin-top: 3rem; }
.modal-box { background: #121214; border: 1px solid var(--border); border-radius: 1.6rem; padding: 22px; box-shadow: var(--shadow); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: #0a0a0a;
  position: relative;
  z-index: 1;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 46px 20px 38px; text-align: center; }
.store-badges { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.store-badge { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); background: rgba(255,255,255,.04); border-radius: 12px; padding: 8px 14px; transition: border-color .2s, background .2s; }
.store-badge:hover { border-color: var(--border-strong); background: rgba(255,255,255,.07); }
.store-badge .icon { width: 20px; height: 20px; }
.store-badge small { display: block; font-size: 7px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); }
.store-badge strong { display: block; font-size: 11px; font-weight: 900; }
.social-row { display: flex; gap: 26px; }
.social-row a { color: rgba(255,255,255,.4); transition: color .2s, transform .2s; }
.social-row a:hover { color: #fff; transform: scale(1.15); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 34px; }
.footer-links a { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; color: #fff; transition: color .18s; }
.footer-links a:hover { color: var(--primary); }
.footer-copy { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.3); }
.footer-version { font-size: 8px; font-weight: 900; letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,.12); }

/* Hero with a single featured item */
.hero-track.is-single { justify-content: center; }

/* Player control density */
.player-controls { padding: 14px; }
.player-row .left { gap: 4px; }
.player-time { font-size: 9px; padding: 4px 7px; }
#volumeSlider { display: none; }
@media (min-width: 1024px) {
  #volumeSlider { display: block; }
}
@media (max-width: 1023px) {
  #rewindBtn, #forwardBtn { display: none; }
}

/* Dialog-specific backgrounds (dialog.modal resets background/padding) */
dialog.auth-modal { background: #121214; padding: 30px 28px; }
dialog.search-modal { background: #101012; }

/* Hide the native search clear button (we render our own close icon) */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* Keep the compact player controls readable; double-tap still seeks */
#rewindBtn, #forwardBtn, #volumeSlider { display: none !important; }
