/* ============================================================
   REEL - Design system
   Responsive: mobile-first (phone -> tablet -> desktop)
   ============================================================ */

:root {
  --bg:            #08080c;
  --bg-elev:       #12121a;
  --bg-elev-2:     #1a1a26;
  --bg-hover:      #22222f;
  --line:          #262633;
  --line-soft:     #1d1d28;

  --text:          #f2f2f7;
  --text-dim:      #a1a1b5;
  --text-faint:    #6e6e85;

  --brand:         #e8194b;
  --brand-2:       #ff3d70;
  --brand-dark:    #a50f34;
  --accent:        #ffd400;
  --accent-2:      #ffc53d;

  --grad-brand: linear-gradient(135deg, var(--brand) 0%, #ff5e3a 55%, var(--accent) 100%);
  --grad-gold:  linear-gradient(135deg, #b8860b 0%, var(--accent) 50%, #ff8c00 100%);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-full: 999px;

  --shadow-1: 0 2px 8px rgba(0,0,0,.4);
  --shadow-2: 0 10px 40px rgba(0,0,0,.55);
  --shadow-3: 0 20px 70px rgba(0,0,0,.7);

  --header-h: 58px;
  --nav-h: 62px;
  --rail-w: 232px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2b2b3a; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a4d; }

/* ============================ LAYOUT ============================ */
.app { min-height: 100vh; }

.shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.content {
  min-width: 0;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
}

/* ============================ HEADER ============================ */
.header {
  position: sticky; top: 0; z-index: 100;
  height: calc(var(--header-h) + var(--safe-t));
  padding-top: var(--safe-t);
  display: flex; align-items: center; gap: 14px;
  background: rgba(8,8,12,.92);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  width: 100%;
  max-width: 1680px; margin: 0 auto;
  padding: 0 14px;
  display: flex; align-items: center; gap: 12px;
}

.logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 20px; letter-spacing: -.5px;
  flex-shrink: 0;
}
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  font-size: 16px; font-weight: 900; color: #fff;
  box-shadow: 0 4px 14px rgba(232,25,75,.4);
}
.logo-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search {
  flex: 1; max-width: 460px; position: relative;
}
.search input {
  width: 100%; height: 40px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 0 14px 0 38px;
  font-size: 14px;
  transition: border-color .2s, background .2s;
}
.search input::placeholder { color: var(--text-faint); }
.search input:focus {
  outline: none; border-color: var(--brand);
  background: var(--bg-elev-2);
}
.search-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
  display: flex;
}

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-elev); border: 1px solid var(--line);
  color: var(--text-dim);
  transition: all .18s var(--ease);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); border-color: #35354a; }
.icon-btn.active { color: var(--brand-2); border-color: var(--brand); }

.btn {
  height: 38px; padding: 0 18px;
  border-radius: var(--r-full);
  font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .18s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 4px 16px rgba(232,25,75,.3); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: var(--bg-elev); border: 1px solid var(--line); color: var(--text-dim); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-block { width: 100%; }

/* ============================ SIDE RAIL (desktop) ============================ */
.rail { display: none; }

/* ============================ BOTTOM NAV (mobile/tablet) ============================ */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(10,10,16,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line-soft);
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: center;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px; color: var(--text-faint);
  font-size: 10px; font-weight: 600; letter-spacing: .2px;
  transition: color .18s;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--brand-2); }
.nav-item.active .nav-dot {
  width: 4px; height: 4px; border-radius: 50%; background: var(--brand-2);
}

