/* AnimeFlix — estilo inspirado en ani.pm: negro puro, Geist, cristal y pildoras */
:root {
  --bg: #000;
  --text: #f1f1f1;
  --text-2: rgb(241 241 241 / .64);
  --text-3: rgb(241 241 241 / .55); /* contraste AA sobre negro */
  --hairline: rgb(255 255 255 / .08);
  --hairline-2: rgb(255 255 255 / .14);
  --fill-1: rgb(255 255 255 / .06);
  --fill-2: rgb(255 255 255 / .1);
  --fill-3: rgb(255 255 255 / .16);
  --gold: #ffc94a;
  --green: #4ade80;
  --red: #ff6b81;
  --blue: #3ea6ff;
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 20px;
  /* escala de letra: pie, secundario, apoyo, cuerpo, destacado, titulo de seccion, titular */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 28px;
  --accent: #e50914;
  --online: #46d369;
  --gutter: clamp(16px, 4.2vw, 64px);
  --nav-h: 64px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --glass: blur(12px) saturate(140%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--fs-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
/* brillo ambiental de color detras de las filas, como en ani.pm */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 12% 78%, rgb(48 74 160 / .22), transparent 70%),
    radial-gradient(50vw 45vh at 88% 70%, rgb(120 60 150 / .18), transparent 70%),
    radial-gradient(40vw 35vh at 55% 100%, rgb(160 110 40 / .12), transparent 70%);
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }
img { display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: rgb(255 255 255 / .2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .14); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Barra superior ---------- */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  background: transparent;
  transition: background .3s var(--ease);
}
/* degradado suave (sin borde) para que el menu se lea sobre la imagen */
.navbar::before {
  content: '';
  position: absolute;
  inset: 0 0 -40px 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgb(0 0 0 / .6), rgb(0 0 0 / .25) 60%, transparent);
  transition: opacity .3s;
}
.navbar.scrolled {
  background: rgb(0 0 0 / .62);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
}
.navbar.scrolled::before { opacity: 0; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-left { gap: 28px; }
/* Logo ANIMEX: entrada animada, brillo que respira, giro del anillo al pasar el raton */
.logo { position: relative; display: flex; align-items: center; gap: 9px; white-space: nowrap; flex: none; }
.logo-mark-wrap { position: relative; display: grid; place-items: center; width: 42px; height: 32px; }
.logo-mark-img {
  width: 42px; height: 32px; object-fit: contain;
  filter: drop-shadow(0 0 4px rgb(255 255 255 / .35));
  animation: logo-in .9s cubic-bezier(.16, 1, .3, 1) both, logo-glow 4.5s ease-in-out 1.2s infinite;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), filter .3s;
}
.logo-word {
  height: 15px; width: auto;
  -webkit-mask-image: linear-gradient(100deg, #000 40%, rgb(0 0 0 / .45) 50%, #000 60%);
  mask-image: linear-gradient(100deg, #000 40%, rgb(0 0 0 / .45) 50%, #000 60%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  animation: word-in .9s .15s cubic-bezier(.16, 1, .3, 1) both;
}
.logo:hover .logo-mark-img { transform: rotate(-8deg) scale(1.08); filter: drop-shadow(0 0 10px rgb(255 255 255 / .75)); }
.logo:hover .logo-word { animation: word-shine 1.1s ease; }
.logo.bump .logo-mark-img { animation: logo-bump .6s cubic-bezier(.16, 1, .3, 1), logo-glow 4.5s ease-in-out .6s infinite; }
@keyframes logo-in { from { opacity: 0; transform: scale(.4) rotate(-25deg); filter: blur(6px); } }
@keyframes word-in { from { opacity: 0; transform: translateX(-10px); letter-spacing: .3em; } }
@keyframes logo-glow { 0%, 100% { filter: drop-shadow(0 0 3px rgb(255 255 255 / .3)); } 50% { filter: drop-shadow(0 0 9px rgb(255 255 255 / .65)); } }
@keyframes word-shine { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes logo-bump { 0% { transform: scale(1); } 35% { transform: scale(.85) rotate(-12deg); } 100% { transform: scale(1) rotate(0); } }
.login-brand { display: block; width: 230px; height: auto; margin: 0 auto 18px; filter: drop-shadow(0 0 18px rgb(255 255 255 / .25)); animation: logo-in 1s cubic-bezier(.16, 1, .3, 1) both; }
.nav-links { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-item {
  position: relative;
  padding: 8px 6px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  transition: color .2s;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); }
.nav-item.active::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px; bottom: 2px;
  height: 2px;
  border-radius: var(--r-xs);
  background: var(--text);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  width: 240px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--fill-1);
  border: 1px solid var(--hairline-2);
  cursor: text;
  transition: background .2s, border-color .2s;
}
.search-box:focus-within { background: var(--fill-2); border-color: rgb(255 255 255 / .3); }
.search-icon { width: 17px; height: 17px; color: var(--text-2); flex: none; }
.search-box input { background: none; border: none; outline: none; width: 100%; font-size: var(--fs-base); }
.search-box input::placeholder { color: var(--text-3); }

.nas-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--fill-1);
  border: 1px solid var(--hairline);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.nas-badge #nasFreeSpace { color: var(--text); }
.nas-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.btn-downloads {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-weight: 700;
  font-size: var(--fs-base);
  white-space: nowrap;
  transition: transform .2s var(--ease), background .2s;
}
.btn-downloads:hover { background: #e6e6e6; }
.btn-downloads:active { transform: scale(.97); }
.dl-icon { width: 17px; height: 17px; }
.badge-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: var(--fs-xs);
  line-height: 20px;
  text-align: center;
}

/* ---------- Destacado ---------- */
/* Portada compacta: fondo muy desenfocado (las imagenes de animeav1 son de baja
   resolucion y a pantalla completa se ven pixeladas) + poster nitido delante */
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(64px + 40px) var(--gutter) 44px;
}
.hero-bg {
  position: absolute;
  inset: -80px;
  background-size: cover;
  background-position: center;
  filter: blur(50px) saturate(150%) brightness(.55);
  opacity: .9;
  transition: background-image .6s ease;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(0 0 0 / .35) 0%, transparent 40%, #000 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}
.hero-poster {
  flex: none;
  width: clamp(130px, 14vw, 210px);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--r-lg);
  background: #111;
  box-shadow: 0 0 0 1px var(--hairline-2), 0 30px 60px -18px rgb(0 0 0 / .9);
}
.hero-poster:not([src]), .hero-poster[src=""] { visibility: hidden; }
.hero-content {
  width: min(640px, 100%);
  min-width: 0;
}

/* Portada grande (como ani.pm) cuando hay imagen HD.
   La imagen se funde por abajo con una mascara (sin corte) y las filas empiezan encima. */
.hero.big {
  min-height: min(92vh, 860px);
  display: flex;
  align-items: flex-end;
  padding-bottom: 150px;
  margin-bottom: -96px;
  overflow: visible;
}
.hero.big .hero-bg {
  inset: 0;
  filter: none;
  opacity: 1;
  background-position: center 22%;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, rgb(0 0 0 / .5) 70%, rgb(0 0 0 / .15) 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 45%, rgb(0 0 0 / .5) 70%, rgb(0 0 0 / .15) 88%, transparent 100%);
  animation: hero-in 1.2s var(--ease);
}
.hero.big .hero-shade {
  background: linear-gradient(to right, rgb(0 0 0 / .78) 0%, rgb(0 0 0 / .35) 38%, transparent 62%);
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
}
.hero.big .hero-poster { display: none; }
.hero.big .hero-title { font-size: clamp(32px, 4.8vw, 60px); text-shadow: 0 2px 24px rgb(0 0 0 / .55); }
@keyframes hero-in { from { opacity: 0; transform: scale(1.04); } }

/* logo del anime en lugar del titulo (como ani.pm) */
.hero-logo {
  display: block;
  max-width: min(480px, 85%);
  max-height: 190px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left bottom;
  margin-bottom: 18px;
  filter: drop-shadow(0 4px 24px rgb(0 0 0 / .6));
}
.hero-logo[hidden] { display: none; }
.hero.has-logo .hero-title {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hero-badge {
  display: inline-block;
  margin-bottom: 14px;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.hero-title {
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgb(0 0 0 / .5);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgb(0 0 0 / .55);
  border: 1px solid var(--hairline-2);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.chip.gold { color: var(--gold); }
.hero-desc {
  margin: 14px 0 22px;
  color: rgb(241 241 241 / .82);
  font-size: var(--fs-base);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 12px rgb(0 0 0 / .6);
}
.hero-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--fs-lg);
  white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover:not(:disabled) { background: #e6e6e6; }
.btn-secondary { background: var(--fill-2); color: var(--text); border: 1px solid var(--hairline-2); }
.btn-secondary:hover:not(:disabled) { background: var(--fill-3); }
.btn-secondary.on { background: rgb(74 222 128 / .16); border-color: rgb(74 222 128 / .4); color: var(--green); }
.btn-sm { height: 34px; padding: 0 16px; font-size: var(--fs-md); }
.btn-icon { width: 20px; height: 20px; }
.btn-round {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(0 0 0 / .55);
  border: 1px solid var(--hairline-2);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  transition: background .2s, transform .2s var(--ease);
}
.btn-round svg { width: 20px; height: 20px; }
.btn-round:hover { background: rgb(40 40 40 / .7); }
.btn-round:active { transform: scale(.94); }
.btn-round.on { color: var(--green); border-color: rgb(74 222 128 / .45); }

/* ---------- Catalogo ---------- */
.main-container {
  position: relative;
  z-index: 3;
  padding: 12px var(--gutter) 80px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 8px 0 18px;
}
.section-header h2 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.01em; }
body.home-mode .section-header { display: none; }
/* secciones / busqueda: sin destacado, rejilla bajo la barra */
body.grid-mode .hero { display: none; }
body.grid-mode .main-container { margin-top: 0; padding-top: calc(64px + 28px); }
.genre-filter select {
  height: 38px;
  padding: 0 38px 0 16px;
  border-radius: 999px;
  background: var(--fill-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f1f1f1' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--hairline-2);
  font-size: var(--fs-md);
  font-weight: 600;
  appearance: none;
  cursor: pointer;
  outline: none;
}
.genre-filter select option { background: #141414; }

/* filas */
.row-container { margin-bottom: 36px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.row-title { font-size: var(--fs-2xl); font-weight: 500; letter-spacing: -.01em; color: var(--text); }
.row-title b {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}
.row-title .count { font-size: var(--fs-base); font-weight: 600; color: var(--text-3); margin-left: 6px; }
.row-more { font-size: var(--fs-md); font-weight: 600; color: var(--text-2); white-space: nowrap; transition: color .2s; }
.row-more:hover { color: var(--text); }
.row-wrapper { position: relative; }
.row-slider {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(140px, 14.2vw, 210px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 4px 2px 6px;
}
.row-slider::-webkit-scrollbar { display: none; }
.row-slider > .anime-card { scroll-snap-align: start; }
.row-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / .6);
  border: 1px solid var(--hairline-2);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  font-size: var(--fs-md);
  opacity: 0;
  transition: opacity .2s, background .2s;
}
.row-wrapper:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: rgb(30 30 30 / .85); }
.row-arrow-left { left: 8px; }
.row-arrow-right { right: 8px; }

/* rejilla */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 14vw, 200px), 1fr));
  gap: 18px 12px;
}

/* tarjeta */
.anime-card { cursor: pointer; min-width: 0; }
.poster-wrapper {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #111;
  box-shadow: 0 0 0 1px var(--hairline) inset;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.anime-card:hover .poster-wrapper {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .28), 0 18px 40px -12px rgb(0 0 0 / .9);
}
.card-poster { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.anime-card:hover .card-poster { transform: scale(1.04); }
.card-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 44px 10px 10px;
  text-align: center;
  background: linear-gradient(to top, rgb(0 0 0 / .92) 0%, rgb(0 0 0 / .6) 45%, transparent 100%);
}
.card-title {
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
}
.card-meta .movie { color: var(--gold); }
.card-flag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: rgb(0 0 0 / .6);
  border: 1px solid rgb(74 222 128 / .5);
  color: var(--green);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
}
.card-skeleton .poster-wrapper {
  background: linear-gradient(100deg, #0e0e0e 30%, #1a1a1a 50%, #0e0e0e 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.empty-state { grid-column: 1 / -1; padding: 70px 0; text-align: center; color: var(--text-3); font-size: var(--fs-lg); }

.load-more-container { display: flex; justify-content: center; padding: 24px 0; }
.loading-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--fill-2);
  border-top-color: var(--text);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Ficha ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  overflow-y: auto;
  background: rgb(0 0 0 / .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal-card {
  position: relative;
  width: min(940px, 100%);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #0b0b0b;
  border: 1px solid var(--hairline-2);
  box-shadow: 0 40px 120px -20px rgb(0 0 0 / .9);
  transform: translateY(16px) scale(.98);
  transition: transform .35s var(--ease);
}
.modal-backdrop.open .modal-card { transform: none; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: var(--fs-2xl);
  line-height: 1;
  background: rgb(0 0 0 / .6);
  border: 1px solid var(--hairline-2);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
}
.modal-close:hover { background: rgb(40 40 40 / .8); }
.modal-hero { position: relative; aspect-ratio: 16 / 7; min-height: 260px; background: #111; }
.modal-backdrop-img { width: 100%; height: 100%; object-fit: cover; }
.modal-backdrop-img[src=""] { visibility: hidden; }
.modal-hero-gradient { position: absolute; inset: 0; background: linear-gradient(to top, #0b0b0b 0%, rgb(11 11 11 / .5) 45%, transparent 75%); }
.modal-hero-content { position: absolute; inset: auto 0 0 0; padding: 0 32px 22px; }
.modal-title { font-size: clamp(24px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; margin-bottom: 12px; text-wrap: balance; }
.categories-list { display: contents; }
.modal-meta .cat-pill,
.modal-meta .chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgb(0 0 0 / .55);
  border: 1px solid var(--hairline-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.type-tag.pelicula { color: var(--gold); }
.modal-body { padding: 8px 32px 32px; }
.modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.modal-actions-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* selector Serie / Pelicula */
.type-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--fill-1);
  border: 1px solid var(--hairline-2);
}
.type-switch button {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-2);
  transition: background .2s, color .2s;
}
.type-switch button:hover:not(.active) { color: var(--text); }
.type-switch button.active { background: #fff; color: #000; }
.type-switch.manual button.active { box-shadow: 0 0 0 2px var(--gold); }
.type-switch button:disabled { opacity: .5; cursor: default; }
.type-reset { font-size: var(--fs-sm); font-weight: 600; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.type-reset[hidden] { display: none; }
.nas-destination {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-sm);
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.nas-destination .type-reset { margin-left: 6px; font-family: inherit; }
.plan-edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; font-family: inherit; }
.plan-edit label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.plan-edit input { background: var(--fill-1); border: 1px solid var(--hairline); color: var(--text); border-radius: var(--r-sm); padding: 7px 10px; font: inherit; font-size: var(--fs-md); }
.plan-edit #planFolder { width: min(340px, 80vw); }
.plan-edit input[type=number] { width: 90px; }
.modal-desc { color: var(--text-2); font-size: var(--fs-base); line-height: 1.6; margin-bottom: 26px; max-width: 75ch; }
.block-title { font-size: var(--fs-xl); font-weight: 700; }
.download-view { border-top: 1px solid var(--hairline); padding-top: 22px; }
.movie-server-select { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.muted-note { font-size: var(--fs-md); color: var(--text-2); }
.muted-note.error { color: var(--red); }
.episodes-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.episodes-actions { display: flex; gap: 10px; align-items: center; }
.episodes-search-box input {
  height: 34px;
  width: 180px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--fill-1);
  border: 1px solid var(--hairline-2);
  font-size: var(--fs-md);
  outline: none;
}
.episodes-search-box input:focus { border-color: rgb(255 255 255 / .3); }
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}
.episode-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ep-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #151515;
  box-shadow: 0 0 0 1px var(--hairline) inset;
}
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-num {
  position: absolute;
  left: 8px;
  bottom: 8px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: rgb(0 0 0 / .7);
}
.ep-info { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ep-title { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-ep-download {
  flex: none;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--fill-2);
  border: 1px solid var(--hairline-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  transition: background .2s;
}
.btn-ep-download:hover:not(:disabled) { background: #fff; color: #000; }
.btn-ep-download:disabled { opacity: .75; cursor: default; }
.btn-ep-download.done { color: var(--green); border-color: rgb(74 222 128 / .4); }
.ep-buttons { display: flex; gap: 6px; flex: none; }
.btn-ep-watch {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  transition: background .2s;
}
.btn-ep-watch:hover { background: #e6e6e6; }
.ep-thumb { cursor: pointer; }
.ep-thumb::after {
  content: '▶';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: var(--fs-xl);
  color: #fff;
  background: rgb(0 0 0 / .35);
  opacity: 0;
  transition: opacity .2s;
}
.ep-thumb:hover::after { opacity: 1; }
.btn-watch { margin-top: 14px; }

/* ---------- Reproductor ---------- */
.player-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(0 0 0 / .88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
}
.player-backdrop.open { opacity: 1; visibility: visible; }
.player-card { width: min(1180px, 100%); display: flex; flex-direction: column; gap: 14px; }
.player-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.player-top .modal-close { position: static; flex: none; }
.player-title { font-size: var(--fs-xl); font-weight: 800; }
.player-sub { font-size: var(--fs-md); color: var(--text-2); }
.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #050505;
  box-shadow: 0 0 0 1px var(--hairline-2), 0 30px 80px -20px rgb(0 0 0 / .9);
}
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--text-2); pointer-events: none; }
.player-msg:empty { display: none; }
.player-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.server-list { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.server-list button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--fill-1);
  border: 1px solid var(--hairline-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-2);
  transition: background .2s, color .2s;
}
.server-list button:hover { color: var(--text); background: var(--fill-2); }
.server-list button.active { background: #fff; color: #000; border-color: #fff; }
.player-nav { display: flex; gap: 8px; }
.player-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-3); }
.player-foot b { color: var(--text-2); }
.srv-tag { margin-left: 4px; font-size: var(--fs-xs); font-weight: 700; opacity: .7; }
.srv-tag.ok { color: var(--green); opacity: 1; }
.server-list button.active .srv-tag.ok { color: #138a3c; }

/* ---------- Panel de descargas ---------- */
.downloads-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: rgb(10 10 10 / .86);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-left: 1px solid var(--hairline-2);
  transform: translateX(100%);
  transition: transform .4s var(--ease);
}
.downloads-drawer.open { transform: none; box-shadow: -30px 0 80px rgb(0 0 0 / .6); }
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--hairline);
}
.drawer-title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: 700; }
.drawer-tools { display: flex; align-items: center; gap: 8px; }
.drawer-close { width: 34px; height: 34px; border-radius: 50%; font-size: var(--fs-xl); background: var(--fill-1); }
.drawer-close:hover { background: var(--fill-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.empty-downloads { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin-top: 30vh; color: var(--text-2); }
.empty-downloads small { color: var(--text-3); }
.dl-item { padding: 14px; border-radius: var(--r-md); background: var(--fill-1); border: 1px solid var(--hairline); }
.dl-item-header { display: flex; justify-content: space-between; gap: 10px; }
.dl-item-title { font-size: var(--fs-base); font-weight: 700; }
.dl-item-dest { margin-top: 2px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--fs-xs); color: var(--text-3); overflow-wrap: anywhere; }
.dl-btn-cancel { width: 28px; height: 28px; flex: none; border-radius: 50%; font-size: var(--fs-xl); background: var(--fill-2); }
.dl-btn-cancel:hover { background: rgb(255 107 129 / .25); color: var(--red); }
.progress-bar-container { height: 5px; margin: 12px 0 8px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 999px; background: #fff; transition: width .4s ease; }
.dl-item.completed .progress-bar-fill { background: var(--green); }
.dl-item.error .progress-bar-fill, .dl-item.cancelled .progress-bar-fill { background: var(--red); }
.dl-metrics { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-sm); color: var(--text-2); }
.dl-speed { color: var(--text); font-weight: 600; }
.dl-item.error .dl-metrics { color: var(--red); }

/* ---------- Avisos ---------- */
.toast-container { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 11px 18px;
  border-radius: 999px;
  background: rgb(20 20 20 / .88);
  border: 1px solid var(--hairline-2);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  font-size: var(--fs-md);
  font-weight: 600;
  box-shadow: 0 12px 40px rgb(0 0 0 / .6);
  animation: toast-in .35s var(--ease);
}
.toast.success { border-color: rgb(74 222 128 / .45); }
.toast.error { border-color: rgb(255 107 129 / .5); color: #ffd2da; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Login ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card {
  width: min(380px, 100%);
  padding: 32px 28px;
  border-radius: var(--r-xl);
  background: rgb(14 14 14 / .8);
  border: 1px solid var(--hairline-2);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .9);
}
.login-logo { justify-content: center; margin-bottom: 22px; }
.login-card h1 { font-size: var(--fs-xl); font-weight: 800; text-align: center; margin-bottom: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: var(--fs-md); font-weight: 600; color: var(--text-2); }
.field input {
  height: 44px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: var(--fill-1);
  border: 1px solid var(--hairline-2);
  font-size: var(--fs-lg);
  color: var(--text);
  outline: none;
}
.field input:focus { border-color: rgb(255 255 255 / .35); background: var(--fill-2); }
.login-error { min-height: 20px; margin: 4px 0 10px; font-size: var(--fs-md); color: var(--red); }
.login-error:empty { min-height: 0; margin: 0; }
.login-submit { width: 100%; margin-top: 6px; }

