/* =========================================================
   HentaiSB — Estilos
   Tema negro / rojo estilo streaming · Mobile first
   ========================================================= */

:root {
  --bg: #0b0b10;
  --bg-elev: #111118;
  --surface: #16161f;
  --surface-2: #1d1d29;
  --surface-3: #262636;
  --border: #2a2a3a;
  --border-strong: #3a3a50;
  --text: #ededf3;
  --text-muted: #9b9bb2;
  --text-dim: #6c6c84;
  --accent: #ff3d7f;
  --accent-hover: #ff5c94;
  --accent-dark: #e0306c;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(255, 61, 127, 0.14);
  --accent-glow: rgba(255, 61, 127, 0.35);
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --gold: #f5c518;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --live: #22c55e;
  --done: #60a5fa;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.7);
  --header-h: 116px;
  --container: 1280px;
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: dark;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}
@media (min-width: 1024px) {
  :root { --header-h: 76px; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, .08), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1000;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .2s var(--ease), transform .15s var(--ease), border-color .2s, opacity .2s, box-shadow .2s;
  user-select: none;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--wide { min-width: 186px; }
.btn--primary {
  --btn-bg: linear-gradient(135deg, var(--accent), #ff6b5c);
  --btn-fg: #fff;
  box-shadow: 0 6px 22px var(--accent-glow);
}
.btn--primary:hover:not(:disabled) { box-shadow: 0 10px 30px rgba(255, 61, 127, .55); }
.btn--dark { --btn-bg: transparent; border-color: var(--border-strong); }
.btn--dark:hover:not(:disabled) { --btn-bg: var(--surface-3); }
.btn--outline { --btn-bg: var(--accent-soft); --btn-fg: var(--accent); border-color: rgba(255, 61, 127, .4); border-radius: var(--radius); white-space: normal; text-align: center; padding-block: 8px; }
.btn--outline:hover:not(:disabled) { --btn-bg: rgba(255, 61, 127, .22); }
.btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; }
.btn--fav.is-fav { --btn-bg: var(--accent-soft); --btn-fg: #ff7aa5; border-color: rgba(255, 61, 127, .5); }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background .2s, border-color .2s, color .2s;
  flex-shrink: 0;
}
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.icon-btn--plain { background: transparent; border-color: transparent; }
.icon-btn--plain svg { width: 24px; height: 24px; }
.icon-btn--plain[aria-expanded="true"] { background: var(--surface-2); color: var(--accent); }
.icon-btn--square { border-radius: 10px; width: 44px; height: 44px; }
.icon-btn--danger:hover { background: rgba(239, 68, 68, .15); border-color: var(--danger); color: var(--danger); }
.icon-btn--edit:hover { background: rgba(245, 197, 24, .12); border-color: var(--gold); color: var(--gold); }

.link-btn { color: #ff7aa5; font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Cabecera ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 16, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header__row {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "logo actions"
    "tabs tabs";
  align-items: center;
  gap: 6px 16px;
  padding-block: 12px 8px;
}
.logo { grid-area: logo; display: inline-flex; align-items: center; gap: 10px; }
.logo__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  box-shadow: 0 4px 16px rgba(255, 61, 127, .35);
}
.logo__mark svg { width: 18px; height: 18px; fill: #fff; margin-left: 2px; }
.logo__text { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.logo__text b { color: var(--accent); font-weight: 800; }
.logo__text--sm { font-size: 16px; }

.tabs {
  grid-area: tabs;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.is-active { color: #fff; background: var(--surface-2); }
.tab.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.tab--admin { color: #c4b5fd; }
.tab__count {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 800;
  border-radius: 999px;
  background: var(--accent); color: #fff;
}

.header__actions { grid-area: actions; display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.guest-actions { display: flex; gap: 8px; }
.guest-actions .btn span { display: none; }
.guest-actions .btn { padding: 0 12px; }
.user-menu { position: relative; display: flex; align-items: center; min-width: 0; }
.user-menu__btn { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid transparent; transition: background .2s, border-color .2s; min-width: 0; }
.user-menu__btn:hover, .user-menu__btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.user-menu__chev { width: 18px; height: 18px; fill: var(--text-muted); flex-shrink: 0; transition: transform .2s var(--ease); }
.user-menu__btn[aria-expanded="true"] .user-menu__chev { transform: rotate(180deg); }
.avatar {
  display: grid; place-items: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  font-weight: 800; font-size: 14px; text-transform: uppercase; color: #fff;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-menu__email { display: none; color: #dcdce2; font-weight: 600; font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 120;
  width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: slideDown .18s var(--ease);
}
.user-dropdown__head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); min-width: 0; }
.user-dropdown__head strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown__head small { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: #dcdce2; text-align: left; transition: background .15s, color .15s; }
.user-dropdown__item svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; flex-shrink: 0; }
.user-dropdown__item:hover, .user-dropdown__item:focus-visible { background: var(--surface-2); color: var(--text); }
.user-dropdown__item--danger { color: #fca5a5; }
.user-dropdown__item--danger:hover { background: rgba(239, 68, 68, .12); color: #fecaca; }

@media (min-width: 440px) {
  .guest-actions .btn span { display: inline; }
  .guest-actions .btn { padding: 0 16px; }
}
@media (min-width: 1024px) {
  .header__row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo tabs actions";
    gap: 32px;
    padding-block: 14px;
  }
  .tabs { margin: 0; padding: 0; justify-content: center; }
  .user-menu__email { display: inline; }
}

/* Búsqueda de cabecera */
.header-search { border-top: 1px solid var(--border); padding-block: 12px; animation: slideDown .25s var(--ease); }
.header-search__box { position: relative; max-width: 720px; margin-inline: auto; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  z-index: 60;
}
.search-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 8px; border-radius: var(--radius-sm);
  text-align: left; cursor: pointer;
  transition: background .2s;
}
.search-item:hover, .search-item:focus-visible { background: var(--surface-2); }
.search-item img { width: 40px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: var(--surface-3); flex-shrink: 0; }
.search-item__text { min-width: 0; display: flex; flex-direction: column; }
.search-item__title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item__meta { font-size: 12px; color: var(--text-muted); }
.search-all { display: block; width: 100%; text-align: center; padding: 10px; font-weight: 700; color: #ff7aa5; border-top: 1px solid var(--border); margin-top: 4px; }
.search-all:hover { background: var(--surface-2); border-radius: var(--radius-sm); }
.search-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 14px; }

.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 16px; color: var(--text-dim); pointer-events: none; }
.search input {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search--sm input { height: 40px; }

.select { position: relative; display: block; }
.select::after {
  content: ""; position: absolute; right: 18px; top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); pointer-events: none;
}
.select select, .input-box {
  width: 100%;
  height: 46px;
  padding: 0 40px 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.input-box { cursor: text; padding-right: 16px; }
.select select:focus, .input-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select option { background: var(--surface); color: var(--text); }

/* ---------- Layout ---------- */
.main { flex: 1; }
.view { animation: fadeIn .35s var(--ease); }
.section { padding-block: 40px 4px; }
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section__title {
  display: flex; align-items: center; gap: 12px;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.section__title::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad);
  box-shadow: 0 0 0 4px rgba(255, 61, 127, .12);
}
.see-all {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted); font-weight: 600; font-size: 13px;
  white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s;
}
.see-all svg { width: 18px; height: 18px; fill: currentColor; transition: transform .2s; }
.see-all:hover { color: #fff; border-color: var(--accent); background: var(--accent-soft); }
.see-all:hover svg { transform: translateX(3px); }
.center-row { display: flex; justify-content: center; margin-top: 24px; }

.page { padding-block: 24px 20px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb svg { width: 16px; height: 16px; fill: currentColor; }
.breadcrumb [aria-current] { color: #fff; font-weight: 600; }
.page__title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 6px;
}
.page__sub { color: var(--text-muted); margin-bottom: 26px; }

/* ---------- Slider destacado ---------- */
.hero-slider {
  position: relative;
  height: clamp(440px, 64vh, 620px);
  overflow: hidden;
  isolation: isolate;
  background: #000;
  touch-action: pan-y;
}
.hero-slider__track { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .8s var(--ease), visibility 0s linear .8s;
}
.hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity .8s var(--ease), visibility 0s; z-index: 1; }
.hero-slide__bg {
  position: absolute; inset: -40px;
  background-size: cover; background-position: center 25%;
  filter: blur(30px) brightness(.45) saturate(1.25);
  transform: scale(1.1);
}
.hero-slide.is-active .hero-slide__bg { animation: kenburns 9s ease-out both; }
.hero-slide::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(11, 11, 16, .35) 45%, rgba(11, 11, 16, .6) 100%),
    linear-gradient(to right, rgba(11, 11, 16, .85) 0%, transparent 75%);
}
.hero-slide__content {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; align-items: center; gap: 36px;
  padding-block: 40px 96px;
}
.hero-slide__poster {
  display: none;
  width: 220px; aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .08);
  flex-shrink: 0;
  background: var(--surface-2);
}
.hero-slide.is-active .hero-slide__poster { animation: popIn .7s var(--ease) both; }
@media (min-width: 768px) { .hero-slide__poster { display: block; } }
.hero-slide__inner { max-width: 680px; min-width: 0; }
.hero-slide__kicker { color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.hero-slide__title {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.08;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .5);
}
.hero-slide.is-active .hero-slide__inner > * { animation: riseIn .7s var(--ease) both; }
.hero-slide.is-active .hero-slide__inner > *:nth-child(2) { animation-delay: .08s; }
.hero-slide.is-active .hero-slide__inner > *:nth-child(3) { animation-delay: .14s; }
.hero-slide.is-active .hero-slide__inner > *:nth-child(4) { animation-delay: .2s; }
.hero-slide.is-active .hero-slide__inner > *:nth-child(5) { animation-delay: .26s; }
.hero-slide__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(6px);
  font-size: 12px; font-weight: 700;
}
.meta-chip .icon { width: 15px; height: 15px; }
.meta-chip--gold { color: var(--gold); background: rgba(245, 197, 24, .1); border-color: rgba(245, 197, 24, .35); }
.meta-chip--live { color: var(--live); }
.meta-chip--done { color: var(--done); }
.meta-chip--live::before, .meta-chip--done::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hero-slide__genres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.genre-tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600; font-size: 12px;
  transition: background .2s, color .2s, border-color .2s;
}
.genre-tag:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.hero-slide__text {
  color: #c9c9d6;
  font-size: 15px;
  max-width: 600px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 22px;
}
.hero-slide__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-slider__controls {
  position: absolute; left: 0; right: 0; bottom: 28px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.hero-dots { display: flex; gap: 8px; }
.hero-dot {
  width: 10px; height: 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .3);
  transition: width .3s var(--ease), background .3s;
}
.hero-dot.is-active { width: 32px; background: var(--grad); }
.hero-dot:hover { background: rgba(255, 255, 255, .6); }
.hero-arrows { display: flex; gap: 12px; }
.hero-arrow {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(22, 22, 31, .8);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px);
  transition: background .2s, border-color .2s;
}
.hero-arrow svg { width: 24px; height: 24px; fill: #fff; }
.hero-arrow:hover { background: var(--accent); border-color: var(--accent); }
.hero-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 5; background: rgba(255, 255, 255, .06); }
.hero-progress span { display: block; height: 100%; width: 0; background: var(--grad); }
.hero-progress span.is-running { animation: progress var(--hero-ms, 5000ms) linear forwards; }
.hero-slider.is-paused .hero-progress span { animation-play-state: paused; }
.hero-slider--empty { height: auto; min-height: 0; }
.hero-skeleton { position: absolute; inset: 0; padding-block: 120px 96px; }
.hero-skeleton .skeleton--title { width: min(560px, 80%); height: 64px; }
@media (max-width: 767px) {
  .hero-slide__content { align-items: flex-end; padding-bottom: 88px; }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: rgba(0, 0, 0, .65);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #fff;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.badge--new { background: var(--grad); border-color: transparent; }
.badge--live { color: var(--live); }
.badge--done { color: var(--done); }
.badge--live::before, .badge--done::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--year { color: #e4e4ec; }

/* ---------- Últimos capítulos ---------- */
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 26px 22px;
}
@media (max-width: 560px) { .ep-grid { grid-template-columns: 1fr 1fr; gap: 18px 12px; } }
.ep-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; outline: none; min-width: 0; }
.ep-card__media {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.ep-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform .5s var(--ease), filter .3s; }
.ep-card__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .7) 0%, transparent 50%); }
.ep-card__media .badge--new { position: absolute; top: 10px; right: 10px; z-index: 2; }
.ep-card__media .ep-pill { position: absolute; left: 10px; bottom: 10px; z-index: 2; }
.ep-card__play {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.ep-card__play span {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 61, 127, .92);
  box-shadow: 0 8px 24px var(--accent-glow);
  transform: scale(.8);
  transition: transform .3s var(--ease);
}
.ep-card__play svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.ep-card:hover .ep-card__media, .ep-card:focus-visible .ep-card__media { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0, 0, 0, .55), 0 0 0 2px var(--accent); }
.ep-card:hover img, .ep-card:focus-visible img { transform: scale(1.06); filter: brightness(.8); }
.ep-card:hover .ep-card__play, .ep-card:focus-visible .ep-card__play { opacity: 1; }
.ep-card:hover .ep-card__play span, .ep-card:focus-visible .ep-card__play span { transform: scale(1); }
.ep-card__meta { display: flex; align-items: center; gap: 10px; }
.ep-pill { padding: 3px 10px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 800; }
.ep-card__time { font-size: 13px; color: var(--text-muted); }
.ep-card__title {
  font-size: 15px; font-weight: 800; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.ep-card__sub { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -6px; }

/* ---------- Pósters (agregados / catálogo) ---------- */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 16px;
}
@media (min-width: 640px) { .poster-grid { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 26px 20px; } }
@media (min-width: 1100px) { .poster-grid--5 { grid-template-columns: repeat(5, 1fr); } }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; cursor: pointer; outline: none; min-width: 0; }
.card__media {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), filter .3s; }
.card__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, transparent 35%);
}
.card__tl, .card__tr { position: absolute; top: 10px; z-index: 2; display: flex; gap: 6px; }
.card__tl { left: 10px; }
.card__tr { right: 10px; }
.card__fav {
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.card__fav svg { width: 15px; height: 15px; fill: currentColor; }
.card__play {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.card__play span {
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 8px 24px var(--accent-glow);
  transform: scale(.8);
  transition: transform .3s var(--ease);
}
.card__play svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }
.card:hover .card__media, .card:focus-visible .card__media { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0, 0, 0, .6), 0 0 0 2px var(--accent); }
.card:hover .card__media img, .card:focus-visible .card__media img { transform: scale(1.06); filter: brightness(.75); }
.card:hover .card__play, .card:focus-visible .card__play { opacity: 1; }
.card:hover .card__play span, .card:focus-visible .card__play span { transform: scale(1); }
.card__body { min-width: 0; padding-inline: 2px; }
.card__title {
  font-size: 15px; font-weight: 800; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.card__meta { color: var(--text-muted); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Explorar por género ---------- */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
@media (max-width: 480px) { .genre-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
@media (min-width: 1100px) { .genre-grid { grid-template-columns: repeat(6, 1fr); } }
.genre-tile {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
  text-align: center;
  min-width: 0;
  transition: background .2s, border-color .2s, transform .2s var(--ease), color .2s;
}
.genre-tile span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.genre-tile:hover { background: var(--accent-soft); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
#btn-genres-more svg { transition: transform .25s var(--ease); }
#btn-genres-more[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------- Top series ---------- */
.top-grid {
  display: grid;
  gap: 24px;
}
@media (min-width: 900px) { .top-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.top-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.top-col__head {
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 8px; margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.top-card {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  outline: none;
  min-width: 0;
  transition: border-color .2s, background .2s, transform .2s var(--ease), box-shadow .2s;
}
.top-card:hover, .top-card:focus-visible { border-color: rgba(255, 61, 127, .6); background: var(--surface-2); transform: translateX(4px); box-shadow: 0 10px 30px rgba(255, 61, 127, .1); }
.top-card--podium { background: linear-gradient(90deg, rgba(255, 61, 127, .08), var(--surface) 60%); }
.top-card__rank {
  position: relative;
  flex-shrink: 0;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  font-weight: 900; font-size: 18px; color: var(--text-muted);
}
.top-card__rank span { position: relative; z-index: 1; }
.top-card__rank.is-star { background: none; color: #fff; font-size: 16px; }
.top-card__rank.is-star span { margin-top: 3px; text-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.top-card__star {
  position: absolute; inset: -4px;
  width: calc(100% + 8px); height: calc(100% + 8px);
  filter: drop-shadow(0 4px 10px rgba(255, 61, 127, .45));
}
.top-card:hover .top-card__star { animation: starSpin .6s var(--ease); }
.top-card__poster { width: 56px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-3); flex-shrink: 0; }
.top-card.is-skeleton .top-card__poster { height: 84px; }
.top-card__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.top-card__title { font-size: 15px; font-weight: 800; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-card__text { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-card__stats { display: flex; gap: 14px; font-size: 13px; font-weight: 700; color: #cfcfd6; }
.top-card__stats span { display: inline-flex; align-items: center; gap: 5px; }
.top-card__stats .icon { width: 16px; height: 16px; color: var(--accent); }

/* ---------- Panel de filtros (catálogo) ---------- */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
}
@media (min-width: 768px) { .filter-panel { padding: 24px; } }
.filter-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .filter-grid { grid-template-columns: 1fr 1fr; } .filter--search { grid-column: 1 / -1; } }
@media (min-width: 1024px) {
  .filter-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .filter--search { grid-column: span 2; }
}
.filter { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.filter label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.filter label .icon { width: 16px; height: 16px; color: var(--accent); }
.genre-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.genre-chips:empty { display: none; }
.genre-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 61, 127, .5);
  color: #ff7aa5; font-weight: 700; font-size: 13px;
}
.genre-chip span { font-size: 16px; line-height: 1; padding: 0 4px; }
.genre-chip:hover { background: var(--accent); color: #fff; }
.filter-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.filter-foot__summary { display: inline-flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 15px; }
.filter-foot__summary b { color: #fff; }
.filter-foot__summary .icon { color: var(--accent); }

/* ---------- Estrenos ---------- */
.estrenos-panel { display: flex; flex-direction: column; gap: 14px; }
.estrenos-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.estrenos-label .icon { color: var(--accent); width: 16px; height: 16px; }
.years { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.years__viewport { flex: 1; min-width: 0; }
.years__track {
  display: flex; gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 2px;
}
.years__track::-webkit-scrollbar { display: none; }
.years__bar { height: 8px; margin-top: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.years__bar { height: 4px; }
.years__bar span { display: block; height: 100%; width: 30%; border-radius: 999px; background: var(--grad); transition: width .2s, margin-left .2s; }
.year-chip, .month-chip {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 700; font-size: 14px; color: var(--text-muted);
  transition: background .2s, border-color .2s, color .2s;
}
.year-chip:hover, .month-chip:hover { border-color: var(--accent); color: #fff; }
.year-chip.is-active, .month-chip.is-active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 16px var(--accent-glow); }
.year-chip small { font-size: 11px; opacity: .75; margin-left: 4px; }
.months { display: flex; flex-wrap: wrap; gap: 8px; }
.month-chip { font-size: 14px; padding: 0 14px; white-space: nowrap; }
.estrenos-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.estrenos-head h2 { font-size: 22px; font-weight: 900; }
.estrenos-head span { color: var(--text-muted); font-size: 14px; }
.empty-box {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  text-align: center;
  color: #cfcfd6;
}
.empty-box__icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 61, 127, .18); }
.empty-box__icon svg { width: 28px; height: 28px; fill: var(--accent); }

/* ---------- Skeletons / spinners / vacío ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-sm); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
  animation: shimmer 1.4s infinite;
}
.skeleton--line { height: 12px; margin-top: 8px; }
.skeleton--line.w-60 { width: 60%; }
.skeleton--title { height: 34px; width: 55%; margin-bottom: 14px; }
.skeleton--text { height: 14px; margin-bottom: 8px; }
.is-skeleton { pointer-events: none; }
.is-skeleton .card__media::after { display: none; }

.spinner {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .12);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.spinner--sm { width: 20px; height: 20px; border-width: 2px; }
.loading-block { display: grid; place-items: center; gap: 12px; padding: 48px 16px; color: var(--text-muted); font-size: 14px; }
.empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}
.empty svg { width: 42px; height: 42px; fill: var(--text-dim); }
.empty strong { color: var(--text); font-size: 16px; }

/* ---------- Vista de serie ---------- */
.serie-hero { position: relative; isolation: isolate; overflow: hidden; }
.serie-hero__bg {
  position: absolute; inset: -40px; z-index: -2;
  background-size: cover; background-position: center 25%;
  filter: blur(36px) brightness(.35) saturate(1.3);
  transform: scale(1.1);
}
.serie-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, var(--bg) 0%, rgba(5, 5, 6, .55) 60%, rgba(5, 5, 6, .75) 100%);
}
.serie-hero__inner {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px 18px;
  align-items: start;
  padding-block: 24px 20px;
}
.serie-hero__poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--surface-2);
}
.serie-hero__info { min-width: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; font-weight: 600; margin-bottom: 10px; transition: color .2s; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 16px; height: 16px; fill: currentColor; }
.serie-hero__title { font-size: clamp(24px, 4.5vw, 46px); font-weight: 900; letter-spacing: -.03em; line-height: 1.08; margin-bottom: 14px; overflow-wrap: anywhere; }
.serie-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.serie-hero__synopsis-wrap { grid-column: 1 / -1; }
.synopsis {
  color: #d5d5dc;
  white-space: pre-line;
  max-width: 820px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.synopsis.is-expanded { -webkit-line-clamp: unset; display: block; }
.serie-hero__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 720px) {
  .serie-hero__inner { grid-template-columns: 230px 1fr; gap: 34px; padding-block: 40px 28px; }
  .serie-hero__synopsis-wrap, .serie-hero__actions { grid-column: auto; }
  .serie-hero__synopsis-wrap { margin-bottom: 20px; }
}

.watch { display: grid; gap: 18px; padding-block: 8px 40px; scroll-margin-top: calc(var(--header-h) + 12px); }
@media (min-width: 1024px) { .watch { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; gap: 12px;
  text-align: center; padding: 16px;
  color: var(--text-muted);
  background: radial-gradient(ellipse at center, #141416 0%, #000 75%);
  pointer-events: none;
  transition: opacity .3s;
}
.player__overlay svg { width: 48px; height: 48px; fill: var(--text-dim); }
.player__overlay.is-hidden { opacity: 0; }

.servers {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 12px; padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.servers__label { color: var(--text-muted); font-size: 13px; font-weight: 700; margin-right: 4px; }
.server-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  transition: background .2s, color .2s, border-color .2s;
}
.server-btn .icon { width: 14px; height: 14px; }
.server-btn:hover { color: var(--text); }
.server-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }

.player-bar { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "now now" "prev next"; gap: 10px; margin-top: 12px; }
.player-bar #btn-prev { grid-area: prev; }
.player-bar #btn-next { grid-area: next; }
.now-playing { grid-area: now; min-width: 0; text-align: center; }
.now-playing__label { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.now-playing__title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) { .player-bar { grid-template-columns: auto 1fr auto; grid-template-areas: "prev now next"; align-items: center; } }

.episodes { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.episodes__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.episodes__head h2 { font-size: 16px; font-weight: 800; }
.episodes__count { color: var(--text-muted); font-size: 12px; }
.ep-list { display: flex; flex-direction: column; gap: 4px; padding: 8px; max-height: 520px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.ep-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); text-align: left; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.ep-btn:hover { background: var(--surface-2); }
.ep-btn.is-active { background: var(--accent-soft); border-color: rgba(255, 61, 127, .45); }
.ep-btn__num { flex-shrink: 0; min-width: 42px; height: 34px; padding: 0 8px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); font-weight: 900; font-size: 13px; }
.ep-btn.is-active .ep-btn__num { background: var(--accent); color: #fff; }
.ep-btn__text { min-width: 0; display: flex; flex-direction: column; }
.ep-btn__title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-btn__sub { color: var(--text-dim); font-size: 12px; }
.ep-btn__eq { margin-left: auto; display: none; gap: 2px; align-items: flex-end; height: 14px; }
.ep-btn.is-active .ep-btn__eq { display: flex; }
.ep-btn__eq i { width: 3px; background: var(--accent); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.ep-btn__eq i:nth-child(2) { animation-delay: .2s; }
.ep-btn__eq i:nth-child(3) { animation-delay: .4s; }

/* ---------- Admin ---------- */
.admin-grid { display: grid; gap: 20px; margin-bottom: 20px; }
@media (min-width: 1024px) { .admin-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0;
  transition: border-color .3s, box-shadow .3s;
}
@media (min-width: 640px) { .panel { padding: 24px; } }
.panel.is-editing { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 197, 24, .12); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel__title { font-size: 19px; font-weight: 900; }
.panel__step { font-size: 12px; font-weight: 900; color: #ff7aa5; background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.panel.is-editing .panel__step { color: #1a1300; background: var(--gold); }
.panel__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 700; color: #dcdce2; }
.req { color: var(--accent); }
.opt { color: var(--text-dim); font-weight: 500; }
.hint { font-size: 12px; color: var(--text-dim); }
.hint b { color: var(--text-muted); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input[type="date"] { color-scheme: dark; min-height: 45px; }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; cursor: pointer; }
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.is-invalid, .field select.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); }
.field-row { display: grid; gap: 14px; }
@media (min-width: 520px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row--narrow { grid-template-columns: 120px 1fr; }
  .field-row--3 { grid-template-columns: 110px 1fr 1fr; }
}
.field--with-preview { flex-direction: row; align-items: flex-end; gap: 12px; }
.field__grow { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cover-preview { width: 56px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; }
.cover-preview:not([src]), .cover-preview[src=""] { visibility: hidden; }

.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt-row { display: flex; align-items: center; gap: 8px; }
.opt-row__label { flex-shrink: 0; min-width: 78px; font-size: 12px; font-weight: 800; color: #ff7aa5; background: var(--accent-soft); padding: 6px 10px; border-radius: 999px; text-align: center; }
.field .opt-row__input { flex: 1; min-width: 0; }
.opt-add { align-self: flex-start; }
@media (max-width: 420px) {
  .opt-row { flex-wrap: wrap; }
  .field .opt-row__input { flex-basis: 100%; order: 3; }
  .opt-row .icon-btn { margin-left: auto; }
}

.ac-results { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; padding: 8px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); }
.ac-results__head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); padding: 2px 4px 4px; }
.ac-item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); text-align: left; width: 100%; transition: background .2s; }
.ac-item:hover, .ac-item:focus-visible { background: var(--surface-2); }
.ac-item img { width: 42px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; background: var(--surface-3); flex-shrink: 0; }
.ac-item__text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ac-item__title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item__meta { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item__src { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--gold); margin-right: 6px; }

.panel--manager .search { flex: 1; max-width: 320px; min-width: 180px; }
.manager { display: flex; flex-direction: column; gap: 8px; }
.mgr-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); overflow: hidden; }
.mgr-item.is-editing { border-color: var(--gold); }
.mgr-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.mgr-row img { width: 38px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; background: var(--surface-3); flex-shrink: 0; }
.mgr-row__text { min-width: 0; flex: 1; }
.mgr-row__title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-row__meta { font-size: 12px; color: var(--text-muted); }
.mgr-row__actions { display: flex; gap: 6px; flex-shrink: 0; }
.mgr-toggle svg { transition: transform .25s var(--ease); }
.mgr-item.is-open .mgr-toggle svg { transform: rotate(180deg); }
.mgr-eps { border-top: 1px solid var(--border); padding: 6px 12px 10px 62px; display: flex; flex-direction: column; gap: 2px; }
.mgr-ep { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.mgr-ep:last-child { border-bottom: 0; }
.mgr-ep.is-editing { background: rgba(245, 197, 24, .06); border-radius: 6px; }
.mgr-ep__num { font-weight: 900; font-size: 12px; color: #ff7aa5; min-width: 44px; }
.mgr-ep__title { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dcdce2; }
.mgr-ep__opts { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.mgr-ep .icon-btn { width: 32px; height: 32px; }
.mgr-ep .icon-btn svg { width: 17px; height: 17px; }
.mgr-eps .loading-block, .mgr-eps .mgr-empty { padding: 12px 0; place-items: start; font-size: 13px; color: var(--text-muted); }
@media (max-width: 520px) { .mgr-eps { padding-left: 12px; } .mgr-ep__opts { display: none; } }

/* ---------- Modales ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .75); backdrop-filter: blur(6px); animation: fadeIn .2s var(--ease); }
.modal__dialog {
  position: relative;
  width: 100%; max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 22px 22px;
  animation: popIn .28s var(--ease);
}
.modal__dialog--sm { max-width: 380px; }
.modal__dialog form { display: flex; flex-direction: column; gap: 14px; }
.modal__close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--text-muted); transition: background .2s, color .2s; }
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__title { font-size: 22px; font-weight: 900; margin-bottom: 16px; letter-spacing: -.02em; }
.modal__text { color: var(--text-muted); margin-bottom: 20px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 18px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; }
.segmented__btn { padding: 9px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--text-muted); transition: background .2s, color .2s; }
.segmented__btn.is-active { background: var(--surface-3); color: var(--text); }
.form-msg { font-size: 13px; }
.form-msg:empty { display: none; }
.form-msg.is-error { color: #fca5a5; }
.form-msg.is-success { color: #86efac; }

/* ---------- Acceso (login / registro / recuperar) ---------- */
.modal__dialog.auth { max-width: 460px; padding: 26px 28px 28px; }
.auth__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.auth__title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.auth__close { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--text-muted); transition: background .2s, color .2s; }
.auth__close svg { width: 22px; height: 22px; fill: currentColor; }
.auth__close:hover { background: var(--surface-2); color: var(--text); }
.auth__sub { color: var(--text-muted); font-size: 14px; margin: -8px 0 18px; }
.auth form { gap: 16px; }
.auth .field label { color: var(--text-muted); font-weight: 600; }
.auth .field input, .acct-panel .field input { padding: 13px 16px; background: var(--bg-elev); border-color: var(--border); }
.auth__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -2px; }
.auth__link { font-size: 14px; color: var(--text-muted); transition: color .15s; }
.auth__link:hover { color: var(--text); text-decoration: underline; }
.auth__link--strong { color: #ff7aa5; font-weight: 700; }
.auth__link--strong:hover { color: var(--accent); }
.auth__switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-muted); }
.auth__captcha { display: flex; justify-content: center; min-height: 65px; }
.auth__divider { display: flex; align-items: center; gap: 14px; margin: 18px 0 16px; color: var(--text-muted); font-size: 14px; }
.auth__divider::before, .auth__divider::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.auth__social { display: flex; flex-direction: column; gap: 12px; }
.btn-social {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 50px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: transparent; font-weight: 700; font-size: 15px;
  transition: background .2s, border-color .2s, transform .15s;
}
.btn-social svg { width: 22px; height: 22px; flex-shrink: 0; }
.btn-social:hover:not(:disabled) { background: var(--surface-2); border-color: #44445a; }
.btn-social:active:not(:disabled) { transform: scale(.99); }
.btn-social:disabled { opacity: .6; cursor: progress; }
.auth[data-mode="login"] [data-auth-only]:not([data-auth-only="login"]),
.auth[data-mode="signup"] [data-auth-only]:not([data-auth-only="signup"]),
.auth[data-mode="forgot"] [data-auth-only]:not([data-auth-only="forgot"]),
.auth[data-mode="forgot"] [data-auth-hide="forgot"] { display: none; }

/* Casilla personalizada */
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: #dcdce2; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border-strong); background: var(--bg-elev); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.check input:checked + .check__box { background: var(--grad); border-color: transparent; }
.check input:checked + .check__box::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Campo de contraseña con botón ver/ocultar */
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 48px !important; }
.pass-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-dim); transition: color .15s, background .15s; }
.pass-toggle:hover { color: var(--text); background: var(--surface-2); }
.pass-toggle svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Mi Cuenta ---------- */
.acct-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border-strong); margin: 18px 0 34px; overflow-x: auto; scrollbar-width: none; }
.acct-tab { position: relative; padding: 14px 16px; font-weight: 700; font-size: 15px; color: var(--text-muted); white-space: nowrap; transition: color .2s; }
.acct-tab:hover { color: var(--text); }
.acct-tab.is-active { color: var(--text); }
.acct-tab.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad); }
.acct-panel { max-width: 580px; margin-inline: auto; display: flex; flex-direction: column; gap: 18px; animation: fadeIn .25s var(--ease); }
.acct-panel__title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.acct-panel .field label { color: var(--text-muted); font-weight: 600; }
.acct-panel .field input:disabled { opacity: .6; cursor: not-allowed; }
.avatar-edit { display: flex; align-items: center; gap: 18px; }
.avatar-edit__pic { position: relative; cursor: pointer; flex-shrink: 0; border-radius: 50%; }
.avatar--xl { width: 96px; height: 96px; font-size: 36px; border: 3px solid var(--surface-3); }
.avatar-edit__pic:hover .avatar--xl { border-color: var(--accent); }
.avatar-edit__badge { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); border: 3px solid var(--bg); }
.avatar-edit__badge svg { width: 15px; height: 15px; fill: #fff; }
.avatar-edit__spinner { position: absolute; inset: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); display: grid; place-items: center; }
.avatar-edit__spinner::after { content: ''; width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .8s linear infinite; }
.avatar-edit__pic:focus-within .avatar--xl { box-shadow: 0 0 0 3px var(--accent-soft); }
.avatar-edit__text { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-muted); align-items: flex-start; }
.avatar-edit__text strong { color: #dcdce2; font-weight: 600; }
.notice { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--border); font-size: 14px; color: #c8c8d4; line-height: 1.55; }
.notice .link-btn { font-size: 14px; }

.age-gate { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at top, #24101b 0%, var(--bg) 70%); }
.age-gate__box { max-width: 460px; text-align: center; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 32px 24px; box-shadow: var(--shadow-lg); animation: popIn .3s var(--ease); }
.age-gate__badge { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--accent); color: var(--accent); font-weight: 900; font-size: 20px; margin-bottom: 16px; }
.age-gate h2 { font-size: 22px; margin-bottom: 10px; }
.age-gate p { color: var(--text-muted); margin-bottom: 22px; font-size: 14px; }
.age-gate__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 500; left: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
@media (min-width: 560px) { .toasts { left: auto; width: 380px; } }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 4px solid var(--accent-2); border-radius: var(--radius); box-shadow: var(--shadow); animation: toastIn .3s var(--ease); }
.toast.is-leaving { animation: toastOut .25s var(--ease) forwards; }
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
.toast__icon svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--danger); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--info .toast__icon { color: #93c5fd; }
.toast__msg { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.toast__close { color: var(--text-dim); font-size: 18px; line-height: 1; padding: 0 2px; }
.toast__close:hover { color: var(--text); }

/* ---------- Footer y botón subir ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 48px; padding-block: 22px; color: var(--text-dim); font-size: 13px; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer__links a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-muted); font-size: 13px; transition: color .15s, border-color .15s; }
.footer__links a:hover, .footer__links a[aria-current="page"] { color: var(--text); border-color: var(--accent); }

/* Páginas legales */
.legal-header__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.legal { max-width: 780px; padding-block: 34px 10px; line-height: 1.7; color: #c8c8d4; flex: 1; }
.legal__updated { color: var(--text-dim); font-size: 13px; margin: -6px 0 22px; }
.legal h2 { font-size: 19px; font-weight: 800; color: var(--text); margin: 28px 0 8px; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.legal b { color: #e4e4ec; }
.legal a { color: #ff7aa5; text-decoration: underline; }
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 8px 26px var(--accent-glow);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease), background .2s;
}
.to-top svg { width: 24px; height: 24px; fill: #fff; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { filter: brightness(1.1); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--text); z-index: 999; }

/* ---------- Animaciones ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes kenburns { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes progress { from { width: 0; } to { width: 100%; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes starSpin { from { transform: rotate(-72deg) scale(.8); } to { transform: none; } }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
