/* ============================================================
   CELESTIA — style.css  v8.0
   Premium Dark Anime Aesthetic · anime.korsan.surf
   Glassmorphism · Gradient Accents · Micro-animations
   ============================================================ */

/* ── 1. RESET & ROOT ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:where(button, input, select, textarea) {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

:where(ul, ol) {
  list-style: none;
}

:where(a) {
  text-decoration: none;
  color: inherit;
}

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

:root {
  /* — Dark Backgrounds — */
  --bg-page: #060810;
  --bg-surface: #0c1020;
  --bg-card: rgba(15, 20, 40, 0.65);
  --bg-card-solid: #0f1428;
  --bg-glass: rgba(15, 22, 50, 0.55);
  --bg-glass-light: rgba(255, 255, 255, 0.04);

  /* — Celestial Accent Palette — */
  --accent: #7aa2f7;
  --accent2: #bb86fc;
  --accent3: #f7768e;
  --accent-glow: rgba(122, 162, 247, 0.35);
  --gold: #e0af68;
  --green: #73daca;
  --cyan: #7dcfff;

  /* — Text — */
  --text: #e2e8f8;
  --text2: #8b9cc4;
  --text3: #525f7f;
  --text-inverse: #060810;

  /* — Borders — */
  --border: rgba(122, 162, 247, 0.10);
  --border2: rgba(122, 162, 247, 0.22);
  --border3: rgba(187, 134, 252, 0.18);

  /* — Typography — */
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* — Radii — */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 50px;

  /* — Shadows — */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--border);
  --shadow-hover: 0 16px 48px rgba(122, 162, 247, 0.15), 0 0 0 1px var(--border2);
  --shadow-glow: 0 0 30px rgba(122, 162, 247, 0.12);
  --shadow-modal: 0 32px 80px rgba(0, 0, 0, 0.65);

  /* — Transitions — */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-page);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(122, 162, 247, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 110%, rgba(187, 134, 252, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(122, 162, 247, 0.02) 0%, transparent 70%);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(122, 162, 247, 0.25);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(122, 162, 247, 0.4);
}

/* Focus ring */
:is(.btn-primary, .btn-outline, .hero-btn, .filter-chip, .icon-btn, .nav-link, .hero-arrow, .ctrl-btn, .ep-btn, .modal-close, .anime-card):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── 2. CANVAS STAR FIELD ────────────────────────────────── */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.70;
}

/* ── 3. HEADER ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 8, 16, 0.82);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo-mark {
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px var(--accent-glow));
  animation: starPulse 3s ease-in-out infinite;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text2);
  padding: 0.5rem 1rem;
  border-radius: var(--r-pill);
  transition: all 0.2s var(--ease-smooth);
  position: relative;
}

.nav-link:is(:hover, .active) {
  color: #fff;
  background: rgba(122, 162, 247, 0.1);
}

.nav-link.active {
  font-weight: 700;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-glass-light);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(122, 162, 247, 0.1);
  color: var(--accent);
  border-color: var(--border2);
}

.btn-outline {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border2);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: rgba(122, 162, 247, 0.08);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 1.4rem;
  border: none;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 18px rgba(122, 162, 247, 0.30);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(122, 162, 247, 0.45);
}

/* Mobile hamburger */
.hamburger-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ── 4. HERO CAROUSEL ────────────────────────────────────── */
.hero-section {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 1.5rem auto 0;
  padding: 0 2rem;
  overflow: hidden;
}

.hero-track {
  display: flex;
  width: 100%;
  overflow: hidden;
}

.hero-slide {
  position: relative;
  min-width: 100%;
  height: 480px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: var(--r-xl);
  cursor: pointer;
}

.hero-slide:not(.active) {
  display: none;
}