/* ---------- Usuario / ajustes ---------- */
.user-menu { position: relative; }
.user-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: var(--fs-lg);
  background: var(--fill-2);
  border: 1px solid var(--hairline-2);
  text-transform: uppercase;
}
.user-btn:hover { background: var(--fill-3); }
.user-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 8px;
  border-radius: var(--r-md);
  background: rgb(18 18 18 / .95);
  border: 1px solid var(--hairline-2);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  box-shadow: 0 20px 50px rgb(0 0 0 / .6);
  display: none;
}
.user-pop.open { display: block; }
.user-pop .who { padding: 8px 10px 10px; font-size: var(--fs-md); color: var(--text-2); border-bottom: 1px solid var(--hairline); margin-bottom: 6px; }
.user-pop .who b { color: var(--text); font-size: var(--fs-base); }
.user-pop button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: var(--r-sm); font-size: var(--fs-md); font-weight: 600; }
.user-pop button:hover { background: var(--fill-2); }
.settings-card { width: min(560px, 100%); padding: 28px; }
.settings-card h2 { font-size: var(--fs-xl); font-weight: 800; margin-bottom: 18px; }
.settings-card h3 { font-size: var(--fs-lg); font-weight: 700; margin: 22px 0 12px; }
.settings-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.settings-row .field { flex: 1; min-width: 150px; margin-bottom: 0; }
.user-list { display: flex; flex-direction: column; gap: 6px; }
.user-list .u { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--fill-1); border: 1px solid var(--hairline); font-size: var(--fs-base); font-weight: 600; }
.user-list .role { font-size: var(--fs-xs); color: var(--text-3); margin-left: 8px; }
.settings-msg { min-height: 18px; margin-top: 10px; font-size: var(--fs-md); color: var(--text-2); }
.settings-msg.error { color: var(--red); }
.settings-msg.ok { color: var(--green); }

/* Estado de ANIMEX */
.health-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.health-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; border-radius: var(--r-sm); background: var(--fill-1); font-size: var(--fs-md); font-weight: 600; }
.health-row small { color: var(--text-3); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.health-row.ok span { color: var(--green); }
.health-row.bad { background: rgb(255 107 129 / .1); }
.health-row.bad span, .health-row.bad small { color: var(--red); }
.settings-note .good { color: var(--green); }
.settings-note .bad { color: var(--red); }
.settings-card { max-height: calc(100vh - 80px); overflow-y: auto; }

/* invitados: sin nada de NAS / descargas / ajustes del admin */
body.guest .admin-only { display: none !important; }
[hidden] { display: none !important; }

.settings-note { font-size: var(--fs-md); color: var(--text-2); margin-bottom: 12px; line-height: 1.5; }
.settings-note b { color: var(--text); overflow-wrap: anywhere; }

/* buscador: atajo */
.kbd {
  flex: none;
  font: 600 10.5px/1 'Geist', system-ui, sans-serif;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  color: var(--text-3);
  border: 1px solid var(--hairline-2);
}
.search-box:focus-within .kbd { display: none; }

/* Seguir viendo / progreso */
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(255 255 255 / .18); z-index: 3; }
.card-progress span { display: block; height: 100%; background: #fff; }
.card-remove {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-lg); line-height: 1;
  background: rgb(0 0 0 / .6); border: 1px solid var(--hairline-2);
  opacity: 0; transition: opacity .2s;
}
.anime-card:hover .card-remove { opacity: 1; }
.card-play {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center; font-size: 34px;
  background: rgb(0 0 0 / .25); opacity: 0; transition: opacity .2s;
}
.anime-card:hover .card-play { opacity: 1; }
.ep-seen {
  position: absolute; top: 8px; right: 8px; height: 22px; padding: 0 8px; border-radius: 999px;
  display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 700;
  background: rgb(0 0 0 / .7); color: var(--green);
}
.episode-card.watched .ep-thumb img { opacity: .55; }
.cat-pill.gold { color: var(--gold); }

