﻿/* ============================================================
   AnimeStream — Hoja de estilos principal
   Diseño: oscuro, cinematográfico, moderno y responsive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  --bg-0: #070304;
  --bg-1: #120608;
  --bg-2: #1c0a0c;
  --bg-3: #261014;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-0: #f4f4f7;
  --text-1: #b9b9c6;
  --text-2: #7c7c8c;
  --accent: #e5093f;
  --accent-2: #7a1fa0;
  --accent-grad: linear-gradient(135deg, #e5093f, #7a1fa0);
  --accent-soft: rgba(229, 9, 63, 0.16);
  --green: #2ecc71;
  --yellow: #f1c40f;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
  --header-h: 64px;
  --font: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: #3a1512; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #5c1f1a; }

.container { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 24px; }

main { min-height: calc(100vh - var(--header-h)); }

/* ============ HEADER ============ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(7, 3, 4, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  background: rgba(5, 2, 3, 0.94);
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.brand .logo-dot {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent-grad);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  box-shadow: 0 0 18px rgba(229, 9, 63, 0.5);
}

.brand em { font-style: normal; color: var(--accent); }

.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-1);
  transition: color var(--transition), background var(--transition);
}

.main-nav a:hover { color: var(--text-0); background: rgba(255, 255, 255, 0.06); }
.main-nav a.active { color: #fff; background: var(--accent-soft); }

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0 6px 0 14px;
  height: 40px;
  min-width: 220px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search:focus-within {
  border-color: rgba(229, 9, 63, 0.6);
  box-shadow: 0 0 0 3px rgba(229, 9, 63, 0.15);
}

.header-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.92rem;
  color: var(--text-0);
}

.header-search input::placeholder { color: var(--text-2); }

.header-search button {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background var(--transition);
}

.header-search button:hover { background: rgba(255, 255, 255, 0.1); }
.header-search svg { width: 17px; height: 17px; stroke: var(--text-1); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  place-items: center;
  flex-shrink: 0;
}

.nav-toggle svg { width: 22px; height: 22px; stroke: var(--text-0); }

/* ============ BOTONES ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(229, 9, 63, 0.35);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(229, 9, 63, 0.5); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-0);
  border-color: var(--border-strong);
  backdrop-filter: blur(6px);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-2px); }

.btn-outline { border-color: var(--border-strong); color: var(--text-1); }
.btn-outline:hover { color: var(--text-0); border-color: var(--text-1); }

.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: 8px; }

.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.btn-fav { transition: transform var(--transition), background var(--transition); }

.btn-fav.is-fav {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(229, 9, 63, 0.5);
}

/* ============ HERO ============ */

.hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  margin-top: var(--header-h);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  animation: heroZoom 12s ease-out forwards;
}

@keyframes heroZoom {
  from { transform: scale(1.08); }
  to { transform: scale(1.02); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, var(--bg-0) 2%, transparent 45%),
    linear-gradient(90deg, rgba(7, 3, 4, 0.9) 0%, rgba(7, 3, 4, 0.35) 55%, transparent 100%);
}

.hero-content {
  padding: 80px 0 64px;
  max-width: 620px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(229, 9, 63, 0.2);
  border: 1px solid rgba(229, 9, 63, 0.45);
  color: #ff8a6b;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 18px;
  animation: fadeUp 0.7s ease both;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
  animation: fadeUp 0.7s 0.08s ease both;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0;
  color: var(--text-1);
  font-size: 0.9rem;
  animation: fadeUp 0.7s 0.16s ease both;
}

.hero-meta .rating { color: var(--yellow); font-weight: 700; }
.hero-meta .chip { color: var(--text-0); background: rgba(255,255,255,0.1); padding: 2px 10px; border-radius: 20px; font-size: 0.78rem; }

.hero-synopsis {
  color: var(--text-1);
  font-size: 1rem;
  max-width: 560px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 26px;
  animation: fadeUp 0.7s 0.24s ease both;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; animation: fadeUp 0.7s 0.32s ease both; }

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

/* ============ SECCIONES ============ */

.section { padding: 44px 0 8px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

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

.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  border-radius: 4px;
  background: var(--accent-grad);
}

.section-link { color: var(--text-2); font-size: 0.88rem; font-weight: 600; transition: color var(--transition); }
.section-link:hover { color: var(--accent); }

/* ============ FILAS DE TARJETAS ============ */

.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 215px);
  gap: 18px;
  overflow-x: auto;
  padding: 6px 2px 18px;
  scroll-snap-type: x mandatory;
}

.row::-webkit-scrollbar { height: 6px; }
.row::-webkit-scrollbar-thumb { background: #33120e; }
.row:hover::-webkit-scrollbar-thumb { background: #4d1a14; }

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  scroll-snap-align: start;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

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

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-cover img { transform: scale(1.07); }

.card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(7, 3, 4, 0.85) 0%, transparent 45%);
  opacity: 0.75;
  transition: opacity var(--transition);
}

.card:hover .card-cover::after { opacity: 1; }

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.card-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(7, 3, 4, 0.75);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-strong);
  text-transform: uppercase;
}

.card-badge.rating { color: var(--yellow); }
.card-badge.status-live { color: #7ef0b2; border-color: rgba(46, 204, 113, 0.5); }

.card-fav {
  position: absolute;
  right: 10px;
  bottom: 46px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(7, 3, 4, 0.8);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), color var(--transition), background var(--transition);
  z-index: 2;
}

.card:hover .card-fav { opacity: 1; transform: translateY(0); }
.card-fav svg { width: 17px; height: 17px; fill: none; stroke: var(--text-0); }
.card-fav.is-fav { background: var(--accent); }
.card-fav.is-fav svg { fill: #fff; stroke: #fff; }

.card-body { padding: 12px 14px 14px; }

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-2); }

.card-ep {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-grad);
  padding: 4px 10px;
  border-radius: 6px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(229, 9, 63, 0.4);
}

.card-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 2;
}

.card-progress span {
  display: block;
  height: 100%;
  background: var(--accent-grad);
  transition: width 0.4s ease;
}

/* ============ GRID DE CATÁLOGO ============ */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 18px;
  padding: 4px 0 26px;
}

