@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=DM+Sans:wght@400;500;700&display=swap');

:root {
  --bg: #05070e;
  --bg-2: #0b1220;
  --panel: #121a2b;
  --panel-2: #192338;
  --text: #e8edf8;
  --muted: #9ea8be;
  --accent: #e50914;
  --accent-2: #ff6a5f;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --line: #25304a;
  --shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: radial-gradient(circle at 12% 8%, #1a2540, var(--bg)); color: var(--text); font-family: 'DM Sans', sans-serif; }
a { color: #9fd2ff; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { width: min(1180px, 92vw); margin: 0 auto; }
.narrow { width: min(700px, 92vw); }
.mt-3 { margin-top: 1.2rem; }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(5, 7, 14, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.3rem; color: #fff; letter-spacing: .4px; }
.nav-links { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--text); opacity: .92; padding: .35rem .62rem; border: 1px solid transparent; border-radius: 999px; white-space: nowrap; transition: border-color .2s ease, background .2s ease, opacity .2s ease; }
.nav-links a.active { background: #1b2843; border-color: #3d5384; opacity: 1; }
.nav-user { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.pill { display: inline-flex; align-items: center; padding: .35rem .7rem; background: #27344e; border-radius: 999px; color: var(--text); font-size: .84rem; }
.pill.premium { background: linear-gradient(135deg, #f8a100, #ffcd4f); color: #2d2102; font-weight: 700; }
.pill.alert { background: #293457; }
.tag { display: inline-flex; background: #2c3f66; padding: .4rem .8rem; border-radius: 999px; font-size: .8rem; }

.hero { min-height: 62vh; background-size: cover; background-position: center; border-bottom: 1px solid var(--line); }
.hero-inner { padding: 5rem 0; max-width: 720px; }
.hero h1 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 5vw, 3.4rem); margin: .65rem 0; }
.hero p { color: #d6dff3; font-size: 1.04rem; line-height: 1.6; }
.hero-actions { margin-top: 1rem; }

.page-main { min-height: calc(100vh - 120px); }
section { margin: 1.4rem 0; }
h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; margin: 0 0 .7rem; }

.flash-wrap { margin-top: 1rem; }
.flash { padding: .8rem 1rem; border-radius: 10px; margin-bottom: .8rem; border: 1px solid transparent; }
.flash-success { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .3); }
.flash-error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); }

.panel { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.form-grid { display: grid; gap: .8rem; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; background: #0d1526; color: var(--text); border: 1px solid #2b3654; border-radius: 10px; padding: .62rem .72rem; }
textarea { resize: vertical; }
label { display: grid; gap: .35rem; color: #d5ddf2; font-size: .95rem; }
.error { color: #ff9ca0; }

.btn { border: 0; border-radius: 10px; padding: .56rem .92rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.btn:hover { text-decoration: none; opacity: .95; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; }
.btn-secondary { background: #24314f; color: #eef3ff; }
.btn-ghost { background: #1b2740; color: #d9e3fb; }
.btn-small { padding: .38rem .65rem; font-size: .86rem; background: #273555; color: #fff; }
.inline-form { display: inline-flex; gap: .45rem; align-items: center; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .95rem; }
.card { background: #111a2b; border: 1px solid #253250; border-radius: 13px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(229,9,20,.2); border-color: #385080; }
.card img { width: 100%; height: 270px; object-fit: cover; }
.card-body { padding: .8rem; display: grid; gap: .35rem; }
.card-actions { margin-top: .3rem; }
.muted { color: var(--muted); }

.detail-hero { min-height: 46vh; background-size: cover; background-position: center; }
.detail-hero .container { padding: 4rem 0; max-width: 760px; }
.meta-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: .8rem 0; }
.detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-top: .85rem;
}

.btn-play-first {
  font-weight: 700;
  min-width: 170px;
}

.hero-help {
  margin-top: .55rem;
}


.episode-list { display: grid; gap: .75rem; }
.episode-item { display: grid; grid-template-columns: 132px 1fr auto; gap: .8rem; align-items: center; background: #0e1829; border: 1px solid #273658; border-radius: 11px; padding: .58rem; }
.episode-item img { width: 132px; height: 74px; object-fit: cover; border-radius: 8px; }
.episode-item.compact { grid-template-columns: 82px 1fr; }
.episode-item.compact img { width: 82px; height: 50px; }
.episode-item.episode-link {
  color: var(--text);
  text-decoration: none;
}

.episode-item.episode-link:hover {
  text-decoration: none;
  border-color: #3a4f7f;
  box-shadow: 0 10px 20px rgba(0,0,0,.22);
}

.episode-item.episode-link .btn-small {
  justify-self: end;
}


.comment-list { display: grid; gap: .75rem; }
.comment-item { background: #0f182a; border: 1px solid #273454; border-radius: 10px; padding: .75rem; }

.player-wrapper { position: relative; background: #050911; border: 1px solid #2b3655; border-radius: 14px; overflow: hidden; }
#media-player { width: 100%; max-height: 72vh; background: #000; }
.player-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.preroll { position: absolute; inset: 0; background: rgba(2, 4, 9, .95); display: grid; place-items: center; z-index: 6; }
.preroll-box { width: min(520px, 92%); background: #10182a; border: 1px solid #303d61; border-radius: 14px; padding: 1rem; text-align: center; }
.preroll-body video, .preroll-body img { width: 100%; max-height: 240px; object-fit: contain; border-radius: 10px; margin: .7rem 0; }
.autonext { position: absolute; right: 1rem; bottom: 1rem; background: rgba(16, 24, 40, 0.95); border: 1px solid #3a4f7f; border-radius: 10px; padding: .8rem; display: flex; gap: .55rem; align-items: center; }
.autonext[hidden] {
  display: none !important;
}
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .95rem; }
.plan-card { border: 1px solid #2d3a5d; border-radius: 13px; background: #11192b; padding: 1rem; }
.plan-card.featured { border-color: #df2d38; box-shadow: 0 10px 28px rgba(229, 9, 20, .24); }
.price { font-size: 1.6rem; font-weight: 700; color: #fff; }

.ad-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .7rem; }
.ad-item { background: #0f1829; border: 1px solid #2f3f62; border-radius: 10px; overflow: hidden; display: block; }
.ad-item img { width: 100%; height: 100px; object-fit: cover; }

.footer { border-top: 1px solid var(--line); margin-top: 1.5rem; }
.footer-inner { min-height: 62px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); }

.auth-shell { padding: 2rem 0; }
.error-page { padding: 4rem 0; text-align: center; }
.error-page h1 { font-size: 4rem; }

.admin-body .container { width: min(100%, 1000px); }
.admin-shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.admin-sidebar { background: #0b1220; border-right: 1px solid #263352; padding: 1rem; display: grid; align-content: flex-start; gap: .5rem; }
.admin-sidebar a { color: #d7e1f8; padding: .45rem .5rem; border-radius: 8px; }
.admin-sidebar a:hover { background: #1b2843; text-decoration: none; }
.admin-main { padding: 1rem 1.1rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.admin-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; }
.metric-card { background: #10192c; border: 1px solid #2a395e; border-radius: 12px; padding: .9rem; }
.metric-card h3 { font-size: 1.7rem; margin: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.admin-grid .wide { grid-column: span 2; }
.list-row { display: grid; gap: .2rem; border-bottom: 1px solid #23304d; padding: .48rem 0; }
.simple-chart { display: grid; gap: .35rem; }
.simple-chart div { display: flex; justify-content: space-between; background: #0f1728; border: 1px solid #273455; border-radius: 8px; padding: .38rem .58rem; }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th, .table td { border-bottom: 1px solid #273455; padding: .45rem; text-align: left; vertical-align: middle; }
.table th { color: #bcc8e4; font-size: .9rem; }
.table.table-duplicates { min-width: 0; table-layout: fixed; }
.table.table-duplicates th:nth-child(1) { width: 90px; }
.table.table-duplicates th:nth-child(3) { width: 90px; }
.table.table-duplicates th:nth-child(4) { width: min(52vw, 460px); }
.table td.ids-cell { max-width: 460px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.ids-cell-text { max-height: 5.2rem; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: .78rem; line-height: 1.35; }

@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: sticky; top: 0; z-index: 25; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-grid .wide { grid-column: auto; }
}

@media (max-width: 740px) {
  .topbar-inner { flex-wrap: wrap; padding: .6rem 0; }
  .nav-links { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .2rem; -webkit-overflow-scrolling: touch; }
  .nav-links a { flex: 0 0 auto; }
  .hero-inner { padding: 3.4rem 0; }
  .detail-hero-actions {
    width: 100%;
  }
  .detail-hero-actions .btn,
  .detail-hero-actions .inline-form {
    width: 100%;
    justify-content: center;
  }
  .episode-item { grid-template-columns: 1fr; }
  .episode-item img { width: 100%; height: 160px; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 8, 16, 0.78);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(520px, 96vw);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .8rem;
}
.home-search-panel {
  margin-top: 1rem;
}

.home-search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .7rem;
}

.play-gate {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: rgba(2, 5, 10, 0.45);
}

.preroll[hidden] {
  display: none !important;
}
.movie-preview-card {
  position: relative;
  border: 1px solid #2f3c5f;
  border-radius: 14px;
  overflow: hidden;
  background: #060a13;
  box-shadow: var(--shadow);
}

.movie-preview-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.movie-preview-overlay {
  position: absolute;
  left: .9rem;
  right: .9rem;
  bottom: .9rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: rgba(8, 14, 24, 0.78);
  border: 1px solid #394a74;
  border-radius: 12px;
  padding: .75rem .9rem;
  backdrop-filter: blur(4px);
}

.movie-preview-overlay p {
  margin: .2rem 0 0;
  color: #d7e2fb;
  font-size: .92rem;
}

@media (max-width: 740px) {
  .movie-preview-overlay {
    flex-direction: column;
    align-items: flex-start;
  }
}

.anti-inspect-lock {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 20% 10%, #2a1018, #060b16);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.anti-inspect-box {
  width: min(560px, 96vw);
  border: 1px solid #4a2131;
  border-radius: 14px;
  background: linear-gradient(180deg, #15111c, #120f18);
  box-shadow: 0 24px 50px rgba(0,0,0,.55);
  padding: 1.25rem;
  text-align: center;
}

.anti-inspect-box h2 {
  margin: 0 0 .55rem;
}

.anti-inspect-box p {
  margin: 0;
  color: #f2d7de;
}

.anti-inspect-box small {
  display: block;
  margin-top: .65rem;
  color: #b7bdd0;
}
.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.comment-replies {
  margin-top: .65rem;
  display: grid;
  gap: .55rem;
}

.comment-item.reply {
  margin-left: 1.1rem;
  border-left: 2px solid #2f3f66;
}

.comment-reply-box {
  margin-top: .5rem;
}

.comment-reply-box summary {
  cursor: pointer;
  color: #b6d3ff;
}
.catalog-summary {
  margin: .75rem 0;
}

.pagination-wrap {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .7rem;
}

.pagination-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .4rem .8rem;
  border: 1px solid #30426a;
  border-radius: 10px;
  background: #10192b;
  color: #d8e4ff;
}

.season-accordion {
  display: grid;
  gap: .75rem;
}

.season-item {
  padding: .8rem;
}

.season-toggle {
  width: 100%;
  border: 1px solid #2f4068;
  border-radius: 10px;
  background: #0d1628;
  color: #f1f5ff;
  padding: .78rem .88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  cursor: pointer;
}

.season-toggle::after {
  content: "+";
  font-size: .95rem;
  opacity: .88;
}

.season-toggle[aria-expanded='true']::after {
  content: '-';
}

.season-meta {
  color: #b2c0df;
  font-size: .88rem;
  margin-right: .35rem;
}

.season-panel {
  margin-top: .8rem;
}

.episode-lazy-block {
  display: grid;
  gap: .7rem;
}

.lazy-season {
  padding: .5rem .65rem;
}

.lazy-season-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.lazy-season-summary::-webkit-details-marker {
  display: none;
}

.lazy-season-summary::after {
  content: '+';
  margin-left: .35rem;
  opacity: .9;
}

.lazy-season[open] .lazy-season-summary::after {
  content: '-';
}

.episode-item.is-current {
  border-color: #4b69a8;
  background: #13213a;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: #0f1728;
  border: 1px solid #2f4067;
  padding: 2px;
}

.brand-text {
  white-space: nowrap;
}

.settings-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .8rem;
}

.settings-media-card {
  border: 1px solid #2f4068;
  background: #0d1628;
  border-radius: 12px;
  padding: .85rem;
  display: grid;
  gap: .65rem;
}

.settings-media-card h3 {
  margin: 0;
}

.settings-media-preview {
  width: 100%;
  max-height: 90px;
  object-fit: contain;
  border: 1px solid #32456f;
  border-radius: 10px;
  background: #070d18;
  padding: .4rem;
}

.settings-media-favicon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid #32456f;
  border-radius: 10px;
  background: #070d18;
  padding: .35rem;
}

.settings-media-empty {
  min-height: 48px;
  border: 1px dashed #32456f;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b2c0df;
  font-size: .9rem;
}

.live-header-actions {
  align-items: flex-start;
}

.live-header-tools {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.live-maskable {
  transition: filter .2s ease, opacity .2s ease;
}

.live-masked .live-maskable {
  filter: blur(7px);
  opacity: .72;
  user-select: none;
  pointer-events: none;
}

@media (max-width: 740px) {
  .live-header-tools {
    width: 100%;
    justify-content: flex-start;
  }
}
.live-masked-global .live-maskable {
  filter: blur(7px);
  opacity: .72;
  user-select: none;
  pointer-events: none;
}

.live-header-tools [data-live-exclude-ips] {
  min-width: 260px;
  max-width: 420px;
}

.live-header-tools [data-live-exclude-status] {
  min-height: 1rem;
}

@media (max-width: 740px) {
  .live-header-tools [data-live-exclude-ips] {
    min-width: 100%;
    max-width: 100%;
  }
}
