:root {
  --bg: #090b10;
  --surface: #121622;
  --surface-2: #191f30;
  --accent: #e50914;
  --accent-hover: #ff1f2c;
  --gold: #f5b915;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.09);
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.icon-xs { width: 14px; height: 14px; stroke-width: 2.3; flex-shrink: 0; }
.icon-sm { width: 18px; height: 18px; stroke-width: 2.2; flex-shrink: 0; }
.icon-md { width: 26px; height: 26px; stroke-width: 2.2; flex-shrink: 0; }

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 40;
  background: linear-gradient(180deg, rgba(9,11,16,0.95) 0%, rgba(9,11,16,0.45) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-badge {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #ff5e3a);
  display: grid; place-items: center; box-shadow: 0 4px 16px rgba(229,9,20,0.45);
}
.brand-name { font-size: 20px; font-weight: 900; letter-spacing: 0.04em; }
.brand-name span { color: var(--accent); }
.nav-links { display: flex; gap: 6px; }
.nav-link {
  background: transparent; border: none; color: var(--muted); font-family: var(--font);
  font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 8px; cursor: pointer; transition: 0.2s;
}
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.08); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; width: 230px;
}
.search-box input {
  background: transparent; border: none; outline: none; color: #fff;
  font-family: var(--font); font-size: 13px; width: 100%;
}
.btn-vip-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #f5b915, #f97316);
  color: #090b10; font-weight: 800; font-size: 12px; border: none;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(245,185,21,0.3); transition: 0.2s;
}
.btn-vip-pill:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-vip-pill.is-vip { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }

.btn-account, .btn-icon {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1); border: 1px solid var(--border);
  color: #fff; font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.btn-icon { padding: 8px; }

/* HERO */
.hero {
  position: relative;
  min-height: 76vh;
  display: flex;
  align-items: flex-end;
  padding: 120px 36px 56px;
  overflow: hidden;
}
.hero-backdrop {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 25%;
  transform: scale(1.03); transition: background-image 0.5s ease;
}
.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(9,11,16,0.95) 0%, rgba(9,11,16,0.65) 55%, rgba(9,11,16,0.2) 100%),
              linear-gradient(180deg, rgba(9,11,16,0.35) 0%, rgba(9,11,16,0) 45%, var(--bg) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 640px; }
.hero-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.tag-featured {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(229,9,20,0.22); border: 1px solid rgba(229,9,20,0.6);
  color: #ff6b72; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
}
.tag-vj {
  background: rgba(245,185,21,0.18); border: 1px solid rgba(245,185,21,0.5);
  color: var(--gold); font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
}
.tag-meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.hero-title { font-size: clamp(32px, 5vw, 56px); font-weight: 900; line-height: 1.08; margin-bottom: 14px; }
.hero-desc { color: #cbd5e1; font-size: 15px; line-height: 1.6; margin-bottom: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn-primary-lg, .btn-primary-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: none; font-family: var(--font);
  font-weight: 800; border-radius: 12px; cursor: pointer; transition: 0.2s;
}
.btn-primary-lg { padding: 13px 26px; font-size: 15px; box-shadow: 0 8px 24px rgba(229,9,20,0.4); }
.btn-primary-sm { padding: 9px 16px; font-size: 13px; }
.btn-primary-lg:hover, .btn-primary-sm:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-glass-lg, .btn-glass-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; font-family: var(--font); font-weight: 700; border-radius: 12px; cursor: pointer;
  backdrop-filter: blur(8px); text-decoration: none; transition: 0.2s;
}
.btn-glass-lg { padding: 13px 22px; font-size: 15px; }
.btn-glass-sm { padding: 8px 14px; font-size: 13px; }
.btn-glass-lg:hover, .btn-glass-sm:hover { background: rgba(255,255,255,0.2); }
.full-width { width: 100%; }