/* ============ FILTROS ============ */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 1; }

.filter-group label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-2);
}

.filter-group select,
.filter-group input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.filter-group select:focus,
.filter-group input:focus { border-color: rgba(229, 9, 63, 0.6); }

.filters-reset {
  align-self: flex-end;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 12px;
}

.filters-reset:hover { color: var(--accent); }

/* ============ EMPTY STATE ============ */

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-2);
  animation: fadeUp 0.4s ease both;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  opacity: 0.6;
}

.empty-state h3 { color: var(--text-0); font-size: 1.15rem; margin-bottom: 8px; }
.empty-state p { font-size: 0.92rem; }

/* ============ PÁGINA DE ANIME ============ */

.anime-hero {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: flex-end;
  margin-top: var(--header-h);
  isolation: isolate;
}

.anime-hero .hero-bg { z-index: -2; }
.anime-hero .hero-overlay { z-index: -1; }

.anime-head {
  display: flex;
  gap: 28px;
  padding: 48px 0 56px;
  align-items: flex-end;
  max-width: 1100px;
}

.anime-poster {
  width: 210px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: fadeUp 0.6s ease both;
}

.anime-poster img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }

.anime-info { flex: 1; animation: fadeUp 0.6s 0.1s ease both; }

.anime-info .kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.anime-info h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
}

.anime-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--text-1);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.anime-meta .rating { color: var(--yellow); font-weight: 700; }
.anime-meta strong { color: var(--text-0); }

.genre-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.genre-tag {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 20px;
  transition: all var(--transition);
}

.genre-tag:hover { color: var(--text-0); border-color: var(--accent); }

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

.anime-synopsis {
  color: var(--text-1);
  max-width: 820px;
  font-size: 0.98rem;
  margin-top: 28px;
  padding: 0 0 40px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.6s 0.2s ease both;
}

.anime-synopsis p:first-child::first-letter { font-size: 1.4em; color: var(--accent); font-weight: 700; }

/* ============ TEMPORADAS / EPISODIOS ============ */

.season-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.season-tab {
  padding: 9px 18px;
  border-radius: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all var(--transition);
}

.season-tab:hover { color: var(--text-0); }
.season-tab.active { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(229, 9, 63, 0.35); }

.episode-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.episode-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.episode-card:hover { transform: translateY(-3px); border-color: rgba(229, 9, 63, 0.45); background: var(--bg-2); }

.episode-thumb {
  position: relative;
  width: 168px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.episode-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.episode-thumb .play-ico {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 3, 4, 0.35);
  opacity: 0;
  transition: opacity var(--transition);
}

.episode-card:hover .play-ico { opacity: 1; }

.episode-thumb .play-ico svg {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  padding: 10px;
  box-shadow: 0 6px 20px rgba(229, 9, 63, 0.5);
}

.episode-body { flex: 1; min-width: 0; padding: 4px 2px; }

.episode-body .ep-num {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
}

.episode-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 4px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-body p {
  font-size: 0.8rem;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-body .ep-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-2);
}

.ep-duration { display: flex; align-items: center; gap: 4px; }
.ep-duration svg { width: 13px; height: 13px; }

.ep-state {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
}

.ep-state.watched { color: #7ef0b2; background: rgba(46, 204, 113, 0.14); }
.ep-state.progress { color: #ffd97e; background: rgba(241, 196, 15, 0.14); }

/* ============ RECOMENDACIONES ============ */

.recommendations { padding: 40px 0 60px; }

/* ============ PÁGINA DE REPRODUCTOR ============ */

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  padding-top: calc(var(--header-h) + 24px);
  padding-bottom: 60px;
  align-items: start;
}

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

.player-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
}

.player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-msg {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(5, 2, 3, 0.92);
  padding: 30px;
  text-align: center;
  z-index: 5;
}

.player-msg.show { display: grid; }
.player-msg h3 { margin-bottom: 8px; color: var(--text-0); }
.player-msg p { color: var(--text-2); font-size: 0.85rem; word-break: break-all; }

/* Controles */
.player-controls {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, transparent 45%, transparent 60%, rgba(0, 0, 0, 0.35) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 4;
}

.player-wrap:hover .player-controls,
.player-controls.showing { opacity: 1; }

.pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  gap: 12px;
}

.pc-title {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-title small { display: block; font-weight: 500; color: var(--text-2); font-size: 0.75rem; }

.pc-close {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

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

.pc-seek {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
}

.pc-time { font-size: 0.78rem; font-variant-numeric: tabular-nums; color: var(--text-1); white-space: nowrap; }

.progress-bar {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  touch-action: none;
}

.progress-bar .buffered {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  width: 0;
}

.progress-bar .filled {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: var(--accent-grad);
  width: 0;
}

.progress-bar .thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(229, 9, 63, 0.8);
  opacity: 0;
  transition: opacity 0.2s;
  left: 0;
}

.progress-bar:hover .thumb { opacity: 1; }

.pc-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 14px;
}

.pc-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: background var(--transition), transform var(--transition);
}

.pc-btn:hover { background: rgba(255, 255, 255, 0.14); }
.pc-btn:active { transform: scale(0.92); }
.pc-btn svg { width: 22px; height: 22px; fill: #fff; }

.pc-btn.pc-big { width: 52px; height: 52px; }
.pc-btn.pc-big svg { width: 30px; height: 30px; }

.pc-btn.pc-play { background: rgba(255, 255, 255, 0.12); border-radius: 50%; }

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 2px;
}

.volume-slider {
  width: 0;
  overflow: hidden;
  transition: width 0.25s ease;
  accent-color: var(--accent);
  height: 4px;
}

.volume-wrap:hover .volume-slider,
.volume-wrap.volume-open .volume-slider { width: 84px; }

.pc-spacer { flex: 1; }

.pc-btn.pc-fullscreen { margin-left: 4px; }

.big-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 3;
  background: rgba(7, 3, 4, 0.25);
  transition: opacity 0.3s ease, background 0.3s ease;
  border: none;
}

.big-play.hidden { opacity: 0; pointer-events: none; }

