/* ============================================
   ANIME DIVE — Design System & Styles
   AnimeSuge-inspired dark theme
   Fully responsive across Desktop, Tablet & Mobile
   ============================================ */

/* ── Google Fonts are loaded via <link> in HTML <head> for zero render-blocking ── */

/* ── CSS Variables ── */
:root {
  /* Colors */
  --bg-primary: #09090d;
  --bg-secondary: #101017;
  --bg-card: #15151f;
  --bg-card-hover: #1c1c2b;
  --bg-surface: #191925;
  --bg-input: #1a1a27;
  --bg-overlay: rgba(9, 9, 13, 0.88);
  --bg-nav: rgba(14, 14, 22, 0.82);

  --accent-blue: #4f8cff;
  --accent-blue-hover: #6ba0ff;
  --accent-purple: #a855f7;
  --accent-purple-hover: #b96dff;
  --accent-gradient: linear-gradient(135deg, #4f8cff 0%, #a855f7 100%);
  --accent-glow: 0 0 24px rgba(79, 140, 255, 0.35);
  --accent-glow-purple: 0 0 24px rgba(168, 85, 247, 0.35);

  --text-primary: #f0f0f5;
  --text-secondary: #9da0b5;
  --text-muted: #9ca3af;
  --text-accent: var(--accent-blue);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-hover: rgba(79, 140, 255, 0.3);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --container-max: 1320px;
  --container-padding: 24px;
  --nav-height: 60px;
  --bottom-bar-height: 60px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.2, 0, 0, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-Index */
  --z-dropdown: 120;
  --z-navbar: 300;
  --z-bottom-bar: 310;
  --z-overlay: 400;
  --z-modal: 500;
  --z-back-to-top: 250;
  --z-toast: 600;
}

/* ── Theme: Crimson Sakura ── */
[data-theme="crimson"] {
  --accent-blue: #f43f5e;
  --accent-blue-hover: #fb7185;
  --accent-purple: #e11d48;
  --accent-purple-hover: #f43f5e;
  --accent-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --accent-glow: 0 0 24px rgba(244, 63, 94, 0.4);
  --accent-glow-purple: 0 0 24px rgba(225, 29, 72, 0.4);
  --text-accent: var(--accent-blue);
  --border-hover: rgba(244, 63, 94, 0.35);
}

/* ── Theme: Emerald Forest ── */
[data-theme="emerald"] {
  --accent-blue: #10b981;
  --accent-blue-hover: #34d399;
  --accent-purple: #059669;
  --accent-purple-hover: #10b981;
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --accent-glow: 0 0 24px rgba(16, 185, 129, 0.4);
  --accent-glow-purple: 0 0 24px rgba(5, 150, 105, 0.4);
  --text-accent: var(--accent-blue);
  --border-hover: rgba(16, 185, 129, 0.35);
}

/* ── Theme: Sunset Gold ── */
[data-theme="sunset"] {
  --accent-blue: #f59e0b;
  --accent-blue-hover: #fbbf24;
  --accent-purple: #d97706;
  --accent-purple-hover: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --accent-glow: 0 0 24px rgba(245, 158, 11, 0.4);
  --accent-glow-purple: 0 0 24px rgba(239, 68, 68, 0.4);
  --text-accent: var(--accent-blue);
  --border-hover: rgba(245, 158, 11, 0.35);
}

/* ── Theme: Midnight Purple ── */
[data-theme="midnight"] {
  --accent-blue: #c084fc;
  --accent-blue-hover: #d8b4fe;
  --accent-purple: #a855f7;
  --accent-purple-hover: #c084fc;
  --accent-gradient: linear-gradient(135deg, #c084fc 0%, #818cf8 100%);
  --accent-glow: 0 0 24px rgba(192, 132, 252, 0.45);
  --accent-glow-purple: 0 0 24px rgba(168, 85, 247, 0.45);
  --bg-primary: #06050f;
  --bg-secondary: #0b0a1a;
  --bg-card: #110f22;
  --bg-card-hover: #17152e;
  --bg-surface: #140f24;
  --bg-input: #150f26;
  --bg-nav: rgba(11, 10, 26, 0.85);
  --text-accent: var(--accent-blue);
  --border-hover: rgba(192, 132, 252, 0.35);
}

/* ── Theme Picker Panel ── */
.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
}

.theme-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
  box-shadow: var(--accent-glow);
}