/* Recomendaciones */
.recs-building {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin: 4px 0 34px; padding: 18px 20px; border-radius: var(--r-lg);
  background: var(--fill-1); border: 1px solid var(--hairline); font-weight: 700;
}
.recs-building small { flex-basis: 100%; font-weight: 500; color: var(--text-3); margin-left: 34px; }
.loading-spinner.small { width: 20px; height: 20px; border-width: 2px; }
.btn-feedback { width: 44px; height: 44px; background: var(--fill-1); color: var(--text); }
.btn-feedback svg { width: 19px; height: 19px; }
/* marcado: mano blanca rellena sobre fondo claro, como el resto de botones activos */
.btn-feedback.on, .btn-feedback.on-bad { background: #fff; border-color: #fff; color: #000; }
.btn-feedback.on svg, .btn-feedback.on-bad svg { fill: currentColor; stroke: #000; }

/* Relacionados */
.relations { border-top: 1px solid var(--hairline); padding: 20px 0 6px; margin-bottom: 8px; }
.relations-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 12px; }
.relation {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; text-align: left;
  border-radius: var(--r-md); background: var(--fill-1); border: 1px solid var(--hairline);
  transition: background .2s, border-color .2s;
}
.relation:hover { background: var(--fill-2); border-color: var(--hairline-2); }
.relation img { width: 44px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); flex: none; background: #151515; }
.relation-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.relation-type { font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.relation-title { font-size: var(--fs-md); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relation-go { font-size: var(--fs-xl); color: var(--text-3); }

/* Reproductor propio (Plyr con el estilo de la web) */
.player-video { position: absolute; inset: 0; background: #000; }
.player-video .plyr, .player-video video { width: 100%; height: 100%; }
.player-video .plyr__video-wrapper { height: 100%; background: #000; }
.player-video video { object-fit: contain; }
.plyr {
  --plyr-color-main: #fff;
  --plyr-video-control-color: #f1f1f1;
  --plyr-video-control-color-hover: #000;
  --plyr-video-control-background-hover: #fff;
  --plyr-range-thumb-background: #fff;
  --plyr-video-range-track-background: rgb(255 255 255 / .25);
  --plyr-menu-background: rgb(20 20 20 / .95);
  --plyr-menu-color: #f1f1f1;
  --plyr-tooltip-background: rgb(20 20 20 / .95);
  --plyr-tooltip-color: #f1f1f1;
  --plyr-font-family: 'Geist', system-ui, sans-serif;
  --plyr-control-radius: 999px;
  --plyr-video-controls-background: linear-gradient(transparent, rgb(0 0 0 / .8));
}
.plyr__control--overlaid { background: rgb(255 255 255 / .92) !important; color: #000 !important; padding: 22px !important; }
.plyr__control--overlaid:hover { background: #fff !important; }
.player-msg { z-index: 2; }
.player-frame iframe { z-index: 1; }
.server-more { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; }
.server-list .server-toggle { background: transparent; border-style: dashed; }

/* episodios: titulo arriba, botones debajo */
.ep-info { flex-wrap: wrap; }
.ep-info .ep-title { flex: 1 1 100%; }
.ep-buttons { width: 100%; }
.ep-buttons > button { flex: 1; }

/* ---------- Movil ---------- */
@media (max-width: 1500px) {
  .nav-left { gap: 18px; }
  .nav-item { padding: 8px 7px; }
  .nav-item.active::after { left: 7px; right: 7px; }
  .search-box { width: 200px; }
  .kbd { display: none; }
}
@media (max-width: 1360px) {
  .nas-badge { display: none; }
}
@media (max-width: 1100px) {
  .search-box { width: 170px; }
}
@media (max-width: 820px) {
  :root { --nav-h: auto; }
  .navbar { flex-wrap: wrap; padding: 10px var(--gutter); row-gap: 8px; background: rgb(0 0 0 / .8); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); }
  .nav-left { width: 100%; flex-direction: column; align-items: flex-start; gap: 6px; }
  .nav-links { width: 100%; margin: 0 -10px; }
  .nav-right { width: 100%; }
  .search-box { flex: 1; width: auto; }
  .btn-downloads span:not(.badge-count) { display: none; }
  .hero { padding-top: 130px; padding-bottom: 28px; }
  .hero-inner { flex-direction: column; align-items: flex-start; }
  .hero-poster { width: 120px; border-radius: var(--r-md); }
  .hero.big { min-height: 78vh; padding-bottom: 110px; margin-bottom: -70px; }
  .hero-logo { max-height: 120px; }
  .player-backdrop { padding: 10px; }
  .player-frame { border-radius: var(--r-md); }
  .hero.big .hero-bg { background-position: 65% center; }
  .modal-backdrop { padding: 0; }
  .modal-card { border-radius: 0; min-height: 100vh; }
  .modal-hero-content { padding: 0 18px 18px; }
  .modal-body { padding: 8px 18px 28px; }
  .episodes-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: none; }
  .episodes-search-box input { width: 130px; }
  .row-title { font-size: var(--fs-xl); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Mando / TV (tv.js) ---------- */
.kbnav :focus { outline: 3px solid #fff; outline-offset: 3px; border-radius: var(--r-sm); }
.kbnav .anime-card:focus { outline: none; }
.kbnav .anime-card:focus .poster-wrapper { outline: 3px solid #fff; outline-offset: 3px; transform: scale(1.05); z-index: 2; }
.kbnav .anime-card:focus .card-remove, .kbnav .anime-card:focus .card-play { opacity: 1; }
.kbnav #playerVideoBox:focus { outline: none; box-shadow: inset 0 0 0 3px rgb(255 255 255 / .55); }
.kbnav .plyr--fullscreen-active #playerVideoBox:focus, .kbnav #playerVideoBox:focus:has(.plyr--fullscreen-active) { box-shadow: none; }
.kbnav .search-box:focus-within { outline: 3px solid #fff; outline-offset: 2px; }
.kbnav .search-box input:focus { outline: none; }
.row-slider { scroll-padding: 0 48px; }
.tv .row-arrow, .tv .kbd { display: none; }
.tv .row-slider { padding-top: 10px; padding-bottom: 10px; }
.tv .row-title { font-size: var(--fs-2xl); }
.tv .nav-item { font-size: var(--fs-lg); }
.pad-help { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin: 4px 0 12px; font-size: var(--fs-md); color: var(--text-2); }
.pad-help b { color: var(--text); }
.tv-toggle { display: flex; align-items: center; gap: 10px; font-size: var(--fs-base); font-weight: 600; cursor: pointer; margin-bottom: 8px; }
.tv-toggle input { width: 18px; height: 18px; accent-color: #fff; }
.settings-note a { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* iPhone (app de inicio): pantalla completa girada si el movil esta en vertical (ver IOS_APP en app.js) */
@media (orientation: portrait) {
  html.ios-app .plyr.plyr--fullscreen-fallback {
    width: 100vh !important; width: 100dvh !important;
    height: 100vw !important;
    max-width: none !important; max-height: none !important;
    top: 0 !important; left: 0 !important; right: auto !important; bottom: auto !important;
    transform-origin: 0 0;
    transform: translateX(100vw) rotate(90deg);
  }
}

/* ---------- Controles grandes en el centro del video ---------- */
.center-ctrls {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: clamp(28px, 9vw, 84px);
  pointer-events: none;
  opacity: 1; transform: scale(1);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.plyr--hide-controls .center-ctrls { opacity: 0; transform: scale(.94); }
.plyr--hide-controls .center-ctrls .cc-btn { pointer-events: none; }
.cc-btn {
  position: relative; pointer-events: auto;
  display: grid; place-items: center;
  flex: none !important; padding: 0 !important; min-width: 0 !important;
  width: var(--cc, 64px) !important; height: var(--cc, 64px) !important;
  border-radius: 50%; color: #fff;
  background: rgb(0 0 0 / .38);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .2s var(--ease), background .2s;
}
.cc-btn svg { width: 58%; height: 58%; grid-area: 1 / 1; transition: opacity .25s var(--ease), transform .25s var(--ease); }
.cc-btn:active { transform: scale(.9); }
@media (hover: hover) { .cc-btn:hover { background: rgb(0 0 0 / .55); transform: scale(1.06); } }
.cc-play { --cc: 88px; background: rgb(255 255 255 / .16); }
@media (max-width: 600px) { .cc-btn { --cc: 54px; } .cc-play { --cc: 72px; } }
.plyr--fullscreen-active .cc-btn, .plyr--fullscreen-fallback .cc-btn { --cc: 76px; }
.plyr--fullscreen-active .cc-play, .plyr--fullscreen-fallback .cc-play { --cc: 104px; }
.cc-play .ic-pause { opacity: 0; transform: scale(.6); }
.is-playing .cc-play .ic-play { opacity: 0; transform: scale(.6); }
.is-playing .cc-play .ic-pause { opacity: 1; transform: none; }
.cc-flash {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  font-size: var(--fs-lg); font-weight: 800; color: #fff; opacity: 0; pointer-events: none;
  text-shadow: 0 1px 6px rgb(0 0 0 / .7);
}
.cc-btn.flash { animation: cc-pulse .45s var(--ease); }
.cc-btn.flash .cc-flash { animation: cc-float .8s var(--ease); }
.cc-back.flash svg { animation: cc-spin-back .45s var(--ease); }
.cc-fwd.flash svg { animation: cc-spin-fwd .45s var(--ease); }
@keyframes cc-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.14); background: rgb(255 255 255 / .28); } 100% { transform: scale(1); } }
@keyframes cc-float { 0% { opacity: 0; transform: translate(-50%, 8px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
@keyframes cc-spin-back { from { transform: rotate(0); } to { transform: rotate(-360deg); } }
@keyframes cc-spin-fwd { from { transform: rotate(0); } to { transform: rotate(360deg); } }
/* sin el boton grande de Plyr (ya esta el del centro) */
.plyr__control--overlaid { display: none !important; }
/* entrar en pantalla completa con fundido en vez de golpe */
.plyr--fullscreen-fallback { animation: fs-in .3s var(--ease); }
@keyframes fs-in { from { opacity: 0; } to { opacity: 1; } }
/* barra de abajo: aparece/desaparece suave */
.plyr__controls { transition: opacity .35s var(--ease), transform .35s var(--ease) !important; }

/* ---------- iPhone (app de inicio): la web llega hasta arriba (debajo de la hora) ---------- */
html.ios-app .navbar { padding-top: env(safe-area-inset-top); height: calc(var(--nav-h) + env(safe-area-inset-top)); }
html.ios-app body { padding-top: env(safe-area-inset-top); }
html.ios-app .player-backdrop, html.ios-app .modal-backdrop { padding-top: max(24px, env(safe-area-inset-top)); }
/* franja negra detras de la hora (fuera de la pantalla completa, que la cubre con el video) */
html.ios-app body::before { content: ''; position: fixed; inset: 0 0 auto 0; height: env(safe-area-inset-top); background: #000; z-index: 260; }
html.ios-app body:has(.plyr--fullscreen-fallback)::before { display: none; }

/* ---------- Salir de pantalla completa (boton grande arriba a la izquierda) ---------- */
.fs-exit {
  display: none; position: absolute; z-index: 4; top: 18px; left: 18px;
  width: 52px !important; height: 52px !important; padding: 0 !important; place-items: center;
  border-radius: 50%; color: #fff; background: rgb(0 0 0 / .45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .35s var(--ease), transform .2s var(--ease);
}
.fs-exit svg { width: 26px; height: 26px; }
.fs-exit:active { transform: scale(.9); }
.plyr--fullscreen-fallback .fs-exit, .plyr--fullscreen-active .fs-exit { display: grid; }
.plyr--hide-controls .fs-exit { opacity: 0; pointer-events: none; }

/* ---------- Encuadre en pantalla completa (Ajustes > Reproductor) ---------- */
.plyr--fullscreen-fallback .plyr__video-wrapper, .plyr--fullscreen-active .plyr__video-wrapper { overflow: hidden; }
html[data-fs-fit="mid"] .plyr--fullscreen-fallback video, html[data-fs-fit="mid"] .plyr--fullscreen-active video { transform: scale(1.14); }
html[data-fs-fit="fill"] .plyr--fullscreen-fallback video, html[data-fs-fit="fill"] .plyr--fullscreen-active video { object-fit: cover !important; }
.plyr video { transition: transform .3s var(--ease); }

/* ---------- Ajustes: selectores ---------- */
.settings-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.settings-select { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-md); font-weight: 600; color: var(--text-2); }
.settings-select select { background: var(--fill-1); color: var(--text); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 10px 12px; font: inherit; font-size: var(--fs-base); max-width: 100%; }

/* ---------- Tele y consolas (modo TV / mando): rendimiento ----------
   Los procesadores de las teles no pueden con desenfoques ni animaciones continuas: cada cambio de
   foco obligaba a repintar el fondo desenfocado de la portada. Aqui todo es plano y ligero. */
html.tv *, html.tv *::before, html.tv *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.tv .hero-bg { filter: brightness(.4) saturate(1.1); opacity: .35; transition: none; }
html.tv .logo-mark-img, html.tv .logo-word { animation: none !important; filter: none !important; }
html.tv .navbar.scrolled, html.tv .navbar { background: rgb(8 8 10 / .92); }
html.tv .poster-wrapper, html.tv .anime-card:hover .poster-wrapper { box-shadow: none !important; }
html.tv .row-slider { scroll-snap-type: none; }
html.tv .modal-card, html.tv .player-card, html.tv .downloads-drawer { box-shadow: none !important; }
html.tv .modal-backdrop, html.tv .player-backdrop { background: rgb(0 0 0 / .94); }
html.tv .cc-btn, html.tv .fs-exit { background: rgb(20 20 22 / .75); }
html.tv .card-skeleton .poster-wrapper { animation: none !important; }

/* el foco (borde blanco + aumento) no puede cortarse arriba/abajo de las filas */
html.tv .row-slider, html.kbnav .row-slider { padding-top: 16px; padding-bottom: 18px; margin-top: -8px; margin-bottom: -8px; }
.kbnav .anime-card:focus .poster-wrapper { transform: scale(1.04); }

/* ---------- Pantalla completa: titulo, episodios y foco del mando ---------- */
.fs-title, .fs-bar { display: none; }
.plyr--fullscreen-fallback .fs-title, .plyr--fullscreen-active .fs-title {
  display: block; position: absolute; z-index: 4; top: 30px; left: 88px; right: 24px;
  font-size: var(--fs-xl); font-weight: 800; color: #fff; text-shadow: 0 1px 8px rgb(0 0 0 / .8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  transition: opacity .35s var(--ease);
}
.plyr--fullscreen-fallback .fs-bar, .plyr--fullscreen-active .fs-bar {
  display: flex; gap: 10px; position: absolute; z-index: 4; right: 20px; bottom: 74px;
  transition: opacity .35s var(--ease);
}
.fs-ep {
  padding: 10px 18px !important; border-radius: 999px; font-size: var(--fs-base); font-weight: 700; color: #fff;
  background: rgb(20 20 22 / .7);
}
.fs-ep[hidden] { display: none; }
.plyr--hide-controls .fs-title, .plyr--hide-controls .fs-bar { opacity: 0; }
.plyr--hide-controls .fs-bar .fs-ep { pointer-events: none; }
/* foco del mando en los botones del video */
.kbnav .cc-btn:focus, .kbnav .fs-exit:focus { outline: 3px solid #fff; outline-offset: 4px; border-radius: 50%; transform: scale(1.1); }
.kbnav .fs-ep:focus { outline: 3px solid #fff; outline-offset: 3px; background: #fff; color: #000; }
/* el foco de la primera tarjeta tampoco se corta por la izquierda */
html.tv .row-slider, html.kbnav .row-slider { padding-left: 10px; padding-right: 10px; margin-left: -10px; margin-right: -10px; }

/* ---------- Marca de agua: desenfoque ajustado al texto + nuestro logo (primeros minutos) ---------- */
.wm-blur {
  position: absolute; z-index: 2; pointer-events: none; opacity: 0;
  display: grid; place-items: center;
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 68%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 68%, transparent 100%);
  transition: opacity .8s ease;
}
.wm-blur img { height: 52%; width: auto; max-width: 92%; opacity: .82; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .45)); }
.wm-blur.on { opacity: 1; }
/* en la tele se quitaron los desenfoques; este se mantiene (es pequeno) */
html.tv .wm-blur { -webkit-backdrop-filter: blur(7px) !important; backdrop-filter: blur(7px) !important; }
/* foco del mando en la barra de Plyr */
.kbnav .plyr__controls :focus { outline: 3px solid #fff; outline-offset: 2px; border-radius: var(--r-sm); }
.kbnav .plyr__menu :focus { outline: 3px solid #fff; outline-offset: -3px; }

/* ---------- Menu de opciones (mando: mantener OK) ---------- */
.card-menu-backdrop {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 20px;
  background: rgb(0 0 0 / .72); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.card-menu-backdrop.open { opacity: 1; visibility: visible; }
.card-menu {
  width: min(420px, 100%); background: #141416; border: 1px solid var(--hairline-2); border-radius: var(--r-lg); padding: 18px;
  transform: translateY(10px) scale(.98); transition: transform .25s var(--ease);
}
.card-menu-backdrop.open .card-menu { transform: none; }
.cm-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.cm-poster { width: 54px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.cm-title { font-size: var(--fs-lg); font-weight: 800; line-height: 1.25; }
.cm-sub { font-size: var(--fs-md); color: var(--text-2); margin-top: 2px; }
.cm-actions { display: flex; flex-direction: column; gap: 4px; }
.cm-action {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-md);
  font-size: var(--fs-lg); font-weight: 700; text-align: left; color: var(--text); transition: background .15s;
}
.cm-action:hover, .cm-action:focus { background: rgb(255 255 255 / .1); }
.kbnav .cm-action:focus { outline: none; background: #fff; color: #000; }
.cm-action.danger { color: var(--red); }
.kbnav .cm-action.danger:focus { background: var(--red); color: #fff; }
.cm-ic { width: 22px; display: grid; place-items: center; font-size: var(--fs-lg); }
.cm-ic svg { width: 20px; height: 20px; }

/* ---------- Enviar a la tele ---------- */
.player-top-actions { display: flex; gap: 10px; align-items: center; flex: none; }
.btn-cast svg { width: 20px; height: 20px; }
.cast-panel { position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 300px; display: grid; place-items: center; background: #0d0d0f; border: 1px solid var(--hairline-2); }
.cast-panel[hidden] { display: none; }
.cast-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .22; }
.cast-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 20px; text-align: center; width: min(520px, 100%); }
.cast-where { font-size: var(--fs-md); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.cast-status { font-size: var(--fs-lg); font-weight: 700; min-height: 1.4em; }
.cast-progress { width: 100%; height: 4px; border-radius: var(--r-xs); background: rgb(255 255 255 / .15); overflow: hidden; }
.cast-progress span { display: block; height: 100%; width: 0; background: #fff; transition: width .6s linear; }
.cast-buttons { display: flex; align-items: center; gap: 22px; margin: 8px 0; }
.cast-btn { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgb(255 255 255 / .1); transition: transform .15s, background .15s; }
.cast-btn svg { width: 58%; height: 58%; }
.cast-btn:active { transform: scale(.9); }
.cast-main { width: 78px; height: 78px; background: #fff; color: #000; }
.cast-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- Tele: barra superior compacta (no se solapa nada) ---------- */
html.tv .logo-word, html.tv .nas-badge { display: none; }
html.tv .nav-links { gap: 0; }
html.tv .nav-item { font-size: var(--fs-base); padding: 6px 9px; }
html.tv .btn-downloads span:not(.badge-count) { display: none; }
html.tv .btn-downloads { padding: 0; width: 40px; height: 40px; justify-content: center; }
html.tv .search-box { width: 40px; padding: 0 11px; transition: width .25s var(--ease); }
html.tv .search-box:focus-within { width: 230px; }
html.tv .search-box input { min-width: 0; }
html.tv .poster-wrapper { transition: transform .15s ease-out; }

/* ---------- Movil / tactil: nada escondido tras el raton y botones del tamano del dedo ---------- */
@media (hover: none) {
  .card-remove { opacity: 1; width: 32px; height: 32px; }
  .row-arrow { display: none; }
}
@media (pointer: coarse) {
  .row-more { padding: 10px 6px; }
  .btn-ep-watch, .btn-ep-download { min-height: 40px; }
  #playerServers button, .server-toggle { min-height: 40px; }
  .plyr__control { padding: 10px !important; }
  .type-reset { padding: 10px 4px; }
  .player-nav .btn, .modal-actions .btn { min-height: 42px; }
}

/* ---------- Saltar intro / siguiente episodio ---------- */
.skip-btn {
  position: absolute; z-index: 6; right: 24px; bottom: 84px;
  display: flex; align-items: center; gap: 8px; padding: 12px 20px !important;
  border-radius: var(--r-sm); font-size: var(--fs-lg); font-weight: 800; color: #fff;
  background: rgb(20 20 22 / .78); border: 1.5px solid rgb(255 255 255 / .55);
  animation: pop-in .3s var(--ease);
}
.skip-btn svg { width: 18px; height: 18px; }
.skip-btn[hidden] { display: none; }
.skip-btn:hover, .kbnav .skip-btn:focus { background: #fff; color: #000; border-color: #fff; outline: none; }
.next-card {
  position: absolute; z-index: 6; right: 24px; bottom: 84px;
  width: min(320px, 46%); display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-md); background: rgb(16 16 18 / .94); border: 1px solid var(--hairline-2);
  box-shadow: 0 20px 50px -10px rgb(0 0 0 / .8);
  animation: pop-in .35s var(--ease);
}
.next-card[hidden] { display: none; }
.nc-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.nc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nc-ep { position: absolute; left: 10px; bottom: 8px; font-size: var(--fs-sm); font-weight: 800; padding: 3px 8px; border-radius: var(--r-sm); background: rgb(0 0 0 / .7); }
.nc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 9px; }
.nc-label { font-size: var(--fs-base); font-weight: 700; }
.nc-bar { height: 4px; border-radius: var(--r-xs); background: rgb(255 255 255 / .15); overflow: hidden; }
.nc-bar span { display: block; height: 100%; width: 0; background: #fff; }
.nc-actions { display: flex; gap: 8px; }
.nc-actions button { flex: 1; padding: 10px 8px !important; border-radius: var(--r-sm); font-size: var(--fs-md); font-weight: 800; }
.nc-play { background: #fff; color: #000; }
.nc-stay { background: rgb(255 255 255 / .12); color: #fff; }
.kbnav .nc-actions button:focus { outline: 3px solid #fff; outline-offset: 2px; }
.kbnav .nc-stay:focus { background: rgb(255 255 255 / .3); }
.has-next .fs-bar { display: none !important; }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
html.tv .next-card { box-shadow: none; }
.nc-actions button { white-space: nowrap; }
.nc-play { flex: 1.5 !important; }

/* ---------- Perfiles: ¿Quien esta viendo? ---------- */
.pf-avatar { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 800; background: #333; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-btn .ub-avatar { width: 100%; height: 100%; font-size: var(--fs-lg); }
.user-btn:has(.ub-avatar) { padding: 0; overflow: hidden; }
.profile-gate {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at top, #1b1b20 0%, #050506 70%); opacity: 0; transition: opacity .35s var(--ease);
}
.profile-gate.open { opacity: 1; }
.profile-gate[hidden] { display: none; }
.pg-inner { display: flex; flex-direction: column; align-items: center; gap: 28px; width: min(980px, 100%); }
.pg-logo { height: 22px; opacity: .9; }
.pg-title { font-size: clamp(24px, 4vw, 38px); font-weight: 800; text-align: center; }
.pg-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(16px, 3vw, 34px); }
.pg-profile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; width: clamp(96px, 14vw, 150px); color: var(--text-2); transition: color .2s; }
.pg-big { width: clamp(96px, 14vw, 150px); height: clamp(96px, 14vw, 150px); font-size: clamp(36px, 5vw, 58px); border: 3px solid transparent; transition: transform .25s var(--ease), border-color .2s; }
.pg-profile:hover, .pg-profile:focus { color: var(--text); outline: none; }
.pg-profile:hover .pg-big, .pg-profile:focus .pg-big { transform: scale(1.06); border-color: #fff; }
.pg-name { font-size: var(--fs-lg); font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-main { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-top: -6px; }
.pg-plus { background: rgb(255 255 255 / .08) !important; color: var(--text-2); font-weight: 400; border: 2px dashed rgb(255 255 255 / .25) !important; }
.pg-edit-badge { position: absolute; top: calc(clamp(96px, 14vw, 150px) / 2 - 22px); left: 50%; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .65); color: #fff; font-size: var(--fs-xl); pointer-events: none; }
.pg-manage { padding: 10px 22px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .35); font-weight: 700; color: var(--text-2); }
.pg-manage:hover, .pg-manage:focus { color: #000; background: #fff; border-color: #fff; outline: none; }
.pg-editor { position: fixed; inset: 0; z-index: 510; display: grid; place-items: center; padding: 20px; background: rgb(0 0 0 / .78); }
.pg-editor[hidden] { display: none; }
.pg-editor-card { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: #141416; border: 1px solid var(--hairline-2); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.pg-editor-card h2 { font-size: var(--fs-xl); }
.pg-avatars-label { font-size: var(--fs-md); font-weight: 700; color: var(--text-2); }
.pg-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 10px; }
.pg-av { aspect-ratio: 1; border-radius: 50%; padding: 0 !important; border: 3px solid transparent; transition: transform .15s, border-color .15s; }
.pg-av .pf-avatar { font-size: var(--fs-xl); }
.pg-av.on { border-color: #fff; }
.pg-av:hover, .kbnav .pg-av:focus { transform: scale(1.08); outline: none; border-color: rgb(255 255 255 / .6); }
.pg-editor-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pg-delete { margin-left: auto; color: var(--red) !important; }
.next-card.manual .nc-bar { display: none; }

/* ---------- Editor de perfil: color, personajes y foto ---------- */
.pg-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.pg-color { width: 34px; height: 34px; border-radius: 50%; padding: 0 !important; border: 3px solid transparent; transition: transform .15s; }
.pg-color.on { border-color: #fff; transform: scale(1.12); }
.kbnav .pg-color:focus { outline: 3px solid #fff; outline-offset: 3px; }
.pg-avatar-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pg-char-search { flex: 1; min-width: 200px; width: auto; }
.pg-av { position: relative; }
.pg-av-name { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); max-width: 110%; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .15s; pointer-events: none; text-shadow: 0 1px 3px #000; }
.pg-av:hover .pg-av-name, .pg-av:focus .pg-av-name { opacity: 1; }
.pg-avatars { max-height: 290px; overflow-y: auto; padding: 4px; }

/* ---------- Mi perfil y estadisticas ---------- */
.stats-card { width: min(860px, 100%); max-height: calc(100vh - 60px); overflow-y: auto; padding: 26px; }
.st-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-right: 40px; flex-wrap: wrap; }
.st-avatar { width: 76px; height: 76px; flex: none; font-size: var(--fs-2xl); }
.st-avatar .pf-avatar { font-size: var(--fs-2xl); }
.st-head h2 { font-size: var(--fs-2xl); }
.st-sub { color: var(--text-2); font-size: var(--fs-md); }
.st-edit { margin-left: auto; }
.st-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 22px; }
.st-card { background: var(--fill-1); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.st-card b { font-size: var(--fs-2xl); font-weight: 800; line-height: 1.1; }
.st-card span { font-size: var(--fs-sm); color: var(--text-2); font-weight: 600; }
.stats-card h3 { font-size: var(--fs-lg); margin: 18px 0 10px; }
.st-activity { display: flex; align-items: flex-end; gap: 4px; height: 90px; padding: 8px; background: var(--fill-1); border-radius: var(--r-md); }
.st-activity span { flex: 1; border-radius: var(--r-xs); background: rgb(255 255 255 / .1); min-height: 4px; }
.st-activity span.on { background: linear-gradient(to top, var(--accent), #f47521); }
.st-genres { display: flex; flex-direction: column; gap: 8px; }
.st-genre { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; font-size: var(--fs-md); font-weight: 600; }
.st-genre i { height: 8px; border-radius: var(--r-sm); background: rgb(255 255 255 / .08); overflow: hidden; }
.st-genre em { display: block; height: 100%; border-radius: var(--r-sm); background: #fff; }
.st-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.st-top-item { display: flex; flex-direction: column; gap: 4px; text-align: left; border-radius: var(--r-sm); padding: 0 !important; }
.st-top-item img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); }
.st-top-title { font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-top-meta { font-size: var(--fs-xs); color: var(--text-2); }
.kbnav .st-top-item:focus { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- Pantalla de carga ---------- */
.splash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; background: radial-gradient(ellipse at center, #141418 0%, #000 70%); transition: opacity .55s ease, visibility .55s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-logo { width: min(300px, 62vw); animation: splash-in 1s cubic-bezier(.16, 1, .3, 1) both, splash-glow 2.6s ease-in-out 1s infinite; }
.splash-bar { width: min(180px, 40vw); height: 3px; border-radius: var(--r-xs); background: rgb(255 255 255 / .12); overflow: hidden; }
.splash-bar span { display: block; width: 40%; height: 100%; border-radius: var(--r-xs); background: #fff; animation: splash-load 1.1s ease-in-out infinite; }
@keyframes splash-in { from { opacity: 0; transform: scale(.82); filter: blur(8px); } }
@keyframes splash-glow { 0%, 100% { filter: drop-shadow(0 0 6px rgb(255 255 255 / .2)); } 50% { filter: drop-shadow(0 0 22px rgb(255 255 255 / .55)); } }
@keyframes splash-load { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
html.tv .splash-logo { animation: splash-in .8s cubic-bezier(.16, 1, .3, 1) both; }

/* ---------- Trailer de fondo en la portada ---------- */
.hero-video { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; z-index: 0; }
.hero-video iframe { position: absolute; top: 50%; left: 50%; width: 100%; height: 56.25vw; min-height: 100%; min-width: calc(100% * 16 / 9); transform: translate(-50%, -50%) scale(1.15); border: 0; }
.hero.trailer-on .hero-video { opacity: 1; }
.hero.trailer-on .hero-bg { opacity: 0; transition: opacity 1.2s ease; }
.hero.trailer-on .hero-desc { opacity: .0; max-height: 0; overflow: hidden; transition: opacity .8s ease, max-height .8s ease; }
.hero-shade { z-index: 1; }
.hero-sound .snd-on { display: none; }
.hero-sound.on .snd-on { display: inline; }
.hero-sound.on .snd-off { display: none; }

/* ---------- Avisos ---------- */
.notif-menu { position: relative; }
.nav-bell { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); transition: color .2s, background .2s; }
.nav-bell svg { width: 20px; height: 20px; }
.nav-bell:hover, .nav-bell.has-new { color: var(--text); }
.nav-bell:hover { background: var(--fill-1); }
.nav-bell.has-new svg { animation: bell-ring 1.2s ease 1; transform-origin: 50% 0; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
.nav-bell .badge-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 800; display: grid; place-items: center; background: var(--accent); color: #fff; }
.nav-bell .badge-count[hidden] { display: none; }
.notif-pop { position: absolute; right: 0; top: calc(100% + 10px); width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow-y: auto; background: #141416; border: 1px solid var(--hairline-2); border-radius: var(--r-lg); padding: 10px; display: none; z-index: 120; box-shadow: 0 24px 60px -12px rgb(0 0 0 / .8); }
.notif-pop.open { display: block; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 10px; font-size: var(--fs-base); }
.np-readall { font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); padding: 4px 8px; border-radius: var(--r-sm); }
.np-readall:hover, .kbnav .np-readall:focus { color: #000; background: #fff; outline: none; }
.np-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px; border-radius: var(--r-md); text-align: left; }
.np-item:hover, .kbnav .np-item:focus { background: rgb(255 255 255 / .08); outline: none; }
.kbnav .np-item:focus { box-shadow: inset 0 0 0 2px #fff; }
.np-item img { width: 44px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.np-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--fs-md); }
.np-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-text span { color: var(--text-2); font-size: var(--fs-sm); }
.np-item.unread .np-text b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.np-empty { color: var(--text-2); font-size: var(--fs-md); line-height: 1.5; padding: 6px 8px 10px; }
.np-enable { width: 100%; margin-top: 6px; padding: 10px; border-radius: var(--r-sm); font-size: var(--fs-md); font-weight: 700; background: rgb(255 255 255 / .08); }
.np-enable[hidden] { display: none; }
@media (max-width: 700px) { .notif-pop { position: fixed; right: 12px; top: 62px; } }

/* ---------- Movimiento (desactivado en la tele y con "reducir movimiento") ---------- */
@keyframes card-in { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes kenburns { from { transform: scale(1) translate3d(0, 0, 0); } to { transform: scale(1.09) translate3d(-1.2%, -1%, 0); } }
.row-container.reveal .row-head { opacity: 0; }
.row-container.reveal.in .row-head { animation: rise-in .6s var(--ease) both; }
.row-container.reveal .row-slider > .anime-card { opacity: 0; }
.row-container.reveal.in .row-slider > .anime-card { animation: card-in .7s var(--ease) both; }
.row-container.reveal.in .row-slider > .anime-card:nth-child(n+13) { animation-delay: 700ms; }
.row-container.in .row-slider > .anime-card:nth-child(1) { animation-delay: 55ms; }
.row-container.in .row-slider > .anime-card:nth-child(2) { animation-delay: 110ms; }
.row-container.in .row-slider > .anime-card:nth-child(3) { animation-delay: 165ms; }
.row-container.in .row-slider > .anime-card:nth-child(4) { animation-delay: 220ms; }
.row-container.in .row-slider > .anime-card:nth-child(5) { animation-delay: 275ms; }
.row-container.in .row-slider > .anime-card:nth-child(6) { animation-delay: 330ms; }
.row-container.in .row-slider > .anime-card:nth-child(7) { animation-delay: 385ms; }
.row-container.in .row-slider > .anime-card:nth-child(8) { animation-delay: 440ms; }
.row-container.in .row-slider > .anime-card:nth-child(9) { animation-delay: 495ms; }
.row-container.in .row-slider > .anime-card:nth-child(10) { animation-delay: 550ms; }
.row-container.in .row-slider > .anime-card:nth-child(11) { animation-delay: 605ms; }
.row-container.in .row-slider > .anime-card:nth-child(12) { animation-delay: 660ms; }
.anime-grid > .anime-card, .episodes-grid > .episode-card { animation: card-in .6s var(--ease) both; }
.anime-grid > .anime-card:nth-child(12n+1), .episodes-grid > .episode-card:nth-child(12n+1) { animation-delay: 40ms; }
.anime-grid > .anime-card:nth-child(12n+2), .episodes-grid > .episode-card:nth-child(12n+2) { animation-delay: 80ms; }
.anime-grid > .anime-card:nth-child(12n+3), .episodes-grid > .episode-card:nth-child(12n+3) { animation-delay: 120ms; }
.anime-grid > .anime-card:nth-child(12n+4), .episodes-grid > .episode-card:nth-child(12n+4) { animation-delay: 160ms; }
.anime-grid > .anime-card:nth-child(12n+5), .episodes-grid > .episode-card:nth-child(12n+5) { animation-delay: 200ms; }
.anime-grid > .anime-card:nth-child(12n+6), .episodes-grid > .episode-card:nth-child(12n+6) { animation-delay: 240ms; }
.anime-grid > .anime-card:nth-child(12n+7), .episodes-grid > .episode-card:nth-child(12n+7) { animation-delay: 280ms; }
.anime-grid > .anime-card:nth-child(12n+8), .episodes-grid > .episode-card:nth-child(12n+8) { animation-delay: 320ms; }
.anime-grid > .anime-card:nth-child(12n+9), .episodes-grid > .episode-card:nth-child(12n+9) { animation-delay: 360ms; }
.anime-grid > .anime-card:nth-child(12n+10), .episodes-grid > .episode-card:nth-child(12n+10) { animation-delay: 400ms; }
.anime-grid > .anime-card:nth-child(12n+11), .episodes-grid > .episode-card:nth-child(12n+11) { animation-delay: 440ms; }
.anime-grid > .anime-card:nth-child(12n+12), .episodes-grid > .episode-card:nth-child(12n+12) { animation-delay: 480ms; }
.hero.big .hero-bg { animation: kenburns 26s ease-in-out infinite alternate; will-change: transform; }
.hero.swap .hero-content > * { animation: rise-in .8s var(--ease) both; }
.hero.swap .hero-content > *:nth-child(2) { animation-delay: 80ms; }
.hero.swap .hero-content > *:nth-child(3) { animation-delay: 160ms; }
.hero.swap .hero-content > *:nth-child(4) { animation-delay: 230ms; }
.hero.swap .hero-content > *:nth-child(5) { animation-delay: 300ms; }
.hero.swap .hero-content > *:nth-child(n+6) { animation-delay: 370ms; }
.hero.swap .hero-poster { animation: rise-in 1s var(--ease) both; }
.btn, .btn-round { transition: transform .18s var(--ease), background .2s, color .2s, border-color .2s, box-shadow .2s; }
.btn:active, .btn-round:active { transform: scale(.94); }
@media (hover: hover) { .btn-round:hover { transform: scale(1.08); } }
html.tv .row-container.reveal .row-head, html.tv .row-container.reveal .row-slider > .anime-card { opacity: 1; animation: none !important; }
html.tv .anime-grid > .anime-card, html.tv .episodes-grid > .episode-card, html.tv .hero-bg, html.tv .hero.swap .hero-content > *, html.tv .hero.swap .hero-poster { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .row-container.reveal .row-head, .row-container.reveal .row-slider > .anime-card { opacity: 1; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Vista previa al pasar el raton ---------- */
.hover-preview {
  position: absolute; z-index: 150; display: none; border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: #18181b; box-shadow: 0 30px 70px -14px rgb(0 0 0 / .9), 0 0 0 1px rgb(255 255 255 / .08);
}
.hover-preview.open { display: block; animation: hp-in .32s var(--ease) both; }
.hover-preview.out { animation: hp-out .22s ease both; }
@keyframes hp-in { from { opacity: 0; transform: scale(.62); } to { opacity: 1; transform: none; } }
@keyframes hp-out { to { opacity: 0; transform: scale(.9); } }
.hp-media { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.hp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .8s ease; animation: kenburns 12s ease-in-out infinite alternate; }
.hp-video { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hp-video iframe { position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%) scale(1.2); border: 0; pointer-events: none; }
.hover-preview.video-on .hp-video { opacity: 1; }
.hover-preview.video-on .hp-img { opacity: 0; }
.hp-shade { position: absolute; inset: 0; background: linear-gradient(to top, #18181b 0%, transparent 45%); pointer-events: none; }
.hp-logo { position: absolute; left: 14px; bottom: 10px; max-width: 55%; max-height: 38%; object-fit: contain; filter: drop-shadow(0 2px 6px rgb(0 0 0 / .6)); transition: opacity .6s ease; }
.hover-preview.video-on .hp-logo { opacity: .9; }
.hp-sound { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgb(0 0 0 / .45); border: 1px solid rgb(255 255 255 / .4); }
.hp-sound svg { width: 17px; height: 17px; }
.hp-sound .snd-on { display: none; }
.hp-sound.on .snd-on { display: inline; }
.hp-sound.on .snd-off { display: none; }
.hp-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.hp-actions { display: flex; gap: 8px; }
.hp-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid rgb(255 255 255 / .45); background: rgb(30 30 33 / .8); transition: transform .15s var(--ease), border-color .15s, background .15s; }
.hp-btn svg { width: 18px; height: 18px; }
.hp-btn:hover { border-color: #fff; transform: scale(1.1); }
.hp-play { background: #fff; color: #000; border-color: #fff; }
.hp-info { margin-left: auto; }
.hp-like.on { background: #fff; color: #000; border-color: #fff; }
.hp-title { font-size: var(--fs-lg); font-weight: 800; line-height: 1.25; }
.hp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }
.hp-score { color: var(--gold, #f5c518); }
.hp-tag { border: 1px solid rgb(255 255 255 / .35); border-radius: var(--r-xs); padding: 0 5px; }
.hp-why { color: #46d369; }
.hp-genres { font-size: var(--fs-sm); color: var(--text); display: flex; flex-wrap: wrap; gap: 6px; }
.hp-genres i { color: var(--text-3); font-style: normal; }

/* ---------- Portada que rota ---------- */
.hero-bg { transition: opacity .45s ease; }
.hero-bg.fade { opacity: 0 !important; }
.hero-dots { position: absolute; z-index: 3; right: var(--gutter); bottom: 34px; display: flex; gap: 8px; }
.hero-dots button { width: 34px; height: 16px; padding: 0 !important; display: grid; place-items: center; }
.hero-dots span { display: block; width: 100%; height: 4px; border-radius: var(--r-xs); background: rgb(255 255 255 / .28); overflow: hidden; position: relative; transition: background .2s; }
.hero-dots button:hover span { background: rgb(255 255 255 / .5); }
.hero-dots button.on span { background: rgb(255 255 255 / .35); }
.hero-dots button.on span::after { content: ''; position: absolute; inset: 0; background: #fff; transform-origin: left; animation: dot-fill 10s linear forwards; }
.hero.trailer-on .hero-dots button.on span::after { animation: none; transform: none; }
@keyframes dot-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.kbnav .hero-dots button:focus { outline: 2px solid #fff; outline-offset: 2px; border-radius: var(--r-sm); }
@media (max-width: 700px) { .hero-dots { left: 50%; right: auto; transform: translateX(-50%); bottom: 14px; } .hero-dots button { width: 22px; } }

/* ---------- Trailer fusionado con la pagina (sin corte): se disuelve en negro abajo y a la izquierda ---------- */
.hero-video {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 48%, rgb(0 0 0 / .55) 72%, transparent 96%), linear-gradient(to right, rgb(0 0 0 / .25) 0%, #000 42%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 0%, #000 48%, rgb(0 0 0 / .55) 72%, transparent 96%), linear-gradient(to right, rgb(0 0 0 / .25) 0%, #000 42%);
  mask-composite: intersect;
}
.hero.trailer-on .hero-shade {
  background:
    linear-gradient(to bottom, rgb(0 0 0 / .5) 0%, transparent 20%, transparent 52%, rgb(0 0 0 / .7) 78%, #000 100%),
    linear-gradient(to right, rgb(0 0 0 / .72) 0%, rgb(0 0 0 / .3) 38%, transparent 62%);
  transition: background 1s ease;
}

/* ---------- Alto contraste y texto mas grande (Ajustes > Accesibilidad) ---------- */
html.hc { font-size: 112%; --text-2: #f5f5f5; --text-3: #dcdcdc; --hairline: rgb(255 255 255 / .35); --hairline-2: rgb(255 255 255 / .5); --fill-1: rgb(255 255 255 / .14); }
html.hc body { font-size: 1.06rem; }
html.hc .card-title, html.hc .row-title, html.hc .modal-desc, html.hc .hero-desc, html.hc .settings-note { color: #fff !important; }
html.hc .card-overlay { background: linear-gradient(to top, #000 0%, rgb(0 0 0 / .85) 55%, transparent 100%) !important; }
html.hc .chip, html.hc .btn-secondary, html.hc .btn-round, html.hc .nav-item { border: 1.5px solid #fff !important; }
html.hc .nav-item { color: #fff; }
html.hc .nav-item.active { background: #fff; color: #000; }
html.hc :focus-visible, html.hc.kbnav :focus { outline: 4px solid #ffd60a !important; outline-offset: 3px; }
html.hc .kbnav .anime-card:focus .poster-wrapper, html.hc.kbnav .anime-card:focus .poster-wrapper { outline: 4px solid #ffd60a !important; }
html.hc .modal-card, html.hc .notif-pop, html.hc .card-menu, html.hc .user-pop { background: #000 !important; border: 2px solid #fff !important; }
html.hc .hero-shade { background: linear-gradient(to right, rgb(0 0 0 / .85) 0%, rgb(0 0 0 / .45) 55%, transparent 80%), linear-gradient(to bottom, transparent 50%, #000 100%) !important; }
html.hc .cc-btn, html.hc .fs-exit, html.hc .skip-btn { border: 2px solid #fff !important; background: #000 !important; }
html.hc .nav-links { gap: 2px; }
html.hc .nav-item { padding: 5px 7px; font-size: var(--fs-md); }

/* trailer: algo mas ampliado para recortar cualquier resto de la interfaz de YouTube en los bordes */
.hero-video iframe { transform: translate(-50%, -50%) scale(1.28) !important; }
.hp-video iframe { transform: translate(-50%, -50%) scale(1.32) !important; }
/* fundido cruzado del fondo de la portada */
.hero-bg-next { opacity: 0 !important; transition: opacity .85s ease !important; animation: none !important; }
.hero-bg-next.show { opacity: .9 !important; }
.hero.big .hero-bg-next.show { opacity: 1 !important; }

/* ---------- Avisos generales en la campana ---------- */
.np-ann-ic { width: 44px; height: 44px; flex: none; border-radius: var(--r-sm); overflow: hidden; background: #000; }
.np-ann-ic img { width: 100%; height: 100%; }
.np-body { color: var(--text) !important; white-space: normal; line-height: 1.35; }

/* ---------- Vista previa del episodio que estas viendo ---------- */
.ep-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hp-resume { color: #fff; background: var(--accent); border-radius: var(--r-xs); padding: 0 6px; }

/* ---------- Social ---------- */
.live-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); background: var(--fill-1); border: 1px solid var(--hairline); white-space: nowrap; }
.live-chip b { color: var(--text); }
.live-chip[hidden] { display: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgb(229 9 20 / .6); animation: live-pulse 1.6s ease-out infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgb(229 9 20 / .6); } 100% { box-shadow: 0 0 0 8px rgb(229 9 20 / 0); } }
@media (max-width: 1100px) { .live-chip { display: none !important; } }
.chip-live { background: rgb(229 9 20 / .18) !important; color: #fff; border-color: rgb(229 9 20 / .5) !important; }
.chip-live[hidden] { display: none; }
.pop-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-sm); background: var(--accent); color: #fff; font-size: var(--fs-xs); font-weight: 800; margin-left: 6px; }
.pop-badge[hidden] { display: none; }
.user-btn.has-req::after { content: ''; position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #000; }
.user-btn { position: relative; }
.card-friend { position: absolute; left: 8px; top: 8px; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 999px; background: rgb(0 0 0 / .72); font-size: var(--fs-xs); font-weight: 800; max-width: calc(100% - 16px); }
.card-friend span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-friend .cf-av { width: 22px; height: 22px; font-size: var(--fs-xs); flex: none; }
.card-friend.online .cf-av { box-shadow: 0 0 0 2px #46d369; }
.social-card { width: min(620px, 100%); max-height: calc(100vh - 60px); overflow-y: auto; padding: 24px; }
.so-title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xl); margin-bottom: 10px; }
.so-title svg { width: 24px; height: 24px; }
.social-card h3 { font-size: var(--fs-base); margin: 18px 0 8px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.social-card h3 .count { color: var(--text-3); }
.so-person { display: flex; align-items: center; gap: 12px; padding: 8px 8px; border-radius: var(--r-md); }
.so-person:hover { background: rgb(255 255 255 / .04); }
.so-av { width: 46px; height: 46px; flex: none; position: relative; font-size: var(--fs-xl); }
.so-av.online::after { content: ''; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #46d369; border: 2px solid #141416; }
.so-info { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: var(--fs-md); color: var(--text-2); }
.so-info b { color: var(--text); font-size: var(--fs-lg); }
.so-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-now { color: #46d369; font-weight: 700; }
.so-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.so-x { width: 32px; height: 32px; border-radius: 50%; color: var(--text-3); }
.so-x:hover, .kbnav .so-x:focus { color: var(--red); background: rgb(255 107 129 / .12); }
.np-round { border-radius: 50% !important; aspect-ratio: 1 !important; }

/* ---------- Comentarios ---------- */
.comments { margin-top: 6px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.comments[hidden] { display: none; }
.cm-toggle { display: flex; align-items: center; gap: 6px; font-size: var(--fs-base); color: var(--text); padding: 6px 0; }
.cm-toggle span { color: var(--text-2); }
.cm-chev { transition: transform .2s; }
.comments.open .cm-chev { transform: rotate(180deg); }
.cm-panel { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; animation: rise-in .35s var(--ease) both; }
.cm-panel[hidden] { display: none; }
.cm-form { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.cm-me { width: 36px; height: 36px; flex: none; font-size: var(--fs-lg); }
.cm-form textarea { flex: 1; min-width: 200px; resize: none; background: var(--fill-1); border: 1px solid var(--hairline-2); border-radius: var(--r-md); padding: 9px 12px; color: var(--text); font: inherit; font-size: var(--fs-base); line-height: 1.4; }
.cm-spoiler { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); padding-top: 9px; }
.cm-list { display: flex; flex-direction: column; gap: 14px; max-height: 420px; overflow-y: auto; }
.cm-item { display: flex; gap: 10px; }
.cm-av { width: 34px; height: 34px; flex: none; font-size: var(--fs-base); }
.cm-main { min-width: 0; flex: 1; }
.cm-head { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-md); }
.cm-head span { color: var(--text-3); font-size: var(--fs-sm); }
.cm-del { margin-left: auto; font-size: var(--fs-sm); color: var(--text-3); }
.cm-del:hover { color: var(--red); }
.cm-text { font-size: var(--fs-base); line-height: 1.45; margin-top: 2px; overflow-wrap: anywhere; }
.cm-text.spoiler { filter: blur(6px); cursor: pointer; user-select: none; transition: filter .25s; }
.cm-text.spoiler::before { content: 'Spoiler · '; }

/* ---------- Ficha: temporadas y bloques de episodios ---------- */
.season-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.season-bar[hidden], .range-bar[hidden] { display: none; }
.sb-label { font-size: var(--fs-sm); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-right: 4px; }
.sb-season { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 14px !important; border-radius: var(--r-sm); background: var(--fill-1); border: 1px solid var(--hairline-2); transition: background .15s, transform .15s var(--ease); }
.sb-season b { font-size: var(--fs-base); }
.sb-season span { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.sb-season:hover { background: rgb(255 255 255 / .12); }
.sb-season.on { background: #fff; color: #000; border-color: #fff; }
.sb-season.on span { color: #444; }
.kbnav .sb-season:focus { outline: 3px solid #fff; outline-offset: 3px; transform: scale(1.05); }
.range-bar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 12px; padding-bottom: 2px; }
.range-bar::-webkit-scrollbar { display: none; }
.range-bar button { flex: none; padding: 6px 12px !important; border-radius: 999px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); background: var(--fill-1); }
.range-bar button.on { background: #fff; color: #000; }
.range-bar.searching { display: none !important; }
.episode-card.out-range { display: none; }
.episodes-grid.searching .episode-card.out-range { display: flex; }

/* ---------- Tele: episodios en una fila horizontal (como Netflix) ---------- */
html.tv .episodes-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 300px; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 12px 10px 16px; margin: 0 -10px; scrollbar-width: none; }
html.tv .episodes-grid::-webkit-scrollbar { display: none; }
html.tv .episode-card .ep-title { font-size: var(--fs-lg); }
html.tv .episodes-search-box { display: none; }

/* ---------- Portada: boton de play grande, sin barras de progreso ---------- */
.hero-dots { display: none !important; }
.hero-play { height: 56px; padding: 0 34px 0 28px !important; font-size: var(--fs-xl); font-weight: 800; gap: 12px; border-radius: 999px; }
.hero-play .play-round { width: 26px; height: 26px; }
.live-pill {
  margin-left: 10px;
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 999px; max-width: calc(100% - 32px);
  background: rgb(10 10 12 / .62); border: 1px solid rgb(255 255 255 / .12); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); white-space: nowrap; animation: rise-in .8s var(--ease) both;
}
.live-pill[hidden] { display: none; }
.lp-item { display: inline-flex; align-items: center; gap: 6px; }
.lp-item b { color: var(--text); }
.lp-sep { width: 1px; height: 14px; background: rgb(255 255 255 / .2); }
.lp-sep[hidden] { display: none; }
.lp-comment { overflow: hidden; text-overflow: ellipsis; max-width: 380px; color: var(--text-2); }
.lp-comment:hover { color: var(--text); }
.lp-comment[hidden] { display: none; }
@media (max-width: 900px) { .live-pill { display: none !important; } }
html.tv .live-pill { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: rgb(10 10 12 / .85); }
.nav-badge { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-sm); background: var(--accent); color: #fff; font-size: var(--fs-xs); font-weight: 800; margin-left: 4px; vertical-align: 1px; }
.nav-badge[hidden], .nav-live[hidden] { display: none; }
.nav-live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #46d369; margin-left: 5px; vertical-align: 2px; box-shadow: 0 0 0 3px rgb(70 211 105 / .25); }
.toast-container { z-index: 900 !important; }

/* ---------- Explorar ---------- */
.explore-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; flex: 1; }
.explore-bar[hidden], .genre-filter[hidden] { display: none; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { padding: 7px 14px !important; border-radius: 999px; font-size: var(--fs-md); font-weight: 700; color: var(--text-2); background: var(--fill-1); border: 1px solid var(--hairline); transition: background .15s, color .15s; }
.fchip:hover { color: var(--text); }
.fchip.on { background: #fff; color: #000; border-color: #fff; }

/* ---------- Paginas ---------- */
.page-view { padding-bottom: 40px; animation: rise-in .5s var(--ease) both; }
.page-view[hidden] { display: none; }
.page-empty { color: var(--text-2); font-size: var(--fs-lg); line-height: 1.6; max-width: 60ch; padding: 30px 0; }
.page-h { font-size: var(--fs-xl); margin: 26px 0 12px; }
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.genre-tile { position: relative; height: 104px; border-radius: var(--r-lg); overflow: hidden; display: flex; align-items: flex-end; padding: 16px !important; font-size: var(--fs-xl); font-weight: 800; text-align: left; color: #fff;
  background: radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--g) 70%, #fff 0%) 0%, transparent 55%), linear-gradient(135deg, color-mix(in srgb, var(--g) 85%, #000) 0%, color-mix(in srgb, var(--g) 35%, #000) 100%);
  transition: transform .2s var(--ease), box-shadow .2s; }
.genre-tile:hover, .kbnav .genre-tile:focus { transform: translateY(-4px) scale(1.02); box-shadow: 0 18px 40px -14px var(--g); }
.top-row .anime-card .card-meta span::before { content: ''; }
.so-share { margin: 6px 0 4px; }
.btn.sent { background: rgb(70 211 105 / .18) !important; color: #46d369 !important; border-color: rgb(70 211 105 / .5) !important; animation: pop-in .35s var(--ease); }
.spin-sm { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* ---------- Party ---------- */
.btn-party[hidden] { display: none; }
.party-hero { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; padding: 24px; border-radius: var(--r-lg);
  background: linear-gradient(120deg, rgb(229 9 20 / .22), rgb(168 85 247 / .18)); border: 1px solid var(--hairline-2); }
.ph-text h3 { font-size: var(--fs-xl); margin-bottom: 6px; }
.ph-text p { color: var(--text-2); max-width: 60ch; line-height: 1.5; }
.ph-join { display: flex; gap: 8px; }
.ph-join input { width: 120px; text-transform: uppercase; letter-spacing: .15em; font-weight: 800; background: rgb(0 0 0 / .35); border: 1px solid var(--hairline-2); border-radius: var(--r-sm); padding: 9px 12px; color: var(--text); font: inherit; }
.party-current { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 16px; border-radius: var(--r-md); background: rgb(70 211 105 / .12); border: 1px solid rgb(70 211 105 / .4); }
.party-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.party-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); background: var(--fill-1); border: 1px solid var(--hairline); }
.party-card img { width: 52px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.pc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-md); color: var(--text-2); }
.pc-info b { color: var(--text); font-size: var(--fs-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-members, .pp-members { display: flex; align-items: center; }
.pp-m { width: 26px; height: 26px; margin-right: -6px; border: 2px solid #141416; border-radius: 50%; font-size: var(--fs-xs); }
.pp-count { margin-left: 14px; font-size: var(--fs-sm); color: var(--text-2); font-weight: 700; }
.party-panel { border-top: 1px solid var(--hairline); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.party-panel[hidden] { display: none; }
.pp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pp-title { font-weight: 800; }
.pp-title b { letter-spacing: .12em; background: #fff; color: #000; border-radius: var(--r-sm); padding: 1px 7px; margin-left: 4px; }
.pp-actions { display: flex; gap: 6px; margin-left: auto; }
.pp-leave { color: var(--red) !important; }
.pp-chat { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-md); }
.pp-msg { display: flex; gap: 8px; align-items: flex-start; animation: rise-in .3s var(--ease) both; }
.pp-msg.sys { color: var(--text-3); font-size: var(--fs-sm); font-style: italic; justify-content: center; }
.pp-av { width: 22px; height: 22px; flex: none; font-size: var(--fs-xs); }
.pp-form { display: flex; gap: 8px; }
.pp-form input { flex: 1; background: var(--fill-1); border: 1px solid var(--hairline-2); border-radius: var(--r-sm); padding: 8px 12px; color: var(--text); font: inherit; font-size: var(--fs-base); }
.party-toast { position: absolute; z-index: 7; left: 50%; top: 22px; transform: translate(-50%, -10px); padding: 8px 16px; border-radius: 999px; background: rgb(0 0 0 / .75); color: #fff; font-size: var(--fs-base); font-weight: 700; opacity: 0; transition: opacity .3s, transform .3s var(--ease); pointer-events: none; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* barra: que quepan todas las secciones; el buscador se ensancha al escribir */
.search-box { transition: background .2s, border-color .2s, width .3s var(--ease); }
@media (max-width: 1600px) { .search-box { width: 140px; } .search-box:focus-within { width: 260px; } }

/* ---------- Pildora "viendo / en linea" centrada entre la portada y las filas ---------- */
.live-strip { display: none; justify-content: center; position: relative; z-index: 4; margin: 0 0 18px; }
body.home-mode .live-strip { display: flex; }
.live-pill { margin-left: 0; }
.lp-watch, .lp-online { width: 6px; height: 6px; border-radius: 50%; flex: none; display: inline-block; }
.lp-watch { background: #46d369; animation: lp-pulse 1.8s ease-out infinite; }
.lp-online { border: 1.5px solid #46d369; background: transparent; width: 7px; height: 7px; }
@keyframes lp-pulse { 0% { box-shadow: 0 0 0 0 rgb(70 211 105 / .55); } 70% { box-shadow: 0 0 0 5px rgb(70 211 105 / 0); } 100% { box-shadow: 0 0 0 0 rgb(70 211 105 / 0); } }
@media (max-width: 900px) { .live-pill { display: flex !important; } .lp-comment, #lpCommentSep { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .lp-watch { animation: none; } }

/* ---------- Chat ---------- */
#btnChat { position: relative; }
.chat-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #46d369; border: 2px solid #0b0b0d; }
.chat-dot[hidden] { display: none; }
.cd-tab .chat-dot { position: static; display: inline-block; margin-left: 4px; vertical-align: 1px; border: 0; }
.chat-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 320;
  display: flex; flex-direction: column; background: #111113; border-left: 1px solid var(--hairline-2);
  box-shadow: -24px 0 60px rgb(0 0 0 / .5); transform: translateX(105%); visibility: hidden;
  transition: transform .35s var(--ease), visibility 0s linear .35s;
}
.chat-drawer.open { transform: none; visibility: visible; transition: transform .35s var(--ease); }
.cd-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--hairline); }
.cd-tabs { display: flex; gap: 4px; flex: 1; }
.cd-tab { padding: 8px 14px !important; border-radius: 999px; font-size: var(--fs-base); font-weight: 700; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.cd-tab:hover { color: var(--text); background: var(--fill-1); }
.cd-tab.on { background: #fff; color: #000; }
.cd-tab .badge-count { position: static; }
.cd-close { width: 36px; height: 36px; border-radius: 50%; font-size: var(--fs-2xl); color: var(--text-2); display: grid; place-items: center; }
.cd-close:hover { background: var(--fill-2); color: var(--text); }
.cd-sub { padding: 8px 16px; font-size: var(--fs-sm); color: var(--text-3); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--hairline); }
.cd-sub[hidden], .cd-peer[hidden], .cd-threads[hidden], .cd-msgs[hidden], .cd-form[hidden] { display: none; }
.cd-peer { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
.cd-back { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.cd-back:hover { background: var(--fill-2); color: var(--text); }
.cd-back svg { width: 20px; height: 20px; }
.cd-peer-av, .cd-th-av { width: 38px; height: 38px; flex: none; position: relative; font-size: var(--fs-lg); }
.cd-peer-av.online::after, .cd-th-av.online::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #46d369; border: 2px solid #111113; }
.cd-peer-info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: var(--fs-sm); color: var(--text-3); }
.cd-peer-info b { font-size: var(--fs-lg); color: var(--text); }
.cd-threads { flex: 1; overflow-y: auto; padding: 8px; }
.cd-thread { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px !important; border-radius: var(--r-md); text-align: left; }
.cd-thread:hover, .kbnav .cd-thread:focus { background: var(--fill-1); }
.cd-th-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-md); color: var(--text-3); }
.cd-th-info b { font-size: var(--fs-lg); color: var(--text); }
.cd-th-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-thread.unread .cd-th-info span { color: var(--text); font-weight: 600; }
.cd-th-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: var(--fs-xs); color: var(--text-3); }
.cd-th-side .badge-count { position: static; }
.cd-msgs { flex: 1; overflow-y: auto; padding: 16px 12px 8px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.cd-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; color: var(--text-3); font-size: var(--fs-md); line-height: 1.5; }
.cd-empty b { color: var(--text); font-size: var(--fs-lg); }
.cd-msg { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; max-width: 88%; }
.cd-msg.grouped { margin-top: 2px; }
.cd-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.cd-msg.new { animation: rise-in .3s var(--ease) both; }
.cd-av { width: 28px; height: 28px; flex: none; font-size: var(--fs-xs); align-self: flex-start; margin-top: 18px; }
.cd-msg.grouped .cd-av { margin-top: 0; height: 0; }
.cd-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cd-msg.mine .cd-body { align-items: flex-end; }
.cd-name { font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); padding-left: 4px; }
.cd-bubble { padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--fill-2); font-size: var(--fs-base); line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.cd-msg.mine .cd-bubble { background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.cd-meta { display: flex; gap: 8px; font-size: var(--fs-xs); color: var(--text-3); padding: 0 4px; opacity: 0; transition: opacity .15s; }
.cd-msg:hover .cd-meta, .cd-msg:focus-within .cd-meta, .cd-msg:last-child .cd-meta { opacity: 1; }
.cd-del { font-size: var(--fs-xs); color: var(--text-3); padding: 0 !important; }
.cd-del:hover { color: var(--red); text-decoration: underline; }
.cd-card { display: flex; align-items: center; gap: 10px; padding: 8px !important; border-radius: var(--r-md); background: var(--fill-1); border: 1px solid var(--hairline-2); text-align: left; width: 260px; max-width: 100%; transition: background .15s, transform .15s var(--ease); }
.cd-card:hover, .kbnav .cd-card:focus { background: var(--fill-2); transform: translateY(-1px); }
.cd-card img { width: 40px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.cd-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); color: var(--text-2); }
.cd-card-info b { font-size: var(--fs-md); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-card-play { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; flex: none; }
.cd-card-play svg { width: 15px; height: 15px; margin-left: 2px; }
.cd-form { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--hairline); }
.cd-form input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--fill-1); border: 1px solid var(--hairline-2); color: var(--text); font: inherit; font-size: var(--fs-base); }
.cd-form input:focus { outline: none; border-color: rgb(255 255 255 / .35); background: var(--fill-2); }
.cd-attach, .cd-send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.cd-attach { background: var(--fill-1); color: var(--text-2); }
.cd-attach:hover { background: var(--fill-2); color: var(--text); }
.cd-send { background: #fff; color: #000; }
.cd-send:disabled { opacity: .5; }
.cd-attach svg, .cd-send svg { width: 18px; height: 18px; }
html.tv .chat-drawer { box-shadow: none; }
.so-actions { flex-wrap: wrap; justify-content: flex-end; }
.cd-card > i { width: 40px; aspect-ratio: 2 / 3; border-radius: var(--r-sm); flex: none; background: var(--fill-2); }

/* =====================================================================
   Tanda de diseño: foco, barra, tarjetas, ficha, Explorar, Generos,
   Amigos, movil y transiciones
   ===================================================================== */

/* Foco visible con teclado tambien en el ordenador (el raton no lo enseña) */
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

/* Iconos SVG dentro de botones y textos */
.ic { width: 18px; height: 18px; flex: none; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-round .ic { width: 20px; height: 20px; }
.lp-comment .ic { width: 14px; height: 14px; color: var(--text-3); }

/* Barra de secciones: al pasar el raton, una raya blanca mas suave que la de la seccion activa */
.nav-item::after {
  content: ''; position: absolute; left: 6px; right: 6px; bottom: 2px; height: 2px; border-radius: var(--r-xs);
  background: rgb(255 255 255 / .45); transform: scaleX(0); opacity: 0;
  transition: transform .25s var(--ease), opacity .2s, background .2s;
}
.nav-item:hover::after, .kbnav .nav-item:focus::after { transform: scaleX(1); opacity: 1; }
.nav-item.active::after { background: #fff; transform: scaleX(1); opacity: 1; }

/* Tarjetas: "En el NAS" es un puntito verde; la x solo con raton (en el movil, mantener pulsado) */
.card-flag {
  top: 10px; left: auto; right: 10px; width: 10px; height: 10px; padding: 0; border-radius: 50%;
  background: var(--online); border: 2px solid rgb(0 0 0 / .65); box-shadow: 0 0 0 1px rgb(70 211 105 / .4);
}
.anime-card:has(.card-remove) .card-flag { right: 42px; top: 16px; }
@media (hover: none) { .card-remove { display: none !important; } }
.card-play .ic { width: 40px; height: 40px; filter: drop-shadow(0 2px 8px rgb(0 0 0 / .6)); }

/* Top 10: numero grande sobre el poster */
.anime-card.ranked .poster-wrapper { overflow: hidden; }
.rank-num {
  position: absolute; z-index: 3; left: 8px; top: -6px; pointer-events: none;
  font-size: 84px; font-weight: 900; line-height: 1; letter-spacing: -.06em;
  color: rgb(0 0 0 / .55); -webkit-text-stroke: 2px rgb(255 255 255 / .92);
  text-shadow: 0 6px 24px rgb(0 0 0 / .55);
}
.anime-card.ranked .poster-wrapper::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 45%; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, rgb(0 0 0 / .45), transparent);
}

/* Pildora: los numeros solo para el admin */
.live-pill:not(.admin-counts) .lp-count { display: none !important; }
.lp-comment { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Ficha ---------- */
.btn-play { height: 48px; padding: 0 28px 0 22px; font-size: var(--fs-lg); }
.btn-play .ic { width: 20px; height: 20px; }
.modal-actions-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn-party.btn-round { width: 44px; }
.admin-tools {
  width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px;
  padding: 12px 14px; border-radius: var(--r-md); background: var(--fill-1); border: 1px dashed var(--hairline-2);
}
.admin-tools[hidden] { display: none; }
.at-label { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.admin-tools .nas-destination { flex-basis: 100%; }
#btnAdminTools[aria-expanded="true"] { background: #fff; color: #000; }
.modal-desc { margin-bottom: 8px; }
.modal-desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.desc-more { font-size: var(--fs-md); font-weight: 700; color: var(--text); padding: 4px 0 !important; margin-bottom: 20px; text-decoration: underline; text-underline-offset: 3px; }
.desc-more[hidden] { display: none; }
.modal-desc:not(.clamp) + .desc-more, .desc-more[hidden] + .modal-tabs { margin-top: 0; }
.modal-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--hairline-2); margin: 8px 0 20px; }
.modal-tabs[hidden] { display: none; }
.modal-tabs button { position: relative; padding: 12px 0 !important; font-size: var(--fs-lg); font-weight: 700; color: var(--text-2); }
.modal-tabs button:hover { color: var(--text); }
.modal-tabs button.on { color: var(--text); }
.modal-tabs button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: var(--r-xs); background: var(--accent); }
.modal-card.has-tabs .relations > .block-title, .modal-card.has-tabs .episodes-header .block-title { display: none; }
.relations[hidden], .downloads-section[hidden] { display: none !important; }

/* ---------- Explorar ---------- */
.chip-sort { padding-right: 18px; margin-right: 2px; border-right: 1px solid var(--hairline-2); }
@media (max-width: 820px) {
  .explore-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .explore-bar::-webkit-scrollbar { display: none; }
  .chip-group { flex-wrap: nowrap; }
  .fchip { white-space: nowrap; }
}
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state b { color: var(--text); font-size: var(--fs-xl); }
.empty-state span { max-width: 52ch; line-height: 1.5; }
.empty-state .btn { margin-top: 6px; }
.page-lead { color: var(--text-2); font-size: var(--fs-base); margin: -4px 0 20px; }

/* ---------- Generos: portadas de fondo y el nombre en medio ---------- */
.genre-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.genre-tile {
  height: 180px; padding: 0 !important; display: grid; place-items: center; text-align: center;
  background: #141416; border: 1px solid var(--hairline); border-radius: var(--r-lg);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.gt-art { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; }
.gt-art img {
  position: absolute; width: 34%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm);
  box-shadow: 0 10px 30px rgb(0 0 0 / .6);
  left: calc(-6% + var(--n) * 22%); top: 50%;
  transform: translateY(-50%) rotate(calc((var(--n) - 2) * 5deg)) scale(calc(1 - (var(--n) - 2) * (var(--n) - 2) * .04));
  transition: transform .4s var(--ease);
}
.gt-art img[style*="--n:2"] { z-index: 2; }
.gt-art img[style*="--n:1"], .gt-art img[style*="--n:3"] { z-index: 1; }
.gt-shade {
  position: absolute; inset: 0; z-index: 3;
  background:
    radial-gradient(ellipse at center, rgb(0 0 0 / .35), rgb(0 0 0 / .78) 75%),
    linear-gradient(135deg, color-mix(in srgb, var(--g) 30%, transparent), transparent 60%);
}
.gt-text { position: relative; z-index: 4; display: flex; flex-direction: column; gap: 6px; padding: 0 16px; }
.gt-text b { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.01em; color: #fff; text-shadow: 0 2px 18px rgb(0 0 0 / .8); }
.gt-text small { font-size: var(--fs-sm); font-weight: 600; color: rgb(255 255 255 / .75); text-shadow: 0 1px 8px rgb(0 0 0 / .9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.genre-tile:hover, .kbnav .genre-tile:focus { transform: translateY(-4px); box-shadow: 0 22px 44px -18px rgb(0 0 0 / .9); border-color: rgb(255 255 255 / .28); }
.genre-tile:hover .gt-art img { transform: translateY(-50%) rotate(calc((var(--n) - 2) * 7deg)) scale(calc(1.05 - (var(--n) - 2) * (var(--n) - 2) * .04)); }
@media (max-width: 600px) { .genre-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .genre-tile { height: 130px; } .gt-text b { font-size: var(--fs-xl); } .gt-text small { display: none; } }

/* ---------- Amigos ---------- */
.privacy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 16px; margin: 4px 0 8px; border-radius: var(--r-md); background: var(--fill-1); border: 1px solid var(--hairline); }
.privacy-row label { flex: 1; min-width: 220px; font-size: var(--fs-base); font-weight: 600; }
.privacy-row select { height: 38px; padding: 0 12px; border-radius: var(--r-sm); background: #1b1b1e; border: 1px solid var(--hairline-2); color: var(--text); font: inherit; font-size: var(--fs-base); }
.privacy-ic { display: grid; place-items: center; color: var(--text-2); }
.so-info > span { display: block; }
.so-info { gap: 2px; }
.so-now { display: inline-flex !important; align-items: center; gap: 6px; color: var(--online); font-weight: 700; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--online); flex: none; animation: lp-pulse 1.8s ease-out infinite; }
.so-hours { color: var(--text-3); font-size: var(--fs-sm); }
.so-private { display: inline-flex !important; align-items: center; gap: 6px; color: var(--text-3); }
.so-private .ic { width: 14px; height: 14px; }
.so-av.online::after { width: 13px; height: 13px; right: 0; bottom: 0; background: var(--online); border: 2.5px solid #000; }
.so-actions .btn .ic { width: 15px; height: 15px; }

/* ---------- Party ---------- */
.party-hero { background: var(--fill-1); border-color: var(--hairline-2); }
.pp-title { display: inline-flex; align-items: center; gap: 8px; }
.pp-title .ic { width: 18px; height: 18px; }

/* ---------- Movil: cabecera compacta y barra de abajo ---------- */
.tabbar { display: none; }
@media (max-width: 820px) {
  .nav-links { display: none !important; }
  .navbar { flex-wrap: nowrap; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); row-gap: 0; }
  .nav-left { width: auto; flex-direction: row; gap: 0; flex: none; }
  .nav-right { width: auto; flex: 1; min-width: 0; justify-content: flex-end; gap: 6px; }
  .logo-word { display: none; }
  .search-box { flex: 1; min-width: 0; width: auto !important; height: 38px; }
  .search-box:focus-within { width: auto !important; }
  .hero { padding-top: 76px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 150; left: 0; right: 0; bottom: 0;
    height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgb(10 10 12 / .92); border-top: 1px solid var(--hairline-2);
    -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
  }
  .tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); }
  .tab-item .ic { width: 22px; height: 22px; }
  .tab-item.active { color: #fff; }
  .toast-container { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .chat-drawer { z-index: 330; }
}
html.tv .tabbar { display: none !important; }

/* ---------- Cambio de seccion: fundido corto ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: ease; }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* Indicador del NAS dentro del panel de Descargas */
.drawer-header .nas-badge { display: flex !important; height: 30px; padding: 0 10px; margin-left: auto; margin-right: 8px; font-size: var(--fs-sm); }

/* arreglos tras revisar las capturas */
#gridHeader:has(#exploreBar:not([hidden])) { flex-wrap: wrap; row-gap: 16px; }
#gridHeader .explore-bar { order: 3; flex-basis: 100%; }
.modal-card.has-tabs .download-view, .modal-card.has-tabs .relations { border-top: 0; padding-top: 0; }
.so-info > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-info > span > span { display: inline !important; }
@media (max-width: 600px) {
  .hero-actions { gap: 8px; }
  .hero-play { height: 50px; padding: 0 20px 0 16px !important; font-size: var(--fs-lg); flex: 1; min-width: 0; }
  .hero-actions .btn-round { width: 44px; height: 44px; flex: none; }
}

/* =====================================================================
   Estado, perfiles, niveles y recompensas, stickers, TOP y datos de tarjeta
   ===================================================================== */

/* ---------- Estado (punto en el avatar) ---------- */
.presence-dot { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid #000; pointer-events: none; z-index: 2; }
.presence-dot.p-online { background: var(--online); }
.presence-dot.p-dnd { background: var(--accent); }
.presence-dot.p-dnd::after { content: ''; position: absolute; left: 2px; right: 2px; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; background: #fff; }
.presence-dot.p-invisible, .presence-dot.p-offline { background: #000; box-shadow: inset 0 0 0 2.5px #8a8a8f; }
.presence-dot.big { width: 24px; height: 24px; right: 6px; bottom: 6px; border-width: 4px; }
.presence-dot.big.p-dnd::after { left: 4px; right: 4px; height: 3px; margin-top: -1.5px; }
.presence-dot.big.p-invisible, .presence-dot.big.p-offline { box-shadow: inset 0 0 0 4px #8a8a8f; }
.presence-pick { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; margin: 4px 0 6px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.user-pop .presence-pick button { display: flex; align-items: center; gap: 10px; }
.user-pop .presence-pick button.on { background: var(--fill-2); }
.pd { width: 10px; height: 10px; border-radius: 50%; flex: none; position: relative; }
.pd.p-online { background: var(--online); }
.pd.p-dnd { background: var(--accent); }
.pd.p-dnd::after { content: ''; position: absolute; left: 2px; right: 2px; top: 4px; height: 2px; background: #fff; border-radius: 2px; }
.pd.p-invisible { box-shadow: inset 0 0 0 2px #8a8a8f; }
.so-av.dnd::after { content: ''; position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: 2.5px solid #000; }

/* ---------- Amigos: la fila lleva al perfil ---------- */
.so-person[data-profile] { cursor: pointer; transition: background .15s; }
.so-person[data-profile]:hover, .kbnav .so-person[data-profile]:focus { background: var(--fill-1); }
.so-info b { display: flex; align-items: center; gap: 8px; }
.so-lvl { font-size: var(--fs-xs); font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--fill-2); color: var(--text-2); }
.so-chev { color: var(--text-3); display: grid; place-items: center; }
.so-chev .ic { width: 20px; height: 20px; }

/* ---------- Colores de nombre ---------- */
.nc-red { color: #ff5a64; } .nc-blue { color: #5cb3ff; } .nc-green { color: #46d369; } .nc-purple { color: #b892ff; }
.nc-gold { color: #ffc94a; } .nc-pink { color: #ff8fc0; }
.nc-fire, .nc-ocean, .nc-rainbow { -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.nc-fire { background-image: linear-gradient(90deg, #ffb347, #ff4d3d); }
.nc-ocean { background-image: linear-gradient(90deg, #3ee6ff, #5a6bff); }
.nc-rainbow { background-image: linear-gradient(90deg, #ff5a64, #ffc94a, #46d369, #5cb3ff, #b892ff, #ff5a64); background-size: 300% 100%; animation: nc-flow 6s linear infinite; }
@keyframes nc-flow { to { background-position: 300% 0; } }

/* ---------- Marcos del avatar ---------- */
.pf-avatar.frame-ring { box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff; }
.pf-avatar.frame-crimson { box-shadow: 0 0 0 2px #000, 0 0 0 4.5px var(--accent), 0 0 14px rgb(229 9 20 / .55); }
.pf-avatar.frame-neon { box-shadow: 0 0 0 2px #000, 0 0 0 4px #3ee6ff, 0 0 12px #3ee6ff, 0 0 26px rgb(62 230 255 / .45); }
.pf-avatar.frame-sakura { box-shadow: 0 0 0 2px #000, 0 0 0 4px #ff8fc0, 0 0 0 6.5px #fff0f6, 0 0 18px rgb(255 143 192 / .6); }
.pf-avatar.frame-gold { box-shadow: 0 0 0 2px #000, 0 0 0 4px #ffd36b, 0 0 0 6px #8a5a00, 0 0 18px rgb(255 201 74 / .55); }
.pf-avatar.frame-binge { box-shadow: 0 0 0 2px #000, 0 0 0 4px #ff8a00, 0 0 16px rgb(255 120 0 / .7); animation: fr-flicker 1.6s ease-in-out infinite; }
.pf-avatar.frame-aurora { animation: fr-aurora 5s linear infinite; }
.pf-avatar.frame-legend { animation: fr-legend 3s linear infinite; }
@keyframes fr-flicker { 50% { box-shadow: 0 0 0 2px #000, 0 0 0 4px #ffb347, 0 0 24px rgb(255 160 0 / .85); } }
@keyframes fr-aurora {
  0%, 100% { box-shadow: 0 0 0 2px #000, 0 0 0 4.5px #46d369, 0 0 18px rgb(70 211 105 / .6); }
  33% { box-shadow: 0 0 0 2px #000, 0 0 0 4.5px #3ee6ff, 0 0 18px rgb(62 230 255 / .6); }
  66% { box-shadow: 0 0 0 2px #000, 0 0 0 4.5px #b892ff, 0 0 18px rgb(184 146 255 / .6); }
}
@keyframes fr-legend {
  0%, 100% { box-shadow: 0 0 0 2px #000, 0 0 0 5px #ff5a64, 0 0 0 7px #ffc94a, 0 0 26px rgb(255 90 100 / .7); }
  25% { box-shadow: 0 0 0 2px #000, 0 0 0 5px #ffc94a, 0 0 0 7px #46d369, 0 0 26px rgb(255 201 74 / .7); }
  50% { box-shadow: 0 0 0 2px #000, 0 0 0 5px #46d369, 0 0 0 7px #5cb3ff, 0 0 26px rgb(70 211 105 / .7); }
  75% { box-shadow: 0 0 0 2px #000, 0 0 0 5px #5cb3ff, 0 0 0 7px #b892ff, 0 0 26px rgb(92 179 255 / .7); }
}
@media (prefers-reduced-motion: reduce) { .pf-avatar[class*="frame-"], .nc-rainbow { animation: none !important; } }

/* ---------- Bocadillos del chat ---------- */
.cd-body .cd-bubble.bb-glass, .ed-bubble.bb-glass { background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .22); color: #fff; }
.cd-body .cd-bubble.bb-midnight, .ed-bubble.bb-midnight { background: linear-gradient(135deg, #1d2547, #0f1226); border: 1px solid #2f3a73; color: #dfe6ff; }
.cd-body .cd-bubble.bb-neon, .ed-bubble.bb-neon { background: #07181c; border: 1.5px solid #3ee6ff; color: #c9f7ff; box-shadow: 0 0 12px rgb(62 230 255 / .35); }
.cd-body .cd-bubble.bb-sakura, .ed-bubble.bb-sakura { background: linear-gradient(135deg, #ffd1e4, #ff9cc6); color: #5c0a33; }
.cd-body .cd-bubble.bb-gold, .ed-bubble.bb-gold { background: linear-gradient(135deg, #ffe08a, #e0a526); color: #3d2700; font-weight: 600; }
.cd-name { display: inline-flex; align-items: baseline; gap: 6px; padding: 0 4px !important; font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }
.cd-name:hover .nm { text-decoration: underline; }
.cd-title { font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); }
.cd-sticker svg { width: 116px; height: 116px; display: block; filter: drop-shadow(0 6px 14px rgb(0 0 0 / .45)); }
.cd-msg.new .cd-sticker svg { animation: sticker-pop .45s var(--ease); }
@keyframes sticker-pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }
.cd-image { padding: 0 !important; border-radius: var(--r-md); overflow: hidden; max-width: 240px; border: 1px solid var(--hairline-2); }
.cd-image img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.cd-stickers { max-height: 300px; overflow-y: auto; padding: 12px; border-top: 1px solid var(--hairline); background: #151517; }
.cd-stickers[hidden] { display: none; }
.sk-pack + .sk-pack { margin-top: 12px; }
.sk-head { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-sm); font-weight: 800; color: var(--text-2); margin-bottom: 8px; }
.sk-lock { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-weight: 700; }
.sk-lock .ic { width: 13px; height: 13px; }
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sk { padding: 4px !important; border-radius: var(--r-md); transition: background .15s, transform .15s var(--ease); }
.sk:hover:not(:disabled) { background: var(--fill-2); transform: scale(1.06); }
.sk svg { width: 100%; height: auto; display: block; }
.sk-pack.locked .sk { opacity: .35; filter: grayscale(1); cursor: not-allowed; }
.lightbox { position: fixed; inset: 0; z-index: 950; display: none; place-items: center; padding: 24px; background: rgb(0 0 0 / .9); }
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-md); }
.lb-close { position: absolute; top: 16px; right: 20px; font-size: 32px; color: #fff; }

/* ---------- Tarjetas: TOP y linea con nota / genero / subtitulos-doblaje ---------- */
.top-tag {
  position: absolute; z-index: 3; top: 0; left: 10px; width: 30px; padding: 7px 0 6px; border-radius: 0 0 var(--r-xs) var(--r-xs);
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 900; line-height: 1.05; letter-spacing: .02em; text-align: center;
  box-shadow: 0 4px 12px rgb(0 0 0 / .45);
}
.card-stats { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; margin-top: 3px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); }
.card-stats[hidden], .card-meta[hidden] { display: none; }
.cs-score { color: var(--gold); }
.cs-genre { max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.cs-langs { display: inline-flex; gap: 3px; margin-left: 3px; color: #fff; }
.cs-langs .ic { width: 14px; height: 14px; }

/* ---------- Perfil ---------- */
body[data-view="perfil"] #gridHeader { display: none; }
.pf-page { padding-bottom: 40px; }
.pf-banner { height: clamp(150px, 22vw, 300px); border-radius: var(--r-lg); background-size: cover; background-position: center; position: relative; overflow: hidden; }
.pf-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 50%, rgb(0 0 0 / .55)); }
.bn-night { background: radial-gradient(circle at 20% 30%, #26315f 0, transparent 45%), radial-gradient(circle at 80% 70%, #3a1e4f 0, transparent 45%), #0b0d18; }
.bn-aurora { background: linear-gradient(120deg, #0b3d3a 0%, #1c7a5d 30%, #3ee6ff 55%, #5a6bff 80%, #20124d 100%); }
.bn-sunset { background: linear-gradient(160deg, #ffb347 0%, #ff5f6d 45%, #6a2c70 100%); }
.bn-ocean { background: linear-gradient(160deg, #0f2027 0%, #203a43 45%, #2c97b8 100%); }
.bn-sakura { background: radial-gradient(circle at 15% 25%, #fff 0 2px, transparent 3px) 0 0 / 60px 60px, linear-gradient(135deg, #ffd1e4, #ff8fc0 60%, #b5476f); }
.bn-ember { background: radial-gradient(circle at 50% 120%, #ff7b00 0, #b31d1d 35%, #200606 75%); }
.bn-galaxy { background: radial-gradient(circle at 30% 40%, #fff 0 1px, transparent 2px) 0 0 / 40px 40px, radial-gradient(circle at 70% 60%, rgb(184 146 255 / .55), transparent 45%), radial-gradient(circle at 25% 75%, rgb(62 230 255 / .35), transparent 40%), #07061a; }
.bn-image { background-color: #111; }
.pf-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; margin: -64px 24px 28px; position: relative; z-index: 2; }
.pf-av-wrap { position: relative; width: 136px; height: 136px; flex: none; }
.pf-av-wrap .pf-big { width: 136px; height: 136px; font-size: 52px; border: 5px solid #000; }
.pf-id { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; padding-bottom: 4px; }
.pf-name { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.01em; line-height: 1.1; }
.pf-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-md); color: var(--text-2); }
.pf-title { padding: 3px 10px; border-radius: 999px; background: #fff; color: #000; font-weight: 800; font-size: var(--fs-sm); }
.pf-level { padding: 3px 10px; border-radius: 999px; background: var(--fill-2); font-weight: 800; font-size: var(--fs-sm); color: var(--text); }
.pf-pres { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.pf-pres::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #8a8a8f; }
.pf-pres.p-online::before { background: var(--online); }
.pf-pres.p-dnd::before { background: var(--accent); }
.pf-xp { height: 8px; max-width: 420px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.pf-xp i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #ff7a59); transition: width .8s var(--ease); }
.pf-xp-txt { font-size: var(--fs-sm); color: var(--text-3); }
.pf-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; }
.pf-statgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.pf-stat { padding: 16px; border-radius: var(--r-md); background: var(--fill-1); border: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 2px; }
.pf-stat b { font-size: var(--fs-2xl); font-weight: 900; }
.pf-stat span { font-size: var(--fs-sm); color: var(--text-2); }
.pf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.pf-card { padding: 20px; border-radius: var(--r-lg); background: var(--fill-1); border: 1px solid var(--hairline); }
.pf-card h3 { font-size: var(--fs-lg); font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.pf-card h3 .count { color: var(--text-3); font-size: var(--fs-md); }
.pf-wide { grid-column: 1 / -1; }
.pf-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.pf-top-item { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 0 !important; min-width: 0; }
.pf-top-item img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); transition: transform .2s var(--ease); }
.pf-top-item:hover img { transform: translateY(-3px); }
.pf-top-item span { font-size: var(--fs-md); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-top-item small { font-size: var(--fs-xs); color: var(--text-3); }
.pf-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pf-badge { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: rgb(255 255 255 / .03); border: 1px solid var(--hairline); opacity: .45; }
.pf-badge .ic { grid-row: 1 / 3; width: 30px; height: 30px; color: var(--text-3); }
.pf-badge b { font-size: var(--fs-md); }
.pf-badge span { font-size: var(--fs-xs); color: var(--text-3); }
.pf-badge.got { opacity: 1; border-color: rgb(255 201 74 / .35); background: rgb(255 201 74 / .06); }
.pf-badge.got .ic { color: var(--gold); }
.pf-private { display: flex; align-items: center; gap: 14px; padding: 20px; margin-bottom: 16px; border-radius: var(--r-lg); background: var(--fill-1); border: 1px solid var(--hairline); }
.pf-private .ic { width: 28px; height: 28px; color: var(--text-3); }
.pf-private div { display: flex; flex-direction: column; gap: 2px; }
.pf-private span { color: var(--text-2); font-size: var(--fs-md); }
@media (max-width: 900px) { .pf-statgrid { grid-template-columns: repeat(3, 1fr); } .pf-cols { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .pf-head { margin: -48px 12px 20px; }
  .pf-av-wrap, .pf-av-wrap .pf-big { width: 104px; height: 104px; }
  .pf-statgrid { grid-template-columns: repeat(2, 1fr); }
  .pf-actions { width: 100%; }
}

/* ---------- Editor del perfil ---------- */
.pf-editor { padding: 20px; margin-bottom: 20px; border-radius: var(--r-lg); background: #121214; border: 1px solid var(--hairline-2); }
.pf-editor[hidden] { display: none; }
.ed-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ed-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-tabs button { padding: 8px 14px !important; border-radius: 999px; font-weight: 700; font-size: var(--fs-md); color: var(--text-2); background: var(--fill-1); }
.ed-tabs button.on { background: #fff; color: #000; }
.ed-help { font-size: var(--fs-sm); font-weight: 700; color: var(--text-3); cursor: help; }
.ed-rules { font-size: var(--fs-sm); color: var(--text-3); margin: 6px 0 16px; line-height: 1.5; }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ed-opt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px !important; border-radius: var(--r-md); background: var(--fill-1); border: 1.5px solid transparent; transition: border-color .15s, background .15s; text-align: center; }
.ed-opt:hover { background: var(--fill-2); }
.ed-opt.on { border-color: #fff; }
.ed-opt.locked { opacity: .5; }
.ed-opt.locked > :first-child { filter: grayscale(.8); }
.ed-name { font-size: var(--fs-md); font-weight: 700; }
.ed-state { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 800; color: var(--online); }
.ed-state.lock { color: var(--text-3); }
.ed-state .ic { width: 13px; height: 13px; }
.ed-banner { width: 100%; height: 54px; border-radius: var(--r-sm); display: grid; place-items: center; color: #fff; }
.ed-banner.bn-pick { background: var(--fill-2); border: 1px dashed var(--hairline-2); }
.ed-frame { width: 56px; height: 56px; display: block; padding: 6px; }
.ed-frame .pf-avatar { font-size: 20px; }
.ed-color { font-size: var(--fs-lg); font-weight: 900; padding: 12px 0; }
.ed-title { padding: 4px 12px; border-radius: 999px; background: #fff; color: #000; font-weight: 800; font-size: var(--fs-sm); margin: 10px 0; }
.ed-bubble { padding: 8px 14px; border-radius: 16px 16px 16px 4px; background: var(--fill-2); margin: 8px 0; }
/* perfil: solo el avatar pisa el banner; el nombre va debajo */
.pf-head { margin: 0 24px 28px; align-items: flex-start; }
.pf-av-wrap { margin-top: -72px; }
.pf-id { padding-top: 14px; }
.pf-actions { padding-top: 14px; }
@media (max-width: 600px) { .pf-head { margin: 0 12px 20px; } .pf-av-wrap { margin-top: -56px; } .pf-id { padding-top: 0; } }

/* =====================================================================
   Marcos SVG (inspirados en anime) y banners de anime fuera del perfil
   ===================================================================== */
.pf-avatar { position: relative; overflow: visible; }
.pf-avatar img { border-radius: 50%; }
.user-btn:has(.ub-avatar) { overflow: visible; background: none; }
.fr-art { position: absolute; inset: -30%; z-index: 1; pointer-events: none; display: block; }
.fr-art svg { width: 100%; height: 100%; overflow: visible; display: block; }
.fr-art .fr-spin, .fr-art .fr-spin-rev, .fr-art .fr-pulse, .fr-art .fr-sway { transform-box: view-box; transform-origin: 50px 50px; }
.fr-art .fr-spin { animation: fr-rot 16s linear infinite; }
.fr-art .fr-spin-rev { animation: fr-rot 22s linear infinite reverse; }
.fr-art .fr-pulse { animation: fr-pls 1.5s ease-in-out infinite; }
.fr-art .fr-sway { animation: fr-sway 3.2s ease-in-out infinite alternate; }
.fr-art .fr-lick { transform-box: view-box; animation: fr-lick .8s ease-in-out infinite alternate; }
.fr-art .fr-flicker { animation: fr-flk 1.1s steps(2, jump-none) infinite; }
.fr-art .fr-fall { animation: fr-fall 4.2s linear infinite; }
.fr-art .fr-float { animation: fr-float 2.8s ease-in-out infinite alternate; }
@keyframes fr-rot { to { transform: rotate(360deg); } }
@keyframes fr-pls { 50% { transform: scale(1.06); opacity: .85; } }
@keyframes fr-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes fr-lick { from { transform: scale(.82); } to { transform: scale(1.08); } }
@keyframes fr-flk { 0% { opacity: 1; } 50% { opacity: .15; } }
@keyframes fr-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(-26px, 90px) rotate(260deg); opacity: 0; } }
@keyframes fr-float { from { transform: translateY(-2px); } to { transform: translateY(3px); } }
.fx-sharingan svg { filter: drop-shadow(0 0 3px rgb(255 30 40 / .55)); }
.fx-agua svg { filter: drop-shadow(0 0 3px rgb(60 150 255 / .6)); }
.fx-rayo svg { filter: drop-shadow(0 0 4px rgb(120 200 255 / .95)); }
.fx-maldicion svg { filter: drop-shadow(0 0 4px rgb(140 80 255 / .7)); }
.fx-kitsune svg { filter: drop-shadow(0 0 3px rgb(255 120 20 / .55)); }
.fx-saiyan svg { filter: drop-shadow(0 0 6px rgb(255 210 60 / .8)); }
.fx-shinigami svg { filter: drop-shadow(0 0 3px rgb(180 20 30 / .6)); }
.fx-mecha svg { filter: drop-shadow(0 0 3px rgb(130 255 80 / .5)); }
.fx-vacio svg { filter: drop-shadow(0 0 5px rgb(140 180 255 / .6)); }
.fx-legend svg, .fx-admin svg { filter: drop-shadow(0 0 4px rgb(255 210 80 / .6)); }
.fx-binge svg { filter: drop-shadow(0 0 4px rgb(255 110 0 / .7)); }
@media (prefers-reduced-motion: reduce) { .fr-art * { animation: none !important; } }
html.tv .fr-art svg { filter: none !important; }
/* el marco de arriba a la derecha no tapa el punto de estado */
.user-menu .presence-dot { z-index: 3; }
.ed-frame { width: 64px; height: 64px; padding: 12px; box-sizing: content-box; }

/* Tarjeta del menu de usuario con el banner */
.user-card { display: flex !important; align-items: center; gap: 12px; width: 100%; padding: 14px 12px !important; margin-bottom: 6px; border-radius: var(--r-md) !important; background: var(--fill-1) center / cover no-repeat; text-align: left; min-height: 74px; }
.user-card:hover { filter: brightness(1.1); }
.uc-av { width: 44px; height: 44px; flex: none; font-size: 18px; margin: 4px; }
.uc-txt { display: flex; flex-direction: column; min-width: 0; }
.uc-name { font-size: var(--fs-lg); font-weight: 800; text-shadow: 0 1px 6px rgb(0 0 0 / .8); }
.uc-sub { font-size: var(--fs-xs); font-weight: 700; color: rgb(255 255 255 / .8); text-shadow: 0 1px 6px rgb(0 0 0 / .8); }
.user-pop .who { padding: 0 10px 6px; font-size: var(--fs-xs); }
.user-pop .who b { display: none; }
/* Amigos: su banner de fondo en la fila */
.so-person.has-bn { position: relative; overflow: hidden; isolation: isolate; }
.so-person.has-bn::before { content: ''; position: absolute; inset: 0 0 0 30%; z-index: -1; background: var(--bn) center / cover no-repeat; opacity: .45; -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%); transition: opacity .2s; }
.so-person.has-bn:hover::before { opacity: .7; }
/* Chat: banner del amigo en la cabecera del privado */
.cd-peer { background-size: cover; background-position: center; }
/* Editor: galeria de banners de anime */
.ed-grid.ed-banners { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.ed-banners .ed-banner { height: 92px; border-radius: var(--r-sm); background-size: cover; background-position: center; }
.ed-banners .ed-name { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ed-search { margin-bottom: 14px; }
.ed-search input { width: 100%; height: 42px; padding: 0 14px; border-radius: var(--r-sm); background: var(--fill-1); border: 1px solid var(--hairline-2); color: var(--text); font: inherit; }
.ed-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; }
.ed-results button { display: flex; flex-direction: column; gap: 4px; padding: 0 !important; text-align: left; font-size: var(--fs-sm); font-weight: 700; }
.ed-results img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); }
.ed-results span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* decoraciones: alas que aletean, brasas que suben */
.fr-art .fr-flap { transform-box: view-box; transform-origin: 50px 52px; animation: fr-flap 2.4s ease-in-out infinite; }
.fr-art .fr-rise { animation: fr-rise 2.6s ease-in infinite; }
@keyframes fr-flap { 50% { transform: scaleX(1.06) translateY(-1px); } }
@keyframes fr-rise { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
.fx-infierno svg { filter: drop-shadow(0 0 6px rgb(255 80 0 / .75)); }
.fx-diablo svg { filter: drop-shadow(0 0 4px rgb(220 20 30 / .6)); }
.fx-angel svg { filter: drop-shadow(0 0 5px rgb(255 240 190 / .7)); }
.fx-alas svg { filter: drop-shadow(0 0 4px rgb(140 60 200 / .6)); }
html.tv .fr-art [filter] { filter: none !important; }
.uc-av { display: block; }
.uc-av .pf-avatar { width: 44px; height: 44px; }
/* la foto siempre encajada en su circulo (el marco va por fuera); las fotos verticales enseñan la cara */
.pf-avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; border-radius: 50%; }

/* marco propio (imagen subida): un poco mas grande que la foto, centrado */
.fr-art.fr-img { inset: -24%; }
.fr-art.fr-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ed-frame.ed-up { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 1.5px dashed var(--hairline-2); color: var(--text-2); }

/* =====================================================================
   Nombres con brillo y animados
   ===================================================================== */
.nc-rainbow { filter: drop-shadow(0 0 6px rgb(255 255 255 / .25)); }
.nc-neonpink { color: #ff5fd7; text-shadow: 0 0 4px #ff5fd7, 0 0 12px rgb(255 95 215 / .7), 0 0 24px rgb(255 95 215 / .4); animation: nc-pulse 2.2s ease-in-out infinite; }
.nc-toxic { color: #a6ff3d; text-shadow: 0 0 5px #7dff2a, 0 0 16px rgb(125 255 42 / .55); animation: nc-pulse 1.8s ease-in-out infinite; }
.nc-sign { color: #6ff4ff; text-shadow: 0 0 4px #6ff4ff, 0 0 12px #2fd3ff, 0 0 26px rgb(47 211 255 / .6); animation: nc-sign 5s linear infinite; }
.nc-blood { color: #ff2b3d; text-shadow: 0 0 6px rgb(200 0 20 / .9), 0 0 18px rgb(140 0 10 / .7); animation: nc-pulse 1.4s ease-in-out infinite; }
.nc-volt { color: #eaf6ff; text-shadow: 0 0 3px #fff, 0 0 10px #59b4ff, 0 0 22px #2b7fff; animation: nc-volt 2.6s steps(1) infinite; }
.nc-blaze, .nc-frost, .nc-shine, .nc-galaxy { -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; background-size: 250% 100%; }
.nc-blaze { background-image: linear-gradient(90deg, #ffde59, #ff8a00, #ff2d00, #ff8a00, #ffde59); filter: drop-shadow(0 0 6px rgb(255 100 0 / .75)); animation: nc-flow 2.4s linear infinite; }
.nc-frost { background-image: linear-gradient(100deg, #9fd8ff 0%, #e8f8ff 40%, #ffffff 50%, #e8f8ff 60%, #9fd8ff 100%); filter: drop-shadow(0 0 6px rgb(140 210 255 / .7)); animation: nc-sweep 3s ease-in-out infinite; }
.nc-shine { background-image: linear-gradient(100deg, #b8860b 0%, #ffd24a 35%, #fff8d6 50%, #ffd24a 65%, #b8860b 100%); filter: drop-shadow(0 0 6px rgb(255 200 60 / .6)); animation: nc-sweep 2.6s ease-in-out infinite; }
.nc-galaxy { background-image: linear-gradient(90deg, #7b5cff, #ff5fd7, #3ee6ff, #7b5cff); filter: drop-shadow(0 0 8px rgb(150 100 255 / .65)); animation: nc-flow 5s linear infinite; }
.nc-glitch { position: relative; display: inline-block; color: #fff; text-shadow: 0 0 8px rgb(255 255 255 / .35); }
.nc-glitch::before, .nc-glitch::after { content: attr(data-text); position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.nc-glitch::before { color: #ff2b6a; transform: translate(-2px, 0); clip-path: inset(0 0 55% 0); animation: nc-glitch1 2.4s steps(1) infinite; mix-blend-mode: screen; }
.nc-glitch::after { color: #2bf0ff; transform: translate(2px, 0); clip-path: inset(55% 0 0 0); animation: nc-glitch2 2.4s steps(1) infinite; mix-blend-mode: screen; }
@keyframes nc-pulse { 50% { filter: brightness(1.35); } }
@keyframes nc-sign { 0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; } 20%, 24%, 55% { opacity: .35; text-shadow: none; } }
@keyframes nc-volt { 0%, 100% { text-shadow: 0 0 3px #fff, 0 0 10px #59b4ff, 0 0 22px #2b7fff; } 47% { text-shadow: 0 0 6px #fff, 0 0 18px #9fd8ff, 0 0 34px #59b4ff, 2px -1px 0 #9fd8ff; } 50% { text-shadow: 0 0 2px #fff; } }
@keyframes nc-sweep { 0% { background-position: 100% 0; } 60%, 100% { background-position: -150% 0; } }
@keyframes nc-glitch1 { 0%, 86%, 100% { transform: translate(0, 0); opacity: 0; } 88% { transform: translate(-3px, -1px); opacity: 1; } 92% { transform: translate(2px, 1px); opacity: 1; } 95% { transform: translate(-1px, 0); opacity: 1; } }
@keyframes nc-glitch2 { 0%, 86%, 100% { transform: translate(0, 0); opacity: 0; } 89% { transform: translate(3px, 1px); opacity: 1; } 93% { transform: translate(-2px, -1px); opacity: 1; } 96% { transform: translate(1px, 0); opacity: 1; } }

/* =====================================================================
   Bocadillos del chat animados
   ===================================================================== */
.cd-body .cd-bubble.bb-gold, .ed-bubble.bb-gold { background: linear-gradient(110deg, #e0a526 0%, #ffe08a 40%, #fff6d1 50%, #ffe08a 60%, #e0a526 100%); background-size: 250% 100%; animation: nc-sweep 3.2s ease-in-out infinite; color: #3d2700; }
.cd-body .cd-bubble.bb-manga, .ed-bubble.bb-manga { background: #fff; color: #111; border: 2.5px solid #111; font-weight: 800; box-shadow: 3px 3px 0 #111; border-radius: 18px 18px 18px 4px; }
.cd-msg.mine .cd-body .cd-bubble.bb-manga { border-radius: 18px 18px 4px 18px; box-shadow: -3px 3px 0 #111; }
.cd-body .cd-bubble.bb-terminal, .ed-bubble.bb-terminal { background: #050b05; color: #46ff6a; border: 1px solid #1d5c26; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; text-shadow: 0 0 6px rgb(70 255 106 / .6); }
.cd-body .cd-bubble.bb-terminal::after, .ed-bubble.bb-terminal::after { content: '_'; margin-left: 2px; animation: nc-sign 1.1s steps(1) infinite; }
.cd-body .cd-bubble.bb-neonpink, .ed-bubble.bb-neonpink { background: #16050f; color: #ffd6f3; border: 1.5px solid #ff5fd7; box-shadow: 0 0 10px rgb(255 95 215 / .55), inset 0 0 10px rgb(255 95 215 / .25); animation: bb-neon 4s linear infinite; }
.cd-body .cd-bubble.bb-ice, .ed-bubble.bb-ice { background: linear-gradient(135deg, rgb(200 235 255 / .22), rgb(120 190 255 / .12)); border: 1px solid rgb(190 230 255 / .55); color: #eaf8ff; box-shadow: 0 0 14px rgb(140 210 255 / .35), inset 0 1px 0 rgb(255 255 255 / .4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cd-body .cd-bubble.bb-flames, .ed-bubble.bb-flames { color: #fff3e0; border: 2px solid transparent; background: linear-gradient(#1a0800, #1a0800) padding-box, linear-gradient(90deg, #ff2d00, #ffb300, #ff2d00, #ffb300) border-box; background-size: 100% 100%, 300% 100%; animation: bb-border 1.6s linear infinite; box-shadow: 0 0 14px rgb(255 90 0 / .5); }
.cd-body .cd-bubble.bb-galaxy, .ed-bubble.bb-galaxy { color: #fff; background: radial-gradient(circle at 20% 30%, #fff 0 .8px, transparent 1.5px) 0 0 / 22px 22px, radial-gradient(circle at 70% 60%, rgb(255 255 255 / .8) 0 .6px, transparent 1.2px) 0 0 / 30px 30px, linear-gradient(120deg, #2a1466, #5a1f9e, #1c3a8f, #2a1466); background-size: 22px 22px, 30px 30px, 300% 100%; animation: bb-galaxy 8s linear infinite; box-shadow: 0 0 14px rgb(120 80 255 / .45); }
.cd-body .cd-bubble.bb-rainbow, .ed-bubble.bb-rainbow { color: #fff; border: 2px solid transparent; background: linear-gradient(#141416, #141416) padding-box, linear-gradient(90deg, #ff5a64, #ffc94a, #46d369, #5cb3ff, #b892ff, #ff5a64) border-box; background-size: 100% 100%, 300% 100%; animation: bb-border 3s linear infinite; }
@keyframes bb-neon { 0%, 70%, 74%, 100% { box-shadow: 0 0 10px rgb(255 95 215 / .55), inset 0 0 10px rgb(255 95 215 / .25); } 72% { box-shadow: none; } }
@keyframes bb-border { to { background-position: 0 0, 300% 0; } }
@keyframes bb-galaxy { to { background-position: 22px 0, -30px 0, 300% 0; } }
@media (prefers-reduced-motion: reduce) { [class*="nc-"], [class*="bb-"], .nc-glitch::before, .nc-glitch::after { animation: none !important; } }
.ed-color { font-size: var(--fs-xl); }

/* =====================================================================
   Primera vez: contraseña, intro, bienvenida, visita guiada y confeti
   ===================================================================== */
.onb { position: fixed; inset: 0; z-index: 980; display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .45s var(--ease); }
.onb.in { opacity: 1; }
.onb.out { opacity: 0; pointer-events: none; }
.onb-bg { position: absolute; inset: 0; background: radial-gradient(circle at 20% 15%, rgb(229 9 20 / .28), transparent 45%), radial-gradient(circle at 85% 90%, rgb(120 70 255 / .22), transparent 45%), rgb(6 6 8 / .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.onb-card { position: relative; width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 32px; border-radius: var(--r-lg); background: #121214; border: 1px solid var(--hairline-2); box-shadow: 0 40px 120px rgb(0 0 0 / .6); transform: translateY(16px) scale(.98); transition: transform .5s var(--ease); }
.onb.in .onb-card { transform: none; }
.onb-pass { width: min(420px, 100%); text-align: center; }
.onb-pass form { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-top: 18px; }
.onb-logo { width: 64px; height: auto; margin: 0 auto 10px; display: block; filter: drop-shadow(0 0 14px rgb(255 255 255 / .35)); animation: logo-in .9s var(--ease) both; }
.onb-card h2 { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.01em; }
.onb-lead { color: var(--text-2); font-size: var(--fs-base); line-height: 1.55; margin: 6px 0 18px; }
.onb-strength { height: 6px; border-radius: 6px; background: var(--fill-2); overflow: hidden; }
.onb-strength i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s, background .3s; }
.onb-strength i[data-level="mid"] { background: #ffc94a; }
.onb-strength i[data-level="high"] { background: var(--online); }
.onb-hint { color: var(--text-3); font-size: var(--fs-sm); margin-top: -4px; }
.onb-err { color: var(--red); font-size: var(--fs-md); min-height: 1.2em; }
.onb-next { height: 48px; }
.onb-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.onb-dots { display: flex; gap: 6px; }
.onb-dots i { width: 28px; height: 5px; border-radius: 5px; background: var(--fill-2); transition: background .3s, width .3s; }
.onb-dots i.done { background: rgb(255 255 255 / .55); }
.onb-dots i.on { background: var(--accent); width: 44px; }
.onb-skip { font-size: var(--fs-md); font-weight: 700; color: var(--text-3); }
.onb-skip:hover { color: var(--text); }
.onb-body.enter { animation: onb-enter .45s var(--ease) both; }
@keyframes onb-enter { from { opacity: 0; transform: translateX(24px); } }
.onb-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.onb-foot .onb-back[hidden] { visibility: hidden; display: inline-flex; }
.onb-me { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.onb-av { width: 84px; height: 84px; flex: none; font-size: 32px; }
.onb-me .field { flex: 1; }
.onb-search input { width: 100%; height: 42px; padding: 0 14px; border-radius: var(--r-sm); background: var(--fill-1); border: 1px solid var(--hairline-2); color: var(--text); font: inherit; margin-bottom: 12px; }
.onb-avs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; max-height: 260px; overflow-y: auto; padding: 4px; }
.onb-avopt { aspect-ratio: 1; border-radius: 50%; overflow: hidden; padding: 0 !important; border: 3px solid transparent; transition: transform .15s var(--ease), border-color .15s; }
.onb-avopt img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.onb-avopt:hover { transform: scale(1.06); }
.onb-avopt.on { border-color: var(--accent); transform: scale(1.08); }
.onb-likes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; max-height: 360px; overflow-y: auto; padding: 4px; }
.onb-like { position: relative; padding: 0 !important; text-align: left; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); }
.onb-like img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); border: 3px solid transparent; transition: transform .15s var(--ease), border-color .15s, filter .15s; }
.onb-like span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onb-like.on img { border-color: var(--accent); transform: scale(.97); filter: brightness(.75); }
.onb-check { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; transform: scale(0); transition: transform .2s var(--ease); }
.onb-check .ic { width: 15px; height: 15px; }
.onb-like.on .onb-check { transform: scale(1); }
.onb-count { margin-top: 10px; font-size: var(--fs-md); font-weight: 700; color: var(--text-2); }
.onb-banners { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.onb-ban { height: 78px; border-radius: var(--r-sm); background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 8px !important; border: 3px solid transparent; position: relative; overflow: hidden; transition: border-color .15s, transform .15s var(--ease); }
.onb-ban::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .7), transparent 60%); }
.onb-ban span { position: relative; font-size: var(--fs-sm); font-weight: 800; color: #fff; }
.onb-ban.on { border-color: var(--accent); transform: scale(.98); }
.onb-teaser { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; color: var(--text-3); font-size: var(--fs-sm); font-weight: 700; }
.onb-teaser > div { display: flex; gap: 26px; padding: 10px 14px; }
.onb-fr { width: 40px; height: 40px; display: block; opacity: .85; }
.onb-fr .pf-avatar { font-size: 15px; }
@media (max-width: 600px) { .onb { padding: 0; } .onb-card { max-height: 100vh; height: 100%; border-radius: 0; padding: 22px 18px; } }

/* intro de la primera vez */
.intro { position: fixed; inset: 0; z-index: 990; display: grid; place-items: center; background: #000; overflow: hidden; transition: opacity .6s; }
.intro.out { opacity: 0; }
.intro > * { grid-area: 1 / 1; }
.intro-glow { width: 70vmin; height: 70vmin; border-radius: 50%; background: radial-gradient(circle, rgb(229 9 20 / .55), rgb(229 9 20 / 0) 65%); animation: intro-glow 4.2s ease-out both; }
.intro-ring { width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .8); animation: intro-ring 1.6s .5s cubic-bezier(.2, .8, .2, 1) both; }
.intro-ring.r2 { border-color: rgb(229 9 20 / .9); animation-delay: .75s; }
.intro-sparks { width: 0; height: 0; position: relative; }
.intro-sparks i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); opacity: 0; animation: intro-spark var(--t) .6s cubic-bezier(.1, .7, .3, 1) both; }
.intro-logo { width: 120px; height: auto; filter: drop-shadow(0 0 22px rgb(255 255 255 / .55)); animation: intro-logo 1.3s cubic-bezier(.16, 1, .3, 1) both; margin-top: -90px; }
.intro-title { margin-top: 110px; display: flex; gap: .12em; font-size: clamp(34px, 7vw, 64px); font-weight: 900; letter-spacing: .14em; color: #fff; }
.intro-title span { display: inline-block; opacity: 0; animation: intro-letter .7s calc(1s + var(--i) * .08s) cubic-bezier(.16, 1, .3, 1) both; text-shadow: 0 0 24px rgb(229 9 20 / .7); }
.intro-sub { margin-top: 230px; color: rgb(255 255 255 / .75); font-size: var(--fs-lg); font-weight: 600; opacity: 0; animation: intro-fade .8s 1.9s ease both; text-align: center; padding: 0 20px; }
.intro-skip { position: absolute; right: 24px; bottom: 24px; grid-area: auto; color: rgb(255 255 255 / .5); font-weight: 700; font-size: var(--fs-md); }
.intro-skip:hover { color: #fff; }
@keyframes intro-glow { 0% { transform: scale(.2); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.4); opacity: .7; } }
@keyframes intro-ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(7); opacity: 0; } }
@keyframes intro-spark { 0% { transform: rotate(var(--a)) translateX(0); opacity: 1; } 100% { transform: rotate(var(--a)) translateX(var(--d)); opacity: 0; } }
@keyframes intro-logo { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; filter: blur(10px); } 60% { transform: scale(1.12) rotate(4deg); opacity: 1; filter: blur(0) drop-shadow(0 0 30px #fff); } 100% { transform: scale(1); } }
@keyframes intro-letter { from { transform: translateY(30px) scale(.6); opacity: 0; filter: blur(6px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes intro-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* visita guiada */
.tour { position: fixed; inset: 0; z-index: 970; transition: opacity .3s; }
.tour.out { opacity: 0; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 200vmax rgb(0 0 0 / .74), 0 0 0 2px rgb(255 255 255 / .9), 0 0 24px rgb(255 255 255 / .35); transition: all .45s var(--ease); pointer-events: none; }
.tour-tip { position: fixed; padding: 16px 18px; border-radius: var(--r-md); background: #fff; color: #111; box-shadow: 0 24px 60px rgb(0 0 0 / .5); transition: left .45s var(--ease), top .45s var(--ease), bottom .45s var(--ease); }
.tour-tip.pop { animation: tour-pop .4s var(--ease); }
@keyframes tour-pop { from { transform: scale(.92); opacity: 0; } }
.tour-n { font-size: var(--fs-xs); font-weight: 800; color: #888; text-transform: uppercase; letter-spacing: .06em; }
.tour-tip h3 { font-size: var(--fs-xl); font-weight: 900; margin: 2px 0 6px; }
.tour-tip p { font-size: var(--fs-base); line-height: 1.5; color: #333; }
.tour-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.tour-tip .btn-secondary { background: #eee; color: #111; border-color: #ddd; }
.tour-tip .btn-primary { background: var(--accent); color: #fff; }

/* confeti */
.confetti { position: fixed; inset: 0; z-index: 995; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 8px; height: 14px; border-radius: 2px; background: var(--c); animation: confetti var(--t) var(--dl) cubic-bezier(.25, .6, .45, 1) both; }
@keyframes confetti { to { transform: translateY(110vh) rotate(var(--r)); } }

/* invitacion (ajustes) */
.invite-box { margin: 8px 0 16px; padding: 14px; border-radius: var(--r-md); background: rgb(70 211 105 / .08); border: 1px solid rgb(70 211 105 / .35); }
.invite-box[hidden] { display: none; }
.invite-box pre { white-space: pre-wrap; font: inherit; font-size: var(--fs-md); color: var(--text); margin: 8px 0 12px; padding: 10px 12px; border-radius: var(--r-sm); background: rgb(0 0 0 / .35); }
.inv-btns { display: flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .intro *, .onb-body.enter, .confetti i { animation-duration: .01s !important; } }
.onb-avs > p, .onb-likes > p, .onb-banners > p { grid-column: 1 / -1; }
.onb-foot { justify-content: flex-end; }
.onb-foot .onb-back { margin-right: auto; }
.onb-foot .onb-back[hidden] { display: none !important; }

/* =====================================================================
   Ficha: episodios con informacion (titulo, resumen, duracion, fecha, SUB/DOB)
   ===================================================================== */
.modal-card { width: min(1180px, 100%); }
.episodes-grid:has(.ep-row) { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 12px; max-height: none; overflow: visible; }
.episode-card.ep-row { display: grid; grid-template-columns: 210px 1fr; gap: 14px; padding: 10px; border-radius: var(--r-md); background: var(--fill-1); border: 1px solid var(--hairline); transition: background .15s, border-color .15s; }
.episode-card.ep-row:hover, .kbnav .episode-card.ep-row:focus-within { background: var(--fill-2); border-color: var(--hairline-2); }
.episode-card.ep-row.out-range { display: none; }
.ep-row .ep-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #1a1a1d; cursor: pointer; }
.ep-row .ep-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.ep-row:hover .ep-thumb img { transform: scale(1.05); }
.ep-row .ep-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .35); opacity: 0; transition: opacity .2s; }
.ep-row .ep-play .ic { width: 34px; height: 34px; color: #fff; filter: drop-shadow(0 2px 8px rgb(0 0 0 / .6)); }
.ep-row:hover .ep-play { opacity: 1; }
.ep-row.watched .ep-thumb img { opacity: .55; }
.ep-row .ep-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 2px 0; }
.ep-head { display: flex; align-items: baseline; gap: 10px; }
.ep-row .ep-title { flex: 1; min-width: 0; font-size: var(--fs-lg); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-len { flex: none; font-size: var(--fs-sm); font-weight: 700; color: var(--text-3); }
.ep-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-3); font-weight: 700; }
.ep-lang { padding: 2px 7px; border-radius: var(--r-xs); font-weight: 900; letter-spacing: .04em; }
.ep-lang.sub { background: rgb(255 255 255 / .1); color: var(--text); }
.ep-lang.dub { background: rgb(70 211 105 / .16); color: var(--online); }
.ep-lang[hidden] { display: none; }
.ep-date:not(:empty)::before { content: '· '; }
.ep-syn { font-size: var(--fs-md); line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.ep-syn.open { -webkit-line-clamp: unset; }
.ep-syn[hidden] { display: none; }
.ep-row .ep-buttons { margin-top: auto; display: flex; gap: 8px; }
.ep-row .btn-ep-watch { display: inline-flex; align-items: center; gap: 6px; }
.ep-row .btn-ep-watch .ic { width: 14px; height: 14px; }
@media (max-width: 700px) {
  .episodes-grid:has(.ep-row) { grid-template-columns: 1fr; }
  .episode-card.ep-row { grid-template-columns: 132px 1fr; gap: 10px; padding: 8px; }
  .ep-row .ep-title { font-size: var(--fs-md); }
  .ep-syn { -webkit-line-clamp: 2; font-size: var(--fs-sm); }
}
html.tv .episodes-grid:has(.ep-row) { grid-template-columns: repeat(2, 1fr); }
