/* ==========================================================================
   MrFilm — design system
   Cinematic dark theme, neon-green accent, RTL-first, mobile-first.
   ========================================================================== */

:root {
  --bg: #050706;
  --bg-elev: #0b0e0b;
  --surface: #0e120e;
  --surface-2: #151a15;
  --surface-3: #1b211b;
  --line: #202720;
  --line-strong: #2c342c;
  --text: #f1f5f1;
  --text-dim: #b6c0b6;
  --muted: #8a958a;
  --brand: #39ff14;
  --brand-soft: rgba(57, 255, 20, 0.14);
  --brand-line: rgba(57, 255, 20, 0.38);
  --danger: #ff6b6b;
  --warn: #ffc857;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  --glow: 0 0 24px rgba(57, 255, 20, 0.35);
  --header-h: 64px;
  --nav-h: 62px;
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
  --font: 'Vazirmatn', 'Segoe UI', Tahoma, 'Noto Sans Arabic', system-ui, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(70rem 30rem at 88% -8%, rgba(57, 255, 20, 0.10), transparent 65%),
    radial-gradient(55rem 32rem at -5% 105%, rgba(57, 255, 20, 0.07), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--brand); color: #041004; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #080a08; }
::-webkit-scrollbar-thumb { background: #232a23; border-radius: 20px; border: 2px solid #080a08; }
::-webkit-scrollbar-thumb:hover { background: #33402f; }

/* --------------------------------------------------------------- layout */

#app { position: relative; z-index: 2; min-height: 100dvh; display: flex; flex-direction: column; }
#view { flex: 1; padding-bottom: calc(var(--nav-h) + 1.5rem); }
#view:focus, #view:focus-visible { outline: none; }
body[data-chrome='off'] #view { padding-bottom: 1rem; }

.container { width: min(1400px, 100%); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 3.2rem); }

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -60px; z-index: 60;
  background: var(--brand); color: #041004; font-weight: 700;
  padding: 0.6rem 1.2rem; border-radius: 0 0 10px 10px; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* --------------------------------------------------------------- header */

.topbar {
  position: sticky; top: 0; z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(to bottom, rgba(3, 4, 3, 0.96), rgba(3, 4, 3, 0.72) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: transform 0.35s var(--ease), background 0.3s, border-color 0.3s;
}
.topbar.scrolled { background: rgba(4, 6, 4, 0.94); border-bottom-color: var(--line); }
.topbar.hidden { transform: translateY(-110%); }

.topbar__inner {
  display: flex; align-items: center; gap: 1.4rem;
  height: var(--header-h);
  width: min(1400px, 100%); margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 3.2rem);
}

.logo { display: inline-flex; align-items: center; gap: 0.55rem; direction: ltr; flex: none; }
.logo__mark { width: 34px; height: 34px; filter: drop-shadow(0 0 7px rgba(57, 255, 20, 0.55)); }
.logo__text { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.logo__text b { color: var(--brand); }
.logo:hover .reel { animation-duration: 1.2s; }
.reel { transform-origin: 32px 32px; animation: spin 9s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.nav { display: flex; align-items: center; gap: 0.15rem; }
.nav a {
  position: relative; padding: 0.45rem 0.9rem; border-radius: 10px;
  color: var(--text-dim); font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav a[aria-current='page'] { color: var(--text); }
.nav a[aria-current='page']::after {
  content: ''; position: absolute; inset-inline: 0.9rem; bottom: -0.05rem; height: 2px;
  background: var(--brand); border-radius: 2px; box-shadow: 0 0 10px var(--brand);
}

.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 0.6rem; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; color: var(--text-dim);
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; background: #0f1a10; border: 2px solid var(--brand);
  color: var(--brand); box-shadow: 0 0 12px rgba(57, 255, 20, 0.3); overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 76px; height: 76px; font-size: 1.9rem; }

.user-chip { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.2rem 0.55rem 0.2rem 0.2rem; border-radius: 999px; }
.user-chip:hover { background: rgba(255, 255, 255, 0.06); }
.user-chip span { font-size: 0.9rem; color: var(--text-dim); max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.85rem; padding: 0 1.35rem; border-radius: 11px;
  background: var(--brand); color: #04120a; font-weight: 600; font-size: 0.95rem;
  border: 1px solid var(--brand);
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s, opacity 0.2s;
  white-space: nowrap; user-select: none;
}
.btn:hover:not(:disabled) { box-shadow: var(--glow); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

.btn--ghost { background: rgba(255, 255, 255, 0.06); border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.11); border-color: #465246; box-shadow: none; }
.btn--outline { background: transparent; border-color: var(--brand-line); color: var(--brand); }
.btn--danger { background: transparent; border-color: #7a2b2b; color: #ff8a8a; }
.btn--danger:hover:not(:disabled) { background: rgba(255, 107, 107, 0.1); box-shadow: none; }
.btn--sm { min-height: 2.2rem; padding: 0 0.85rem; font-size: 0.85rem; border-radius: 9px; }
.btn--lg { min-height: 3.2rem; padding: 0 1.9rem; font-size: 1rem; }
.btn--icon { width: 2.85rem; padding: 0; }
.btn--block { width: 100%; }

/* --------------------------------------------------------------- hero */

.hero { position: relative; min-height: min(62vh, 560px); display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to top, var(--bg) 2%, rgba(5, 7, 6, 0.55) 38%, rgba(5, 7, 6, 0.15) 70%),
    linear-gradient(to left, rgba(5, 7, 6, 0.85), transparent 60%);
}
.hero__slide { position: relative; z-index: 2; }
.hero__inner { position: relative; z-index: 2; width: min(1400px, 100%); margin-inline: auto; padding: clamp(1.5rem, 6vw, 4rem) clamp(1rem, 4vw, 3.2rem) clamp(1.8rem, 5vw, 3.2rem); display: grid; gap: 0.9rem; justify-items: start; }
.hero__title { max-width: 46rem; }
.hero__badge { display: inline-flex; align-items: center; gap: 0.45rem; justify-self: start; background: var(--brand); color: #04120a; font-weight: 700; font-size: 0.78rem; padding: 0.2rem 0.7rem; border-radius: 6px; }
.hero__title { font-size: clamp(1.9rem, 5vw, 3.6rem); font-weight: 700; line-height: 1.4; letter-spacing: 0; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6); }
.hero__en { direction: ltr; text-align: start; color: var(--text-dim); font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; }
.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; color: var(--text-dim); font-size: 0.9rem; }
.hero__desc { color: #cfd8cf; max-width: 40rem; line-height: 1.95; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.4rem; }
.hero__dots { position: absolute; inset-inline-start: clamp(1rem, 4vw, 3.2rem); bottom: 1rem; display: flex; gap: 0.4rem; z-index: 3; }
.hero__dot { width: 26px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); transition: background 0.25s, width 0.25s; }
.hero__dot[aria-current='true'] { background: var(--brand); width: 40px; box-shadow: 0 0 10px var(--brand); }
.hero__nav { position: absolute; inset-inline-end: clamp(1rem, 4vw, 3.2rem); bottom: 1rem; display: none; gap: 0.4rem; z-index: 3; }
.hero__nav button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; }
.hero__nav button:hover { border-color: var(--brand); color: var(--brand); }
@media (min-width: 900px) { .hero__nav { display: flex; } }

/* --------------------------------------------------------------- chips */

.chips { display: flex; gap: 0.55rem; overflow-x: auto; scrollbar-width: none; padding: 1.3rem 0 0.4rem; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 0.5rem 1.05rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid transparent;
  color: var(--text-dim); font-size: 0.9rem; font-weight: 600;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip[aria-current='true'] { background: var(--brand); color: #04120a; border-color: var(--brand); font-weight: 700; }

/* --------------------------------------------------------------- rows */

.rail { margin-top: 2.2rem; }
.rail__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.rail__title { display: flex; align-items: baseline; gap: 0.6rem; font-size: 1.18rem; font-weight: 700; }
.rail__title::before { content: ''; width: 4px; height: 1.15em; border-radius: 3px; background: var(--brand); box-shadow: 0 0 12px var(--brand-line); transform: translateY(2px); }
.rail__hint { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.rail__arrows { display: none; gap: 0.35rem; }
.rail__arrows button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--text-dim); }
.rail__arrows button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.rail__arrows button:disabled { opacity: 0.25; cursor: default; }
@media (hover: hover) and (min-width: 760px) { .rail__arrows { display: flex; } }

.rail__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(9.2rem, 16vw, 12.4rem);
  gap: 0.9rem; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 0.2rem 0.2rem 0.6rem;
  scroll-padding-inline-start: 0.2rem;
}
.rail__track::-webkit-scrollbar { display: none; }
.rail__track > * { scroll-snap-align: start; }

/* --------------------------------------------------------------- card */

.card { display: grid; gap: 0.45rem; align-content: start; text-align: start; }
.card__poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  transition: transform 0.28s var(--ease), border-color 0.28s, box-shadow 0.28s;
}
.card__poster img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card__poster, .card:focus-visible .card__poster {
  transform: translateY(-4px); border-color: var(--brand-line);
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.95), 0 0 26px rgba(57, 255, 20, 0.18);
}
.card__rank { position: absolute; inset-inline-start: 0; top: 0; z-index: 2; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; background: var(--brand); color: #04120a; font-weight: 700; border-end-end-radius: 12px; font-size: 0.9rem; }
.card__tag { position: absolute; top: 0.5rem; inset-inline-start: 0.5rem; z-index: 2; background: rgba(0, 0, 0, 0.72); border: 1px solid var(--brand-line); color: var(--brand); font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 5px; backdrop-filter: blur(6px); }
.card__rating { position: absolute; bottom: 0.5rem; inset-inline-start: 0.5rem; z-index: 2; display: inline-flex; align-items: center; gap: 0.25rem; background: rgba(0, 0, 0, 0.75); color: #ffd84d; font-size: 0.74rem; font-weight: 700; padding: 0.1rem 0.42rem; border-radius: 5px; direction: ltr; backdrop-filter: blur(6px); }
.card__play {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 3;
  background: rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity 0.25s;
}
.card:hover .card__play, .card:focus-visible .card__play { opacity: 1; }
.card__play i { width: 3rem; height: 3rem; border-radius: 50%; background: var(--brand); color: #04120a; display: grid; place-items: center; box-shadow: 0 0 26px rgba(57, 255, 20, 0.55); font-style: normal; }
.card__play svg { width: 18px; height: 18px; margin-inline-start: -2px; }
.card__progress { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.18); z-index: 3; }
.card__progress i { display: block; height: 100%; background: var(--brand); }
.card__name { font-size: 0.92rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__sub { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------- detail */

.detail { position: relative; }
.detail__bg { position: absolute; inset: 0 0 auto; height: min(64vh, 620px); z-index: 0; overflow: hidden; }
.detail__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; filter: blur(2px) saturate(1.15); transform: scale(1.03); }
.detail__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 4%, rgba(5, 7, 6, 0.6) 55%, rgba(5, 7, 6, 0.35)); }
.detail__top { position: relative; z-index: 1; padding-top: clamp(2rem, 8vw, 6rem); }
.detail__grid { display: flex; gap: clamp(1.2rem, 3vw, 2.4rem); align-items: flex-end; flex-wrap: wrap; }
.detail__poster { width: clamp(9rem, 18vw, 14rem); aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow); flex: none; }
.detail__poster img { width: 100%; height: 100%; object-fit: cover; }
.detail__info { flex: 1; min-width: min(100%, 18rem); display: grid; gap: 0.7rem; justify-items: start; }
.detail__title { font-size: clamp(1.8rem, 4.4vw, 3rem); font-weight: 700; line-height: 1.2; }
.detail__en { direction: ltr; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.85rem; }
.detail__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.8rem; color: var(--text-dim); font-size: 0.9rem; }
.detail__desc { color: #d3dcd3; max-width: 46rem; line-height: 1.95; }
.detail__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.detail__section { margin-top: 2.4rem; }
.detail__section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.9rem; }