.big-play:hover { background: rgba(7, 3, 4, 0.1); }

.big-play svg {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(229, 9, 63, 0.92);
  padding: 24px;
  box-shadow: 0 0 60px rgba(229, 9, 63, 0.6);
  fill: #fff;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(229, 9, 63, 0.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 70px rgba(229, 9, 63, 0.75); }
}

.episode-selector {
  position: absolute;
  right: 14px;
  bottom: 72px;
  z-index: 6;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
  background: rgba(18, 6, 8, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px;
  display: none;
  box-shadow: var(--shadow-lg);
}

.episode-selector.open { display: block; animation: fadeUp 0.2s ease both; }

.episode-selector .es-head {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 8px 10px 6px;
}

.episode-selector .es-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
}

.episode-selector .es-item:hover { background: rgba(255, 255, 255, 0.07); }
.episode-selector .es-item.current { background: var(--accent-soft); color: #ff8a6b; font-weight: 700; }
.episode-selector .es-item .es-num {
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--bg-3);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.78rem;
}
.episode-selector .es-item.current .es-num { background: var(--accent-grad); color: #fff; }
.episode-selector .es-item .es-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.quality-wrap { position: relative; }
.quality-wrap .quality-selector {
  position: absolute;
  right: 0;
  bottom: 44px;
  z-index: 6;
  min-width: 150px;
  background: rgba(18, 6, 8, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  display: none;
  box-shadow: var(--shadow-lg);
}
.quality-wrap .quality-selector.open { display: block; animation: fadeUp 0.2s ease both; }
.quality-wrap .qs-head {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 6px 10px 4px;
}
.quality-wrap .qs-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  background: none;
  border: none;
  transition: background var(--transition);
}
.quality-wrap .qs-item:hover { background: rgba(255, 255, 255, 0.07); }
.quality-wrap .qs-item.current { background: var(--accent-soft); color: #ff8a6b; font-weight: 700; }

/* Info del episodio */

.watch-info { padding-top: 24px; }

.watch-info h2 { font-size: 1.4rem; font-weight: 800; }
.watch-info .kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.watch-info .wi-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--text-2);
  font-size: 0.85rem;
  margin: 10px 0 14px;
}

.watch-info .wi-meta a { color: var(--text-0); font-weight: 700; }
.watch-info .wi-meta a:hover { color: var(--accent); }

.watch-info p.wi-desc { color: var(--text-1); font-size: 0.92rem; max-width: 760px; }

.watch-nav { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* Lateral de episodios */

.watch-side { min-width: 0; }

.watch-side .ws-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.watch-side .ws-head h3 { font-size: 1.05rem; font-weight: 800; }
.watch-side .ws-head span { font-size: 0.8rem; color: var(--text-2); }

.ws-list { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; padding-right: 4px; }

.ws-item {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  transition: border-color var(--transition), transform var(--transition);
}

.ws-item:hover { border-color: var(--border-strong); transform: translateX(3px); }

.ws-item.current { border-color: rgba(229, 9, 63, 0.6); background: rgba(229, 9, 63, 0.07); }

.ws-item img {
  width: 118px;
  border-radius: 6px;
  aspect-ratio: 16/9;
  object-fit: cover;
  flex-shrink: 0;
}

.ws-item .ws-body { min-width: 0; padding: 2px 2px 0; }

.ws-item .ws-body .ws-num { font-size: 0.68rem; font-weight: 800; letter-spacing: 1px; color: var(--accent); }
.ws-item .ws-body h4 {
  font-size: 0.86rem;
  font-weight: 700;
  margin: 2px 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-item .ws-body span { font-size: 0.74rem; color: var(--text-2); }
.ws-item.current .ws-body h4 { color: #ff8a6b; }

/* ============ PÁGINA DE FAVORITOS ============ */

.page-hero {
  margin-top: var(--header-h);
  padding: 56px 0 24px;
  background: linear-gradient(180deg, rgba(229, 9, 63, 0.08), transparent);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
.page-hero p { color: var(--text-2); margin-top: 8px; max-width: 620px; }

/* ============ ANUNCIOS ============ */

.ad-space {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  overflow: visible;
  line-height: 0;
}

.ad-space iframe,
.ad-space ins,
.ad-space .container-ad,
.ad-prime iframe,
.ad-prime ins,
.ad-prime > div {
  display: block !important;
  margin: 0 auto !important;
  max-width: 100%;
}

.ad-space:hover { border-color: rgba(229, 9, 63, 0.4); }

.ad-space .ad-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  opacity: 0.55;
}

.ad-space .ad-size { font-size: 0.75rem; opacity: 0.4; }

.ad-top { min-height: 0; margin: calc(var(--header-h) + 22px) 0 10px; }
.ad-top.home-hero-ad { margin-top: 22px; }

.ad-prime {
  display: block;
  min-height: 0;
  margin: 18px 0 22px;
  overflow: visible;
  line-height: 0;
}

.ad-banner { min-height: 0; margin: 28px 0 0; }

.ad-between { min-height: 0; margin: 20px 0 8px; }

.ad-below-player { min-height: 0; margin: 22px 0 0; }

.ad-side { min-height: 0; display: flex; justify-content: center; }

/* ============ PIE DE PÁGINA ============ */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  padding: 48px 0 24px;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.footer-brand p { color: var(--text-2); font-size: 0.88rem; margin-top: 12px; max-width: 320px; }

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-0);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  color: var(--text-2);
  font-size: 0.88rem;
  padding: 4px 0;
  transition: color var(--transition);
}

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

.footer-bottom {
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 0.8rem;
}

.footer-bottom a { color: var(--text-1); }
.footer-bottom a:hover { color: var(--accent); }

/* ============ PANEL ADMIN ============ */

.admin-wrap { padding-top: calc(var(--header-h) + 28px); padding-bottom: 60px; }

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-head h1 { font-size: 1.7rem; font-weight: 800; }

.admin-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(241, 196, 15, 0.08);
  border: 1px solid rgba(241, 196, 15, 0.3);
  color: #e8d48a;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.88rem;
  margin: 20px 0;
}

.admin-notice svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }

.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

.admin-health {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 18px 0 28px;
}

