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

:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface2: #242424;
  --border: #2e2e2e;
  --accent: #ff6b35;
  --accent-hover: #ff8c5a;
  --text: #e0e0e0;
  --text-muted: #888;
  --radius: 6px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

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

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav a {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  transition: background .15s, color .15s;
}

nav a:hover, nav a.active {
  background: var(--surface2);
  color: var(--accent);
}

/* ── Layout ── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ── Section title ── */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── Category chips on index ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.category-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.category-card .cat-name {
  font-weight: 600;
  font-size: 15px;
}

.category-card .cat-count {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

/* ── Video grid ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}

.video-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

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

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.video-card:hover .thumb-wrap img {
  transform: scale(1.05);
}

.duration-badge {
  position: absolute;
  bottom: 20px;
  right: 6px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
}

.thumb-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,.2);
}

.thumb-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.card-info {
  padding: 10px 12px 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.card-meta {
  color: var(--text-muted);
  font-size: 11px;
  display: flex;
  gap: 10px;
}

.card-meta span { display: flex; align-items: center; gap: 3px; }

/* ── Tags ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}

.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
}

.page-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: border-color .12s, color .12s;
}

.page-btn:hover, .page-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn:disabled { opacity: .35; cursor: default; }

/* ── Video player page ── */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

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

.embed-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.embed-wrap iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
}

.video-title-large {
  font-size: 18px;
  font-weight: 700;
  margin: 14px 0 8px;
  line-height: 1.4;
}

.video-stats {
  display: flex;
  gap: 18px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.likes-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 14px;
  overflow: hidden;
}
.likes-fill { height: 100%; background: var(--accent); }

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 11px;
}

.related-card {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 6px;
  transition: background .12s;
}
.related-card:hover { background: var(--surface2); }

.related-thumb {
  flex-shrink: 0;
  width: 110px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
  background: #111;
}

.related-info { flex: 1; min-width: 0; }

.related-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Breadcrumb ── */
.breadcrumb {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 20px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb span { color: var(--border); }

/* ── Thumbnails strip ── */
.thumb-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.thumb-strip img {
  width: 80px;
  height: 50px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .12s;
}

.thumb-strip img:hover { border-color: var(--accent); }

/* ── Author chip ── */
.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 10px 4px 6px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.author-chip .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
}

/* ── Loading / empty ── */
.loading, .empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Age gate ── */
#age-gate {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.age-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.age-box h2 { font-size: 24px; margin-bottom: 8px; }
.age-box p { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; line-height: 1.6; }

.age-btns { display: flex; gap: 12px; justify-content: center; }

.btn-enter {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-enter:hover { background: var(--accent-hover); }

.btn-leave {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 20px;
  margin-top: 60px;
}