/* ============================ HERO ============================ */
.hero {
  position: relative;
  min-height: 62vh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(2px) saturate(115%);
  transform: scale(1.04);
}
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 2%, rgba(8,8,12,.72) 38%, rgba(8,8,12,.35) 70%, rgba(8,8,12,.6) 100%),
    linear-gradient(to right, rgba(8,8,12,.88) 0%, rgba(8,8,12,.25) 55%, transparent 100%);
}
.hero-inner {
  position: relative; width: 100%; max-width: 1680px; margin: 0 auto;
  padding: 30px 16px 26px;
}
.hero-title {
  font-size: clamp(26px, 7vw, 52px);
  font-weight: 900; line-height: 1.03;
  letter-spacing: -1.4px; margin-bottom: 10px;
  text-shadow: 0 4px 30px rgba(0,0,0,.8);
}
.hero-title .accent {
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-meta {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-dim); margin-bottom: 12px;
}
.hero-synopsis {
  font-size: 14px; color: var(--text-dim);
  max-width: 620px; margin-bottom: 20px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn { height: 44px; padding: 0 24px; font-size: 15px; border-radius: var(--r-md); }
.btn-play {
  background: #fff; color: #0a0a0a; font-weight: 700;
  box-shadow: 0 6px 24px rgba(255,255,255,.18);
}
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,255,255,.25); }
.btn-info {
  background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.22);
}
.btn-info:hover { background: rgba(255,255,255,.24); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  background: var(--bg-hover); color: var(--text-dim);
  border: 1px solid var(--line);
}
.badge-gold { background: var(--grad-gold); color: #1a1200; border: none; }
.badge-brand { background: var(--grad-brand); color: #fff; border: none; }

/* ============================ ROWS ============================ */
.rows { padding: 4px 0 10px; }

.row { margin-bottom: 26px; }

.row-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 0 16px; margin-bottom: 12px;
}
.row-title {
  font-size: 17px; font-weight: 800; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 8px;
}
.row-title .bar { width: 4px; height: 17px; border-radius: 2px; background: var(--grad-brand); }
.row-link {
  margin-left: auto; font-size: 12px; font-weight: 700;
  color: var(--text-faint); display: flex; align-items: center; gap: 3px;
}
.row-link:hover { color: var(--brand-2); }

/* horizontal scroller */
.scroller {
  display: flex; gap: 11px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding: 2px 16px 8px;
  scrollbar-width: thin;
}
.scroller::-webkit-scrollbar { height: 6px; }

/* ============================ CARD ============================ */
.card {
  flex: 0 0 auto;
  width: 136px;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform .22s var(--ease);
}
.card:hover { transform: translateY(-4px); }

.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-elev-2);
  box-shadow: var(--shadow-1);
  margin-bottom: 8px;
}
.card-poster img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s var(--ease), opacity .3s;
  opacity: 0;
}
.card-poster img.loaded { opacity: 1; }
.card:hover .card-poster img { transform: scale(1.07); }
.card-poster .ph {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1d1d2b, #14141e);
}
.card-poster .pl {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #3a3a4d;
}
.card-badge {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  padding: 2.5px 7px; border-radius: 6px;
  font-size: 10px; font-weight: 800;
  background: var(--grad-brand); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.card-rating {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  padding: 2.5px 6px; border-radius: 6px;
  font-size: 10px; font-weight: 800;
  background: rgba(0,0,0,.75); color: var(--accent);
  display: flex; align-items: center; gap: 3px;
  backdrop-filter: blur(4px);
}
.card-eps {
  position: absolute; bottom: 7px; left: 7px; z-index: 2;
  padding: 2.5px 7px; border-radius: 6px;
  font-size: 10px; font-weight: 700;
  background: rgba(0,0,0,.72); color: #fff;
  backdrop-filter: blur(4px);
}
.card-title {
  font-size: 12.5px; font-weight: 700; line-height: 1.32;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-sub {
  font-size: 11px; color: var(--text-faint); margin-top: 2px;
  display: flex; align-items: center; gap: 5px;
}

/* ============================ GRID ============================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px 12px;
  padding: 4px 16px 20px;
}
.grid .card { width: auto; }

/* ============================ CATEGORY CHIPS ============================ */
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 16px 14px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 16px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 600;
  background: var(--bg-elev); border: 1px solid var(--line);
  color: var(--text-dim); cursor: pointer;
  transition: all .18s var(--ease);
  white-space: nowrap;
}
.chip:hover { background: var(--bg-hover); color: var(--text); }
.chip.active {
  background: var(--grad-brand); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(232,25,75,.28);
}

/* ============================ DETAIL PAGE ============================ */
.detail {
  display: grid; grid-template-columns: 1fr;
  gap: 0;
}
.detail-backdrop {
  position: relative;
  height: 46vh; min-height: 300px;
  overflow: hidden;
}
.detail-backdrop img {
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(1px);
}
.detail-backdrop::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 1%, rgba(8,8,12,.55) 50%, rgba(8,8,12,.7) 100%);
}
.detail-body {
  max-width: 1680px; width: 100%; margin: 0 auto;
  padding: 0 16px 40px;
  margin-top: -84px;
  position: relative; z-index: 2;
}
.detail-head {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.detail-poster {
  aspect-ratio: 2/3; border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-3);
  background: var(--bg-elev-2);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { min-width: 0; }
.detail-title {
  font-size: clamp(22px, 5.5vw, 38px); font-weight: 900;
  line-height: 1.08; letter-spacing: -1px; margin-bottom: 10px;
}
.detail-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.detail-synopsis {
  color: var(--text-dim); font-size: 14px; line-height: 1.6;
  margin-bottom: 16px; max-width: 780px;
}
.detail-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.detail-actions .btn { height: 42px; border-radius: var(--r-md); padding: 0 20px; }

.section-head {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0 13px;
}
.section-title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }

/* ============================ EPISODE LIST ============================ */
.episodes { display: flex; flex-direction: column; gap: 9px; }
.episode {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: var(--r-md);
  background: var(--bg-elev); border: 1px solid var(--line-soft);
  cursor: pointer; transition: all .18s var(--ease);
}
.episode:hover { background: var(--bg-elev-2); border-color: var(--line); transform: translateX(3px); }
.episode-thumb {
  position: relative; flex: 0 0 auto;
  width: 108px; aspect-ratio: 16/9;
  border-radius: 9px; overflow: hidden; background: #22222e;
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.42);
  opacity: 0; transition: opacity .2s;
}
.episode:hover .episode-num { opacity: 1; }
.episode-num svg { width: 26px; height: 26px; color: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.episode-info { min-width: 0; flex: 1; }
.episode-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .7px;
  color: var(--brand-2); text-transform: uppercase; margin-bottom: 3px;
}
.episode-title {
  font-size: 14px; font-weight: 700; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.episode-desc {
  font-size: 12px; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.episode-dur {
  font-size: 12px; color: var(--text-faint);
  flex: 0 0 auto; font-variant-numeric: tabular-nums;
}

/* ============================ PLAYER ============================ */
.player-page {
  position: fixed; inset: 0; z-index: 300;
  background: #000;
  display: flex; flex-direction: column;
}
.player-stage {
  flex: 1; position: relative;
  display: grid; place-items: center;
  background: #000;
  overflow: hidden;
}
.player-stage video {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
}
.player-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.35);
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.player-overlay.show { opacity: 1; }
.player-overlay svg { width: 64px; height: 64px; color: #fff; filter: drop-shadow(0 4px 20px rgba(0,0,0,.7)); }

.player-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  padding: calc(12px + var(--safe-t)) 14px 12px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,.8), transparent);
  transition: opacity .25s;
}
.player-top h3 { font-size: 14px; font-weight: 700; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-back {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,.5); display: grid; place-items: center;
  color: #fff; flex: 0 0 auto;
}

.player-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 14px;
  background: linear-gradient(to top, rgba(0,0,0,.9), transparent);
  transition: opacity .25s, transform .25s;
}
.player-episode-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .7px;
  color: var(--brand-2); text-transform: uppercase; margin-bottom: 4px;
}
.player-series-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.player-ctrl {
  display: flex; align-items: center; gap: 11px;
}
.player-ctrl button { color: #fff; display: grid; place-items: center; }
.player-ctrl svg { width: 22px; height: 22px; }
.player-progress {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.25); position: relative; cursor: pointer;
}
.player-progress-bar {
  position: absolute; inset: 0 auto 0 0;
  background: var(--brand-2); border-radius: 2px;
}
.player-time {
  font-size: 11.5px; color: rgba(255,255,255,.8);
  font-variant-numeric: tabular-nums; flex: 0 0 auto;
}

/* episode rail in player */
.player-episodes {
  background: #0d0d14;
  border-top: 1px solid var(--line-soft);
  padding: 12px 14px calc(12px + var(--safe-b));
  max-height: 34vh; overflow-y: auto;
}
.player-episodes h4 {
  font-size: 12px; font-weight: 800; color: var(--text-dim);
  margin-bottom: 9px; letter-spacing: .4px; text-transform: uppercase;
}
.player-ep-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.player-ep-chip {
  flex: 0 0 auto; min-width: 38px; height: 34px; padding: 0 11px;
  border-radius: 8px; background: var(--bg-elev-2);
  border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700; color: var(--text-dim);
  display: grid; place-items: center; cursor: pointer;
  transition: all .16s;
}
.player-ep-chip:hover { border-color: var(--brand); color: var(--text); }
.player-ep-chip.active { background: var(--grad-brand); color: #fff; border-color: transparent; }

/* ============================ AUTH MODAL ============================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 18px;
  animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: 100%; max-width: 400px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px;
  box-shadow: var(--shadow-3);
  animation: rise .25s var(--ease);
  max-height: 90vh; overflow-y: auto;
}
@keyframes rise { from { transform: translateY(18px); opacity: 0 } to { transform: none; opacity: 1 } }
.modal h2 { font-size: 21px; font-weight: 800; margin-bottom: 5px; }
.modal .sub { color: var(--text-dim); font-size: 13.5px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-dim); margin-bottom: 6px;
  letter-spacing: .2px;
}
.field input {
  width: 100%; height: 44px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 0 13px; font-size: 14.5px;
  transition: border-color .18s;
}
.field input:focus { outline: none; border-color: var(--brand); }
.form-error {
  background: rgba(232,25,75,.12); border: 1px solid rgba(232,25,75,.35);
  color: #ff8095; padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13px; margin-bottom: 14px;
}
.form-switch {
  text-align: center; font-size: 13px; color: var(--text-dim);
  margin-top: 16px;
}
.form-switch button { color: var(--brand-2); font-weight: 700; }

/* ============================ TOAST ============================ */
.toast-wrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  z-index: 500; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.toast {
  background: var(--bg-elev-2); border: 1px solid var(--line);
  color: var(--text); padding: 10px 17px; border-radius: var(--r-full);
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-2);
  animation: toastIn .25s var(--ease);
}
@keyframes toastIn { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ============================ MISC ============================ */
.empty {
  padding: 60px 20px; text-align: center; color: var(--text-faint);
}
.empty svg { width: 46px; height: 46px; margin-bottom: 14px; opacity: .45; }
.empty p { font-size: 14px; }

.skeleton {
  background: linear-gradient(90deg, #16161f 25%, #1f1f2b 50%, #16161f 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.sk-card { width: 136px; }
.sk-card .sk-poster { aspect-ratio: 2/3; }
.sk-card .sk-line { height: 10px; margin-top: 8px; border-radius: 4px; }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand);
  animation: spin .8s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg) } }

