:root {
  color-scheme: dark;
  --bg: #0a0e17;
  --bg-secondary: #12151f;
  --bg-elevated: #1a1f2e;
  --bg-card: rgba(26, 31, 46, 0.6);
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-strong: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --border: rgba(148, 163, 184, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Performance optimization */
  --gpu-acceleration: translateZ(0);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

body.age-gate-active {
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 600px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15), transparent 60%),
    radial-gradient(ellipse at 100% 20%, rgba(236, 72, 153, 0.1), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.age-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 30% 15%, rgba(124, 92, 255, 0.25), transparent 55%), rgba(6, 8, 18, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2000;
  opacity: 1;
  visibility: visible;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.age-gate--hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.age-gate__card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(135deg, rgba(15, 19, 32, 0.98), rgba(10, 14, 23, 0.98));
  border-radius: 20px;
  padding: 40px 32px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 20px;
  text-align: center;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 260ms ease, opacity 260ms ease;
}

.age-gate:not(.age-gate--hidden) .age-gate__card {
  transform: scale(1);
  opacity: 1;
}

body.is-light .age-gate__card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 30px 70px rgba(148, 163, 184, 0.3);
}

.age-gate__badge {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: white;
  box-shadow: 0 18px 36px rgba(124, 92, 255, 0.45);
}

.age-gate__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.age-gate__desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

.age-gate__actions {
  display: grid;
  gap: 12px;
}

.age-gate__exit {
  width: 100%;
  text-align: center;
}

body.is-light {
  color-scheme: light;
  --bg: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-strong: #ec4899;
  --border: rgba(148, 163, 184, 0.15);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.15);
  background: #f8f9fa;
}

body.is-light::before {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.08), transparent 50%),
    radial-gradient(ellipse at 100% 20%, rgba(236, 72, 153, 0.06), transparent 40%);
}


.btn[aria-busy="true"] {
  opacity: 0.65;
  pointer-events: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 18px calc(74px + env(safe-area-inset-bottom)) 18px;
  position: relative;
  overflow-x: hidden;
  z-index: 1;
}

@media (min-width: 768px) {
  .app-shell {
    padding: env(safe-area-inset-top) 32px calc(74px + env(safe-area-inset-bottom)) 32px;
  }
}

@media (min-width: 1920px) {
  .app-shell {
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
  }
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 22px;
  gap: 16px;
  position: relative;
  z-index: 10;
}

@media (min-width: 640px) {
  .top-bar {
    padding-bottom: 28px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.brand__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

@media (min-width: 640px) {
  .brand__icon {
    width: 54px;
    height: 54px;
  }
}

.brand__icon svg {
  width: 28px;
  height: 28px;
}

@media (min-width: 640px) {
  .brand__icon svg {
    width: 32px;
    height: 32px;
  }
}

.brand > div {
  min-width: 0;
}

.brand__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand__subtitle {
  margin: 0;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.top-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.user-menu-btn {
  border: none;
  background: var(--bg-elevated);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover,
.user-menu-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.theme-toggle:active,
.user-menu-btn:active {
  transform: scale(0.95);
}

.user-menu-btn svg {
  width: 20px;
  height: 20px;
}

.sun-icon,
.moon-icon {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}

body.is-light .sun-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}

body.is-light .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.search-section {
  margin-top: 22px;
  display: none;
  flex-direction: column;
  gap: 18px;
}

.search-section.is-visible {
  display: flex;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 20px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 16px 56px 16px 56px;
  border-radius: var(--radius-xl);
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow:
    0 4px 16px rgba(99, 102, 241, 0.15),
    0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.search-clear {
  position: absolute;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 2;
}

.search-clear.is-visible {
  display: flex;
}

.search-clear:hover {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.search-clear svg {
  width: 16px;
  height: 16px;
}

.chip-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chip-row::-webkit-scrollbar {
  height: 6px;
}

.chip-row::-webkit-scrollbar-track {
  background: transparent;
}

.chip-row::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.chip-row::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.chip-row.hidden {
  display: none;
}

.chip {
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: -0.01em;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.view-container {
  flex: 1;
  margin-top: 28px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section + .section {
  margin-top: 40px;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Hero Carousel Container */
.hero-carousel {
  position: relative;
  width: 100%;
  perspective: 1200px;
}

.hero-carousel__track {
  position: relative;
  width: 100%;
  min-height: 320px;
}

.hero-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  opacity: 0;
  transform: translateX(100%) scale(0.95) translateZ(0);
  transition: none;
  will-change: transform, opacity;
}

.hero-card.is-active {
  position: relative;
  opacity: 1;
  transform: translateX(0) scale(1) translateZ(0);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.6s ease-out;
  z-index: 3;
}

.hero-card.is-prev {
  opacity: 0;
  transform: translateX(-100%) scale(0.95) translateZ(0);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.6s ease-out;
  z-index: 1;
}

.hero-card__img-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

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

/* Carousel Controls - Removed */

.hero-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  transform: var(--gpu-acceleration);
}

.hero-card:hover .hero-card__image {
  transform: scale(1.03) translateZ(0);
}

.hero-card__content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 4px;
}

.hero-card__meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 1024px) {
  .hero-card__content {
    gap: 16px;
  }

  .hero-card__title {
    font-size: 2rem;
  }
}

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

.hero-card__title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-card__tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  transition: all var(--transition);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.badge:hover {
  background: rgba(10, 14, 23, 0.95);
  border-color: var(--accent);
  transform: translateY(-2px);
}

body.is-light .badge {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  border-color: rgba(15, 23, 42, 0.15);
  text-shadow: none;
}

body.is-light .badge:hover {
  background: white;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  padding: 11px 20px;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn--primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn--primary:active {
  transform: translateY(0) scale(1);
}

.btn--ghost {
  background: rgba(10, 14, 23, 0.7);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.btn--ghost:hover {
  background: rgba(10, 14, 23, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

body.is-light .btn--ghost {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
  border-color: rgba(15, 23, 42, 0.15);
}

body.is-light .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(99, 102, 241, 0.3);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 16px;
}

@media (min-width: 480px) {
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 640px) {
  .movie-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 1024px) {
  .movie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1440px) {
  .movie-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1920px) {
  .movie-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
  }
}

.movie-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  transform: var(--gpu-acceleration);
}

.movie-card:hover {
  transform: translateY(-6px) translateZ(0);
}

.movie-card__img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-secondary));
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s ease;
}

.movie-card:hover .movie-card__img-wrapper {
  box-shadow:
    var(--shadow-lg),
    0 0 0 2px rgba(99, 102, 241, 0.3);
}

.movie-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
  will-change: transform;
  transform: var(--gpu-acceleration);
}

.movie-card:hover .movie-card__img {
  transform: scale(1.05) translateZ(0);
  filter: brightness(1.05);
}

.movie-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(12px);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  z-index: 3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.is-light .movie-card__badge {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary);
  border-color: rgba(15, 23, 42, 0.1);
}