.pill { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.14rem 0.55rem; border-radius: 6px; font-size: 0.78rem; font-weight: 700; background: var(--surface-3); color: var(--text-dim); }
.pill--rating { background: var(--brand); color: #04120a; direction: ltr; }
.pill--kind { border: 1px solid var(--line-strong); background: transparent; }

/* --------------------------------------------------------------- episodes */

.season-tabs { display: flex; gap: 0.45rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.6rem; }
.season-tabs::-webkit-scrollbar { display: none; }
.season-tabs button { flex: none; padding: 0.45rem 1.1rem; border-radius: 9px; background: var(--surface-2); color: var(--text-dim); font-weight: 700; font-size: 0.9rem; }
.season-tabs button[aria-current='true'] { background: var(--brand); color: #04120a; }

.episodes { display: grid; gap: 0.5rem; max-width: 62rem; }
.episode {
  display: flex; align-items: center; gap: 0.9rem; width: 100%; text-align: start;
  padding: 0.8rem 1rem; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); transition: border-color 0.2s, background 0.2s;
}
.episode:hover { border-color: var(--brand-line); background: var(--surface-2); }
.episode__num { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-dim); font-weight: 700; font-size: 0.85rem; }
.episode--watched .episode__num { background: rgba(57, 255, 20, 0.16); color: var(--brand); }
.episode__body { flex: 1; min-width: 0; display: grid; }
.episode__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode__meta { color: var(--muted); font-size: 0.78rem; }
.episode__bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); margin-top: 0.35rem; overflow: hidden; }
.episode__bar i { display: block; height: 100%; background: var(--brand); }
.episode__state { flex: none; color: var(--muted); font-size: 0.8rem; }