.hero-slide.active {
  display: flex;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.50;
  display: block;
  transition: transform 8s linear, opacity 0.6s;
  animation: kenBurns 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  0% {
    transform: scale(1.0) translate(0, 0);
  }

  100% {
    transform: scale(1.12) translate(-1.5%, -1%);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 3.5rem 3.5rem;
  max-width: 580px;
  background: linear-gradient(to right, rgba(6, 8, 16, 0.88) 0%, rgba(6, 8, 16, 0.4) 70%, transparent 100%);
  width: 100%;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.9rem;
  border-radius: var(--r-pill);
  background: rgba(122, 162, 247, 0.12);
  border: 1px solid rgba(122, 162, 247, 0.25);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.08;
  color: #fff;
  letter-spacing: -0.04em;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-weight: 400;
  opacity: 0.65;
  font-size: 1.4rem;
}

.hero-desc {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.65;
  margin-bottom: 1rem;
  max-width: 440px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.hero-stat {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.7rem;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 8px 30px rgba(122, 162, 247, 0.35);
}

.hero-btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 40px rgba(122, 162, 247, 0.50);
}

.hero-btn-secondary {
  padding: 0.75rem 1.5rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
}

.hero-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Hero arrows */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 8, 16, 0.65);
  backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-arrow:hover {
  background: rgba(122, 162, 247, 0.2);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}

.hero-prev {
  left: 3rem;
}

.hero-next {
  right: 3rem;
}

.hero-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 3.5rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.hero-dot {
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}

.hero-dot.active {
  background: var(--accent);
  width: 36px;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ── 5. CONTENT GRID ─────────────────────────────────────── */
.content-grid {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  gap: 1.75rem;
}

/* ── 5.5. LATEST EPISODES CAROUSEL ────────────────────────── */
.latest-scroll {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
  padding-bottom: 0.5rem;
}
.latest-scroll::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

.latest-ep-card {
  flex: 0 0 170px;
  scroll-snap-align: start;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  aspect-ratio: 2 / 3;
}
.latest-ep-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.latest-ep-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.latest-ep-card:hover .latest-ep-img {
  transform: scale(1.1);
}

.latest-ep-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 0.75rem 0.75rem;
  background: linear-gradient(to top, rgba(6, 8, 16, 0.95) 0%, rgba(6, 8, 16, 0.4) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  z-index: 2;
}

.latest-ep-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.latest-ep-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ── 6. SECTION UTILITIES ────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

:where(.section-title, .modal-title, .sidebar-name, .card-title) {
  font-family: var(--font-display);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.see-all {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.see-all:hover {
  opacity: 0.7;
}

.label-sm {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 0.75rem;
}

/* ── 7. LEFT COLUMN ──────────────────────────────────────── */
.left-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── 8. ARTWORK STRIP ────────────────────────────────────── */
.artwork-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.artwork-item {
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 2/3;
  position: relative;
  cursor: pointer;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s;
  border: 1px solid var(--border);
}

.artwork-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artwork-item:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border2);
}

.artwork-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 0.75rem 0.75rem;
  background: linear-gradient(to top, rgba(6, 8, 16, 0.92) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.artwork-item:hover .artwork-overlay {
  opacity: 1;
}

.artwork-title {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.artwork-attr {
  font-size: 0.65rem;
  color: var(--text3);
  margin-bottom: 0.15rem;
}

/* ── 9. SEARCH SECTION ───────────────────────────────────── */
.search-section {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.search-bar-wrap {
  position: relative;
  margin-top: 0.75rem;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-glass-light);
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  transition: all 0.2s;
}

.search-input::placeholder {
  color: var(--text3);
}

.search-input:focus {
  border-color: var(--accent);
  background: rgba(122, 162, 247, 0.05);
  box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.1);
}

.recent-searches {
  margin-top: 1rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.search-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border-radius: var(--r-pill);
  background: var(--bg-glass-light);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.search-pill:hover {
  background: rgba(122, 162, 247, 0.08);
  border-color: var(--border2);
  color: var(--accent);
}

/* ── 10. FILTER CHIPS ────────────────────────────────────── */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.genre-scroll {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 0.4rem;
  scrollbar-width: none;
}

.genre-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--bg-glass-light);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-chip:hover {
  border-color: var(--border2);
  color: var(--accent);
  background: rgba(122, 162, 247, 0.06);
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(122, 162, 247, 0.2), rgba(187, 134, 252, 0.15));
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(122, 162, 247, 0.15);
}

/* ── 11. LOADING BAR ─────────────────────────────────────── */
.loading-bar {
  display: none;
  justify-content: center;
  padding: 3rem;
}

.loading-bar.visible {
  display: flex;
}

.loading-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  animation: bounceDot 1.2s ease-in-out infinite;
}

