:root {
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-light: #a5b4fc;
  --accent: #f472b6;
  --success: #34d399;
  --bg: #1a1630;
  --bg-soft: #221c3d;
  --surface: #2a2448;
  --surface-alt: #332c55;
  --text: #f1eef9;
  --text-secondary: #c4bce0;
  --text-muted: #8b82a8;
  --border: #3d3560;
  --border-light: #342c52;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .2);
  --shadow-lg: 0 12px 28px rgb(0 0 0 / .35);
  --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --gradient-subtle: linear-gradient(135deg, #2d2650 0%, #3a2558 100%);
  --transition: .2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgb(99 102 241 / .28), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgb(236 72 153 / .18), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* AGE GATE */
.age-gate {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #120f24 0%, #1e1b4b 40%, #3b0764 100%);
}
.age-gate[hidden] { display: none; }
.age-gate-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px; max-width: 440px; width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.age-gate-logo {
  font-size: 28px; font-weight: 900; letter-spacing: -1px;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 8px;
}
.age-gate-icon { font-size: 48px; margin-bottom: 16px; }
.age-gate-box h2 { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.age-gate-box p { color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }
.age-gate-enter, .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: none;
  background: var(--gradient); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 14px rgb(99 102 241 / .35);
  transition: transform .2s, box-shadow .2s;
}
.age-gate-enter { width: 100%; padding: 14px 24px; font-size: 15px; }
.age-gate-enter:hover, .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgb(99 102 241 / .45); }
.age-gate-exit { display: inline-block; margin-top: 16px; color: var(--text-muted); font-size: 13px; }

/* HEADER */
.header {
  background: var(--gradient);
  color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 20px rgb(0 0 0 / .35);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: 64px;
  max-width: 1400px; margin: 0 auto; width: 100%;
}
.logo { font-size: 22px; font-weight: 900; letter-spacing: -.5px; color: #fff; white-space: nowrap; }
.logo span { opacity: .75; font-weight: 600; }
.header-search { flex: 1; max-width: 420px; margin: 0 auto; position: relative; }
.header-search input {
  width: 100%; padding: 10px 16px 10px 40px;
  background: rgb(255 255 255 / .15);
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: 10px; color: #fff; font-size: 14px; outline: none;
}
.header-search input::placeholder { color: rgb(255 255 255 / .65); }
.header-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: rgb(255 255 255 / .55); pointer-events: none;
}
.header-nav { display: flex; gap: 4px; flex-shrink: 0; }
.header-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: rgb(255 255 255 / .85);
  transition: background .2s;
}
.header-nav a:hover, .header-nav a.active { background: rgb(255 255 255 / .2); color: #fff; }
.burger { display: none; padding: 8px; flex-direction: column; gap: 4px; }
.burger span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }

/* CATEGORY BAR — wraps to fit viewport */
.category-bar {
  background: rgb(42 36 72 / .92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.category-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--surface-alt); color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.cat-chip:hover { border-color: var(--primary-light); color: #fff; background: #3b3270; }
.cat-chip.active {
  background: var(--gradient); color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgb(99 102 241 / .35);
}

/* SORT */
.sort-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; padding: 20px 0 12px;
}
.sort-bar h1 { font-size: 22px; font-weight: 800; }
.sort-bar h1 small, #totalCount { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-left: 8px; }
.sort-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-pill {
  padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary); background: var(--surface);
  border: 1px solid var(--border);
}
.sort-pill:hover { border-color: var(--primary-light); color: #fff; }
.sort-pill.active { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }

/* VIDEO GRID — responsive fill */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: clamp(12px, 2vw, 20px);
  padding: 8px 0 32px;
  width: 100%;
}
.video-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: transform .25s ease, box-shadow .25s ease;
  min-width: 0;
}
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.video-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb {
  position: relative; aspect-ratio: 16 / 9;
  background: var(--gradient-subtle); overflow: hidden;
}
.card-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .4s ease;
}
.card-thumb-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--text-muted);
}
.card-duration {
  position: absolute; bottom: 8px; right: 8px;
  background: rgb(0 0 0 / .75); color: #fff;
  padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600;
}
.card-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s; background: rgb(0 0 0 / .25);
}
.video-card:hover .card-play { opacity: 1; }
.card-play-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgb(255 255 255 / .92);
  display: flex; align-items: center; justify-content: center;
}
.card-play-btn svg { width: 20px; height: 20px; fill: var(--primary-dark); margin-left: 2px; }
.card-body { padding: 12px 14px 14px; }
.card-title {
  font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 8px;
}
.card-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.card-meta .rating { color: var(--success); font-weight: 600; }