/* --------------------------------------------------------------- player */

.player-page { display: grid; gap: 1.2rem; padding-top: 1rem; }
.player-shell { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 78vh; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.player-shell:fullscreen { border-radius: 0; max-height: none; aspect-ratio: auto; border: 0; }
.player-shell video, .player-shell canvas { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-shell.idle { cursor: none; }
.player-shell.idle .player__controls { opacity: 0; pointer-events: none; }

.player__controls {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 3;
  padding: 2.6rem 1rem 0.75rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  display: grid; gap: 0.35rem; transition: opacity 0.3s;
}
.player__row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.player__btn { min-width: 2.6rem; height: 2.6rem; padding: 0 0.6rem; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; color: #fff; font-weight: 700; font-size: 0.9rem; }
.player__btn:hover { background: rgba(255, 255, 255, 0.14); color: var(--brand); }
.player__btn svg { width: 20px; height: 20px; }
.player__time { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: #e6ece6; padding-inline: 0.4rem; direction: ltr; }
.player__spacer { flex: 1; }
.player__volume { width: 5.5rem; accent-color: var(--brand); }
@media (max-width: 640px) { .player__volume { display: none; } }

.scrub { position: relative; display: flex; align-items: center; height: 1.35rem; }
.scrub__track { position: absolute; inset-inline: 0; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.scrub__buffer { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: rgba(255, 255, 255, 0.32); }
.scrub__played { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--brand); box-shadow: 0 0 10px rgba(57, 255, 20, 0.5); }
.scrub input { position: relative; width: 100%; margin: 0; height: 1.35rem; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.scrub input::-webkit-slider-runnable-track { height: 5px; background: transparent; }
.scrub input::-moz-range-track { height: 5px; background: transparent; }
.scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); margin-top: -4.5px; box-shadow: 0 0 9px var(--brand); }
.scrub input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--brand); }

.player__spinner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.player__spinner::after { content: ''; width: 3rem; height: 3rem; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.15); border-top-color: var(--brand); animation: spin 0.9s linear infinite; }

