/* ============================================================
   STREAD DRAMA — Global Styles
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --bg:          #0a0a0a;
  --bg-2:        #111111;
  --bg-card:     #1a1a1a;
  --bg-card-h:   #222222;
  --border:      #2a2a2a;
  --accent:      #e8002d;
  --accent-h:    #c4001f;
  --accent-glow: rgba(232, 0, 45, 0.3);
  --gold:        #f5aa00;
  --gold-bg:     rgba(245, 170, 0, 0.12);
  --text:        #f0f0f0;
  --text-2:      #aaaaaa;
  --text-muted:  #555555;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,0.5);
  --nav-h:       62px;
  --font:        'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  transition: background 0.3s;
}
.navbar.scrolled { background: rgba(8,8,8,0.98); }

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.5px;
  flex-shrink: 0;
}
.nav-logo .logo-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff;
}
.nav-logo .logo-text { color: var(--text); }
.nav-logo .logo-text span { color: var(--accent); }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
}
.nav-links a {
  padding: 6px 14px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 0.875rem; font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,0.07); }

.nav-right {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px;
  transition: background 0.2s, border-color 0.2s;
}
.search-bar:focus-within { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 0.875rem; width: 160px;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar .search-icon { color: var(--text-muted); font-size: 0.85rem; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 20px;
  font-size: 0.85rem; font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.14); }
.btn-vip { background: var(--gold); color: #000; font-weight: 700; }
.btn-vip:hover { background: #d49200; }
.btn-lg { padding: 12px 28px; font-size: 0.95rem; border-radius: var(--radius); }

.nav-mobile-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.07);
  color: var(--text); font-size: 1rem;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page { padding-top: var(--nav-h); min-height: 100vh; }

/* ── Section ──────────────────────────────────────────────── */
.section { padding: 32px 24px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  display: block; width: 4px; height: 18px;
  background: var(--accent); border-radius: 2px;
}
.section-more { color: var(--accent); font-size: 0.85rem; font-weight: 500; }
.section-more:hover { text-decoration: underline; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative; height: 520px;
  overflow: hidden; display: flex; align-items: flex-end;
}
.hero-backdrop {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 20%;
  filter: brightness(0.4);
  transition: background-image 0.5s;
}
.hero-backdrop::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    var(--bg) 0%,
    rgba(0,0,0,0.2) 60%,
    transparent 100%
  );
}
.hero-content {
  position: relative; z-index: 1;
  padding: 40px 36px; max-width: 600px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  padding: 3px 10px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; margin-bottom: 10px;
}
.hero-title {
  font-size: 2.2rem; font-weight: 800; line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 10px;
}
.hero-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.82rem; color: var(--text-2); margin-bottom: 14px;
}
.hero-meta span { display: flex; align-items: center; gap: 4px; }
.hero-desc {
  color: var(--text-2); font-size: 0.9rem; line-height: 1.7;
  max-width: 480px; margin-bottom: 20px;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-dots {
  position: absolute; bottom: 20px; right: 30px;
  display: flex; gap: 6px; z-index: 2;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 4px;
  background: rgba(255,255,255,0.3); cursor: pointer;
  transition: all 0.3s;
}
.hero-dot.active { width: 24px; background: var(--accent); }

/* ── Category pills ───────────────────────────────────────── */
.categories {
  padding: 0 24px 8px;
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; padding: 6px 16px; border-radius: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-2); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}
.cat-pill:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.cat-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Horizontal scroll row ────────────────────────────────── */
.drama-row {
  display: flex; gap: 12px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.drama-row::-webkit-scrollbar { display: none; }

/* ── Drama card ───────────────────────────────────────────── */
.drama-card {
  flex-shrink: 0; width: 145px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card);
  cursor: pointer; transition: transform 0.25s, box-shadow 0.25s;
  scroll-snap-align: start;
  position: relative;
}
.drama-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow); }

.drama-card .card-cover {
  width: 100%; aspect-ratio: 3/4;
  object-fit: cover; background: var(--bg-card);
  transition: filter 0.25s;
}
.drama-card:hover .card-cover { filter: brightness(0.85); }

.drama-card .card-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
  opacity: 0; transition: opacity 0.25s;
  display: flex; align-items: flex-end; padding: 10px;
}
.drama-card:hover .card-overlay { opacity: 1; }
.card-play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; margin: 0 auto;
}