.theme-btn svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.theme-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(21, 21, 31, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(79, 140, 255, 0.12);
  padding: 14px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: var(--z-dropdown);
}

.theme-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.theme-panel-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 0 2px;
}

.theme-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.theme-swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-surface);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
  white-space: nowrap;
}

.theme-swatch:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.theme-swatch.active {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 1px var(--accent-blue) inset;
}

.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.theme-wrapper {
  position: relative;
  flex-shrink: 0;
}



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

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

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

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

ul, ol {
  list-style: none;
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================
   FLOATING ISLAND PILL NAVBAR
   ============================================ */
.navbar-wrapper {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: var(--z-navbar);
  padding: 0 16px;
  pointer-events: none;
  display: flex;
  justify-content: center;
  width: 100%;
}

.navbar {
  pointer-events: auto;
  width: 100%;
  max-width: var(--container-max);
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(79, 140, 255, 0.12);
  transition: transform var(--transition-base), background var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.navbar.scrolled {
  background: rgba(10, 10, 16, 0.95);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(79, 140, 255, 0.2);
  border-color: rgba(79, 140, 255, 0.18);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 18px;
  gap: 16px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.navbar-logo .logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(79, 140, 255, 0.35);
  transition: transform var(--transition-fast);
}

.navbar-logo:hover .logo-icon {
  transform: rotate(-8deg) scale(1.05);
}

.navbar-logo .logo-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  letter-spacing: -0.4px;
}

/* ── Desktop Search Bar ── */
.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0 14px;
  height: 38px;
  transition: all var(--transition-base);
}

.search-bar:focus-within {
  border-color: var(--accent-blue);
  box-shadow: var(--accent-glow);
  background: #1e1e30;
}

.search-bar svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 0 10px;
  font-family: var(--font-family);
  min-width: 0;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

/* ── Desktop Search Dropdown ── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(21, 21, 31, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(79, 140, 255, 0.15);
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-smooth);
  z-index: var(--z-dropdown);
}

.search-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-subtle);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.highlighted {
  background: var(--bg-card-hover);
}

.search-result-item img {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg-surface);
}

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

.search-result-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-no-results {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Desktop Nav Links ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-link {
  padding: 7px 15px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 4px 14px rgba(79, 140, 255, 0.35);
}

/* ── Mobile Search Button in Navbar ── */
.navbar-mobile-search-btn {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.navbar-mobile-search-btn:active {
  transform: scale(0.92);
}

.navbar-mobile-search-btn svg {
  width: 17px;
  height: 17px;
}

/* ============================================
   MOBILE BOTTOM NAVIGATION BAR
   ============================================ */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(12, 12, 18, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
  z-index: var(--z-bottom-bar);
}

.mobile-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--bottom-bar-height);
  padding: 0 4px;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
  padding: 2px 0;
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-base), color var(--transition-fast);
}

.bottom-nav-item.active {
  color: var(--accent-blue);
}

.bottom-nav-item.active svg {
  transform: translateY(-1px) scale(1.08);
  color: var(--accent-blue);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 3px;
  width: 14px;
  height: 2.5px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--accent-blue);
}

/* ============================================
   MOBILE SEARCH OVERLAY SHEET
   ============================================ */
.mobile-search-modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 13, 0.97);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-smooth);
  padding-top: env(safe-area-inset-top, 0px);
}

.mobile-search-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(16, 16, 24, 0.7);
}

.mobile-search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0 14px;
  height: 42px;
}

.mobile-search-bar:focus-within {
  border-color: var(--accent-blue);
  box-shadow: var(--accent-glow);
}

.mobile-search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mobile-search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 0 10px;
  font-family: var(--font-family);
  min-width: 0;
}

.mobile-search-bar input::placeholder {
  color: var(--text-muted);
}

.mobile-search-close {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  flex-shrink: 0;
}

.mobile-search-close svg {
  width: 18px;
  height: 18px;
}

.mobile-search-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-search-chips-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.mobile-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mobile-search-chip {
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.mobile-search-chip:active {
  background: rgba(79, 140, 255, 0.2);
  color: #fff;
  border-color: var(--accent-blue);
}

.mobile-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  width: 100%;
  height: 520px;
  margin-top: 82px;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  filter: blur(2px) brightness(0.4);
  transform: scale(1.04);
  transition: transform 6s ease-out;
  overflow: hidden;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: blur(2px) brightness(0.4);
  transform: scale(1.04);
  transition: transform 6s ease-out;
}

.hero-slide.active .hero-bg,
.hero-slide.active .hero-bg-img {
  transform: scale(1);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(9, 9, 13, 0.96) 0%,
    rgba(9, 9, 13, 0.75) 45%,
    rgba(9, 9, 13, 0.25) 75%,
    rgba(9, 9, 13, 0.6) 100%
  );
}

.hero-gradient::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg-primary), transparent);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  max-width: 600px;
  padding: 0 var(--container-padding);
  margin: 0 auto 0 calc((100vw - var(--container-max)) / 2 + var(--container-padding));
}

@media (max-width: 1400px) {
  .hero-content {
    margin-left: var(--container-padding);
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(79, 140, 255, 0.15);
  border: 1px solid rgba(79, 140, 255, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  width: fit-content;
  backdrop-filter: blur(10px);
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 12px;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.hero-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
}

.hero-meta-item svg {
  width: 13px;
  height: 13px;
  color: var(--accent-blue);
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  box-shadow: 0 6px 20px rgba(79, 140, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(79, 140, 255, 0.55);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  backdrop-filter: blur(10px);
  transition: all var(--transition-base);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Hero Indicators */
.hero-indicators {
  position: absolute;
  bottom: 30px;
  right: calc((100vw - var(--container-max)) / 2 + var(--container-padding));
  display: flex;
  gap: 6px;
  z-index: 3;
}

@media (max-width: 1400px) {
  .hero-indicators {
    right: var(--container-padding);
  }
}

.hero-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all var(--transition-base);
}

.hero-indicator.active {
  width: 28px;
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue);
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section {
  padding: 36px 0;
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .title-accent {
  width: 4px;
  height: 20px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

/* ============================================
   TRENDING ROW (Horizontal Scroll)
   ============================================ */
.trending-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.trending-row::-webkit-scrollbar {
  display: none;
}

.trending-card {
  flex-shrink: 0;
  width: 180px;
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-smooth);
}

.trending-card:hover {
  transform: translateY(-4px);
}

.trending-card .card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.trending-card:hover .card-image-wrap {
  border-color: var(--accent-blue);
  box-shadow: var(--accent-glow);
}

.trending-card .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.trending-card:hover .card-image {
  transform: scale(1.05);
}

.trending-card .card-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 9, 13, 0.85) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.trending-card:hover .card-image-wrap::after {
  opacity: 1;
}

.trending-card .card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px);
  transition: all var(--transition-smooth);
}

.trending-card:hover .card-overlay {
  opacity: 1;
  transform: translateY(0);
}

.card-play-btn {
  width: 38px;
  height: 38px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 140, 255, 0.45);
}

.card-play-btn svg {
  width: 16px;
  height: 16px;
  margin-left: 2px;
}

.trending-card .rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.trending-card .card-ep-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 7px;
  background: rgba(9, 9, 13, 0.8);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trending-card .card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trending-card .card-genre {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ============================================
   BROWSE GRID (Strict 2-Col on Mobile)
   ============================================ */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
  width: 100%;
}

.anime-card {
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-smooth);
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
  display: flex;
  flex-direction: column;
}

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

.anime-card:hover {
  transform: translateY(-5px);
}

.anime-card .card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 8px;
  border: 1.5px solid transparent;
  background: var(--bg-surface);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.anime-card:hover .card-image-wrap {
  border-color: var(--accent-blue);
  box-shadow: var(--accent-glow);
}

.anime-card .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.anime-card:hover .card-image {
  transform: scale(1.05);
}

.anime-card .card-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 9, 13, 0.85) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.anime-card:hover .card-image-wrap::after {
  opacity: 1;
}

.anime-card .card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(6px);
  transition: all var(--transition-smooth);
}

