/* ========================================
   AnimeGo.su - Modern Anime Theme
   DLE Flow-based custom anime streaming UI
   ======================================== */

/* ---------- 1. CSS VARIABLES ---------- */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.85rem;
  --font-size-base: 0.9375rem;
  --font-size-lg: 1rem;
  --font-size-xl: 1.125rem;
  --fix-size-base: 1rem;
  --app-em: var(--font-size-lg);

  /* Accent: Violet-Pink (default) */
  --accent-violet: #7c3aed;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;

  --accent: var(--accent-violet);
  --accent-2: var(--accent-pink);
  --accent-grad: linear-gradient(135deg, var(--accent-violet) 0%, var(--accent-pink) 100%);
  --accent-grad-hover: linear-gradient(135deg, #6d28d9 0%, #db2777 100%);
  --accent-soft: rgba(124, 58, 237, 0.12);
  --accent-ink: #ffffff;

  /* Backgrounds - Dark Theme */
  --bg: #0a0a12;
  --bg-2: #0f0f1a;
  --surface: #151525;
  --surface-2: #1a1a2e;
  --surface-3: #202038;
  --surface-soft: #181828;
  --surface-sunk: #0d0d16;
  --surface-hover: #22223a;

  /* Text */
  --text: #e8e8f0;
  --text-2: #b8b8d0;
  --muted: #80809a;
  --muted-2: #60607a;

  /* Borders & Lines */
  --line: #252540;
  --line-2: #2e2e4a;
  --line-soft: rgba(124, 58, 237, 0.2);

  /* Status Colors */
  --status-going: #10b981;
  --status-completed: #06b6d4;
  --status-announce: #f59e0b;
  --status-paused: #f97316;
  --positive: #10b981;
  --negative: #ef4444;
  --warn: #f59e0b;
  --info: #3b82f6;

  /* Rating */
  --rating-shiki: #2d6e9e;
  --rating-kp: #ffa200;
  --rating-site: #7c3aed;
  --star: #fbbf24;
  --star-off: #3a3a55;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 4px 20px rgba(124, 58, 237, 0.35);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.25);

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Layout */
  --container: 1280px;
  --container-narrow: 960px;
  --header-h: 68px;
  --catbar-h: 52px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms var(--ease);
  --t-base: 200ms var(--ease);
  --t-slow: 350ms var(--ease-out);

  color-scheme: dark;
}

:root[data-accent="pink"] {
  --accent: #ec4899;
  --accent-2: #f43f5e;
  --accent-grad: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  --accent-grad-hover: linear-gradient(135deg, #db2777 0%, #e11d48 100%);
  --accent-soft: rgba(236, 72, 153, 0.12);
  --shadow-accent: 0 4px 20px rgba(236, 72, 153, 0.35);
  --shadow-glow: 0 0 40px rgba(236, 72, 153, 0.25);
}

:root[data-accent="cyan"] {
  --accent: #06b6d4;
  --accent-2: #3b82f6;
  --accent-grad: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --accent-grad-hover: linear-gradient(135deg, #0891b2 0%, #2563eb 100%);
  --accent-soft: rgba(6, 182, 212, 0.12);
  --shadow-accent: 0 4px 20px rgba(6, 182, 212, 0.35);
  --shadow-glow: 0 0 40px rgba(6, 182, 212, 0.25);
}

:root[data-theme="light"] {
  --bg: #f5f5fa;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f8fc;
  --surface-3: #f0f0f8;
  --surface-soft: #fafafe;
  --surface-sunk: #eeeef5;
  --surface-hover: #f0eef8;
  --text: #151525;
  --text-2: #404055;
  --muted: #6a6a85;
  --muted-2: #8a8aa5;
  --line: #e5e5f0;
  --line-2: #dddded;
  --line-soft: rgba(124, 58, 237, 0.15);
  --shadow-sm: 0 2px 8px rgba(20, 20, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 20, 40, 0.08);
  --shadow-lg: 0 8px 32px rgba(20, 20, 40, 0.1);
  --shadow-xl: 0 16px 48px rgba(20, 20, 40, 0.12);
  color-scheme: light;
}

/* ---------- 2. RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(236, 72, 153, 0.08), transparent);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
iframe { display: block; border: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-sunk); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: var(--radius-full); border: 2px solid var(--surface-sunk); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: auto; z-index: 999;
  padding: 8px 16px; background: var(--accent); color: #fff; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---------- 3. PRELOADER ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__inner { text-align: center; }
.preloader__logo {
  width: 72px; height: 72px; margin: 0 auto 24px;
  animation: pulse 1.5s ease-in-out infinite;
}
.preloader__logo svg { width: 100%; height: 100%; filter: drop-shadow(0 0 20px rgba(124,58,237,0.5)); }
.preloader__bar {
  width: 180px; height: 3px; background: var(--surface-3);
  border-radius: var(--radius-full); overflow: hidden; margin: 0 auto;
}
.preloader__bar span {
  display: block; width: 40%; height: 100%;
  background: var(--accent-grad);
  animation: slide 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ---------- 4. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-lg);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-base);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--sm { padding: 7px 14px; font-size: var(--font-size-xs); border-radius: var(--radius-md); }
.btn--sm svg { width: 15px; height: 15px; }
.btn--lg { padding: 14px 28px; font-size: var(--font-size-base); border-radius: var(--radius-xl); }
.btn--lg svg { width: 20px; height: 20px; }

.btn--primary {
  background: var(--accent-grad);
  color: #fff;
  border: 0;
  box-shadow: var(--shadow-accent);
}
.btn--primary:hover {
  background: var(--accent-grad-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(124,58,237,0.45);
}
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}
.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--line);
  transition: all var(--t-base);
  flex-shrink: 0;
}
.icon-button:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.icon-button svg { width: 20px; height: 20px; }

.icon-action {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color var(--t-fast), transform var(--t-fast);
  cursor: pointer;
}
.icon-action:hover { color: var(--accent); transform: scale(1.08); }
.icon-action.is-active { color: var(--accent-pink); }
.icon-action svg { width: 18px; height: 18px; }

/* ---------- 5. BADGES & CHIPS ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-2);
  line-height: 1.4;
}
.badge svg { width: 10px; height: 10px; }
.badge--new { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.badge--update { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; }
.badge--pin { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.badge--quality { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; }
.badge--type { background: rgba(6,182,212,0.15); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,0.3); }

.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chips__item,
.chips > a,
.chips > span {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  transition: all var(--t-fast);
  line-height: 1.4;
  cursor: pointer;
}
.chips > a:hover,
.chips__item:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.chips__item.is-active,
.chips > a.is-active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
}

.chips--category > a,
.chips--category .chips__item {
  background: rgba(124,58,237,0.12);
  color: var(--accent);
  border-color: rgba(124,58,237,0.25);
  font-weight: 600;
}
.chips--category > a:hover { background: var(--accent); color: #fff; }

.chips--status > span,
.chips--status--ongoing { color: var(--status-going); background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3); }
.chips--status--released { color: var(--status-completed); background: rgba(6,182,212,0.12); border-color: rgba(6,182,212,0.3); }
.chips--status--anons { color: var(--status-announce); background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); }

.chips--tags-mini > a,
.chips--tags-mini > span {
  padding: 3px 9px;
  font-size: 11px;
}

.chips--tags-lg > a,
.chips--lg > a,
.chips--lg > span {
  padding: 7px 14px;
  font-size: var(--font-size-sm);
}

/* ---------- 6. HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: ''; position: absolute; inset: 100% 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-violet), var(--accent-pink), transparent);
  opacity: 0.4;
}

.header-main {
  display: flex; align-items: center; gap: var(--sp-4);
  height: var(--header-h);
}
.header-left { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }

.menu-button { display: none; }
@media (max-width: 1024px) { .menu-button { display: inline-flex; } }

/* Brand */
.brand {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.brand__mark {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 4px 12px rgba(124,58,237,0.4));
  transition: transform var(--t-base);
}
.brand__mark svg { width: 100%; height: 100%; }
.brand:hover .brand__mark { transform: scale(1.05) rotate(-4deg); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__accent { color: var(--text); -webkit-text-fill-color: initial; }
.brand__tagline { font-size: 11px; color: var(--muted); font-weight: 500; }

/* Search */
.header-search {
  flex: 1; max-width: 520px; margin: 0 auto;
  position: relative;
}
@media (max-width: 860px) { .header-search { display: none; } }

.search-form {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 14px;
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  transition: all var(--t-base);
}
.search-form:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm);
}
.search-form__icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search-form input[type="search"] {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  font-size: var(--font-size-sm);
  color: var(--text);
  padding: 6px 0;
}
.search-form input::placeholder { color: var(--muted-2); }
.search-form__submit {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--accent-grad);
  color: #fff;
  border-radius: var(--radius-lg);
  transition: all var(--t-base);
  flex-shrink: 0;
}
.search-form__submit:hover { transform: scale(1.05); }
.search-form__submit svg { width: 16px; height: 16px; }

.search-suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 10;
}
.search-suggest__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.search-suggest__item:hover { background: var(--surface-2); }
.search-suggest__poster {
  width: 40px; height: 56px; flex-shrink: 0;
  border-radius: var(--radius-xs); overflow: hidden;
  background: var(--surface-3);
}

/* Header actions */
.header-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.header-actions .theme-moon { display: none; }
:root[data-theme="light"] .header-actions .theme-sun { display: none; }
:root[data-theme="light"] .header-actions .theme-moon { display: inline-block; }

/* Category bar */
.category-bar {
  border-top: 1px solid var(--line);
  background: rgba(21, 21, 37, 0.6);
}
.category-scroll-wrap { position: relative; }
.category-scroll {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  padding: 0 40px;
  margin: 0 -40px;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-scroll-fade {
  position: absolute; top: 0; right: 0; bottom: 0; width: 80px;
  background: linear-gradient(90deg, transparent, rgba(21,21,37,0.95));
  pointer-events: none;
}

.category-menu {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 4px;
  height: var(--catbar-h);
  min-width: max-content;
}
.category-menu__item { position: relative; }
.category-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--catbar-h);
  padding: 0 14px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: all var(--t-fast);
  position: relative;
}
.category-link svg { width: 16px; height: 16px; }
.category-link::after {
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: 10px;
  height: 2px; border-radius: 2px;
  background: var(--accent-grad);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-base);
}
.category-link:hover {
  color: var(--text);
}
.category-link:hover::after { transform: scaleX(1); }
.category-link.is-active {
  color: var(--accent);
}
.category-link.is-active::after { transform: scaleX(1); }

.category-link__count {
  padding: 1px 6px;
  font-size: 10px; font-weight: 600;
  background: var(--surface-3);
  color: var(--muted);
  border-radius: var(--radius-full);
}

/* ---------- 7. MOBILE MENU ---------- */
.mobile-menu { position: fixed; inset: 0; z-index: 200; }
.mobile-menu__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s var(--ease);
}
.mobile-menu__panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(340px, 88vw);
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  animation: slideInLeft 0.3s var(--ease-out);
  overflow: hidden;
}
.mobile-menu__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.brand--mobile .brand__mark { width: 36px; height: 36px; }
.brand--mobile .brand__name { font-size: 20px; }
.mobile-menu__search { padding: var(--sp-4); border-bottom: 1px solid var(--line); }
.mobile-menu__search .search-form { padding-left: 12px; height: 42px; }
.mobile-menu__nav { flex: 1; overflow-y: auto; padding: var(--sp-3); }
.mobile-nav { list-style: none; margin: 0; padding: 0; }
.mobile-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: all var(--t-fast);
}
.mobile-nav a:hover,
.mobile-nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.mobile-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.mobile-menu__foot { padding: var(--sp-4); border-top: 1px solid var(--line); }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideInLeft { from { transform: translateX(-100%); } }