.movie-card__fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  opacity: 0;
  z-index: 3;
  transform: scale(0.8);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

body.is-light .movie-card__fav-btn {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-strong);
  border-color: rgba(15, 23, 42, 0.1);
}

.movie-card:hover .movie-card__fav-btn {
  opacity: 1;
  transform: scale(1);
}

.movie-card__fav-btn:hover {
  background: var(--accent-strong);
  color: white;
  transform: scale(1.15);
  border-color: var(--accent-strong);
}

.movie-card__fav-btn.is-active {
  opacity: 1;
  background: var(--accent-strong);
  color: white;
  transform: scale(1);
  border-color: var(--accent-strong);
}

.movie-card__fav-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.movie-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 12px 12px;
  background: linear-gradient(
    to top,
    rgba(10, 14, 23, 0.95) 0%,
    rgba(10, 14, 23, 0.7) 25%,
    rgba(10, 14, 23, 0.25) 50%,
    transparent 100%
  );
  z-index: 2;
}

body.is-light .movie-card__overlay {
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.7) 25%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
}

.movie-card__title {
  margin: 0 0 6px 0;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: white;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

body.is-light .movie-card__title {
  color: var(--text-primary);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.4);
}

.movie-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.movie-card__year {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

body.is-light .movie-card__year {
  color: var(--text-secondary);
}

.movie-card__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

body.is-light .movie-card__dot {
  background: var(--text-muted);
}

.movie-card__rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

body.is-light .movie-card__rating {
  color: var(--text-secondary);
}

.movie-card__star {
  width: 14px;
  height: 14px;
  fill: var(--warning);
  filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.5));
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  border: 2px dashed var(--border);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.empty-state__title {
  font-weight: 700;
  margin: 0;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  opacity: 0.3;
}

.load-more {
  margin-top: 6px;
  width: 100%;
}

.detail-header {
  display: grid;
  gap: 18px;
}

.detail-back {
  display: none;
}

.detail-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .detail-title {
    font-size: 2rem;
  }
}

.detail-info {
  display: grid;
  gap: 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.detail-info p {
  line-height: 1.7;
  color: var(--text-secondary);
}

.detail-info__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-info__meta span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.player-section {
  margin-top: 24px;
  display: grid;
  gap: 16px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

#player {
  scroll-margin-top: 96px;
}

.player-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 2px solid var(--border);
  background: #000;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.player-frame:hover {
  border-color: var(--accent);
  box-shadow:
    var(--shadow-lg),
    0 0 0 4px rgba(99, 102, 241, 0.1);
}

.player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.player-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.player-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-play-btn {
  position: relative;
  z-index: 3;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.player-play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 48px rgba(99, 102, 241, 0.6);
}

.player-play-btn:active {
  transform: scale(0.95);
}

.player-play-btn svg {
  width: 32px;
  height: 32px;
  margin-left: 4px;
}