.anime-card:hover .card-overlay {
  opacity: 1;
  transform: translateY(0);
}

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

.card-overlay-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-overlay-genre {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1px;
}

.anime-card .status-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  padding: 2px 7px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.anime-card .ep-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  padding: 2px 7px;
  background: rgba(9, 9, 13, 0.8);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 3px;
}

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

.anime-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.anime-card .card-views {
  display: flex;
  align-items: center;
  gap: 3px;
}

.anime-card .card-views svg {
  width: 11px;
  height: 11px;
}

/* ============================================
   GENRE FILTER PILLS
   ============================================ */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  width: 100%;
}

.filter-pill {
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.filter-pill.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(79, 140, 255, 0.35);
}

/* ============================================
   SKELETON LOADERS
   ============================================ */
.skeleton {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-card {
  display: flex;
  flex-direction: column;
}

.skeleton-card .skeleton-image {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
}

.skeleton-card .skeleton-title {
  height: 14px;
  width: 80%;
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
}

.skeleton-card .skeleton-meta {
  height: 10px;
  width: 50%;
  border-radius: var(--radius-sm);
}

.skeleton-trending {
  flex-shrink: 0;
  width: 180px;
}

.skeleton-trending .skeleton-image {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
}

.skeleton-trending .skeleton-title {
  height: 14px;
  width: 75%;
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
}

.skeleton-trending .skeleton-meta {
  height: 10px;
  width: 45%;
  border-radius: var(--radius-sm);
}

.hero-skeleton {
  height: 520px;
  margin-top: 82px;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.hero-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

/* ============================================
   ANIME DETAIL PAGE
   ============================================ */
.detail-page {
  margin-top: 82px;
  min-height: calc(100vh - 82px);
  width: 100%;
}

.detail-banner {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
}

.detail-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(10px) brightness(0.35);
  transform: scale(1.1);
}

.detail-banner-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(9, 9, 13, 0.3) 0%,
    rgba(9, 9, 13, 0.85) 65%,
    var(--bg-primary) 100%
  );
}

.detail-info {
  position: relative;
  z-index: 2;
  margin-top: -160px;
  padding-bottom: 40px;
}

.detail-info-inner {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.detail-cover {
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 2/3;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  border: 3px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-surface);
}

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

.detail-text {
  flex: 1;
  padding-top: 36px;
  min-width: 0;
}

.detail-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.detail-tag {
  padding: 4px 12px;
  background: rgba(79, 140, 255, 0.12);
  border: 1px solid rgba(79, 140, 255, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-blue);
}

.detail-tag.status-tag {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.25);
  color: var(--accent-purple);
}

.detail-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.detail-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.detail-stat svg {
  width: 15px;
  height: 15px;
  color: var(--accent-blue);
}

.detail-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 760px;
}

/* ── Episodes Section ── */
.episodes-section {
  padding-bottom: 50px;
  width: 100%;
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  width: 100%;
}

.episode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
}

.episode-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(3px);
}

.episode-card:active {
  transform: scale(0.98);
}

.episode-num {
  width: 38px;
  height: 38px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(79, 140, 255, 0.3);
}

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

.episode-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-sublabel {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.episode-download-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 140, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--accent-blue);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.episode-card:hover .episode-download-icon {
  background: rgba(79, 140, 255, 0.2);
}

.episode-download-icon svg {
  width: 16px;
  height: 16px;
}

.no-episodes {
  padding: 40px 16px;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
}

.no-episodes p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.no-episodes svg {
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  margin-bottom: 10px;
  opacity: 0.5;
}

/* ── Similar Anime ── */
.similar-section {
  padding-bottom: 60px;
  width: 100%;
}

/* ============================================
   CLEAN MINIMAL FOOTER
   ============================================ */
.footer {
  padding: 40px 0 30px;
  border-top: 1px solid var(--border-color);
  background: rgba(12, 12, 18, 0.6);
  width: 100%;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.footer-brand-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
}

.footer-logo .logo-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-nav a:hover {
  color: var(--accent-blue);
}

.footer-disclaimer {
  max-width: 640px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 10px;
}

.footer-bottom {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: var(--z-back-to-top);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-smooth);
  box-shadow: 0 6px 20px rgba(79, 140, 255, 0.4);
  cursor: pointer;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px) scale(1.05);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   ACCESSIBLE SKIP LINK
   ============================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent-blue);
  color: #ffffff !important;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 10000;
  transition: top 0.2s ease;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid #ffffff;
}

/* ── Page Loader (Disabled to prevent render-blocking FCP/LCP) ── */
.page-loader {
  display: none !important;
}

/* ── Browse Load More ── */
.browse-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 36px;
  margin-bottom: 20px;
  width: 100%;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-load-more:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--accent-glow);
}

.btn-load-more svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.btn-load-more:hover svg {
  transform: translateY(2px);
}

/* ── Legal & Static Pages ── */
.page-section {
  padding-top: 120px;
  padding-bottom: 60px;
  min-height: calc(100vh - 200px);
}

.page-header {
  margin-bottom: 30px;
  text-align: center;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.page-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1.05rem;
}

.page-content h2 {
  color: #fff;
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.page-content h3 {
  color: #fff;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.page-content p {
  margin-bottom: 15px;
}

.page-content ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 15px;
}

.page-content a {
  color: var(--accent-blue);
}

.page-content a:hover {
  text-decoration: underline;
}

.footer-legal-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer-legal-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.footer-legal-nav a:hover {
  color: var(--accent-blue);
}

/* ============================================
   RESPONSIVE (TABLET & MOBILE FINE-TUNING)
   ============================================ */

/* ── Tablet (<= 1024px) ── */
@media (max-width: 1024px) {
  :root {
    --container-padding: 20px;
  }

  .hero {
    height: 440px;
    margin-top: 76px;
  }

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

  .browse-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }

  .detail-page {
    margin-top: 76px;
  }

  .detail-cover {
    width: 180px;
  }

  .detail-title {
    font-size: 1.85rem;
  }
}