/* ---------- 8. HERO / SLIDER ---------- */
.hero {
  padding: var(--sp-6) 0 var(--sp-8);
}
.hero-slider {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface-2);
  min-height: 380px;
}
.hero-slider > * { min-height: inherit; }
.hero-track {
  display: flex;
  width: 100%;
  will-change: transform;
}
.hero-slide {
  position: relative;
  width: 100%; flex-shrink: 0;
  min-height: 380px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-slide--default .hero-slide__bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a0a2e 0%, #2e1065 50%, #4a044e 100%);
}
.hero-slide--default .hero-slide__bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(124,58,237,0.5), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(236,72,153,0.4), transparent 50%);
}
.hero-slide__bg {
  position: absolute; inset: 0;
}
.hero-slide__bg img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.1) brightness(0.55);
}
.hero-slide::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 30%, rgba(10,10,18,0.85) 85%, var(--bg) 100%),
    linear-gradient(90deg, rgba(10,10,18,0.75) 0%, transparent 60%);
}
.hero-slide__content {
  position: relative; z-index: 1;
  padding: var(--sp-10) var(--sp-12);
  max-width: 680px;
  width: 100%;
}
@media (max-width: 768px) {
  .hero-slide__content { padding: var(--sp-8) var(--sp-5); }
  .hero-slider, .hero-slide { min-height: 320px; }
}

.hero-slide__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--accent-grad);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-accent);
}
.hero-slide__badge svg { width: 12px; height: 12px; }
.hero-slide__title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-3);
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.hero-slide__desc {
  font-size: var(--font-size-lg);
  color: rgba(255,255,255,0.8);
  margin: 0 0 var(--sp-6);
  line-height: 1.6;
  max-width: 540px;
}
.hero-slide__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

.hero-controls {
  position: absolute; bottom: var(--sp-5); right: var(--sp-8);
  display: flex; align-items: center; gap: var(--sp-4);
  z-index: 2;
}
@media (max-width: 640px) { .hero-controls { right: var(--sp-5); } }

.hero-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  color: #fff;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all var(--t-base);
}
.hero-btn:hover {
  background: var(--accent-grad);
  border-color: transparent;
  transform: scale(1.08);
}
.hero-btn svg { width: 18px; height: 18px; }
.hero-dots {
  display: flex; align-items: center; gap: 6px;
}
.hero-dots button {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.3);
  transition: all var(--t-base);
}
.hero-dots button.is-active {
  width: 24px;
  background: var(--accent-grad);
}

/* ---------- 9. FILTERS ---------- */
.filters-section {
  margin-bottom: var(--sp-6);
}
.filters-grid {
  display: flex; flex-direction: column; gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.filter-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.filter-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
}
.filter-chips { max-height: 40px; overflow-y: auto; }

.filter-select,
.filter-select-wrap select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: border-color var(--t-fast);
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2380809a' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.filter-select:focus,
.filter-select-wrap select:focus { border-color: var(--accent); }

/* ---------- 10. SECTIONS COMMON ---------- */
.site-main {
  padding-bottom: var(--sp-12);
}
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--sp-8);
  align-items: start;
}
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }
.layout__main { min-width: 0; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-4);
  margin: var(--sp-8) 0 var(--sp-5);
  flex-wrap: wrap;
}
.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
.section-title__dot {
  width: 6px; height: 26px;
  background: var(--accent-grad);
  border-radius: var(--radius-full);
  box-shadow: 0 0 12px rgba(124,58,237,0.5);
}
.section-title__dot--pink { background: linear-gradient(180deg, #ec4899, #be185d); box-shadow: 0 0 12px rgba(236,72,153,0.5); }
.section-title__dot--cyan { background: linear-gradient(180deg, #06b6d4, #075985); box-shadow: 0 0 12px rgba(6,182,212,0.5); }
.section-title__dot--amber { background: linear-gradient(180deg, #f59e0b, #b45309); box-shadow: 0 0 12px rgba(245,158,11,0.5); }
.section-title__dot--green { background: linear-gradient(180deg, #10b981, #047857); box-shadow: 0 0 12px rgba(16,185,129,0.5); }
.section-title__dot--violet { background: linear-gradient(180deg, #7c3aed, #4c1d95); }
.section-title .counter {
  margin-left: 8px;
  padding: 2px 10px;
  background: var(--surface-3);
  color: var(--muted);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
}
.section-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--font-size-sm);
}
.section-more {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text-2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: all var(--t-base);
}
.section-more:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.section-more svg { width: 14px; height: 14px; }

.section-intro {
  padding: var(--sp-6) 0 var(--sp-4);
}
.section-intro h1 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.section-intro p { color: var(--muted); margin: 0; }

.view-toggle {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 3px;
  gap: 2px;
}
.view-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  color: var(--muted);
  transition: all var(--t-fast);
}
.view-btn:hover { color: var(--text); }
.view-btn.is-active {
  background: var(--accent-grad);
  color: #fff;
}
.view-btn svg { width: 18px; height: 18px; }

/* ---------- 11. PAGETOOLS ---------- */
.pagetools {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) 0 var(--sp-3);
  flex-wrap: wrap;
}

/* ---------- 12. ANIME GRID & CARDS ---------- */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-5);
}
@media (max-width: 1400px) { .anime-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .anime-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .anime-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); } }
@media (max-width: 640px) { .anime-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); } }
@media (max-width: 380px) { .anime-grid { grid-template-columns: 1fr; } }

.anime-grid[data-view="list"] { grid-template-columns: 1fr; }
.anime-grid[data-view="list"] .anime-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--sp-4);
}
.anime-grid[data-view="list"] .anime-card__media { aspect-ratio: auto; }
.anime-grid[data-view="list"] .anime-card__image { height: 200px; }