.player-poster.is-hidden {
  display: none;
}

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

.player-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.player-meta__label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
}

.player-meta span {
  font-weight: 600;
}

.player-fallback {
  display: flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8125rem;
  transition: all var(--transition);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
}

.player-fallback:hover {
  color: var(--accent-hover);
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

/* Modern Player Controls */
.player-fullscreen-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 15;
  opacity: 0;
}

.player-frame:hover .player-fullscreen-btn {
  opacity: 1;
}

.player-fullscreen-btn:active {
  transform: scale(0.9);
}

.player-fullscreen-btn svg {
  width: 20px;
  height: 20px;
}

.player-frame.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding-top: 0 !important;
  border-radius: 0 !important;
  z-index: 99999 !important;
  border: none !important;
}

.player-frame.is-fullscreen iframe {
  border-radius: 0 !important;
}

.episode-list {
  display: grid;
  gap: 16px;
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.episode-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 16px;
}

.episode-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.episode-card__header span:last-child {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.episode-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.episode-chip {
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.episode-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.episode-chip span {
  position: relative;
  z-index: 1;
}

.episode-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px) scale(1.05);
}

.episode-chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.episode-chip.is-active::before {
  opacity: 1;
}

.episode-chip.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 11, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px env(safe-area-inset-right) calc(4px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
  height: 56px;
}

@media (min-width: 1920px) {
  .bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    max-width: 1920px;
  }
}

.bottom-nav__item {
  flex: 1;
  max-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: var(--radius-lg);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.bottom-nav__item::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 0 0 2px 2px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav__item svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav__item span {
  position: relative;
  z-index: 1;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav__item:active {
  transform: scale(0.95);
}

.bottom-nav__item.is-active {
  color: var(--accent);
}

.bottom-nav__item.is-active::before {
  transform: translateX(-50%) scaleX(1);
}

.bottom-nav__item.is-active svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 6px rgba(124, 92, 255, 0.3));
}

/* Light mode */
body.is-light .bottom-nav {
  background: rgba(255, 255, 255, 0.8);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
}

.rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating__star {
  width: 22px;
  height: 22px;
  fill: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rating__star.is-active {
  fill: url(#starGradient);
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
}

.rating__value {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.toast {
  position: fixed;
  bottom: calc(74px + 16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9375rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 1000;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-width: calc(100vw - 32px);
  text-align: center;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    var(--bg-card) 50%,
    var(--bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

.pull-to-refresh {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  z-index: 1001;
  transition: top 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pull-to-refresh.is-visible {
  top: 24px;
}

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

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  z-index: 1000;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* User Menu & Auth */
.user-menu {
  position: fixed;
  top: 80px;
  right: 18px;
  width: 280px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (min-width: 768px) {
  .user-menu {
    right: 32px;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-menu__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar svg {
  width: 28px;
  height: 28px;
  color: white;
}

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

.user-name {
  margin: 0 0 4px 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.user-menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.user-menu__item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
}

.user-menu__item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal__close:hover {
  background: rgba(255, 0, 0, 0.1);
  color: #ef4444;
}

.modal__close svg {
  width: 20px;
  height: 20px;
}

.modal__title {
  margin: 0 0 24px 0;
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.form-group input {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition);
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.modal__footer {
  margin: 20px 0 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.modal__footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  transition: color var(--transition);
}

.modal__footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Comment System */
.comments-section {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-top: 24px;
  border: 1px solid var(--border);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.btn--comment {
  padding: 10px 20px;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn--comment:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.comment-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

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

.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
}

.comment-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comment-author-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-delete {
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.comment-delete svg {
  width: 18px;
  height: 18px;
}

.comment-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
  word-wrap: break-word;
}

.comments-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.comments-empty svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.3;
}

.comments-empty p {
  font-size: 0.9375rem;
  margin-top: 8px;
}

/* Comment Form */
.comment-form textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition);
  resize: vertical;
  font-family: inherit;
  min-height: 100px;
}

.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.comment-form textarea::placeholder {
  color: var(--text-muted);
}

/* Advertisement Areas */
.ad-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(236, 72, 153, 0.05));
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  margin: 24px 0;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.ad-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.ad-banner:hover::before {
  left: 100%;
}

.ad-banner--large {
  min-height: 200px;
  padding: 48px 24px;
}

.ad-banner--sidebar {
  min-height: 280px;
  margin: 16px 0;
}

.ad-banner__icon {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  color: var(--text-muted);
}

.ad-banner__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
}

.ad-banner__subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Top Banner Ad */
.ad-top-banner {
  margin: 20px 0;
}

/* Sidebar Ad (for larger screens) */
@media (min-width: 1024px) {
  .content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
  }

  .main-content {
    min-width: 0;
  }

  .sidebar-ads {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}

/* In-feed Ad */
.ad-in-feed {
  margin: 32px 0;
}
