/* ═══════════════════════════════════════════════════════════════
   HENTAI HAVEN — Design System
   Dark premium theme with neon accents
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Orbitron:wght@400;700;900&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-card: #16161f;
  --bg-card-hover: #1e1e2d;
  --bg-overlay: rgba(10, 10, 15, 0.95);

  --text-primary: #e8e8f0;
  --text-secondary: #9090a8;
  --text-muted: #606078;

  --accent-primary: #c850f0;
  --accent-secondary: #6366f1;
  --accent-pink: #f472b6;
  --accent-blue: #38bdf8;
  --accent-green: #34d399;
  --accent-orange: #fb923c;

  --gradient-primary: linear-gradient(135deg, #c850f0 0%, #6366f1 100%);
  --gradient-card: linear-gradient(135deg, rgba(200, 80, 240, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
  --gradient-glow: linear-gradient(135deg, rgba(200, 80, 240, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);

  --border-color: rgba(255, 255, 255, 0.06);
  --border-active: rgba(200, 80, 240, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(200, 80, 240, 0.15);

  /* Layout */
  --rail-width: 180px;
  --bar-height: 100px;
  --header-height: 64px;
  --content-max-width: 1400px;
  --card-radius: 12px;

  /* Animation */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-pink); }

img { max-width: 100%; display: block; }

/* ─── Age Gate Overlay ──────────────────────────────────────── */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.age-gate.hidden {
  display: none;
}

.age-gate__card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  max-width: 460px;
  width: 90%;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.age-gate__icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.age-gate__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.age-gate__text {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
  line-height: 1.7;
}

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

.age-gate__btn {
  padding: 12px 32px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
}

.age-gate__btn--enter {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(200, 80, 240, 0.3);
}
.age-gate__btn--enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(200, 80, 240, 0.4);
}

