:root {
  --bg: #09090d;
  --surface: #12121a;
  --surface-2: #191923;
  --surface-3: #20202c;
  --border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --muted: #a5a7b5;
  --accent: #ff3366;
  --accent-2: #ff7a59;
  --danger: #ff4d4d;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 51, 102, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 122, 89, 0.11), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button { border: 0; cursor: pointer; }

.hidden { display: none !important; }

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(9, 9, 13, 0.82);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark,
.age-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(255, 51, 102, 0.22);
}

.brand strong { display: block; font-size: 19px; }
.brand span { color: var(--muted); font-size: 12px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  color: #d9dbe7;
  padding: 9px 12px;
  border-radius: 999px;
  transition: 0.2s ease;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.hero {
  padding: 34px 0 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
}

.hero h1 {
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -1.7px;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  max-width: 720px;
  line-height: 1.7;
}

.hero-stats,
.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.admin-stats {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.stat-card strong {
  display: block;
  font-size: 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.panel,
.sidebar-card,
.admin-card,
.admin-table-wrap {
  background: rgba(18, 18, 26, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toolbar {
  padding: 16px;
  margin: 10px 0 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 130px;
  gap: 12px;
  align-items: center;
}

.field {
  width: 100%;
  color: #fff;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}

.field:focus {
  border-color: rgba(255, 51, 102, 0.65);
  box-shadow: 0 0 0 4px rgba(255, 51, 102, 0.12);
}

select.field { color-scheme: dark; }

textarea.field {
  min-height: 120px;
  resize: vertical;
}

.main-layout,
.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.video-card {
  position: relative;
  overflow: hidden;
  background: rgba(18, 18, 26, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.video-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 51, 102, 0.55);
  background: rgba(26, 26, 38, 0.98);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1a24;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: 0.2s ease;
}

.video-card:hover .play-badge { opacity: 1; }

.play-badge span {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 51, 102, 0.92);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 34px rgba(255, 51, 102, 0.28);
}

.duration,
.quality,
.age-chip {
  position: absolute;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.duration { right: 8px; bottom: 8px; }
.quality { left: 8px; bottom: 8px; background: rgba(255, 51, 102, 0.9); }
.age-chip { top: 8px; left: 8px; background: rgba(37, 211, 102, 0.88); color: #05120a; }

.card-body { padding: 13px; }

.card-title {
  font-size: 15px;
  line-height: 1.35;
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tag { color: #ffd1dc; }

.grid-native-ad {
  grid-column: span 2;
  min-height: 100%;
}

.ad-slot {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: #9295a6;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  min-height: 86px;
}

.ad-slot small {
  display: block;
  color: #707384;
  margin-top: 6px;
  font-size: 12px;
}

.ad-top,
.ad-footer {
  width: min(1000px, calc(100% - 32px));
  min-height: 92px;
  margin: 18px auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 88px;
}

.sidebar-card { padding: 16px; }
.sidebar-card h3 { font-size: 16px; margin-bottom: 12px; }
.sidebar-card p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.sidebar-ad { min-height: 260px; }

.pagination-wrap {
  margin: 24px 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 13px;
  border-radius: 13px;
  background: var(--surface-2);
  color: #e6e7ef;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover,
.page-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

.page-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.empty-state {
  padding: 34px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius);
}

.back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 13px;
  background: var(--surface-2);
  color: #fff;
  border: 1px solid var(--border);
  transition: 0.2s ease;
}

.btn:hover { background: var(--surface-3); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(255, 51, 102, 0.2);
}

.btn-danger {
  background: rgba(255, 77, 77, 0.12);
  border-color: rgba(255, 77, 77, 0.28);
  color: #ffb6b6;
}

.btn.small {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.full { width: 100%; }

.video-ad { margin-bottom: 14px; }
.mt-14 { margin-top: 14px; }

.player-shell {
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.player-shell video {
  width: 100%;
  height: auto;
  min-height: 240px;
  max-height: 72vh;
  background: #000;
  display: block;
}

.theater-mode .watch-layout { grid-template-columns: 1fr; }
.theater-mode .watch-layout > .sidebar { display: none; }

.watch-info { padding: 18px 0 8px; }

.watch-info h1 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.14;
  margin-bottom: 12px;
}

.watch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
}

.watch-desc {
  color: #c8cad6;
  line-height: 1.7;
  max-width: 880px;
  margin-bottom: 16px;
}

.report-box {
  padding: 18px;
  margin: 18px 0;
}

.report-box h2 {
  margin-bottom: 12px;
}

.report-box form {
  display: grid;
  gap: 12px;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
}

.age-gate.show { display: flex; }

.age-box {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.age-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  margin-bottom: 16px;
}

.age-box h2 { margin-bottom: 10px; font-size: 25px; }

.age-box p {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 18px;
}

.footer {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 46px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer a {
  color: #d8d9e4;
  margin-left: 12px;
}

/* Admin */
.admin-body {
  background: var(--bg);
}

.admin-header {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.admin-logo {
  font-weight: 800;
  font-size: 20px;
  color: #fff;
}

.admin-header nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-header nav a {
  color: #d8d9e4;
}

.admin-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto 60px;
}

.admin-shell.narrow {
  width: min(720px, calc(100% - 32px));
}

.login-wrap {
  width: min(440px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.admin-card {
  padding: 24px;
  display: grid;
  gap: 13px;
}

.admin-card h1 {
  margin-bottom: 4px;
}

.admin-card p,
.muted-link {
  color: var(--muted);
  font-size: 14px;
}

.admin-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 22px 0 14px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.admin-table th,
.admin-table td {
  padding: 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: #d9dbe7;
  font-size: 13px;
}

.admin-table td {
  color: #f5f5f7;
  font-size: 14px;
}

.admin-thumb,
.preview-img {
  width: 110px;
  height: 62px;
  object-fit: cover;
  border-radius: 10px;
  background: #222;
}

.preview-img {
  width: 260px;
  height: auto;
  max-height: 150px;
}

.action-cells {
  white-space: nowrap;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
}

.alert.error {
  background: rgba(255, 77, 77, 0.12);
  border: 1px solid rgba(255, 77, 77, 0.25);
  color: #ffb6b6;
}

.alert.success {
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.25);
  color: #b9ffd2;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field.mini {
  min-width: 130px;
  padding: 8px;
  border-radius: 10px;
}

@media (max-width: 1180px) {
  .video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .main-layout,
  .watch-layout { grid-template-columns: 1fr; }

  .sidebar { display: none; }

  .hero { grid-template-columns: 1fr; }

  .toolbar { grid-template-columns: 1fr; }

  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .admin-stats { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .header-inner,
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .grid-native-ad { grid-column: span 2; }

  .hero-stats {
    min-width: 0;
    width: 100%;
  }

  .footer {
    display: block;
    line-height: 2;
  }
}

@media (max-width: 440px) {
  .page-shell,
  .header-inner,
  .footer,
  .admin-shell,
  .admin-header {
    width: min(100% - 22px, 1240px);
  }

  .video-grid { grid-template-columns: 1fr; }

  .grid-native-ad { grid-column: span 1; }

  .ad-top,
  .ad-footer { width: calc(100% - 22px); }
}


/* SEO content */
.seo-content {
  margin-top: 24px;
  margin-bottom: 8px;
  padding: 22px;
  background: rgba(18, 18, 26, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.seo-content h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.seo-content p {
  color: var(--muted);
  line-height: 1.75;
  max-width: 900px;
}

.keyword-tags {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.keyword-tags span {
  display: inline-flex;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: #ffd1dc;
  font-size: 13px;
}

/* Stronger mobile admin panel */
@media (max-width: 720px) {
  .admin-shell {
    margin-top: 16px;
  }

  .admin-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-title-row .btn {
    width: 100%;
  }

  .admin-card {
    padding: 18px;
    border-radius: 16px;
  }

  .admin-card h1 {
    font-size: 24px;
  }

  .admin-table-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .admin-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tr {
    background: rgba(18, 18, 26, 0.92);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  }

  .admin-table td {
    border-bottom: 0;
    padding: 9px 0;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
  }

  .admin-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .admin-table td.action-cells {
    display: block;
  }

  .admin-table td.action-cells::before {
    display: block;
    margin-bottom: 8px;
  }

  .action-cells .btn,
  .action-cells form,
  .action-cells form button {
    width: 100%;
    margin: 4px 0;
  }

  .admin-thumb {
    width: 100%;
    max-width: 180px;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .preview-img {
    width: 100%;
    max-width: 100%;
  }

  .login-wrap {
    align-items: start;
    padding-top: 30px;
  }

  .field,
  .btn {
    min-height: 46px;
  }
}



/* Ads from admin panel */
.ad-live {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: auto;
  display: block;
  overflow: visible;
}

.ad-live iframe,
.ad-live img {
  max-width: 100%;
}

/* Admin ads/smartlink/settings UI */
.ads-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ad-edit-card h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.admin-help {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.code-field {
  min-height: 180px;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

.smartlink-form {
  grid-template-columns: 220px minmax(0, 1fr) auto;
  align-items: end;
}

.mt-18 {
  margin-top: 18px;
}

.gateway-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.gateway-box {
  width: min(460px, 100%);
  background: rgba(18, 18, 26, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.gateway-box h1 {
  margin-bottom: 10px;
}

.gateway-box p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

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

  .smartlink-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-header nav a {
    background: rgba(255,255,255,0.06);
    padding: 8px 10px;
    border-radius: 999px;
  }

  .code-field {
    min-height: 150px;
  }
}

@media (max-width: 440px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }
}



/* No zoom helper */
html,
body,
.no-zoom {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

/* Keep ad scripts/iframes responsive */
.ad-live,
.ad-slot {
  max-width: 100%;
}

.ad-live iframe,
.ad-live img,
.ad-live ins,
.ad-live div {
  max-width: 100%;
}



/* Smartlink before play overlay */
.smart-player-shell {
  position: relative;
}

.smart-player-shell video {
  display: block;
}

.smart-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.18);
  border: 0;
  color: #fff;
}

.smart-player-shell.smart-unlocked .smart-play-overlay {
  display: none;
}

.smart-play-icon {
  width: clamp(68px, 11vw, 112px);
  height: clamp(68px, 11vw, 112px);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 55px rgba(255, 51, 102, 0.38);
  font-size: clamp(28px, 5vw, 46px);
  padding-left: 5px;
}



/* Video share buttons */
.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.watch-actions .btn {
  min-height: 40px;
}

.mini-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 9999;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18, 18, 26, 0.96);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  font-size: 14px;
}

.mini-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 560px) {
  .watch-actions .btn {
    flex: 1 1 calc(50% - 10px);
  }
}