.anime-grid--related {
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1200px) { .anime-grid--related { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) { .anime-grid--related { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .anime-grid--related { grid-template-columns: repeat(2, 1fr); } }

.anime-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--t-slow);
  display: flex; flex-direction: column;
}
.anime-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-soft);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  z-index: 2;
}

.anime-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 7;
  overflow: hidden;
  background: var(--surface-3);
}
.anime-card__image {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out), filter 0.3s var(--ease);
}
.anime-card:hover .anime-card__image {
  transform: scale(1.08);
  filter: saturate(1.1) brightness(0.5);
}
.anime-card__image--placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
}
.anime-card__image--placeholder svg { width: 42%; height: 42%; }

.anime-card__overlay {
  position: absolute; inset: 0;
  padding: var(--sp-3);
  display: flex; flex-direction: column;
  pointer-events: none;
}
.anime-card__overlay-top {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  flex-shrink: 0;
}
.anime-card__play {
  margin: auto;
  opacity: 0;
  transform: scale(0.7);
  transition: all var(--t-slow);
}
.anime-card:hover .anime-card__play {
  opacity: 1; transform: scale(1);
}
.play-btn {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: rgba(124,58,237,0.95);
  color: #fff;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 30px rgba(124,58,237,0.6), inset 0 0 0 4px rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
}
.play-btn--lg { width: 64px; height: 64px; }
.play-btn svg { width: 50%; height: 50%; margin-left: 6px; }

.anime-card__overlay-info {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  flex-shrink: 0;
}
.anime-card__rating,
.anime-card__episodes {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  background: rgba(10,10,18,0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.08);
}
.anime-card__rating svg { width: 12px; height: 12px; color: var(--star); }
.anime-card__rating--shiki svg { color: #42a5f5; }
.anime-card__episodes svg { width: 12px; height: 12px; color: var(--accent-cyan); }
.anime-card__season { color: var(--muted); font-weight: 500; }

.anime-card__body {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
  min-width: 0;
}
.anime-card__top {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  min-height: 22px;
}
.anime-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
  transition: color var(--t-fast);
}
.anime-card__title a:hover { color: var(--accent); }

.anime-card__original {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.anime-card__meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.anime-card__meta svg { width: 12px; height: 12px; }
.meta-item { display: inline-flex; align-items: center; gap: 4px; }
.meta-item--year { font-weight: 600; color: var(--text-2); }
.meta-item--type { font-weight: 600; color: var(--accent-cyan); }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); flex-shrink: 0; }

.anime-card__tags { min-height: 22px; }

.anime-card__voice {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  font-size: 11px;
  color: var(--text-2);
}
.anime-card__voice svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
.anime-card__voice span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}

.anime-card__actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 2px;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.card-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
}
.card-btn svg { width: 16px; height: 16px; }
.card-btn:hover { background: var(--accent-soft); }
.card-btn--watch { background: var(--accent-grad); color: #fff !important; }
.card-btn--watch:hover { transform: scale(1.08); box-shadow: var(--shadow-accent); }

/* ---------- 13. LOAD MORE ---------- */
.load-more-wrap {
  display: flex; justify-content: center;
  margin-top: var(--sp-8);
}
.load-more-btn { min-width: 200px; position: relative; }
.load-more-btn.is-loading { pointer-events: none; }
.load-more-btn.is-loading::after {
  content: ''; position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pagination-wrap { margin-top: var(--sp-6); }

/* ---------- 14. ANIME HERO (FULL STORY) ---------- */
.anime-hero {
  position: relative;
  margin-bottom: var(--sp-8);
  overflow: hidden;
}
.anime-hero__backdrop {
  position: absolute; inset: 0;
  z-index: 0;
}
.anime-hero__backdrop img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.2) brightness(0.28) blur(3px);
  transform: scale(1.1);
}
.anime-hero__backdrop-filter {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 0%, rgba(124,58,237,0.25), transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 50%, rgba(236,72,153,0.18), transparent 70%);
}
.anime-hero__backdrop-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,18,0.3) 0%, rgba(10,10,18,0.8) 70%, var(--bg) 100%);
}