/* AD SLOTS */
.ad-slot-wrap { padding: 0 36px; margin: 12px 0 22px; }
.ad-banner {
  background: linear-gradient(90deg, #131929 0%, #1c1726 100%);
  border: 1px dashed rgba(245,185,21,0.4);
  border-radius: 14px; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.ad-badge {
  background: rgba(245,185,21,0.16); color: var(--gold); border: 1px solid rgba(245,185,21,0.4);
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 6px;
}
.ad-copy { flex: 1; font-size: 13px; color: #cbd5e1; min-width: 200px; }
.btn-ad-cta {
  background: var(--gold); color: #090b10; border: none; font-family: var(--font);
  font-weight: 800; font-size: 12px; padding: 8px 14px; border-radius: 8px; cursor: pointer;
}

/* CATALOG */
.catalog-main { padding: 0 36px 56px; }
.filter-strip {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 24px;
  scrollbar-width: none;
}
.filter-strip::-webkit-scrollbar { display: none; }
.filter-pill {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-family: var(--font); font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: 0.2s;
}
.filter-pill:hover, .filter-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.row-section { margin-bottom: 36px; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.row-head h2 { font-size: 20px; font-weight: 800; }
.row-head span { font-size: 12px; color: var(--muted); font-weight: 600; }

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
}
.movie-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform 0.22s, border-color 0.22s;
  display: flex; flex-direction: column;
}
.movie-card:hover { transform: translateY(-5px); border-color: rgba(229,9,20,0.65); }
.poster-wrap { position: relative; aspect-ratio: 2/3; background: #141926; overflow: hidden; }
.poster-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s; }
.movie-card:hover .poster-wrap img { transform: scale(1.06); }

.card-badges {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; justify-content: space-between; gap: 4px;
}
.badge-vip {
  background: linear-gradient(135deg, #f5b915, #f97316); color: #090b10;
  font-size: 10px; font-weight: 900; padding: 3px 7px; border-radius: 6px;
}
.badge-free {
  background: #10b981; color: #fff;
  font-size: 10px; font-weight: 900; padding: 3px 7px; border-radius: 6px;
}
.badge-rating {
  background: rgba(9,11,16,0.82); color: #fff;
  font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px;
}
.card-play-overlay {
  position: absolute; inset: 0; background: rgba(9,11,16,0.48);
  display: grid; place-items: center; opacity: 0; transition: 0.2s;
}
.movie-card:hover .card-play-overlay { opacity: 1; }
.play-circle {
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent);
  display: grid; place-items: center; color: #fff; box-shadow: 0 6px 20px rgba(229,9,20,0.55);
}
.card-body { padding: 11px 12px; }
.card-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.card-meta { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--border); padding: 24px 36px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: #06080c; font-size: 13px; color: var(--muted);
}
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-brand strong { color: #fff; font-size: 15px; }
.footer-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.link-btn { background: none; border: none; color: #cbd5e1; font-family: var(--font); font-size: 13px; cursor: pointer; }
.link-btn:hover { color: var(--gold); }

/* MODALS */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.82); backdrop-filter: blur(8px); }
.dialog-card, .player-shell, .admin-shell {
  position: relative; z-index: 2; background: var(--surface);
  border: 1px solid var(--border); border-radius: 20px; width: 100%;
  box-shadow: 0 24px 70px rgba(0,0,0,0.75);
}
.dialog-card { max-width: 460px; padding: 28px; }
.player-shell { max-width: 980px; overflow: hidden; }
.admin-shell { max-width: 860px; max-height: 90vh; overflow-y: auto; padding-bottom: 22px; }

.floating-close { position: absolute; top: 16px; right: 16px; }
.btn-close-modal {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  color: #fff; display: grid; place-items: center; cursor: pointer;
}
.player-topbar {
  padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.player-topbar h2 { font-size: 18px; font-weight: 800; }
.player-sub { font-size: 12px; color: var(--muted); }
.player-top-actions { display: flex; align-items: center; gap: 10px; }

.video-stage { position: relative; aspect-ratio: 16/9; background: #000; width: 100%; }
.video-el { width: 100%; height: 100%; border: none; display: block; background: #000; }
.player-footer-desc { padding: 16px 22px; font-size: 14px; color: #cbd5e1; line-height: 1.55; }

.preroll-overlay, .vip-lock-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(9,11,16,0.92); display: grid; place-items: center; padding: 24px; text-align: center;
}
.preroll-card, .vip-lock-card { max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.vip-crown-circle {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #f5b915, #f97316); color: #090b10;
  display: grid; place-items: center;
}
.preroll-actions, .vip-lock-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

.vip-header-badge {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; margin-bottom: 8px;
}
.dialog-title { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.dialog-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.vip-perks { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; font-size: 13px; color: #e2e8f0; }
.vip-perks li { display: flex; align-items: center; gap: 8px; }
.vip-perks svg { color: #10b981; }

.stack-form { display: flex; flex-direction: column; gap: 10px; }
.stack-form label { font-size: 12px; font-weight: 700; color: #cbd5e1; }
.input {
  background: var(--surface-2); border: 1px solid var(--border); color: #fff;
  font-family: var(--font); font-size: 14px; padding: 11px 14px; border-radius: 10px; outline: none; width: 100%;
}
.input:focus { border-color: var(--accent); }
.form-alert {
  background: rgba(229,9,20,0.16); border: 1px solid rgba(229,9,20,0.5);
  color: #fca5a5; font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px;
}
.form-alert.success { background: rgba(16,185,129,0.16); border-color: rgba(16,185,129,0.5); color: #6ee7b7; }

.polling-box {
  margin-top: 16px; padding: 14px; border-radius: 12px;
  background: rgba(245,185,21,0.1); border: 1px solid rgba(245,185,21,0.35);
  display: flex; align-items: center; gap: 12px;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(245,185,21,0.25); border-top-color: var(--gold);
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-tabs, .admin-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab, .admin-tab {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-family: var(--font); font-weight: 700; font-size: 13px;
  padding: 10px; border-radius: 10px; cursor: pointer;
}
.auth-tab.active, .admin-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.account-box { display: flex; flex-direction: column; gap: 12px; }
.acct-row { display: flex; justify-content: space-between; font-size: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.acct-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ADMIN */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 18px 22px; }
.stat-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.stat-box span { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.stat-box strong { font-size: 20px; font-weight: 900; color: #fff; }
.admin-tabs { padding: 0 22px; }
.admin-pane { padding: 0 22px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.span-2 { grid-column: span 2; }
.check-row { display: flex; gap: 18px; font-size: 13px; color: #cbd5e1; }
.admin-movie-list { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.admin-movie-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); padding: 10px 14px; border-radius: 10px; font-size: 13px;
}
.muted-hint { font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 100;
  background: #10b981; color: #fff; font-weight: 700; font-size: 13px;
  padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

@media (max-width: 820px) {
  .navbar { padding: 0 14px; }
  .nav-links, .search-box { display: none; }
  .hero { padding: 96px 18px 36px; min-height: 62vh; }
  .ad-slot-wrap, .catalog-main, .site-footer { padding-left: 16px; padding-right: 16px; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}