/* VIDEO DETAIL */
.video-detail { padding: 24px 0 8px; }
.vd-player {
  position: relative; aspect-ratio: 16 / 9;
  background: #0b0914; border-radius: var(--radius); overflow: hidden; margin-bottom: 24px;
}
.vd-player img, .vd-poster-fallback {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #111;
}
.vd-watch {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgb(0 0 0 / .45);
}
.vd-watch:hover { background: rgb(0 0 0 / .58); }
.vd-watch-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 36px; border-radius: 14px;
  background: var(--gradient); color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: 0 8px 24px rgb(99 102 241 / .45);
}
.vd-watch-btn svg { width: 24px; height: 24px; fill: #fff; }
.vd-watch-sub { margin-top: 12px; color: rgb(255 255 255 / .75); font-size: 13px; }
.vd-info h1 { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.vd-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; font-size: 14px; color: var(--text-secondary); }
.vd-stats .stat-good { color: var(--success); }
.vd-cta { margin-bottom: 18px; }
.vd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.vd-tag {
  padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  background: var(--surface-alt); color: var(--primary-light); border: 1px solid var(--border);
}
.vd-tag:hover { border-color: var(--primary); color: #fff; }
.vd-disclaimer { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.7; }

.related-section { padding-bottom: 40px; }
.related-section[hidden] { display: none !important; }
.related-section h2 {
  font-size: 20px; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 2px solid var(--border);
}

/* COMMENTS */
.comments-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
}
.comments-panel h2 { font-size: 18px; margin-bottom: 16px; }
.comment-form { display: grid; gap: 10px; margin-bottom: 20px; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; outline: none;
}
.comment-form textarea { min-height: 90px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--primary); }
.comment-item {
  padding: 14px 0; border-top: 1px solid var(--border);
}
.comment-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; }
.comment-head span { color: var(--text-muted); }
.comment-item p { color: var(--text-secondary); font-size: 14px; }
.comments-empty { color: var(--text-muted); font-size: 14px; padding: 8px 0; }

/* PAGINATION */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 8px 0 40px; }
.page-btn {
  min-width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border);
}
.page-btn:hover { border-color: var(--primary-light); color: #fff; }
.page-btn.active { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* FOOTER */
.footer {
  margin-top: auto;
  background: rgb(20 16 36 / .95);
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px;
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
}
.footer-brand .footer-logo {
  font-size: 20px; font-weight: 900;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.footer-brand p { font-size: 13px; color: var(--text-muted); margin-top: 8px; max-width: 360px; line-height: 1.7; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-secondary); }
.footer-links a:hover { color: var(--primary-light); }
.footer-bottom {
  text-align: center; font-size: 12px; color: var(--text-muted);
  margin-top: 24px; padding: 20px 20px 0; border-top: 1px solid var(--border);
  max-width: 1400px; margin-left: auto; margin-right: auto; line-height: 1.8;
}

/* LEGAL PAGES */
.legal-page { padding: 36px 0 60px; max-width: 860px; }
.legal-page h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.legal-page .legal-updated { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.legal-page h2 { font-size: 18px; margin: 24px 0 10px; }
.legal-page p, .legal-page li { color: var(--text-secondary); font-size: 15px; margin-bottom: 12px; line-height: 1.75; }
.legal-page ul { padding-left: 20px; margin-bottom: 12px; }
.contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-top: 16px;
}
.contact-card a { color: var(--primary-light); font-weight: 600; }
.contact-card a:hover { text-decoration: underline; }

.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.loading { display: flex; align-items: center; justify-content: center; padding: 60px 0; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
}
@media (max-width: 768px) {
  .header-nav { display: none; }
  .burger { display: flex; }
  .header-search { max-width: none; }
  .sort-bar h1 { font-size: 18px; }
  .vd-info h1 { font-size: 20px; }
  .container { padding: 0 14px; }
  .category-inner { padding: 10px 14px; }
}
@media (max-width: 480px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 8px 10px 10px; }
  .card-title { font-size: 13px; }
}