.anime-hero__content {
  position: relative; z-index: 1;
  padding: var(--sp-12) 0;
}
.anime-hero__row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--sp-10);
  align-items: start;
}
@media (max-width: 900px) {
  .anime-hero__row {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
  .anime-hero__poster { max-width: 220px; margin: 0 auto; }
}

.poster-box {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl), 0 20px 60px rgba(0,0,0,0.5);
  background: var(--surface-2);
  aspect-ratio: 5 / 7;
}
.poster-box__image {
  width: 100%; height: 100%; object-fit: cover;
}
.poster-box__age {
  position: absolute; top: 12px; right: 12px;
  padding: 4px 10px;
  background: rgba(239,68,68,0.95);
  color: #fff;
  font-size: 12px; font-weight: 800;
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
}
.poster-box__status {
  position: absolute; left: 12px; bottom: 12px;
  padding: 5px 12px;
  font-size: 11px; font-weight: 700;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.poster-box__status--ongoing { background: rgba(16,185,129,0.95); color: #fff; }
.poster-box__status--released { background: rgba(6,182,212,0.95); color: #fff; }
.poster-box__status--anons { background: rgba(245,158,11,0.95); color: #fff; }

.anime-hero__info { min-width: 0; }
.anime-hero__badges {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: var(--sp-4);
}
.chips--new { background: linear-gradient(135deg, #10b981, #059669); color: #fff; border-color: transparent; }
.chips--pin { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; border-color: transparent; }
.chips--type { background: rgba(6,182,212,0.15); color: var(--accent-cyan); border-color: rgba(6,182,212,0.3); }
.chips--quality { background: rgba(124,58,237,0.15); color: var(--accent); border-color: rgba(124,58,237,0.3); }

.anime-hero__title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: #fff;
}
.anime-hero__title-original {
  font-size: var(--font-size-lg);
  font-weight: 400;
  color: var(--text-2);
  margin: 0 0 var(--sp-5);
  opacity: 0.8;
}

.anime-hero__ratings {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.rating-badge {
  display: inline-flex;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.rating-badge > a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  transition: background var(--t-fast);
}
.rating-badge:hover { border-color: var(--line-2); }
.rating-badge svg { width: 16px; height: 16px; }
.rating-badge__value {
  font-weight: 800;
  font-size: 15px;
}
.rating-badge__votes {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.rating-badge__label {
  padding-left: 10px;
  margin-left: 10px;
  border-left: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rating-badge--shiki svg { color: #42a5f5; }
.rating-badge--shiki .rating-badge__value { color: #42a5f5; }
.rating-badge--kp svg { color: var(--rating-kp); }
.rating-badge--kp .rating-badge__value { color: var(--rating-kp); }
.rating-badge--site svg { color: var(--star); }
.rating-badge--site .rating-badge__value { color: var(--text); }

.anime-hero__meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin-bottom: var(--sp-5);
}
@media (max-width: 640px) { .anime-hero__meta-grid { grid-template-columns: 1fr; } }
.meta-row {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  font-size: var(--font-size-sm);
}
.meta-row__label {
  flex-shrink: 0;
  width: 110px;
  color: var(--muted);
  font-weight: 500;
  padding-top: 1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.meta-row__label svg { width: 14px; height: 14px; color: var(--accent); }
.meta-row__value {
  color: var(--text);
  font-weight: 500;
  min-width: 0;
  word-break: break-word;
}
.meta-row__value--status-ongoing { color: var(--status-going); }
.meta-row__value--status-released { color: var(--status-completed); }
.meta-row__value--status-anons { color: var(--status-announce); }
.meta-row--next .meta-row__value { color: var(--warn); font-weight: 600; }

.anime-hero__genres {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.anime-hero__genres .meta-row__label { padding-top: 6px; }
.anime-hero__genres .chips { flex: 1; }

.anime-hero__actions {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.btn-fav.is-active {
  background: rgba(236,72,153,0.15);
  border-color: rgba(236,72,153,0.35);
  color: var(--accent-pink);
}

.anime-hero__voice {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.anime-hero__voice svg {
  width: 22px; height: 22px; flex-shrink: 0;
  color: var(--accent);
  margin-top: 2px;
}
.anime-hero__voice-info { flex: 1; min-width: 0; }
.voice-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  font-weight: 600;
}
.voice-value {
  display: block;
  font-weight: 600;
  color: var(--text);
  font-size: var(--font-size-base);
}
.voice-all { margin-top: 6px; }
.voice-all summary {
  cursor: pointer;
  color: var(--accent);
  font-size: var(--font-size-xs);
  font-weight: 600;
  list-style: none;
}
.voice-all summary::-webkit-details-marker { display: none; }
.voice-all[open] summary { margin-bottom: 6px; }
.voice-all__list {
  padding: var(--sp-3);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--text-2);
  line-height: 1.8;
}

/* ---------- 15. PLAYER SECTION ---------- */
.player-section { margin-bottom: var(--sp-8); }
.player-quality { margin-bottom: 0; }
.chips--quality-lg {
  padding: 7px 14px;
  font-size: var(--font-size-sm);
  gap: 6px;
}
.chips--quality-lg svg { width: 14px; height: 14px; }

.player-tabs {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: var(--sp-4);
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: fit-content;
}
.player-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--radius-md);
  transition: all var(--t-fast);
}
.player-tab svg { width: 16px; height: 16px; }
.player-tab:hover { color: var(--text); }
.player-tab.is-active {
  background: var(--accent-grad);
  color: #fff;
}

.player-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  position: relative;
}
.player-frame {
  width: 100%; height: 100%;
}
.player-frame iframe,
.player-frame video {
  width: 100% !important; height: 100% !important;
  border: 0;
}
.player-empty {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3);
  color: var(--muted);
  padding: var(--sp-8);
  text-align: center;
}
.player-empty svg { width: 64px; height: 64px; opacity: 0.4; margin-bottom: var(--sp-3); }
.player-empty h3 { margin: 0; font-size: 18px; color: var(--text-2); font-weight: 700; }
.player-empty p { margin: 0; font-size: var(--font-size-sm); max-width: 400px; }

.player-info-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.player-info-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--font-size-sm);
  color: var(--text-2);
}
.player-info-item svg { width: 16px; height: 16px; color: var(--accent); }

/* ---------- 16. EPISODES SECTION ---------- */
.episodes-section { margin-bottom: var(--sp-8); }
.episodes-actions { display: flex; gap: var(--sp-3); }
.episodes-search {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast);
}
.episodes-search:focus-within { border-color: var(--accent); }
.episodes-search svg { width: 16px; height: 16px; color: var(--muted); }
.episodes-search input {
  width: 100px;
  background: transparent; border: 0; outline: 0;
  font-size: var(--font-size-sm);
  color: var(--text);
}
.episodes-search input::-webkit-outer-spin-button,
.episodes-search input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.ep-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: all var(--t-fast);
  text-align: left;
  cursor: pointer;
}
.ep-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.ep-btn.is-active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
}
.ep-btn.is-watched {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.3);
}
.ep-btn.is-watched .ep-num { color: var(--status-going); }
.ep-btn.is-active.is-watched { background: var(--accent-grad); color: #fff; }
.ep-btn.is-active .ep-num,
.ep-btn.is-active .ep-sub { color: rgba(255,255,255,0.8); }
.ep-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.ep-sub {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- 17. ANIME DETAILS ---------- */
.anime-details { margin-bottom: var(--sp-8); }
.details-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--sp-8);
  align-items: start;
}
@media (max-width: 960px) { .details-layout { grid-template-columns: 1fr; } }

.anime-description {
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-base);
  line-height: 1.75;
  color: var(--text-2);
}
.anime-description p { margin: 0 0 1em; }
.anime-description p:last-child { margin-bottom: 0; }