.player__message { position: absolute; inset: 0; display: grid; place-content: center; gap: 1rem; text-align: center; padding: 1.4rem; background: rgba(0, 0, 0, 0.86); z-index: 4; }

.player__meta { display: grid; gap: 0.3rem; }
.player__meta h1 { font-size: 1.3rem; font-weight: 700; }
.player__meta p { color: var(--muted); font-size: 0.9rem; }

.up-next { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.6rem; padding: 0.8rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.up-next__label { color: var(--muted); font-size: 0.8rem; }
.up-next b { font-size: 0.95rem; }

/* --------------------------------------------------------------- auth */

.auth { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; overflow: hidden; isolation: isolate; }
.auth__wall { position: absolute; inset: -20% -10%; z-index: -3; display: flex; gap: 0.9rem; justify-content: center; transform: rotate(-8deg); opacity: 0.45; }
.auth__col { flex: none; width: 10rem; display: flex; flex-direction: column; gap: 0.9rem; animation: drift 60s linear infinite; }
.auth__col:nth-child(even) { animation-direction: reverse; animation-duration: 74s; }
.auth__col img { border-radius: 12px; aspect-ratio: 2/3; object-fit: cover; border: 1px solid #222; }
@keyframes drift { to { transform: translateY(-50%); } }
.auth::before { content: ''; position: absolute; inset: 0; z-index: -2; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.9) 88%); }
.auth__beam { position: absolute; inset: -10% -10% auto; height: 70%; z-index: -2; background: linear-gradient(165deg, rgba(57, 255, 20, 0.22), transparent 65%); clip-path: polygon(0 0, 100% 55%, 30% 100%); }