:where(.loading-dots span:nth-child(1)) {
  animation-delay: 0s;
}

:where(.loading-dots span:nth-child(2)) {
  animation-delay: 0.12s;
}

:where(.loading-dots span:nth-child(3)) {
  animation-delay: 0.24s;
}

:where(.loading-dots span:nth-child(4)) {
  animation-delay: 0.36s;
}

:where(.loading-dots span:nth-child(5)) {
  animation-delay: 0.48s;
}

@keyframes bounceDot {

  0%,
  60%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.5;
  }

  30% {
    transform: translateY(-12px) scale(1.3);
    opacity: 1;
  }
}

/* ── 12. ANIME GRID ──────────────────────────────────────── */
.anime-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 1rem;
}

.anime-card {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s, border-color 0.35s;
  position: relative;
  backdrop-filter: blur(8px);
}

.anime-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--border2);
}

.anime-card:active {
  transform: scale(0.97);
}

.card-thumb {
  aspect-ratio: 2/3;
  overflow: hidden;
  position: relative;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-smooth);
}

.anime-card:hover .card-thumb img {
  transform: scale(1.08);
}

/* Score & episode badges */
.card-score,
.card-eps {
  position: absolute;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.card-score {
  top: 8px;
  right: 8px;
  background: rgba(6, 8, 16, 0.75);
  color: var(--gold);
}

.card-eps {
  bottom: 8px;
  left: 8px;
  background: rgba(6, 8, 16, 0.75);
  color: rgba(255, 255, 255, 0.8);
}

/* Play button overlay */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 8, 16, 0.9) 0%, rgba(6, 8, 16, 0.1) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.anime-card:hover .card-overlay {
  opacity: 1;
}

.card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(122, 162, 247, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s, transform 0.3s var(--ease-spring);
  box-shadow: 0 0 24px rgba(122, 162, 247, 0.4);
}

.anime-card:hover .card-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.card-play:hover {
  transform: translate(-50%, -50%) scale(1.12);
}

/* Card body */
.card-body {
  padding: 0.65rem 0.75rem 0.75rem;
}

.card-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.35rem;
}

.card-genre {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
}

.card-year {
  font-size: 0.65rem;
  color: var(--text3);
}

/* No results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text3);
}

.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* ── 13. SIDEBAR ─────────────────────────────────────────── */
.sidebar-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.sidebar-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 0.9rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
  backdrop-filter: blur(8px);
}

.sidebar-card:hover {
  transform: translateX(3px);
  border-color: var(--border2);
  box-shadow: var(--shadow-glow);
}

.sidebar-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(122, 162, 247, 0.15), rgba(187, 134, 252, 0.15));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.sidebar-card-body {
  flex: 1;
  min-width: 0;
}

.sidebar-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.sidebar-card-desc {
  font-size: 0.72rem;
  color: var(--text2);
  line-height: 1.5;
}

/* ── 14. FOOTER ──────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem 1.5rem;
}

.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand {}

.footer-brand .logo {
  margin-bottom: 0.75rem;
}

.footer-brand-desc {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.6;
  max-width: 280px;
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-link {
  font-size: 0.82rem;
  color: var(--text2);
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: 1360px;
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text3);
}

.footer-socials {
  display: flex;
  gap: 0.75rem;
}

.footer-social {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-glass-light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  transition: all 0.2s;
  cursor: pointer;
}

.footer-social:hover {
  color: var(--accent);
  border-color: var(--border2);
  background: rgba(122, 162, 247, 0.08);
}

.footer-social svg {
  width: 14px;
  height: 14px;
}

/* ── 15. REVEAL ANIMATION ────────────────────────────────── */
.reveal-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-section.in-view,
.reveal-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered card animations */
.anime-card {
  opacity: 0;
  animation: cardFadeIn 0.5s var(--ease-out) forwards;
}

.anime-card:nth-child(1) {
  animation-delay: 0.00s;
}