.details-card {
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  margin-bottom: var(--sp-4);
}
.details-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.details-card__title::before {
  content: '';
  width: 4px; height: 16px;
  background: var(--accent-grad);
  border-radius: var(--radius-full);
}

.details-list { display: flex; flex-direction: column; gap: 10px; }
.details-list__row {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  font-size: 13px;
}
.details-list__label {
  flex-shrink: 0;
  width: 100px;
  color: var(--muted);
  font-weight: 500;
  padding-top: 1px;
}
.details-list__value {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}
.details-list__row--voices .details-list__value {
  line-height: 1.6;
}
.details-list__row--link a {
  color: var(--accent);
  font-weight: 600;
  transition: color var(--t-fast);
}
.details-list__row--link a:hover { color: var(--accent-pink); }

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot--ongoing { background: var(--status-going); box-shadow: 0 0 8px rgba(16,185,129,0.6); }
.status-dot--released { background: var(--status-completed); box-shadow: 0 0 8px rgba(6,182,212,0.6); }
.status-dot--anons { background: var(--status-announce); box-shadow: 0 0 8px rgba(245,158,11,0.6); }

/* ---------- 18. SCREENSHOTS ---------- */
.screenshots-section { margin-bottom: var(--sp-8); }
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
}
.screenshots-grid img,
.screenshots-grid a {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base);
  background: var(--surface-2);
  display: block;
}
.screenshots-grid img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* ---------- 19. STORY NAV ---------- */
.story-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin: var(--sp-8) auto;
}
@media (max-width: 700px) { .story-nav { grid-template-columns: 1fr; } }
.story-nav__item {
  display: flex; flex-direction: column;
  gap: 6px;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  transition: all var(--t-base);
  min-height: 80px;
}
.story-nav__item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.story-nav__item--next { text-align: right; }
.story-nav__label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.story-nav__item--next .story-nav__label { justify-content: flex-end; }
.story-nav__label svg { width: 14px; height: 14px; }
.story-nav__title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 20. SIDEBAR / WIDGETS ---------- */
.sidebar {
  display: flex; flex-direction: column;
  gap: var(--sp-5);
  position: sticky;
  top: calc(var(--header-h) + var(--catbar-h) + var(--sp-5));
}
.widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.widget__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  gap: var(--sp-3);
}
.widget__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.widget__head h2::before {
  content: '';
  width: 4px; height: 16px;
  background: var(--accent-grad);
  border-radius: var(--radius-full);
}
.widget__link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--accent);
}
.widget__link svg { width: 12px; height: 12px; }
.widget__link:hover { color: var(--accent-pink); }

.popular-list {
  list-style: none; margin: 0; padding: 0;
  counter-reset: popular;
}
.popular-item {
  position: relative;
  counter-increment: popular;
}
.popular-item__link {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  transition: background var(--t-fast);
  position: relative;
}
.popular-item + .popular-item .popular-item__link { border-top: 1px solid var(--line); }
.popular-item__link:hover { background: var(--surface-soft); }
.popular-item__link::before {
  content: counter(popular);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 800;
  border-radius: var(--radius-md);
}
.popular-item:nth-child(1) .popular-item__link::before { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.popular-item:nth-child(2) .popular-item__link::before { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #fff; }
.popular-item:nth-child(3) .popular-item__link::before { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.popular-item__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  transition: color var(--t-fast);
}
.popular-item__link:hover .popular-item__title { color: var(--accent); }
.popular-item__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.popular-item__meta > span { display: inline-flex; align-items: center; gap: 3px; }
.popular-item__meta svg { width: 12px; height: 12px; }

/* Tabs */
.tabs {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 2px;
}
.tabs__btn {
  padding: 6px 12px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}
.tabs__btn:hover { color: var(--text); }
.tabs__btn.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}
.tab-panel { padding: var(--sp-4) var(--sp-5); }
.tab-panel[hidden] { display: none; }

.archive-list {
  display: flex; flex-direction: column; gap: 4px;
  font-size: var(--font-size-sm);
}
.archive-list a {
  display: flex; justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: background var(--t-fast);
}
.archive-list a:hover { background: var(--surface-2); color: var(--accent); }
.archive-list a span:last-child { color: var(--muted); }

/* ---------- 21. SCHEDULE ---------- */
.schedule-section { margin-top: var(--sp-10); }
.schedule-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: var(--sp-5);
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.schedule-day {
  flex: 1; min-width: 60px;
  padding: 10px 8px;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--muted);
  border-radius: var(--radius-lg);
  transition: all var(--t-base);
}
.schedule-day:hover { color: var(--text); background: var(--surface); }
.schedule-day.is-active {
  background: var(--accent-grad);
  color: #fff;
}
.schedule-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.schedule-list > * { padding: var(--sp-5); }

/* ---------- 22. DISCUSSION / COMMENTS ---------- */
.discussion { margin-top: var(--sp-10); }
.thread {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
}

/* ---------- 23. FOOTER ---------- */
.site-footer {
  margin-top: var(--sp-12);
  background: var(--surface-sunk);
  border-top: 1px solid var(--line);
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-violet), var(--accent-pink), transparent);
  opacity: 0.5;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: var(--sp-8);
  padding: var(--sp-10) 0 var(--sp-8);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: var(--sp-6); } }

.footer-brand .brand { margin-bottom: var(--sp-4); }
.footer-brand p {
  margin: 0 0 var(--sp-5);
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.7;
  max-width: 380px;
}
.footer-brand__links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.soft-button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: var(--font-size-xs);
  font-weight: 600;
  transition: all var(--t-fast);
}
.soft-button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.soft-button svg { width: 14px; height: 14px; }