.section-label {
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-faint);
  padding: 0 16px; margin: 4px 0 10px;
}

/* ============================ TABLET ============================ */
@media (min-width: 700px) {
  .shell { grid-template-columns: var(--rail-w) 1fr; }
  .rail {
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--rail-w); z-index: 110;
    background: #0b0b11;
    border-right: 1px solid var(--line-soft);
    padding: 16px 10px;
    overflow-y: auto;
  }
  .rail-logo { display: flex; align-items: center; gap: 9px; padding: 0 8px 20px; }
  .rail-logo .logo-mark { width: 32px; height: 32px; font-size: 17px; }
  .rail-nav { display: flex; flex-direction: column; gap: 3px; }
  .rail-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--r-sm);
    color: var(--text-dim); font-size: 14px; font-weight: 600;
    transition: all .16s var(--ease);
  }
  .rail-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
  .rail-item:hover { background: var(--bg-elev); color: var(--text); }
  .rail-item.active { background: rgba(232,25,75,.13); color: var(--brand-2); }
  .rail-section {
    font-size: 10.5px; font-weight: 800; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-faint);
    padding: 18px 12px 7px;
  }
  .content { grid-column: 2; }
  .nav { display: none; }
  .content { padding-bottom: 40px; }
  .header-inner { padding: 0 22px; }
  .search { max-width: 520px; }
  .hero { min-height: 68vh; }
  .hero-inner { padding: 40px 22px 34px; }
  .hero-synopsis { -webkit-line-clamp: 4; font-size: 15px; }
  .row-head, .grid, .chips, .section-label { padding-left: 22px; padding-right: 22px; }
  .scroller { padding-left: 22px; padding-right: 22px; gap: 13px; }
  .card { width: 152px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 20px 14px; }
  .detail-body { padding: 0 22px 50px; }
  .detail-head { grid-template-columns: 168px 1fr; gap: 22px; }
  .detail-actions .btn { height: 44px; }
  .episode-thumb { width: 148px; }
  .toast-wrap { bottom: 26px; }
}

/* ============================ DESKTOP ============================ */
@media (min-width: 1100px) {
  .header { padding-left: var(--rail-w); }
  .header-inner { padding: 0 28px; }
  .hero { min-height: 76vh; }
  .hero-inner { padding: 54px 28px 44px; }
  .card { width: 168px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .row-head, .grid, .chips, .section-label { padding-left: 28px; padding-right: 28px; }
  .scroller { padding-left: 28px; padding-right: 28px; gap: 15px; }
  .detail-body { padding: 0 28px 60px; }
  .detail-head { grid-template-columns: 210px 1fr; gap: 28px; }
  .player-page { flex-direction: row; }
  .player-stage { flex: 1; }
  .player-side {
    width: 340px; flex: 0 0 340px;
    background: #0d0d14; border-left: 1px solid var(--line-soft);
    overflow-y: auto; padding: 18px 16px;
  }
  .player-side h4 {
    font-size: 12px; font-weight: 800; color: var(--text-dim);
    margin-bottom: 10px; letter-spacing: .5px; text-transform: uppercase;
  }
  .player-episodes { border: none; padding: 0; max-height: none; }
  .player-ep-grid { flex-wrap: wrap; }
}

@media (min-width: 1500px) {
  .card { width: 186px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); }
}

/* ============================ MOBILE TUNING ============================ */
@media (max-width: 699px) {
  .detail-head { grid-template-columns: 104px 1fr; gap: 13px; }
  .detail-body { margin-top: -70px; }
  .player-episodes { max-height: 30vh; }
  .search { max-width: none; }
  .header-inner { gap: 9px; }
  .logo-text { display: none; }
  .btn-hide-sm { display: none; }
}

@media (max-width: 400px) {
  .card { width: 128px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
  .hero-actions .btn { flex: 1; padding: 0 14px; }
}

/* landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 100vh; }
  .player-episodes { max-height: 22vh; }
}
