:root {
  --bg: #060816;
  --panel: rgba(10, 14, 31, 0.82);
  --panel-strong: rgba(14, 20, 40, 0.95);
  --text: #f7fbff;
  --muted: #9eaed2;
  --line: rgba(115, 152, 255, 0.18);
  --accent: #19f0ff;
  --accent-strong: #ff4fd8;
  --accent-warm: #ffd24d;
  --success: #60ffb0;
  --danger: #ff6c7c;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(25, 240, 255, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 79, 216, 0.18), transparent 28%),
    radial-gradient(circle at bottom, rgba(255, 210, 77, 0.08), transparent 30%),
    linear-gradient(180deg, #070a16 0%, #05070f 100%);
}
.backdrop {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.78), transparent 90%);
  pointer-events: none;
}
.topbar, .layout, .login-shell { position: relative; z-index: 1; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px clamp(20px, 3vw, 40px) 12px;
}
.brand-wrap { display: flex; flex-direction: column; gap: 4px; }
.brand-kicker, .eyebrow, .section-kicker, .hero-label {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  color: var(--accent);
}
.brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.9;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text);
  text-shadow: 0 0 24px rgba(25, 240, 255, 0.28);
}
.topbar-actions, .results-block { display: flex; align-items: center; gap: 12px; }
.search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(440px, 62vw);
  padding: 10px 14px;
  border: 1px solid rgba(25, 240, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
.search-shell span, .user-label, .results-label, .login-copy, .login-message, #featuredMeta, #playerMeta, .featured-description, .movie-description, .stat-label {
  color: var(--muted);
}
.search-shell input, .admin-card input, .admin-card textarea, .admin-card select, .login-form input, .profile-shell input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.layout { padding: 12px clamp(20px, 3vw, 40px) 44px; display: grid; gap: 24px; }
.hero-panel, .panel, .content-shell, .admin-shell, .player-chrome, .login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 680px);
  gap: 22px;
  padding: clamp(22px, 3vw, 40px);
  border-radius: 34px;
  align-items: stretch;
}
.hero-panel h1, .section-head h2, .player-copy h2, .login-card h1 { margin: 0; line-height: 0.94; }
.hero-panel h1, .login-card h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  max-width: 10ch;
}
.hero-text { max-width: 58ch; }
.hero-actions, .toolbar-row, .hero-stats, .editor-actions, .card-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions { margin-top: 26px; }
.hero-stats { margin-top: 28px; }
.stat-card {
  min-width: 120px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}
.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.8rem;
}
.primary-btn, .secondary-btn, .ghost-btn, .play-btn, .close-btn, .chip-btn, .danger-btn {
  padding: 12px 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.primary-btn, .play-btn {
  color: #08101d;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 28px rgba(25, 240, 255, 0.22);
}
.secondary-btn {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 210, 77, 0.2), rgba(255, 79, 216, 0.2));
  border: 1px solid rgba(255, 210, 77, 0.22);
}
.ghost-btn, .close-btn, .chip-btn {
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.ghost-btn.is-favorite,
.favorite-btn.is-favorite,
#favoriteFeaturedBtn.is-favorite {
  color: #ffe4e9;
  background: rgba(255, 108, 124, 0.2);
  border: 1px solid rgba(255, 108, 124, 0.42);
  box-shadow: 0 12px 28px rgba(255, 108, 124, 0.18);
}
.danger-btn {
  color: #ffe4e9;
  background: rgba(255, 108, 124, 0.18);
  border: 1px solid rgba(255, 108, 124, 0.38);
}
.chip-btn.active {
  color: #08101d;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 26px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.06), rgba(0,0,0,0.72)),
    radial-gradient(circle at top, rgba(25, 240, 255, 0.22), transparent 36%),
    linear-gradient(135deg, #101a35 0%, #0d1326 100%);
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 56%;
  background: linear-gradient(180deg, transparent, rgba(4, 7, 12, 0.96));
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card h2 { margin: 8px 0 10px; font-size: clamp(1.8rem, 3vw, 3rem); }
.hero-strip-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}
.hero-strip-head #featuredMeta {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.featured-scroller {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
  align-content: start;
}
.featured-scroller.single-poster {
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: start;
  max-height: none;
  min-height: 0;
  gap: 10px;
}
.featured-strip-card {
  display: block;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
}
.featured-strip-card.active {
  border-color: rgba(25, 240, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(25, 240, 255, 0.1);
}
.featured-strip-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  min-height: 280px;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  background: linear-gradient(135deg, #20315d, #121b32 55%, #0b1020 100%);
}
.featured-scroller.single-poster .featured-strip-card {
  width: auto;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.featured-scroller.single-poster .featured-strip-poster {
  min-height: 0;
  max-height: 560px;
  object-fit: contain;
  background: transparent;
  display: block;
  border-radius: 18px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1fr;
  gap: 20px;
}
.panel, .content-shell, .admin-shell { border-radius: 28px; padding: 24px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 20px;
}
.section-head.compact { margin-bottom: 14px; }
.profile-summary { display: grid; gap: 8px; margin-bottom: 14px; }
.genre-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.toolbar-row { justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.subsection + .subsection { margin-top: 26px; }
.stacked-sections {
  display: grid;
  gap: 28px;
}
.catalog-section {
  display: grid;
  gap: 14px;
}
.movie-grid, .episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.series-shelf { display: grid; gap: 20px; }
.series-group {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255,255,255,0.025);
}
.series-group-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}
.season-block {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  margin-top: 14px;
  overflow: hidden;
}
.season-summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 700;
  background: rgba(255,255,255,0.04);
}
.season-summary::-webkit-details-marker {
  display: none;
}
.season-block .episode-grid {
  padding: 16px;
}
.movie-card {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.07);
  background: linear-gradient(180deg, rgba(19, 27, 52, 0.96), rgba(10, 14, 27, 0.98));
  cursor: pointer;
}
.movie-card.selected {
  outline: 2px solid rgba(25, 240, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(25,240,255,0.08);
}
.movie-art {
  position: relative;
  min-height: 290px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.46)),
    radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 26%),
    linear-gradient(135deg, #20315d, #121b32 55%, #0b1020 100%);
}
.movie-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.movie-art-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.movie-badge, .movie-duration {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(6, 10, 18, 0.58);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.78rem;
}
.movie-body { padding: 16px; }
.movie-body-top { display: flex; justify-content: space-between; gap: 12px; }
.movie-title { margin: 0 0 6px; font-size: 1.05rem; }
.movie-genre, .movie-year { margin: 0; color: var(--muted); font-size: 0.88rem; }
.movie-description { display: none; }
.card-actions .ghost-btn, .card-actions .play-btn { flex: 1; }
.request-grid {
  grid-template-columns: 1fr;
}
.request-list {
  display: grid;
  gap: 12px;
}
.request-row {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.request-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.request-row-head span,
.request-row p {
  color: var(--muted);
}
.request-row p {
  margin: 0;
}
.rail-empty {
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,0.12);
  color: var(--muted);
  text-align: center;
}
.empty-state {
  padding: 40px 16px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 24px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}
.admin-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255,255,255,0.03);
}
.admin-card h3 { margin-top: 0; }
.upload-form, .edit-form, .login-form { display: grid; gap: 14px; }
.editor-card #externalEditFields, .login-switcher, .user-list { display: grid; gap: 12px; }
.user-row {
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  cursor: pointer;
}
.user-row.selected {
  border-color: rgba(25, 240, 255, 0.45);
  color: var(--text);
}
.admin-card label, .login-form label { display: grid; gap: 8px; }
.admin-card input, .admin-card textarea, .admin-card select, .login-form input, .profile-shell input {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkbox-row {
  display: flex !important;
  align-items: center;
  justify-content: start;
  gap: 10px;
}
.player-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(3, 6, 10, 0.84);
  padding: 28px;
  display: grid;
  place-items: center;
}
.player-chrome {
  width: min(1160px, 100%);
  padding: 18px;
  border-radius: 28px;
}
.player-copy { padding: 10px 4px 16px; }
.player-nav {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.player-nav .ghost-btn[disabled] {
  opacity: 0.45;
  cursor: default;
}
#videoPlayer, #embedPlayer {
  width: 100%;
  max-height: 72vh;
  border: 0;
  border-radius: 20px;
  background: #000;
}
#embedPlayer { height: min(72vh, 70vw); }
.login-body { display: grid; place-items: center; }
.login-shell { width: min(560px, calc(100% - 32px)); }
.login-card { border-radius: 28px; padding: 28px; }
.hidden { display: none !important; }
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover, .play-btn:hover, .close-btn:hover, .chip-btn:hover, .danger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(0,0,0,0.18);
}
code {
  padding: 0.15rem 0.4rem;
  border-radius: 0.45rem;
  background: rgba(255,255,255,0.07);
}

@media (max-width: 1120px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .topbar, .section-head, .results-block, .series-group-head { flex-direction: column; align-items: stretch; }
  .topbar-actions, .search-shell { width: 100%; }
  .hero-panel { grid-template-columns: 1fr; }
  .featured-scroller { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .toolbar-row { flex-direction: column; }
}

@media (max-width: 640px) {
  .layout, .topbar { padding-left: 16px; padding-right: 16px; }
  .player-modal { padding: 12px; }
  .inline-fields { grid-template-columns: 1fr; }
  .card-actions { flex-direction: column; }
  .featured-scroller { grid-template-columns: 1fr; }
}