.footer-col h2 {
  margin: 0 0 var(--sp-4);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  font-size: var(--font-size-sm);
  color: var(--muted);
  transition: color var(--t-fast), padding-left var(--t-fast);
  padding-left: 0;
}
.footer-col a:hover { color: var(--accent); padding-left: 4px; }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-4);
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--font-size-xs);
}
.footer-bottom a { color: var(--text-2); transition: color var(--t-fast); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- 24. TO TOP ---------- */
.to-top {
  position: fixed; right: 24px; bottom: 24px;
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transform: translateY(16px);
  transition: all var(--t-base);
}
.to-top.is-visible {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.to-top:hover {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}
.to-top svg { width: 20px; height: 20px; }

/* ---------- 25. GATE (LOGIN/REGISTER) ---------- */
.gate {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--sp-8) var(--sp-5);
  position: relative;
  overflow: hidden;
}
.gate__bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 30% 30%, rgba(124,58,237,0.2), transparent),
    radial-gradient(ellipse 50% 40% at 70% 70%, rgba(236,72,153,0.15), transparent);
}
.gate__bg::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,58,237,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}
.gate__back {
  position: absolute; top: var(--sp-5); left: var(--sp-5);
  z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text-2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: all var(--t-fast);
}
.gate__back:hover { color: var(--accent); border-color: var(--accent); }
.gate__back svg { width: 16px; height: 16px; }
.gate__card {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  padding: var(--sp-8);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
}
.brand--gate {
  justify-content: center;
  margin-bottom: var(--sp-6);
}
.brand--gate .brand__name { font-size: 28px; }
.gate__card > * + * { margin-top: var(--sp-4); }
.gate__foot {
  margin-top: var(--sp-6);
  color: var(--muted);
  font-size: var(--font-size-xs);
  text-align: center;
  z-index: 1;
  position: relative;
}

/* ---------- 26. PLAYER MODAL ---------- */
.player-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5);
}
.player-modal__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s var(--ease);
}
.player-modal__content {
  position: relative; z-index: 1;
  width: min(1080px, 100%);
  background: #000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: popIn 0.25s var(--ease-out);
}
@keyframes popIn {
  from { transform: scale(0.95); opacity: 0; }
}
.player-modal__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  transition: all var(--t-fast);
}
.player-modal__close:hover { background: var(--negative); transform: rotate(90deg); }
.player-modal__close svg { width: 18px; height: 18px; }
.player-modal__body {
  width: 100%;
  aspect-ratio: 16 / 9;
}
.player-modal__body iframe {
  width: 100%; height: 100%;
}

/* ---------- 27. PRINT ---------- */
@media print {
  .site-header, .site-footer, .sidebar, .hero, .to-top, .player-section, .filters-section,
  .schedule-section, .anime-hero__actions, .anime-card__actions, .hero-controls {
    display: none !important;
  }
  .layout { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
}

/* ---------- 28. DLE SYSTEM COMPATIBILITY ---------- */
/* Engine.css integration overrides */
.fixed { /* DLE fixed/pinned badge wrapper */ }
.edit-note {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--line);
  font-size: var(--font-size-xs);
  color: var(--muted);
}
.edit-note b { color: var(--text-2); }

.fullstory__pages {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  text-align: center;
}

/* XFields content styling */
.xfvalue,
.xfield {
  color: inherit;
}

/* DLE default comment styles override */
.dle-comments, .dle-comment { background: transparent !important; }

/* ---------- 29. ANIMATIONS ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
}
.fade-in-up { animation: fadeInUp 0.5s var(--ease-out) backwards; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.3s; }
.stagger > *:nth-child(9) { animation-delay: 0.34s; }
.stagger > *:nth-child(10) { animation-delay: 0.38s; }

/* ---------- 30. MOTION REDUCED ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   31. CRITICAL UI FIXES (live site patches)
   ============================================================ */

/* A. Global hide-empty wrappers (used in module templates via {xfield}) */
[data-hide-empty]:empty { display: none !important; }
img[src=""], img:not([src]) { display: none !important; }

/* B. HEADER LOGIN FORM → dropdown (not inline) */
.header-user {
  position: relative;
}
.header-user > form,
.header-user > form[name="login"],
.header-user form {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--sp-4);
  box-shadow: var(--shadow-xl);
  z-index: 150;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.header-user:hover > form,
.header-user:focus-within > form,
.header-user.is-open > form {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Login opener (Войти button or link) */
.header-user > a[href*="do=register"],
.header-user > a[href*="do=lostpassword"],
.header-user > a[href*="do=login"],
.header-user > button,
.header-user > input[type="submit"],
.header-user > .login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: all var(--t-fast);
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}
.header-user > a[href*="do=register"]:hover,
.header-user > button:hover,
.header-user > .login-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.header-user form input[type="text"],
.header-user form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: all var(--t-fast);
  margin-bottom: 10px;
}
.header-user form input[type="text"]:focus,
.header-user form input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.header-user form label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.header-user form input[type="submit"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: 4px;
}
.header-user form input[type="submit"]:hover { filter: brightness(1.1); }
.header-user form > a[href] {
  display: block;
  font-size: 12px;
  color: var(--accent);
  margin-top: 10px;
  text-align: center;
}
.header-user form > a[href]:hover { text-decoration: underline; }
.header-user form br { display: none; } /* Kill DLE messy <br> */

/* Mobile login inline: stack clean */
@media (max-width: 1024px) {
  .header-user > form {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    width: 100%;
    padding: var(--sp-3);
    box-shadow: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-top: 10px;
    background: var(--surface-2);
  }
}

/* C. FILTERS CHIPS → wrap, not horizontal scroll single-line overflow */
.filter-chips {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px;
}
.filter-chips > a, .filter-chips > span {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  margin: 0;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  border: 1px solid var(--line);
  transition: all var(--t-fast);
  white-space: nowrap;
}
.filter-chips > a:hover,
.filter-chips > a.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
}

/* D. Sidebar tag chips wrap */
.sidebar .chips--tags,
.widget--tags .chips--tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sidebar .chips--tags > a,
.widget--tags .chips--tags > a {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--line);
  transition: all var(--t-fast);
}
.sidebar .chips--tags > a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* E. Engine.css override: .container lock */
.container.container,
body .container {
  max-width: var(--container);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--sp-5);
  padding-right: var(--sp-5);
  float: none;
}