.drama-card .card-badges {
  position: absolute; top: 8px; left: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.badge {
  padding: 2px 7px; border-radius: 4px;
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-vip  { background: var(--gold); color: #000; }
.badge-free { background: #1a8a1a; color: #fff; }
.badge-new  { background: var(--accent); color: #fff; }
.badge-lang { background: rgba(0,0,0,0.6); color: var(--text); border: 1px solid var(--border); }

.drama-card .card-info { padding: 8px; }
.card-title {
  font-size: 0.8rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.card-sub { font-size: 0.7rem; color: var(--text-muted); }

/* ── Drama grid ───────────────────────────────────────────── */
.drama-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.drama-grid .drama-card { width: 100%; }

/* ── Rank badge ───────────────────────────────────────────── */
.rank-badge {
  position: absolute; top: 0; left: 0;
  width: 26px; height: 26px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; color: #fff;
  border-radius: 0 0 var(--radius-sm) 0;
}

/* ── Episode grid ─────────────────────────────────────────── */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
}
.ep-btn {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 0.8rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; position: relative;
}
.ep-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.ep-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ep-btn.watched { opacity: 0.5; }
.ep-btn.locked {
  color: var(--text-muted);
  cursor: default;
}
.ep-btn.locked::after {
  content: '🔒';
  position: absolute; top: 2px; right: 2px;
  font-size: 0.55rem;
}
.ep-btn.locked:hover { background: var(--bg-card); border-color: var(--border); color: var(--text-muted); }

/* ── Drama detail page ────────────────────────────────────── */
.drama-hero-section {
  position: relative; overflow: hidden;
  padding-top: var(--nav-h);
}
.drama-backdrop {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 30%;
  filter: blur(16px) brightness(0.25);
  transform: scale(1.05);
}
.drama-info-wrap {
  position: relative; z-index: 1;
  display: flex; gap: 28px; padding: 40px 28px;
  align-items: flex-start;
}
.drama-cover-wrap { flex-shrink: 0; }
.drama-cover {
  width: 180px; border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.drama-meta { flex: 1; min-width: 0; }
.drama-provider { font-size: 0.78rem; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.drama-title-main { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag {
  padding: 3px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-2); cursor: pointer;
  transition: all 0.2s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.drama-stats { display: flex; gap: 20px; margin-bottom: 14px; }
.stat-item { text-align: center; }
.stat-num { font-size: 1.1rem; font-weight: 700; }
.stat-lbl { font-size: 0.7rem; color: var(--text-muted); }
.drama-synopsis { color: var(--text-2); font-size: 0.9rem; line-height: 1.7; }

/* ── Episodes section ─────────────────────────────────────── */
.episodes-section { padding: 28px; }
.ep-filter {
  display: flex; gap: 8px; margin-bottom: 16px;
  overflow-x: auto; scrollbar-width: none;
}
.ep-filter::-webkit-scrollbar { display: none; }
.ep-range-btn {
  flex-shrink: 0; padding: 5px 14px; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-2); font-size: 0.8rem; cursor: pointer;
  transition: all 0.2s;
}
.ep-range-btn.active, .ep-range-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── VIP Gate / Modal ─────────────────────────────────────── */
.vip-gate {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.vip-gate-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px;
  max-width: 440px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.vip-gate-card .lock-icon { font-size: 3rem; margin-bottom: 12px; }
.vip-gate-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.vip-gate-card p { color: var(--text-2); font-size: 0.9rem; margin-bottom: 24px; }
.vip-gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── VIP Page ─────────────────────────────────────────────── */
.vip-page { max-width: 900px; margin: 0 auto; padding: 60px 24px; }
.vip-page h1 { font-size: 2rem; font-weight: 800; text-align: center; margin-bottom: 8px; }
.vip-page .subtitle { text-align: center; color: var(--text-2); margin-bottom: 40px; }

.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 48px;
}
.plan-card {
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: 14px; padding: 28px 20px; text-align: center;
  transition: all 0.25s; position: relative; overflow: hidden;
}
.plan-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(245,170,0,0.15); }
.plan-card.popular { border-color: var(--gold); }
.plan-popular-badge {
  position: absolute; top: 12px; right: -20px;
  background: var(--gold); color: #000;
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.5px;
  padding: 3px 28px; transform: rotate(35deg);
}
.plan-duration { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.plan-price { font-size: 2rem; font-weight: 800; color: var(--gold); margin-bottom: 4px; }
.plan-price span { font-size: 0.9rem; color: var(--text-2); }
.plan-perks { font-size: 0.82rem; color: var(--text-2); margin-bottom: 20px; }

.activate-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 32px; max-width: 520px; margin: 0 auto;
}
.activate-section h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.activate-section p { color: var(--text-2); font-size: 0.88rem; margin-bottom: 20px; }
.code-input-wrap {
  display: flex; gap: 8px;
}
.code-input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 16px;
  color: var(--text); font-size: 0.9rem; letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  transition: border-color 0.2s;
}
.code-input:focus { outline: none; border-color: var(--gold); }
.code-input::placeholder { color: var(--text-muted); letter-spacing: 0; font-family: var(--font); font-size: 0.85rem; }
.alert {
  margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.alert-success { background: rgba(26,138,26,0.15); border: 1px solid #1a8a1a; color: #4dcc4d; }
.alert-error { background: rgba(232,0,45,0.1); border: 1px solid var(--accent); color: #ff6b80; }

.vip-status-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--gold-bg); border: 1px solid rgba(245,170,0,0.3);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 24px;
}
.vip-status-bar .vip-crown { font-size: 1.3rem; }
.vip-status-bar .vip-info { flex: 1; }
.vip-status-bar .vip-label { font-weight: 700; color: var(--gold); font-size: 0.9rem; }
.vip-status-bar .vip-expiry { font-size: 0.78rem; color: var(--text-2); }

/* ── Player page ──────────────────────────────────────────── */
.player-page { display: flex; flex-direction: column; min-height: 100vh; }
.player-wrap {
  background: #000; position: relative;
  width: 100%; aspect-ratio: 16/9;
  max-height: calc(100vh - var(--nav-h) - 60px);
}
#main-video {
  width: 100%; height: 100%;
  display: block; background: #000;
}
.player-layout {
  display: flex; gap: 0;
  flex: 1; min-height: 0;
}
.player-main { flex: 1; min-width: 0; }
.player-sidebar {
  width: 300px; flex-shrink: 0;
  background: var(--bg-2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; max-height: calc(100vh - var(--nav-h));
  position: sticky; top: var(--nav-h);
}
.sidebar-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-ep-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-ep-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.2s;
  border: 1px solid transparent;
}
.sidebar-ep-item:hover { background: rgba(255,255,255,0.06); }
.sidebar-ep-item.active { background: rgba(232,0,45,0.12); border-color: var(--accent); }
.sidebar-ep-item .ep-num {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--bg-card); display: flex; align-items: center;
  justify-content: center; font-size: 0.78rem; font-weight: 700;
  flex-shrink: 0;
}
.sidebar-ep-item.active .ep-num { background: var(--accent); color: #fff; }
.sidebar-ep-item .ep-name { font-size: 0.82rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-ep-item .ep-lock { color: var(--text-muted); font-size: 0.75rem; }

.player-controls-bar {
  padding: 14px 20px; background: var(--bg-2);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.player-ep-nav { display: flex; gap: 8px; }
.player-ep-nav .btn { padding: 6px 14px; font-size: 0.82rem; }

.quality-selector, .sub-selector {
  display: flex; align-items: center; gap: 6px;
}
.quality-selector label, .sub-selector label { font-size: 0.8rem; color: var(--text-2); }
.quality-selector select, .sub-selector select {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 5px 10px; border-radius: var(--radius-sm);
  font-size: 0.82rem; cursor: pointer;
}
.quality-selector select:focus, .sub-selector select:focus { outline: none; border-color: var(--accent); }

.player-drama-info { padding: 20px; }
.player-drama-info h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.player-drama-info p { font-size: 0.85rem; color: var(--text-2); }

/* ── Search / Browse page ─────────────────────────────────── */
.browse-page { max-width: 1300px; margin: 0 auto; padding: 28px 24px; }
.browse-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.browse-header h1 { font-size: 1.5rem; font-weight: 800; }

.filters-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 24px; align-items: center;
}
.filters-bar .filter-group { display: flex; align-items: center; gap: 6px; }
.filters-bar label { font-size: 0.82rem; color: var(--text-2); }
.filter-select {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 0.82rem; cursor: pointer;
  transition: border-color 0.2s;
}
.filter-select:focus { outline: none; border-color: var(--accent); }

.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px;
  margin-bottom: 24px; max-width: 560px;
}
.search-input-wrap i { color: var(--text-muted); }
.search-input-wrap input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 0.95rem;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 28px 0; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 0.85rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.page-btn:hover { background: var(--accent); border-color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); }
.page-btn:disabled { opacity: 0.3; pointer-events: none; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--bg-2); border-top: 1px solid var(--border);
  padding: 40px 28px 24px;
}
.footer-top { display: flex; gap: 40px; flex-wrap: wrap; margin-bottom: 28px; }
.footer-brand { max-width: 260px; }
.footer-brand .logo { font-size: 1.2rem; font-weight: 800; margin-bottom: 10px; }
.footer-brand p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; }
.footer-links h4 { font-size: 0.88rem; font-weight: 700; margin-bottom: 12px; }
.footer-links ul { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.83rem; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; gap: 8px;
}

/* ── Loading / Skeleton ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-h) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-card { width: 145px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; }
.skeleton-card .sk-cover { width: 100%; aspect-ratio: 3/4; }
.skeleton-card .sk-info { padding: 8px; }
.skeleton-card .sk-line { height: 10px; border-radius: 4px; margin-bottom: 6px; }
.skeleton-card .sk-line.short { width: 60%; }

.loading-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 0.9rem; }

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 0.88rem; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  animation: slideInRight 0.3s ease;
  max-width: 300px;
}
.toast-success { border-left: 3px solid #1a8a1a; }
.toast-error   { border-left: 3px solid var(--accent); }
.toast-info    { border-left: 3px solid var(--gold); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── Profile / User dropdown ──────────────────────────────── */
.user-menu-wrap { position: relative; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.2s;
}
.user-avatar.vip-user { border-color: var(--gold); }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 200px;
  box-shadow: var(--shadow); overflow: hidden;
  display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.user-dropdown-header .name { font-weight: 700; font-size: 0.9rem; }
.user-dropdown-header .vip-tag { font-size: 0.72rem; color: var(--gold); font-weight: 600; }
.user-dropdown ul { padding: 6px; }
.user-dropdown li a, .user-dropdown li button {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  width: 100%; text-align: left; color: var(--text-2);
  font-size: 0.85rem; transition: all 0.15s;
}
.user-dropdown li a:hover, .user-dropdown li button:hover { background: rgba(255,255,255,0.06); color: var(--text); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .player-layout { flex-direction: column; }
  .player-sidebar { width: 100%; max-height: 300px; position: static; border-left: none; border-top: 1px solid var(--border); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }
  .search-bar { display: none; }
  .hero { height: 420px; }
  .hero-title { font-size: 1.6rem; }
  .drama-info-wrap { flex-direction: column; padding: 24px 16px; }
  .drama-cover { width: 140px; }
  .section { padding: 20px 16px; }
  .categories { padding: 0 16px 8px; }
  .vip-page { padding: 40px 16px; }
  .browse-page { padding: 20px 16px; }
  .footer-top { flex-direction: column; gap: 24px; }
}

@media (max-width: 480px) {
  .navbar { padding: 0 14px; }
  .hero-content { padding: 28px 20px; }
  .hero-title { font-size: 1.35rem; }
  .drama-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .code-input-wrap { flex-direction: column; }
}

/* ── Mobile nav drawer ────────────────────────────────────── */
.mobile-nav {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(0,0,0,0.7); display: none;
}
.mobile-nav.open { display: block; }
.mobile-nav-drawer {
  position: absolute; top: 0; left: 0; bottom: 0; width: 260px;
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  animation: slideInLeft 0.25s ease;
}
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.mobile-nav-drawer .mob-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.mobile-nav-drawer ul { padding: 12px; }
.mobile-nav-drawer li a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 0.9rem;
  transition: all 0.15s;
}
.mobile-nav-drawer li a:hover { color: var(--text); background: rgba(255,255,255,0.07); }

/* ── Utility classes ──────────────────────────────────────── */
.text-gold   { color: var(--gold); }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Navbar user section (new auth system) ──────────────────── */
.nav-vip-tag {
  font-size: .78rem; font-weight: 700; color: #000;
  background: var(--gold); padding: 4px 10px; border-radius: 20px;
}
.nav-user-wrap { position: relative; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; cursor: pointer;
  border: 2px solid transparent; transition: border-color .2s;
  user-select: none;
}
.nav-avatar.is-vip { border-color: var(--gold); }
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 210px;
  box-shadow: var(--shadow); overflow: hidden;
  display: none; z-index: 900;
}
.nav-dropdown.open { display: block; }
.nav-dropdown-head { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.nav-dd-email { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-dd-status { font-size: .72rem; margin-top: 3px; }
.nav-dd-status.vip { color: var(--gold); }
.nav-dd-status.free { color: var(--text-muted); }
.nav-dropdown ul { padding: 6px; list-style: none; }
.nav-dropdown ul li a,
.nav-dropdown ul li .dd-logout-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  width: 100%; text-align: left; color: var(--text-2);
  font-size: .85rem; transition: all .15s;
  background: none; border: none; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.nav-dropdown ul li a:hover,
.nav-dropdown ul li .dd-logout-btn:hover {
  background: rgba(255,255,255,.06); color: var(--text-primary);
}
.btn-outline-vip {
  border: 1.5px solid var(--accent); color: var(--accent);
  background: transparent; border-radius: 8px;
  font-weight: 600; transition: all .2s; text-decoration: none;
  display: inline-flex; align-items: center;
}
.btn-outline-vip:hover { background: var(--accent); color: #fff; }