/* ── Mobile / Small Screens (<= 768px) ── */
@media (max-width: 768px) {
  :root {
    --container-padding: 14px;
    --nav-height: 52px;
    --bottom-bar-height: 58px;
  }

  body {
    padding-bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom, 0px) + 16px);
  }

  .page-content {
    padding: 24px;
  }
  .page-title {
    font-size: 2rem;
  }
  .footer-legal-nav {
    gap: 12px;
  }

  /* Floating Navbar */
  .navbar-wrapper {
    top: 8px;
    padding: 0 10px;
  }

  .navbar {
    height: var(--nav-height);
  }

  .navbar-inner {
    padding: 0 14px;
  }

  .navbar-logo {
    font-size: 1.1rem;
  }

  .navbar-logo .logo-icon {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }

  .search-wrapper,
  .nav-links {
    display: none;
  }

  .navbar-mobile-search-btn {
    display: flex;
  }

  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-bar {
    display: block;
  }

  /* Hero Section Mobile */
  .hero {
    height: 360px;
    margin-top: 68px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .hero-content {
    max-width: 100%;
    margin-left: 0;
    padding: 0 14px;
    justify-content: flex-end;
    padding-bottom: 24px;
  }

  .hero-badge {
    font-size: 0.68rem;
    padding: 3px 9px;
    margin-bottom: 6px;
  }

  .hero-title {
    font-size: 1.45rem;
    line-height: 1.2;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-description {
    display: none;
  }

  .hero-meta {
    gap: 6px;
    margin-bottom: 12px;
  }

  .hero-meta-item {
    font-size: 0.7rem;
    padding: 2px 7px;
  }

  .hero-actions {
    gap: 8px;
  }

  .btn-primary, .btn-secondary {
    padding: 8px 16px;
    font-size: 0.8rem;
    height: 36px;
  }

  .btn-primary svg, .btn-secondary svg {
    width: 14px;
    height: 14px;
  }

  .hero-indicators {
    bottom: 12px;
    right: 14px;
    gap: 4px;
  }

  .hero-indicator {
    width: 6px;
    height: 6px;
  }

  .hero-indicator.active {
    width: 18px;
  }

  /* Section Spacing */
  .section {
    padding: 24px 0;
  }

  .section-header {
    margin-bottom: 12px;
  }

  .section-title {
    font-size: 1.15rem;
  }

  /* Trending Row Mobile */
  .trending-row {
    gap: 10px;
    padding-bottom: 4px;
  }

  .trending-card {
    width: 130px;
  }

  .trending-card .card-image-wrap {
    margin-bottom: 6px;
    border-radius: var(--radius-md);
  }

  .trending-card .rank-badge {
    width: 20px;
    height: 20px;
    font-size: 0.62rem;
    top: 6px;
    left: 6px;
  }

  .trending-card .card-ep-badge {
    font-size: 0.6rem;
    padding: 2px 5px;
    top: 6px;
    right: 6px;
  }

  .trending-card .card-title {
    font-size: 0.78rem;
  }

  .trending-card .card-genre {
    font-size: 0.68rem;
  }

  /* Genre Filter Pills Mobile */
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 8px 2px;
    margin-bottom: 14px;
    gap: 6px;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    padding: 5px 13px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  /* BROWSE GRID: STRICT 2 ANIME PER ROW */
  .browse-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    width: 100%;
  }

  .anime-card {
    width: 100%;
  }

  .anime-card .card-image-wrap {
    margin-bottom: 6px;
    border-radius: var(--radius-md);
  }

  .anime-card .status-badge {
    font-size: 0.58rem;
    padding: 2px 6px;
    top: 6px;
    left: 6px;
  }

  .anime-card .ep-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    top: 6px;
    right: 6px;
  }

  .anime-card .card-title {
    font-size: 0.78rem;
    line-height: 1.25;
    min-height: 2.5em;
  }

  .anime-card .card-meta {
    font-size: 0.68rem;
    margin-top: 2px;
  }

  /* ANIME DETAIL PAGE MOBILE */
  .detail-page {
    margin-top: 68px;
    min-height: calc(100vh - 68px);
  }

  .detail-banner {
    height: 200px;
  }

  .detail-info {
    margin-top: -90px;
    padding-bottom: 28px;
  }

  .detail-info-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }

  .detail-cover {
    width: 135px;
    border-radius: var(--radius-lg);
    border-width: 2px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  }

  .detail-text {
    padding-top: 0;
    width: 100%;
  }

  .detail-title {
    font-size: 1.35rem;
    line-height: 1.25;
    margin-bottom: 8px;
  }

  .detail-tags {
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
  }

  .detail-tag {
    font-size: 0.7rem;
    padding: 3px 9px;
  }

  .detail-stats {
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
  }

  .detail-stat {
    font-size: 0.72rem;
  }

  .detail-description {
    text-align: left;
    font-size: 0.82rem;
    line-height: 1.6;
    background: var(--bg-card);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
  }

  /* Episodes Mobile */
  .episodes-section {
    padding-bottom: 36px;
  }

  .episodes-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .episode-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .episode-num {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
  }

  .episode-label {
    font-size: 0.8rem;
  }

  .episode-sublabel {
    font-size: 0.68rem;
  }

  .episode-download-icon {
    width: 30px;
    height: 30px;
  }

  .episode-download-icon svg {
    width: 14px;
    height: 14px;
  }

  /* Similar Anime Grid Mobile: 2 per row */
  #similar-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Back to top on mobile */
  .back-to-top {
    bottom: calc(var(--bottom-bar-height) + 12px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    width: 38px;
    height: 38px;
  }

  .back-to-top svg {
    width: 16px;
    height: 16px;
  }

  /* Footer Mobile */
  .footer {
    padding: 28px 0 18px;
  }

  .footer-nav {
    gap: 14px;
  }

  .footer-tagline {
    font-size: 0.75rem;
  }

  .footer-disclaimer {
    font-size: 0.68rem;
  }

  .footer-bottom {
    font-size: 0.7rem;
  }
}

/* ── Extra Small Mobile (<= 380px) ── */
@media (max-width: 380px) {
  :root {
    --container-padding: 10px;
  }

  .navbar-inner {
    padding: 0 10px;
  }

  .navbar-logo .logo-text {
    font-size: 1rem;
  }

  .hero {
    height: 330px;
  }

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

  .browse-grid {
    gap: 8px !important;
  }

  .detail-cover {
    width: 120px;
  }

  .detail-title {
    font-size: 1.2rem;
  }
}