/* F. DLE default: kill list bullets / padding in ol/ul within sidebar lists */
.popular-list, .category-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* G. VOTE widget styles */
.widget .vote-form,
.widget .vote,
#vote {
  padding: 0 16px 16px;
  font-size: 13px;
  color: var(--text-2);
}
.widget .vote h3 {
  font-size: 14px;
  margin: 0 0 12px;
  color: var(--text);
}
.widget .vote .poll-answer,
.widget .vote label {
  display: block;
  padding: 8px 10px;
  margin: 2px 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--t-fast);
}
.widget .vote .poll-answer:hover,
.widget .vote label:hover { background: var(--surface-2); }
.widget .vote input[type="submit"],
.widget #vote input[type="submit"] {
  padding: 9px 18px;
  background: var(--accent-grad);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.widget .vote-results-link,
.widget a[href*="poll=results"] {
  font-size: 12px;
  color: var(--accent);
  margin-left: 8px;
}

/* H. CALENDAR widget base */
.widget table.calendar,
.widget--archive table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: var(--text-2);
}
.widget--archive table td,
.widget--archive table th {
  padding: 6px 4px;
  text-align: center;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.widget--archive table a { color: var(--accent); font-weight: 700; }
.widget--archive table td:hover:not(:empty) { background: var(--surface-2); }

/* I. .feed .anime-grid inherit width when inside layout */
.feed.anime-grid {
  width: 100%;
  min-width: 0;
}

/* J. section-subtitle muted */
.section-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--font-size-sm);
}

/* K. PAGINATION */
.pagination-wrap {
  margin-top: var(--sp-6);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination-wrap a,
.pagination-wrap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--t-fast);
}
.pagination-wrap a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.pagination-wrap span.pagi_prev,
.pagination-wrap span.pagi_next,
.pagination-wrap span.pagecurrent {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
}

/* L. AUTH FORM STYLES (registration / lostpassword pages / gate pages) */
.auth-form {
  max-width: 460px;
  margin: var(--sp-8) auto;
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.auth-form::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent-grad);
}
.auth-form__title {
  margin: 0 0 var(--sp-2);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.auth-form__lead {
  margin: 0 0 var(--sp-6);
  color: var(--muted);
  font-size: var(--font-size-base);
  line-height: 1.6;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--sp-4);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
.form-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.form-req { color: var(--negative); font-weight: 700; }
.form-input,
.form-inline input[type="text"],
.form-inline input[type="email"],
.form-inline input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
  transition: all var(--t-fast);
  min-height: 44px;
}
.form-input:focus,
.form-inline input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface-2);
}
.form-inline {
  display: flex;
  gap: 8px;
}
.form-inline > :first-child { flex: 1; }
.soft-button,
.form-inline button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.soft-button:hover,
.form-inline button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: var(--sp-4);
  user-select: none;
}
.form-checkbox input {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-4);
}
.primary-button,
.form-actions button[type="submit"],
.form-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: 0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(124,58,237,0.25);
}
.primary-button:hover,
.form-actions button[type="submit"]:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(124,58,237,0.35);
}
.form-actions__hint {
  font-size: 12px;
  color: var(--muted);
}
.form-actions__hint a { color: var(--accent); font-weight: 600; }
.form-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}
.form-links a {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.form-links a:hover { text-decoration: underline; }

/* M. Captcha styles */
.c-captcha {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.c-captcha img {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  height: 44px;
}
.c-captcha input {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.c-captcha input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* N. Social login (used in login-form / header dropdown) */
.soc-login-title {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: center;
}
.soc-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: var(--sp-3);
}
.soc-links__item {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: all var(--t-fast);
}
.soc-links__item:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* O. User dropdown (authenticated header panel) */
.user-dropdown {
  position: relative;
}
.user-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.user-dropdown__toggle:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
}
.avatar--sm { width: 28px; height: 28px; }
.avatar--fallback { padding: 5px; color: var(--muted); }
.user-dropdown__name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--negative);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
}
.user-dropdown__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 150;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.user-dropdown:hover .user-dropdown__panel,
.user-dropdown:focus-within .user-dropdown__panel,
.user-dropdown.is-open .user-dropdown__panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.user-dropdown__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.user-dropdown__head .avatar { width: 48px; height: 48px; }
.user-dropdown__profile {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.user-dropdown__group {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 2px;
}
.user-dropdown__list {
  display: flex;
  flex-direction: column;
  padding: 8px;
}
.user-dropdown__list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--t-fast);
}
.user-dropdown__list a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.user-dropdown__count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.user-dropdown__list a:hover .user-dropdown__count { color: var(--accent); }
.user-dropdown__foot {
  padding: 12px;
  border-top: 1px solid var(--line);
}
.btn--full { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 12px; }

/* P. Header login toggle + form (guest mode) */
.header-login-toggle,
.header-register-link {
  padding: 8px 12px !important;
}
.header-login-form {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  box-shadow: var(--shadow-xl);
  z-index: 150;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.header-user:hover .header-login-form,
.header-user:focus-within .header-login-form,
.header-user.is-open .header-login-form {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.header-login-form__title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
  letter-spacing: -0.01em;
}
@media (max-width: 1024px) {
  .header-login-form {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    width: 100%;
    padding: var(--sp-3);
    box-shadow: none;
    border-radius: var(--radius-lg);
    margin-top: 10px;
  }
  .form-grid { grid-template-columns: 1fr; }
  .auth-form { padding: var(--sp-4); margin: var(--sp-5) var(--sp-3); }
}

/* Q. Gate-page wrapper (background gradient for auth pages) */
body[data-auth-page] {
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(124, 58, 237, 0.28), transparent 60%),
              radial-gradient(ellipse 60% 40% at 100% 100%, rgba(236, 72, 153, 0.22), transparent 55%),
              var(--bg);
}