.auth__card {
  width: min(26rem, 100%); display: grid; gap: 1.05rem; padding: 2rem 1.7rem;
  background: rgba(7, 9, 7, 0.86); backdrop-filter: blur(16px);
  border: 1px solid var(--brand-line); border-radius: 18px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 1), 0 0 50px -18px rgba(57, 255, 20, 0.35);
  animation: rise 0.6s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.985); } }
.auth__card .logo { justify-self: center; }
.auth__card .logo__text { font-size: 1.7rem; }
.auth__title { text-align: center; font-size: 1.15rem; font-weight: 700; }
.auth__sub { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: -0.6rem; }
.auth__switch { text-align: center; color: var(--muted); font-size: 0.9rem; }
.auth__switch a { color: var(--brand); font-weight: 700; }
.auth__note { font-size: 0.78rem; color: var(--muted); text-align: center; line-height: 1.7; }

/* --------------------------------------------------------------- forms */

.field { display: grid; gap: 0.3rem; }
.field > label, .label { font-size: 0.85rem; color: var(--text-dim); font-weight: 600; }
.input, .textarea, .select {
  width: 100%; height: 2.85rem; padding: 0 0.9rem;
  background: #070a07; border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--text); font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { height: auto; padding: 0.6rem 0.9rem; resize: vertical; min-height: 6rem; line-height: 1.8; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.14); }
.input[dir='ltr'] { text-align: left; }
.input[aria-invalid='true'] { border-color: var(--danger); }
.field__error { min-height: 1.1rem; font-size: 0.78rem; color: var(--danger); }
.form-error { color: var(--danger); font-size: 0.85rem; min-height: 1.2rem; }

.input-wrap { position: relative; }
.input-wrap .input { padding-inline-start: 2.9rem; }
.input-wrap__btn { position: absolute; inset-inline-start: 0.3rem; top: 0.3rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; color: var(--muted); border-radius: 8px; }
.input-wrap__btn:hover { color: var(--brand); }
.input-wrap__btn svg { width: 18px; height: 18px; }

.check-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; border-radius: 9px; background: var(--surface-2); font-size: 0.86rem; cursor: pointer; }
.check input { accent-color: var(--brand); }
.check:has(input:checked) { background: rgba(57, 255, 20, 0.12); outline: 1px solid var(--brand-line); }

.search-box { display: flex; align-items: center; gap: 0.6rem; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px; padding: 0.25rem 0.9rem; transition: border-color 0.2s, box-shadow 0.2s; }
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.12); }
.search-box svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-box input { flex: 1; min-width: 0; height: 3rem; background: none; border: 0; outline: none; font-size: 1rem; }
.search-box input::-webkit-search-cancel-button { display: none; }

/* --------------------------------------------------------------- profile */

.profile { display: grid; gap: 1.6rem; padding-top: 2rem; max-width: 1100px; }
.profile__head { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.profile__id { flex: 1; min-width: 12rem; display: grid; gap: 0.1rem; }
.profile__id h1 { font-size: 1.5rem; font-weight: 700; }
.profile__id p { color: var(--muted); font-size: 0.88rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; display: grid; gap: 0.1rem; justify-items: center; }
.stat b { font-size: 1.5rem; color: var(--brand); }
.stat span { font-size: 0.8rem; color: var(--muted); }

.tabs { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; padding: 0.45rem 1rem; border-radius: 9px; color: var(--text-dim); font-weight: 700; font-size: 0.9rem; }
.tabs button[aria-current='page'] { background: var(--surface-2); color: var(--text); }
.tabs button:hover { color: var(--text); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1rem; }

.setting-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; display: grid; gap: 0.8rem; background: var(--surface); }
.setting-card h2 { font-size: 1rem; font-weight: 700; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.2rem, 1fr)); gap: 0.55rem; }
.avatar-option { aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; display: grid; place-items: center; font-size: 1.5rem; }
.avatar-option[aria-current='true'] { border-color: var(--brand); box-shadow: 0 0 14px rgba(57, 255, 20, 0.45); }

/* --------------------------------------------------------------- admin */