.health-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.health-head h2 { margin: 0; font-size: 1.1rem; }
.health-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.health-summary { margin-bottom: 14px; }
.hb-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hb-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; color: var(--text-2);
}
.hb-chip b { color: var(--text-1); font-size: 0.92rem; }
.hb-chip.hb-broken b { color: #ff7b7b; }
.hb-meta { margin-top: 10px; font-size: 0.76rem; color: var(--text-2); }

.health-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.health-filters label { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-2); }
.health-filters select,
.health-filters input {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; color: var(--text-1); font-size: 0.85rem;
}
.health-filter-count { font-size: 0.78rem; color: var(--text-3); }

.health-table-wrap { overflow-x: auto; }
.health-table { min-width: 680px; }
.health-table td { font-size: 0.85rem; }
.health-table tr.hb-broken td:first-child { box-shadow: inset 3px 0 0 #ff7b7b; }
.health-table tr.hb-lowres td:first-child { box-shadow: inset 3px 0 0 #f5b301; }

.admin-table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 32px;
}

.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }

.admin-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background var(--transition); }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.at-cover { width: 46px; height: 66px; border-radius: 6px; object-fit: cover; display: block; }

.at-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.at-tag.pub { color: #7ef0b2; background: rgba(46, 204, 113, 0.14); }
.at-tag.draft { color: #ffd97e; background: rgba(241, 196, 15, 0.14); }

.at-actions { display: flex; gap: 8px; }

.at-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.at-btn svg { width: 16px; height: 16px; }
.at-btn:hover { border-color: var(--border-strong); }
.at-btn.edit:hover { color: #7ec8ff; border-color: rgba(126, 200, 255, 0.4); }
.at-btn.del:hover { color: #ff7b7b; border-color: rgba(255, 123, 123, 0.4); background: rgba(255, 77, 77, 0.08); }

/* Formulario admin */

.admin-form {
  display: grid;
  gap: 18px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 40px;
}

.admin-form h2 {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-form h2 .badge-count {
  background: var(--accent-soft);
  color: #ff8a6b;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 20px;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.form-field { display: flex; flex-direction: column; gap: 6px; }

.form-field.full { grid-column: 1 / -1; }

.form-field label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-2);
}

.form-field label .req { color: var(--accent); }

.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-field textarea { resize: vertical; min-height: 90px; }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: rgba(229, 9, 63, 0.6);
  box-shadow: 0 0 0 3px rgba(229, 9, 63, 0.12);
}

.form-field .hint { font-size: 0.75rem; color: var(--text-2); }

.form-checks { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }

.check-item { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; color: var(--text-1); cursor: pointer; }

.check-item input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Editor de temporadas */

.season-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 18px;
  margin-bottom: 14px;
}

.season-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.season-editor-head h3 { font-size: 1rem; font-weight: 800; }
.season-editor-head h3 small { color: var(--text-2); font-weight: 600; font-size: 0.8rem; }

.ep-editor {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 2fr 1fr 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: var(--bg-3);
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.ep-editor .form-field { gap: 4px; }

.ep-editor .form-field input { padding: 8px 10px; font-size: 0.85rem; }
.ep-editor .form-field label { font-size: 0.65rem; }

.ep-remove {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: #ff7b7b;
  display: grid;
  place-items: center;
  margin-top: 20px;
}

.ep-remove svg { width: 15px; height: 15px; }
.ep-remove:hover { background: rgba(255, 77, 77, 0.2); }

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  color: var(--text-1);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all var(--transition);
}

.add-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.add-btn svg { width: 16px; height: 16px; }

.add-btn.danger:hover { color: #ff7b7b; border-color: #ff7b7b; background: rgba(255, 77, 77, 0.08); }

.form-submit {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 6px;
}

/* ============ TOAST ============ */

.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  color: var(--text-0);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
  width: 100%;
  text-align: center;
}

.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: #ff5b5b; }

.toast.hide { animation: toastOut 0.3s ease both; }

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

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

/* ============ MENÚ MÓVIL ============ */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1500;
  visibility: hidden;
  pointer-events: none;
}

.mobile-menu.open { visibility: visible; pointer-events: auto; }

.mobile-menu .mm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.mobile-menu.open .mm-backdrop { opacity: 1; }

.mobile-menu .mm-panel {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: min(320px, 84vw);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: 20px;
  transform: translateX(-105%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.mobile-menu.open .mm-panel { transform: translateX(0); }

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

.mm-close {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.mm-close svg { width: 20px; height: 20px; }

.mm-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-1);
  transition: all var(--transition);
}

.mm-link:hover { background: var(--bg-2); color: var(--text-0); }
.mm-link.active { background: var(--accent-soft); color: #fff; }

.mm-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 14px 14px 6px;
}

/* ============ SCROLL REVEAL ============ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============ AJUSTES POR PÁGINA ============ */

.pc-btn[disabled] { opacity: 0.3; cursor: default; }
.pc-btn[disabled]:hover { background: none; }

body[data-page="favoritos"] .card-fav,
body[data-page="admin"] .card-fav { opacity: 1; transform: none; }

.ep-row .form-field input[type="url"] { font-size: 0.8rem; }

/* ============ RESPONSIVE ============ */

@media (max-width: 1080px) {
  .watch-layout { grid-template-columns: 1fr; }
  .watch-side .ws-list { max-height: 420px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .nav-toggle { display: grid; }
  .header-search { min-width: 0; width: 100%; }
  .header-inner { gap: 14px; }
  .anime-head { flex-direction: column; align-items: flex-start; }
  .anime-poster { width: 160px; }
  .ep-editor { grid-template-columns: 1fr 1fr; }
  .ep-editor .form-field.full { grid-column: 1 / -1; }
  .ep-remove { margin-top: 0; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .brand span.brand-text { display: none; }
  .hero { min-height: 480px; }
  .row { grid-auto-columns: minmax(150px, 175px); gap: 14px; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 14px; }
  .section { padding-top: 34px; }
  .section-title { font-size: 1.15rem; }
  .episode-list { grid-template-columns: 1fr; }
  .episode-thumb { width: 130px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .filters { padding: 12px; }
  .filter-group { min-width: calc(50% - 6px); flex: 1 1 45%; }
  .admin-form { padding: 16px; }
  .pc-buttons { flex-wrap: wrap; }
  .volume-wrap .volume-slider { width: 60px; }
  .hero-actions .btn { flex: 1; }
}

/* ============================================================
   ANIMESTREAM ULTRA — Mejoras visuales de alto impacto
   Auroras de fondo, bordes de gradiente, brillos y micro-motion
   ============================================================ */

:root {
  --accent: #ff4500;
  --accent-2: #e5093f;
  --accent-3: #8b0000;
  --accent-grad: linear-gradient(135deg, #ff4500 0%, #e5093f 55%, #8b0000 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(255, 69, 0, 0.18), rgba(229, 9, 63, 0.14), rgba(139, 0, 0, 0.18));
  --accent-soft: rgba(255, 69, 0, 0.16);
  --glow-pink: 0 0 40px rgba(255, 69, 0, 0.35);
  --glow-purple: 0 0 44px rgba(229, 9, 63, 0.4);
  --text-grad: linear-gradient(92deg, #ffd9a0 0%, #ff7a3d 45%, #ff2e2e 90%);
}

/* --- Auroras animadas de fondo --- */

body {
  background:
    radial-gradient(900px 520px at 12% -5%, rgba(255, 69, 0, 0.13), transparent 62%),
    radial-gradient(1000px 600px at 88% 8%, rgba(139, 0, 0, 0.12), transparent 62%),
    radial-gradient(1100px 700px at 55% 110%, rgba(229, 9, 63, 0.11), transparent 62%),
    var(--bg-0);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 20% 30%, rgba(255, 69, 0, 0.05), transparent 60%),
    radial-gradient(700px 460px at 80% 60%, rgba(139, 0, 0, 0.05), transparent 60%);
  animation: auroraDrift 22s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1);    filter: brightness(0.9) saturate(1.1); }
  50%  { transform: translate3d(-1.5%, 1%, 0) scale(1.05); filter: brightness(1.15) saturate(1.35); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.08); filter: brightness(0.95) saturate(1.2); }
}

/* --- Resplandores de lava que respiran en el fondo --- */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(700px 500px at 18% 85%, rgba(255, 69, 0, 0.1), transparent 62%),
    radial-gradient(500px 380px at 82% 20%, rgba(229, 9, 63, 0.09), transparent 60%);
  animation: lavaBreathe 9s ease-in-out infinite alternate;
}

@keyframes lavaBreathe {
  0%   { opacity: 0.55; transform: scale(1); }
  100% { opacity: 1;    transform: scale(1.12); }
}

/* --- Scrollbar ultra --- */

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #120608; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff4500, #e5093f, #8b0000);
  border-radius: 8px;
  border: 3px solid #120608;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ff7a3d, #e5093f); }

.row::-webkit-scrollbar { height: 5px; }
.row::-webkit-scrollbar-thumb { border: none; background: linear-gradient(90deg, #ff4500, #e5093f); }

::selection { background: linear-gradient(135deg, #ff4500, #e5093f); color: #fff; }

/* --- Header con glow al hacer scroll --- */

.site-header {
  background: rgba(8, 8, 14, 0.55);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(8, 8, 14, 0.82);
  border-bottom-color: rgba(229, 9, 63, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 69, 0, 0.12);
}

.brand .logo-dot {
  background: var(--accent-grad);
  box-shadow: 0 0 22px rgba(255, 69, 0, 0.55), 0 0 46px rgba(229, 9, 63, 0.3);
  animation: logoBreath 3.4s ease-in-out infinite;
}

@keyframes logoBreath {
  0%, 100% { box-shadow: 0 0 18px rgba(255, 69, 0, 0.45), 0 0 40px rgba(229, 9, 63, 0.25); }
  50%      { box-shadow: 0 0 30px rgba(255, 69, 0, 0.75), 0 0 60px rgba(229, 9, 63, 0.45); }
}

.brand em {
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-nav a { border-radius: 10px; }
.main-nav a.active {
  background: linear-gradient(135deg, rgba(255, 69, 0, 0.22), rgba(229, 9, 63, 0.2));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 69, 0, 0.35), 0 4px 14px rgba(229, 9, 63, 0.18);
}

.header-search { background: rgba(23, 23, 34, 0.7); border-color: rgba(255, 255, 255, 0.1); }
.header-search:focus-within {
  border-color: rgba(229, 9, 63, 0.7);
  box-shadow: 0 0 0 3px rgba(229, 9, 63, 0.18), 0 0 24px rgba(229, 9, 63, 0.2);
}

/* --- Botones con brillo (shine) --- */

.btn-primary {
  background: var(--accent-grad);
  background-size: 180% 180%;
  box-shadow: 0 10px 30px rgba(255, 69, 0, 0.4), 0 4px 18px rgba(229, 9, 63, 0.35);
  position: relative;
  overflow: hidden;
  animation: gradShift 6s ease infinite;
}

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

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -85%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-22deg);
  animation: btnShine 3.4s ease infinite;
  pointer-events: none;
}

@keyframes btnShine {
  0%   { left: -85%; }
  55%  { left: 130%; }
  100% { left: 130%; }
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 44px rgba(255, 69, 0, 0.55), 0 6px 26px rgba(229, 9, 63, 0.45);
}

.btn-ghost { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.18); }

/* --- Hero cinematográfico --- */

.hero { min-height: 600px; }
.hero-bg { filter: saturate(1.12) contrast(1.04); }
.hero-overlay {
  background:
    linear-gradient(0deg, var(--bg-0) 2%, rgba(7, 3, 4, 0.35) 40%, transparent 62%),
    linear-gradient(90deg, rgba(8, 8, 14, 0.94) 0%, rgba(8, 8, 14, 0.5) 48%, rgba(8, 8, 14, 0.12) 100%);
}

.hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--accent-grad);
  opacity: 0.9;
  z-index: 1;
  box-shadow: 0 0 24px rgba(229, 9, 63, 0.6);
}

.hero-badge {
  background: linear-gradient(135deg, rgba(255, 69, 0, 0.25), rgba(229, 9, 63, 0.22));
  border: 1px solid rgba(255, 69, 0, 0.5);
  color: #ffb3cc;
  box-shadow: 0 0 20px rgba(255, 69, 0, 0.25);
  animation: fadeUp 0.7s ease both, badgeGlow 2.6s ease-in-out infinite;
}

@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 69, 0, 0.2); }
  50%      { box-shadow: 0 0 30px rgba(229, 9, 63, 0.55); }
}