.anime-card:nth-child(2) {
  animation-delay: 0.04s;
}

.anime-card:nth-child(3) {
  animation-delay: 0.08s;
}

.anime-card:nth-child(4) {
  animation-delay: 0.12s;
}

.anime-card:nth-child(5) {
  animation-delay: 0.16s;
}

.anime-card:nth-child(6) {
  animation-delay: 0.20s;
}

.anime-card:nth-child(7) {
  animation-delay: 0.24s;
}

.anime-card:nth-child(8) {
  animation-delay: 0.28s;
}

.anime-card:nth-child(9) {
  animation-delay: 0.32s;
}

.anime-card:nth-child(10) {
  animation-delay: 0.36s;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── 16. KEYFRAMES ───────────────────────────────────────── */
@keyframes starPulse {

  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(122, 162, 247, 0.5));
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(187, 134, 252, 0.7));
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  100% {
    background-position: -200% 0;
  }
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* ── 17. TOAST ───────────────────────────────────────────── */
#toastContainer {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  font-size: 0.82rem;
  max-width: 340px;
  background: rgba(12, 16, 32, 0.95);
  border: 1px solid rgba(122, 162, 247, 0.2);
  color: var(--text2);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-error {
  border-color: rgba(247, 118, 142, 0.35);
  color: #ffaaaa;
}

.toast.toast-success {
  border-color: rgba(115, 218, 202, 0.4);
  color: #aaffee;
}

/* ── 18. LOAD MORE ───────────────────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 2rem 0 3rem;
}

.btn-load-more {
  padding: 0.75rem 2.5rem;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, rgba(122, 162, 247, 0.1), rgba(187, 134, 252, 0.1));
  border: 1px solid var(--border2);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.03em;
}

.btn-load-more:hover {
  background: linear-gradient(135deg, rgba(122, 162, 247, 0.2), rgba(187, 134, 252, 0.15));
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(122, 162, 247, 0.2);
}

.btn-load-more:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── 19. SKELETON LOADING ────────────────────────────────── */
.skeleton-card {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.skeleton-thumb {
  aspect-ratio: 2/3;
  background: linear-gradient(90deg, var(--bg-glass-light) 25%, rgba(255, 255, 255, 0.06) 50%, var(--bg-glass-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  margin: 0.75rem;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-glass-light) 25%, rgba(255, 255, 255, 0.06) 50%, var(--bg-glass-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text.short {
  width: 60%;
}

/* Stat badges */
.stat-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--text3);
}

.stat-mini svg {
  width: 12px;
  height: 12px;
}

/* ── 20. BODY — MODAL OPEN ───────────────────────────────── */
body.modal-open {
  overflow: hidden;
}

body.modal-open :is(.site-header, main) {
  filter: blur(3px);
}

/* ── 21. RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: 240px 1fr 220px;
    gap: 1.25rem;
  }
}

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

  .left-column {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .artwork-strip {
    flex: 1 1 200px;
  }

  .search-section {
    flex: 1 1 200px;
  }

  .sidebar {
    order: -1;
  }

  .sidebar-cards {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-card {
    flex: 1 1 220px;
  }

  .desktop-only-sidebar {
    display: none !important;
  }

  .hero-prev {
    left: 1.5rem;
  }

  .hero-next {
    right: 1.5rem;
  }

  .hero-content {
    padding: 2rem 2rem 2.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 901px) {
  .left-column .sidebar {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 1rem;
  }

  .main-nav {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .hero-section {
    padding: 0 1rem;
    margin-top: 1rem;
  }

  .hero-slide {
    height: 340px;
    border-radius: var(--r-lg);
  }

  .hero-content {
    padding: 1.5rem 1.5rem 2rem;
    max-width: 100%;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-desc {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
  }

  .hero-prev {
    left: 0.75rem;
  }

  .hero-next {
    right: 0.75rem;
  }

  .hero-arrow {
    width: 36px;
    height: 36px;
  }

  .hero-dots {
    left: 1.5rem;
    bottom: 1rem;
  }

  .content-grid {
    padding: 0 1rem;
  }

  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}