.admin { display: grid; gap: 1rem; padding-top: 1.6rem; max-width: 900px; }
.admin__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin__head h1 { font-size: 1.4rem; font-weight: 700; }
.notice { border: 1px solid var(--brand-line); background: rgba(57, 255, 20, 0.07); color: #d9f5d9; border-radius: 12px; padding: 0.75rem 0.95rem; font-size: 0.86rem; }

.admin-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.admin-row__thumb { width: 2.9rem; aspect-ratio: 2/3; border-radius: 7px; overflow: hidden; background: var(--surface-3); flex: none; }
.admin-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-row__body { flex: 1; min-width: 0; display: grid; }
.admin-row__body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row__body small { color: var(--muted); font-size: 0.78rem; }

.season-editor { border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem; display: grid; gap: 0.6rem; margin-bottom: 0.7rem; }
.media-edit { display: grid; gap: 0.9rem; grid-template-columns: 1fr 1fr; }
.media-edit__row { display: flex; align-items: flex-start; gap: 0.8rem; }
.media-edit__poster { width: 5.2rem; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; text-align: center; font-size: 0.72rem; flex: none; }
.media-edit__poster img { width: 100%; height: 100%; object-fit: cover; }
.media-edit__banner { width: 100%; max-width: 12rem; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; text-align: center; font-size: 0.72rem; flex: none; }
.media-edit__banner img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .media-edit { grid-template-columns: 1fr; } }
.ep-editor { display: grid; grid-template-columns: 1.2fr 1.6fr auto; gap: 0.45rem; }
.ep-editor input { height: 2.4rem; padding: 0 0.6rem; background: #050705; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 0.85rem; min-width: 0; }
@media (max-width: 640px) { .ep-editor { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- empty / states */

.empty { display: grid; gap: 0.8rem; justify-items: center; text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 1.15rem; }
.empty svg { width: 56px; height: 56px; color: var(--brand); opacity: 0.7; }

.skeleton { background: linear-gradient(100deg, #101410 30%, #1a201a 50%, #101410 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner { width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.25); border-top-color: currentColor; animation: spin 0.8s linear infinite; }

/* --------------------------------------------------------------- toast */

.toast-host { position: fixed; inset-inline: 0; bottom: calc(var(--nav-h) + 1.2rem + env(safe-area-inset-bottom, 0px)); z-index: 90; display: grid; justify-items: center; gap: 0.5rem; pointer-events: none; }
.toast { background: #101710; border: 1px solid var(--brand-line); color: var(--text); padding: 0.6rem 1.1rem; border-radius: 10px; font-size: 0.88rem; box-shadow: var(--shadow); animation: toast-in 0.25s var(--ease); max-width: min(92vw, 26rem); }
.toast--error { border-color: #7a2b2b; background: #1a1010; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --------------------------------------------------------------- bottom nav */

.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
  display: none; justify-content: space-around; align-items: center;
  padding: 0.3rem 0.4rem calc(0.3rem + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 9, 6, 0.94); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.bottom-nav a { display: grid; justify-items: center; gap: 0.1rem; padding: 0.3rem 0.7rem; border-radius: 10px; color: var(--muted); font-size: 0.68rem; font-weight: 600; min-width: 3.6rem; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a[aria-current='page'] { color: var(--brand); }

/* --------------------------------------------------------------- sheet */

.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(3px); display: grid; place-items: end center; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(30rem, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px 18px 0 0; padding: 1.2rem; display: grid; gap: 0.8rem; animation: slide-up 0.28s var(--ease); }
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } }

/* --------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--line); margin-top: 3.5rem; padding: 2rem 0 2.5rem; color: var(--muted); font-size: 0.82rem; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer__links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer a:hover { color: var(--brand); }

/* --------------------------------------------------------------- misc */

.section-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.9rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack { display: grid; gap: 0.8rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.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; }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 1rem; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  .nav { display: none; }
}

@media (max-width: 760px) {
  .bottom-nav { display: flex; }
  .hero { min-height: min(68vh, 540px); }
  .hero__desc { display: none; }
  .hero__dots { bottom: 0.8rem; }
  .detail__grid { align-items: flex-start; }
  .detail__poster { width: 8.4rem; }
  .topbar__actions .user-chip span { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .toast-host { bottom: calc(var(--nav-h) + 0.9rem + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