.age-gate__btn--leave {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.age-gate__btn--leave:hover {
  background: var(--bg-card-hover);
}

/* ─── Header ────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
}

.header__logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.header__logo span {
  -webkit-text-fill-color: var(--text-muted);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 8px;
}

.logo-ai {
  background: linear-gradient(135deg, #00d4ff 0%, #c850f0 50%, #ff6ec4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  font-size: 26px;
  margin-right: 2px;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4));
  animation: aiPulse 3s ease-in-out infinite alternate;
}

@keyframes aiPulse {
  0% { filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.3)); }
  100% { filter: drop-shadow(0 0 12px rgba(200, 80, 240, 0.5)); }
}

.header__nav {
  display: flex;
  gap: 8px;
  list-style: none;
}

.header__nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all var(--transition-fast);
}
.header__nav a:hover,
.header__nav a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.header__search {
  position: relative;
}

.header__search input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 16px 8px 36px;
  color: var(--text-primary);
  font-size: 14px;
  width: 220px;
  transition: all var(--transition-base);
  outline: none;
}
.header__search input:focus {
  border-color: var(--accent-primary);
  width: 280px;
  box-shadow: 0 0 12px rgba(200, 80, 240, 0.15);
}

.header__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── 3-Column Ad Layout ────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--rail-width) 1fr var(--rail-width);
  min-height: calc(100vh - var(--header-height) - var(--bar-height));
  gap: 0;
}

/* ─── Ad Zones ──────────────────────────────────────────────── */
.sidebar-rail {
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.promo-zone {
  background: var(--bg-secondary);
  border: 1px dashed rgba(200, 80, 240, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  padding: 8px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.promo-zone--skyscraper {
  width: 160px;
  height: 600px;
}

.promo-zone--banner {
  width: 728px;
  max-width: 100%;
  height: 90px;
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  height: var(--bar-height);
}

.bottom-bar__close {
  position: absolute;
  right: 16px;
  top: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition-fast);
}
.bottom-bar__close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ─── Main Content Area ─────────────────────────────────────── */
.content {
  padding: 24px;
  padding-bottom: calc(var(--bar-height) + 24px);
}

.content__header {
  margin-bottom: 24px;
}

.content__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.content__subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ─── Tag Filter Bar ────────────────────────────────────────── */
.tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.tag-chip:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(200, 80, 240, 0.08);
}
.tag-chip.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}
.tag-chip__count {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
}
.tag-chip.active .tag-chip__count {
  background: rgba(255, 255, 255, 0.2);
}

/* ─── Post Card Grid ────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Skeleton loading cards */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  overflow: hidden;
}
.skeleton-card__image {
  aspect-ratio: 3 / 4;
  background: linear-gradient(110deg, var(--bg-tertiary) 8%, var(--bg-secondary) 18%, var(--bg-tertiary) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skeleton-card__body {
  padding: 12px;
}
.skeleton-card__line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(110deg, var(--bg-tertiary) 8%, var(--bg-secondary) 18%, var(--bg-tertiary) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  margin-bottom: 8px;
}
.skeleton-card__line--short { width: 60%; }
.skeleton-card__line--xs { width: 40%; height: 10px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card__image-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.card:hover .card__image {
  transform: scale(1.05);
}

.card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.9) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.card:hover .card__overlay {
  opacity: 1;
}

.card__image-count {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card__body {
  padding: 14px 16px;
}

.card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.card__creator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.card__tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.card__tag {
  font-size: 11px;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ─── Post Detail Page ──────────────────────────────────────── */
.post-detail {
  max-width: 1000px;
  margin: 0 auto;
}

.post-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all var(--transition-fast);
}
.post-detail__back:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.post-detail__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.post-detail__creator {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}
.post-detail__creator a {
  color: var(--accent-primary);
}

/* Gallery */
.gallery {
  margin-bottom: 32px;
}

.gallery__main {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--bg-tertiary);
  margin-bottom: 0;
  cursor: pointer;
}

.gallery__main-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.gallery__nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.gallery__nav-btn:hover {
  background: rgba(200, 80, 240, 0.6);
  transform: translateY(-50%) scale(1.1);
}
.gallery__nav-btn--prev { left: 12px; }
.gallery__nav-btn--next { right: 12px; }

.gallery__counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 5;
}

/* Thumbnail Strip Container */
.gallery__thumbs-wrap {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  padding: 12px 48px;
  margin-bottom: 16px;
}

.gallery__thumbs-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 2;
}
.gallery__thumbs-scroll-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}
.gallery__thumbs-scroll-btn--left { left: 8px; }
.gallery__thumbs-scroll-btn--right { right: 8px; }

.gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.gallery__thumbs::-webkit-scrollbar {
  display: none;
}

.gallery__thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  opacity: 0.5;
}
.gallery__thumb:hover {
  opacity: 0.85;
  border-color: rgba(200, 80, 240, 0.3);
}
.gallery__thumb.active {
  border-color: var(--accent-primary);
  opacity: 1;
  box-shadow: 0 0 16px rgba(200, 80, 240, 0.4);
}
.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── Auto-Play Controls ───────────────────────────────────── */
.autoplay-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

/* Thin progress bar along the bottom edge */
.autoplay-bar__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  transition: width 100ms linear;
  pointer-events: none;
  z-index: 2;
}

/* Play / Pause button — anchored left */
.autoplay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.autoplay-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.autoplay-btn.playing {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(200, 80, 240, 0.3);
}
.autoplay-btn__icon {
  font-size: 16px;
}

/* Separator */
.autoplay-sep {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  flex-shrink: 0;
}

/* Timer section — takes up remaining space */
.autoplay-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.autoplay-timer__label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.autoplay-timer__slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-tertiary);
  outline: none;
  cursor: pointer;
  min-width: 60px;
}
.autoplay-timer__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(200, 80, 240, 0.4);
  transition: transform var(--transition-fast);
}
.autoplay-timer__slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.autoplay-timer__slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(200, 80, 240, 0.4);
}