.hero-title {
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 26px rgba(0, 0, 0, 0.7));
}

.hero-meta .chip {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-actions .btn-primary { min-width: 170px; }

/* --- Títulos de sección con gradiente --- */

.section-title {
  background: linear-gradient(92deg, #ffd9a0 0%, #ff7a3d 50%, #e5093f 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-title::before {
  background: var(--accent-grad);
  box-shadow: 0 0 14px rgba(255, 69, 0, 0.55);
  border-radius: 4px;
}

.section-link { color: #9a9ab0; }
.section-link:hover {
  color: #fff;
  text-shadow: 0 0 16px rgba(229, 9, 63, 0.7);
}

/* --- Tarjetas con borde de gradiente y shine --- */

.card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, #191925, #14141e);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: var(--accent-grad);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 4;
}

.card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6), 0 0 34px rgba(229, 9, 63, 0.28);
  border-color: transparent;
}

.card:hover::before { opacity: 1; }

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
  z-index: 3;
}

.card:hover::after { left: 135%; }

.card:hover .card-cover img { transform: scale(1.1); }

.card-badge {
  background: rgba(8, 8, 14, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.card-badge.rating { color: #ffd97e; text-shadow: 0 0 12px rgba(241, 196, 15, 0.4); }
.card-badge.status-live { color: #7ef0b2; border-color: rgba(46, 204, 113, 0.5); box-shadow: 0 0 12px rgba(46, 204, 113, 0.3); }

.card-fav {
  background: rgba(8, 8, 14, 0.72);
  backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-fav.is-fav {
  background: var(--accent-grad);
  box-shadow: 0 0 18px rgba(255, 69, 0, 0.55);
}

.card-ep {
  background: var(--accent-grad);
  box-shadow: 0 4px 18px rgba(255, 69, 0, 0.5);
  border-radius: 7px;
}

.card-title { font-weight: 800; }

/* Stagger de entrada para filas y catálogo */
.row .reveal:nth-child(1), .catalog-grid .reveal:nth-child(1) { transition-delay: 0.02s; }
.row .reveal:nth-child(2), .catalog-grid .reveal:nth-child(2) { transition-delay: 0.05s; }
.row .reveal:nth-child(3), .catalog-grid .reveal:nth-child(3) { transition-delay: 0.08s; }
.row .reveal:nth-child(4), .catalog-grid .reveal:nth-child(4) { transition-delay: 0.11s; }
.row .reveal:nth-child(5), .catalog-grid .reveal:nth-child(5) { transition-delay: 0.14s; }
.row .reveal:nth-child(6), .catalog-grid .reveal:nth-child(6) { transition-delay: 0.17s; }
.row .reveal:nth-child(7), .catalog-grid .reveal:nth-child(7) { transition-delay: 0.2s; }
.row .reveal:nth-child(8), .catalog-grid .reveal:nth-child(8) { transition-delay: 0.23s; }
.row .reveal:nth-child(9), .catalog-grid .reveal:nth-child(9) { transition-delay: 0.26s; }
.row .reveal:nth-child(10), .catalog-grid .reveal:nth-child(10) { transition-delay: 0.29s; }

.reveal { transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.visible { transform: translateY(0) scale(1); }

/* --- Filtros con glow --- */

.filters {
  background: rgba(23, 23, 34, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.filter-group select,
.filter-group input {
  background: rgba(30, 30, 44, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: rgba(229, 9, 63, 0.7);
  box-shadow: 0 0 0 3px rgba(229, 9, 63, 0.15);
}

/* --- Página de anime --- */

.anime-hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--accent-grad);
  z-index: 1;
  box-shadow: 0 0 26px rgba(229, 9, 63, 0.6);
}

.anime-poster {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 36px rgba(229, 9, 63, 0.22);
  border-color: rgba(255, 255, 255, 0.14);
  transition: transform var(--transition), box-shadow var(--transition);
}

.anime-poster:hover {
  transform: translateY(-6px) scale(1.03) rotate(-1deg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(255, 69, 0, 0.3);
}

.anime-info h1 {
  background: linear-gradient(92deg, #ffd9a0 0%, #ff7a3d 50%, #e5093f 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 22px rgba(0, 0, 0, 0.65));
}

.genre-tag:hover {
  background: var(--accent-grad-soft);
  border-color: rgba(229, 9, 63, 0.6);
  color: #fff;
  box-shadow: 0 0 16px rgba(229, 9, 63, 0.3);
}

.season-tab.active {
  background: var(--accent-grad);
  box-shadow: 0 8px 26px rgba(255, 69, 0, 0.45), 0 0 22px rgba(229, 9, 63, 0.3);
}

.season-tab:hover { border-color: rgba(229, 9, 63, 0.5); color: #fff; }

.episode-card {
  background: linear-gradient(180deg, rgba(23, 23, 34, 0.85), rgba(18, 6, 8, 0.85));
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.episode-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(229, 9, 63, 0.55);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 26px rgba(229, 9, 63, 0.2);
}

.episode-thumb .play-ico svg {
  background: var(--accent-grad);
  box-shadow: 0 8px 26px rgba(255, 69, 0, 0.55);
  animation: pulse 2.4s ease-in-out infinite;
}

/* --- Reproductor ultra --- */

.player-wrap {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 44px rgba(229, 9, 63, 0.18);
}

.progress-bar .filled {
  background: var(--accent-grad);
  box-shadow: 0 0 14px rgba(255, 69, 0, 0.7);
}

.progress-bar .thumb {
  width: 16px; height: 16px;
  background: #fff;
  box-shadow: 0 0 14px rgba(255, 69, 0, 0.9), 0 0 30px rgba(229, 9, 63, 0.5);
}

.big-play svg {
  background: var(--accent-grad);
  animation: pulse 2.2s ease-in-out infinite, gradShift 4s ease infinite;
  background-size: 180% 180%;
}

.pc-btn.pc-play { background: linear-gradient(135deg, rgba(255, 69, 0, 0.35), rgba(229, 9, 63, 0.3)); }

.ws-item {
  background: rgba(23, 23, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.ws-item:hover {
  border-color: rgba(229, 9, 63, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transform: translateX(4px);
}

.ws-item.current {
  border-color: rgba(255, 69, 0, 0.65);
  background: linear-gradient(135deg, rgba(255, 69, 0, 0.12), rgba(229, 9, 63, 0.1));
  box-shadow: 0 0 22px rgba(229, 9, 63, 0.18);
}

.episode-selector {
  background: rgba(14, 14, 22, 0.94);
  border: 1px solid rgba(229, 9, 63, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(229, 9, 63, 0.15);
}

.episode-selector .es-item.current {
  background: var(--accent-grad-soft);
  color: #ffb3cc;
}

.episode-selector .es-item.current .es-num { background: var(--accent-grad); }

/* --- Favoritos / Páginas interiores --- */

.page-hero {
  background:
    radial-gradient(700px 300px at 20% 0%, rgba(255, 69, 0, 0.12), transparent 60%),
    radial-gradient(700px 300px at 85% 10%, rgba(139, 0, 0, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(229, 9, 63, 0.05), transparent);
}

.page-hero h1 {
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Footer con línea de gradiente --- */

.site-footer {
  background: linear-gradient(180deg, rgba(20, 20, 32, 0.55), var(--bg-1) 55%), var(--bg-1);
  border-top: none;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff4500, #e5093f, #8b0000, transparent);
  opacity: 0.75;
  box-shadow: 0 0 30px rgba(229, 9, 63, 0.5);
}

.footer-col a { transition: color var(--transition), transform var(--transition); }
.footer-col a:hover { color: #ffb37a; transform: translateX(4px); }

/* --- Toast con gradiente --- */

.toast {
  background: rgba(23, 23, 34, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 3px solid #ff4500;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(229, 9, 63, 0.2);
}

/* --- Admin con toque premium --- */

.admin-table-wrap {
  background: rgba(23, 23, 34, 0.55);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.at-tag.pub { color: #7ef0b2; background: rgba(46, 204, 113, 0.14); box-shadow: 0 0 12px rgba(46, 204, 113, 0.2); }

.admin-form {
  background: rgba(23, 23, 34, 0.55);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.admin-notice {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.1), rgba(229, 9, 63, 0.08));
  border-color: rgba(241, 196, 15, 0.35);
  box-shadow: 0 0 22px rgba(241, 196, 15, 0.12);
}

/* --- Anuncios discretos con glow sutil --- */

.ad-space:hover { border-color: rgba(229, 9, 63, 0.45); box-shadow: 0 0 24px rgba(229, 9, 63, 0.12); }

/* ============================================================
   ANIMESTREAM ULTRA — Efectos dinámicos (js/effects.js)
   Aura del cursor, partículas del hero y barra de scroll
   ============================================================ */

/* --- Aura de neón que sigue al cursor --- */

.cursor-aura {
  position: fixed;
  top: 0;
  left: 0;
  width: 440px;
  height: 440px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center,
      rgba(255, 69, 0, 0.07) 0%,
      rgba(229, 9, 63, 0.06) 38%,
      rgba(139, 0, 0, 0.04) 55%,
      transparent 72%);
  filter: blur(10px);
  transition: opacity 0.4s ease;
  will-change: transform, opacity;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* --- Partículas flotantes del hero --- */

.particle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.hero .particle-field { z-index: 1; }

.particle {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb37a, #ff5e3a);
  filter: blur(0.4px);
  animation: particleFloat linear infinite;
  mix-blend-mode: screen;
  opacity: 0.35;
}

@keyframes particleFloat {
  0%   { transform: translate3d(0, 20px, 0) scale(0.6); opacity: 0; }
  12%  { opacity: 0.7; }
  50%  { transform: translate3d(24px, -90px, 0) scale(1); }
  88%  { opacity: 0.45; }
  100% { transform: translate3d(-18px, -190px, 0) scale(0.7); opacity: 0; }
}

/* --- Barra de progreso de scroll --- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 2001;
  background: var(--accent-grad);
  box-shadow: 0 0 14px rgba(255, 69, 0, 0.8), 0 0 28px rgba(229, 9, 63, 0.5);
  pointer-events: none;
}

/* --- Tilt 3D: respeta hover para no pisar estilos del ULTRA --- */

.card, .episode-card, .anime-poster { will-change: transform; }

/* En pantallas táctiles desactivar aura y tilt */
@media (hover: none), (pointer: coarse) {
  .cursor-aura { display: none; }
  .card, .episode-card, .anime-poster { transition: transform 0.3s ease; }
}

/* ============================================================
   ANIMESTREAM — Bottom nav (mobile)
   ============================================================ */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1001;
  background: rgba(14, 14, 22, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 8px env(safe-area-inset-bottom, 8px);
  justify-content: space-around;
  align-items: center;
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-2);
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.3px;
}

.bn-item svg { width: 22px; height: 22px; stroke: var(--text-2); transition: stroke var(--transition); }

.bn-item.active { color: #ff8a6b; }
.bn-item.active svg { stroke: #ff4500; }

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  body { padding-bottom: 72px; }
  .site-footer { padding-bottom: 90px; }
  .toast-wrap { bottom: 80px; }
}

/* ============================================================
   ANIMESTREAM — Search dropdown
   ============================================================ */

.header-search { position: relative; }

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(20, 20, 30, 0.98);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  z-index: 100;
}

.search-dropdown.open { display: block; animation: fadeUp 0.18s ease both; }

.search-dropdown .sd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.search-dropdown .sd-item:hover { background: rgba(255, 255, 255, 0.06); }

.search-dropdown .sd-item img {
  width: 40px; height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.search-dropdown .sd-item .sd-info { min-width: 0; }

.search-dropdown .sd-item .sd-title {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-0);
}

.search-dropdown .sd-item .sd-meta {
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: 2px;
}

/* ============================================================
   ANIMESTREAM — Skeleton loading
   ============================================================ */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  border-radius: var(--radius);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

@keyframes skeletonShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-card {
  background: var(--bg-2);
  border-radius: var(--radius);
  height: 120px;
}

.skeleton-cover { aspect-ratio: 2 / 3; background: var(--bg-2); border-radius: var(--radius); }
.skeleton-title { height: 18px; background: var(--bg-2); border-radius: 4px; margin-top: 10px; width: 80%; }
.skeleton-text { height: 14px; background: var(--bg-2); border-radius: 4px; margin-top: 6px; width: 50%; }

/* ============================================================
   ANIMESTREAM — Profile page
   ============================================================ */

.profile-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
}

.profile-side { min-width: 0; }

.profile-card {
  background: rgba(23, 23, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.profile-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--accent-grad);
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 30px rgba(255, 69, 0, 0.4), 0 0 14px rgba(229, 9, 63, 0.3);
  transition: transform var(--transition), box-shadow var(--transition);
}

.profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255, 69, 0, 0.6), 0 0 20px rgba(229, 9, 63, 0.5);
}

.profile-avatar-text {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.profile-name { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }

.profile-main { min-width: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  background: rgba(23, 23, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 69, 0, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-top: 4px;
  display: block;
}

/* ============================================================
   ANIMESTREAM — History page
   ============================================================ */

.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-item {
  display: flex;
  gap: 14px;
  padding: 10px;
  background: rgba(23, 23, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.history-item:hover {
  transform: translateX(4px);
  border-color: rgba(255, 69, 0, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.history-item .hi-thumb {
  width: 148px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.history-item .hi-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.history-item .hi-thumb .play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.history-item:hover .hi-thumb .play-overlay { opacity: 1; }

.history-item .hi-thumb .play-overlay svg {
  width: 38px; height: 38px;
  fill: #fff;
  background: rgba(255, 69, 0, 0.85);
  border-radius: 50%;
  padding: 8px;
}

.history-item .hi-body { min-width: 0; padding: 4px 2px; display: flex; flex-direction: column; justify-content: space-between; }

.history-item .hi-body .hi-anime {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.history-item .hi-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 2px 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item .hi-body .hi-meta {
  font-size: 0.78rem;
  color: var(--text-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

.history-item .hi-bar {
  height: 3px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.history-item .hi-bar span {
  display: block;
  height: 100%;
  background: var(--accent-grad);
  transition: width 0.4s ease;
}

.history-item .hi-delete {
  align-self: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(255, 123, 123, 0.3);
  color: var(--text-2);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}

.history-item:hover .hi-delete { opacity: 1; }
.history-item .hi-delete:hover { background: rgba(255, 77, 77, 0.15); color: #ff7b7b; }
.history-item .hi-delete svg { width: 16px; height: 16px; }

/* ============================================================
   ANIMESTREAM — Auto-next dialog
   ============================================================ */

.auto-next-dialog {
  position: absolute;
  bottom: 80px;
  right: 24px;
  background: rgba(20, 20, 30, 0.96);
  border: 1px solid rgba(255, 69, 0, 0.45);
  border-radius: 14px;
  padding: 18px 20px;
  max-width: 320px;
  z-index: 5;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(229, 9, 63, 0.2);
  display: none;
  animation: fadeUp 0.3s ease both;
}

.auto-next-dialog.show { display: block; }

.auto-next-dialog h4 { font-size: 0.9rem; font-weight: 800; margin-bottom: 5px; }
.auto-next-dialog p { font-size: 0.8rem; color: var(--text-2); margin-bottom: 12px; }

.auto-next-dialog .and-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auto-next-dialog .and-timer {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
}

.auto-next-dialog .and-actions .btn { font-size: 0.82rem; padding: 8px 14px; }

/* ============================================================
   ANIMESTREAM — 404 error page
   ============================================================ */

.error-404 {
  text-align: center;
  padding: 120px 24px 80px;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.error-404 .err-code {
  font-size: 5rem;
  font-weight: 900;
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.error-404 h2 { font-size: 1.4rem; font-weight: 800; }
.error-404 p { color: var(--text-2); max-width: 500px; font-size: 0.92rem; }

/* ============================================================
   ANIMESTREAM — Accessibility
   ============================================================ */

:focus-visible {
  outline: 2px solid rgba(255, 69, 0, 0.8);
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.25);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent-grad);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 2002;
  transition: top 0.3s;
}

.skip-link:focus { top: 10px; }

/* ============================================================
   ANIMESTREAM — Share button
   ============================================================ */

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--text-1);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-share:hover { color: var(--text-0); border-color: rgba(255, 69, 0, 0.5); background: var(--accent-soft); }

.btn-share svg { width: 16px; height: 16px; }

/* ============================================================
   ANIMESTREAM — Mobile responsive refinements
   ============================================================ */

@media (max-width: 768px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-side { order: -1; }
  .profile-card { text-align: left; display: flex; align-items: center; gap: 16px; }
  .profile-avatar { margin: 0; width: 64px; height: 64px; }
  .profile-avatar-text { font-size: 1.4rem; }

  .history-item { flex-wrap: wrap; }
  .history-item .hi-thumb { width: 100%; }
  .history-item .hi-delete { opacity: 1; }

  .auto-next-dialog {
    left: 16px;
    right: 16px;
    bottom: 100px;
    max-width: none;
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .header-search { position: static; }
  .search-dropdown {
    left: 0;
    right: 0;
    top: calc(var(--header-h) + 4px);
    border-radius: 0 0 12px 12px;
  }

  .main-nav { display: none; }
}

/* ============================================================
   ANIMESTREAM — Responsive: hide desktop nav, show mobile
   ============================================================ */

@media (max-width: 900px) { .header-search { position: relative; } }

@media (min-width: 769px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

@media (max-width: 640px) {
  .episode-selector { left: 8px; right: 8px; bottom: 80px; min-width: auto; }
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #7ef0b2;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}