/* Toggle buttons (Repeat, Shuffle) */
.autoplay-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.autoplay-toggle:hover {
  border-color: var(--accent-secondary);
  color: var(--text-secondary);
}
.autoplay-toggle.active {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
  background: rgba(99, 102, 241, 0.1);
}
.autoplay-toggle__icon {
  font-size: 14px;
}

/* Countdown display */
.autoplay-countdown {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}
.autoplay-countdown.visible {
  opacity: 1;
}

/* Story Section */
.story-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 28px;
  margin-bottom: 24px;
}

.story-section__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-section__text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

/* ─── Story Header (title + narrator button) ────────────────── */
.story-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.story-section__header .story-section__title {
  margin-bottom: 0;
}

/* ─── Narrator Button ───────────────────────────────────────── */
.narrator-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(200, 80, 240, 0.15));
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 20px;
  color: var(--accent-cyan, #00d4ff);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}
.narrator-btn:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(200, 80, 240, 0.25));
  border-color: var(--accent-cyan, #00d4ff);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}
.narrator-btn.active {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(200, 80, 240, 0.3));
  border-color: var(--accent-cyan, #00d4ff);
}
.narrator-btn__icon { font-size: 16px; }

/* ─── Narrator Panel ────────────────────────────────────────── */
.narrator-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(15, 15, 30, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

/* Controls row */
.narrator-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.narrator-ctrl {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.narrator-ctrl:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  box-shadow: 0 0 10px rgba(200, 80, 240, 0.4);
}

/* Settings row */
.narrator-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.narrator-setting {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.narrator-setting label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 36px;
}
.narrator-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 11px;
  padding: 4px 8px;
  max-width: 200px;
  cursor: pointer;
}
.narrator-slider {
  width: 80px;
  accent-color: var(--accent-cyan, #00d4ff);
  cursor: pointer;
}
.narrator-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan, #00d4ff);
  min-width: 24px;
}

/* Progress bar */
.narrator-progress {
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}
.narrator-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00d4ff, #c850f0);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ─── Sentence Highlighting ─────────────────────────────────── */
.narrator-sentence {
  transition: all 0.3s ease;
  border-radius: 3px;
  padding: 1px 2px;
}
.narrator-sentence.narrator-active {
  background: rgba(0, 212, 255, 0.15);
  color: var(--text-primary);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
}

/* Tags Section on Post */
.post-tags {
  margin-bottom: 24px;
}

.post-tags__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.post-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-tag {
  padding: 5px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.post-tag:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.post-tag--character {
  color: var(--accent-green);
  border-color: rgba(52, 211, 153, 0.2);
}
.post-tag--character:hover {
  border-color: var(--accent-green);
}

/* ─── Lightbox ──────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.2); }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.lightbox__nav:hover { background: rgba(200, 80, 240, 0.4); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

/* ─── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding: 16px 0;
}

.pagination__btn {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.pagination__btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.pagination__btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}
.pagination__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ─── Footer ────────────────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: var(--bar-height);
}

.footer a { color: var(--text-secondary); }
.footer a:hover { color: var(--accent-primary); }

/* ─── Loading States ────────────────────────────────────────── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.loading-spinner::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card { animation: slideUp 0.4s ease backwards; }
.card:nth-child(1) { animation-delay: 0.02s; }
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.06s; }
.card:nth-child(4) { animation-delay: 0.08s; }
.card:nth-child(5) { animation-delay: 0.10s; }
.card:nth-child(6) { animation-delay: 0.12s; }
.card:nth-child(7) { animation-delay: 0.14s; }
.card:nth-child(8) { animation-delay: 0.16s; }
.card:nth-child(9) { animation-delay: 0.18s; }
.card:nth-child(10) { animation-delay: 0.20s; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar-rail { display: none; }
  .content { padding: 16px; }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .header__search { display: none; }
  .header__nav { gap: 2px; }
  .header__nav a {
    padding: 6px 10px;
    font-size: 13px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .promo-zone--banner {
    width: 320px;
    height: 50px;
  }

  .post-detail__title {
    font-size: 22px;
  }

  .gallery__thumb {
    width: 48px;
    height: 48px;
  }
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }
