/* ============================================================
   StreamFlix — hoja de estilos
   ============================================================ */

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

:root {
  --bg: #07090f;
  --bg-2: #0b0e16;
  --panel: #11151f;
  --panel-2: #161b28;
  --text: #f2f4fa;
  --muted: #98a2b8;
  --muted-2: #6b7488;
  --accent: #7c5cff;
  --accent-2: #ff4d8d;
  --accent-3: #22d3ee;
  --gold: #f5c518;
  --green: #22c55e;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --header-h: 72px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(124, 92, 255, 0.4); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------- Fondo ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 12% -5%, rgba(124, 92, 255, 0.24), transparent 62%),
    radial-gradient(45% 40% at 88% 2%, rgba(255, 77, 141, 0.16), transparent 62%),
    radial-gradient(70% 55% at 50% 108%, rgba(34, 211, 238, 0.09), transparent 62%);
}
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(90% 55% at 50% 0%, #000 20%, transparent 100%);
  mask-image: radial-gradient(90% 55% at 50% 0%, #000 20%, transparent 100%);
}

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(7, 9, 15, 0.74);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.45);
  color: #fff;
}
.brand-text span {
  background: linear-gradient(90deg, #a78bfa, #ff7aa8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav { display: flex; gap: 2px; margin-right: auto; }
.nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav a.active { color: var(--text); }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.search { position: relative; width: min(340px, 30vw); flex-shrink: 0; }
.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  font-size: 13.5px;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus {
  border-color: rgba(124, 92, 255, 0.65);
  background: rgba(124, 92, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
.icon-btn.small { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }

/* ---------- Contenedor ---------- */
.view {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 80px;
  min-height: 62vh;
}

/* ---------- Héroe ---------- */
.hero {
  position: relative;
  margin: 24px 0 48px;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  isolation: isolate;
  background: linear-gradient(150deg, #1a1333, #0b0e16 60%);
}
.hero-bg { position: absolute; inset: -2px; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 9, 15, 0.12) 0%, rgba(7, 9, 15, 0.62) 52%, rgba(7, 9, 15, 0.97) 100%),
    linear-gradient(90deg, rgba(7, 9, 15, 0.92) 0%, rgba(7, 9, 15, 0.45) 45%, transparent 75%);
}
.hero-content { position: relative; padding: 56px; max-width: 700px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(10px);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #dfe4f2;
}
.hero-kicker .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
  animation: pulse 2s infinite;
}
.hero-title {
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.02;
  letter-spacing: -1.8px;
  font-weight: 800;
  margin: 16px 0 18px;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.hero-desc {
  color: #ccd3e1;
  font-size: 15.5px;
  line-height: 1.65;
  max-width: 580px;
  margin-bottom: 26px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Chips y botones ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.chip.rating { color: var(--gold); }
.chip.small { padding: 4px 9px; font-size: 11px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(135deg, #8b6bff, #6a3df5);
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(124, 92, 255, 0.48); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-2);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.btn-ghost.active { color: #ff7a95; border-color: rgba(255, 77, 141, 0.45); background: rgba(255, 77, 141, 0.1); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn.disabled { opacity: 0.4; pointer-events: none; }

.chip-btn {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}
.chip-btn:hover { color: var(--text); border-color: var(--border-2); }
.chip-btn.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(255, 77, 141, 0.14));
  border-color: rgba(124, 92, 255, 0.5);
}

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 24px; }

/* ---------- Secciones ---------- */
.section { margin-bottom: 46px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 { font-size: clamp(20px, 2.4vw, 28px); letter-spacing: -0.5px; font-weight: 800; }
.section-head .link { color: #a78bfa; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.section-head .link:hover { color: #c4b5fd; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hint { font-size: 12px; color: var(--muted-2); margin-top: 10px; line-height: 1.5; }

/* ---------- Filas y grids ---------- */
.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 182px;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.row::-webkit-scrollbar { height: 8px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  gap: 18px;
}

/* ---------- Tarjetas ---------- */
.card { position: relative; display: block; scroll-snap-align: start; }
.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, #1b2133, #0d1018);
  border: 1px solid var(--border);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.card img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, opacity 0.3s;
}
.card:hover .card-poster {
  transform: translateY(-6px);
  border-color: rgba(124, 92, 255, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 92, 255, 0.25);
}
.card:hover img { transform: scale(1.06); }
.card-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -1px;
  color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(160deg, #241f4a, #0f1424);
}
.card-type {
  position: absolute;
  z-index: 2;
  left: 8px;
  top: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.card-rating {
  position: absolute;
  z-index: 2;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(7, 9, 15, 0.78);
  color: var(--gold);
  backdrop-filter: blur(8px);
}
.fav-btn {
  position: absolute;
  z-index: 3;
  right: 8px;
  top: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(7, 9, 15, 0.68);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  opacity: 0;
  transform: scale(0.9);
  transition: 0.2s;
}
.card:hover .fav-btn, .fav-btn.active, .fav-btn:focus-visible { opacity: 1; transform: scale(1); }
.fav-btn:hover { background: rgba(7, 9, 15, 0.92); }
.fav-btn.active { color: #ff4d6d; border-color: rgba(255, 77, 109, 0.55); }
.card-hover {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 9, 15, 0.34);
  opacity: 0;
  transition: opacity 0.25s;
}
.card:hover .card-hover { opacity: 1; }
.play-badge {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.94);
  color: #0b0e16;
  font-size: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  padding-left: 3px;
}
.card-body { padding: 10px 2px 0; }
.card-body h3 {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-body p {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Encabezados de página ---------- */
.page-head { padding: 38px 0 24px; }
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #a78bfa;
  margin-bottom: 10px;
}
.page-head h1 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -1.2px; font-weight: 800; }
.page-head p { color: var(--muted); max-width: 760px; margin-top: 10px; line-height: 1.65; font-size: 14.5px; }

/* ---------- Detalle ---------- */
.detail-hero {
  position: relative;
  margin: 24px 0 34px;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  isolation: isolate;
  background: linear-gradient(150deg, #191233, #0b0e16 65%);
}
.detail-hero .backdrop { position: absolute; inset: -2px; z-index: -2; }
.detail-hero .backdrop img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(7, 9, 15, 0.18), rgba(7, 9, 15, 0.78) 58%, var(--bg) 100%);
}
.detail-inner {
  position: relative;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 34px;
  padding: 46px 46px 38px;
}
.detail-poster {
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-2);
  background: linear-gradient(160deg, #241f4a, #0f1424);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { min-width: 0; }
.detail-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #a78bfa;
}
.detail-title {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -1.2px;
  font-weight: 800;
  margin: 8px 0 14px;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.detail-desc { color: #ccd3e1; line-height: 1.7; max-width: 780px; margin: 18px 0 26px; font-size: 14.5px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.detail-cast { margin-top: 22px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.detail-cast strong { color: var(--text); font-weight: 600; }

.season-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin: 6px 0 16px; }
.season-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: 0.2s;
}
.season-tab:hover { color: var(--text); border-color: var(--border-2); }
.season-tab.active {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(255, 77, 141, 0.15));
  border-color: rgba(124, 92, 255, 0.5);
  color: var(--text);
}
.episode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}
.episode {
  display: flex;
  gap: 12px;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  transition: 0.2s;
  text-align: left;
}
.episode:hover {
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.08);
  transform: translateY(-2px);
}
.episode-num { font-size: 12px; font-weight: 800; color: #a78bfa; min-width: 30px; padding-top: 2px; }
.episode h4 { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.episode p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.manual-ep { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.manual-ep label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.manual-ep input {
  width: 90px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}
.manual-ep input:focus { border-color: rgba(124, 92, 255, 0.6); }

/* ---------- Reproductor ---------- */
.player { margin: 20px 0 44px; }
.player-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.back-link { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.back-link:hover { color: var(--text); }
.player-title h1 { font-size: clamp(20px, 2.6vw, 30px); letter-spacing: -0.5px; margin-top: 4px; }
.player-title p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.player-top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  background: #05070c;
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
}
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.player-frame-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 80px rgba(124, 92, 255, 0.08);
}
.frame-tools { position: absolute; top: 12px; right: 12px; z-index: 3; }
.server-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(7, 9, 15, 0.78);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #7ee2a0;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}
.server-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.server-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.server-head h3 { font-size: 16px; font-weight: 700; }
.server-head .muted { margin-top: 2px; }
.server-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
  gap: 10px;
}
.server-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  transition: 0.2s;
  min-width: 0;
}
.server-btn:hover { border-color: var(--border-2); background: rgba(255, 255, 255, 0.06); }
.server-btn.active {
  border-color: rgba(124, 92, 255, 0.6);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(255, 77, 141, 0.1));
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.25);
}
.server-flag { font-size: 19px; flex-shrink: 0; }
.server-name { display: block; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-sub {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.server-btn .server-badge { margin-left: auto; flex-shrink: 0; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.switch input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.ep-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ep-chip {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: 0.15s;
}
.ep-chip:hover { color: var(--text); border-color: var(--border-2); }
.ep-chip.active {
  background: rgba(124, 92, 255, 0.2);
  border-color: rgba(124, 92, 255, 0.55);
  color: var(--text);
}
.select-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.select-inline select {
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  outline: none;
  cursor: pointer;
}
.provider-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-provider {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  font-weight: 600;
  transition: 0.2s;
}
.mini-provider:hover { border-color: rgba(124, 92, 255, 0.5); background: rgba(124, 92, 255, 0.1); }

/* ---------- Página de servidores ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 22px 0 28px;
}
.stat {
  padding: 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.stat strong { display: block; font-size: 27px; letter-spacing: -0.6px; }
.stat span { font-size: 12px; color: var(--muted); }

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.provider-card {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}
.provider-card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
.provider-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.provider-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.provider-name { font-weight: 800; font-size: 15.5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.provider-domain { font-size: 11.5px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.provider-desc { font-size: 12.5px; color: #c3cadb; line-height: 1.55; margin-bottom: 12px; flex: 1; }
.provider-pattern {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin-bottom: 14px;
  font-size: 10.5px;
}
.provider-pattern span {
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  white-space: nowrap;
}
.provider-pattern code {
  color: #b9a8ff;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
}
.lang-row { display: flex; flex-wrap: wrap; gap: 6px; }
.lang {
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.14);
  color: #c9baff;
  border: 1px solid rgba(124, 92, 255, 0.25);
  white-space: nowrap;
}
.lang.latino { background: rgba(34, 197, 94, 0.12); color: #7ee2a0; border-color: rgba(34, 197, 94, 0.25); }
.provider-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.provider-foot .icon-btn { margin-left: auto; }

.note-card {
  margin-top: 34px;
  padding: 24px;
  border-radius: 18px;
  background: rgba(124, 92, 255, 0.06);
  border: 1px solid rgba(124, 92, 255, 0.2);
}
.note-card h3 { font-size: 17px; margin-bottom: 10px; }
.note-card p { font-size: 13.5px; color: #c3cadb; line-height: 1.65; }
.note-card p + p { margin-top: 10px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal {
  width: min(700px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 22px;
  box-shadow: var(--shadow);
  animation: pop 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.modal-head h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.modal-body { padding: 22px 24px; }
.modal-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.settings-section + .settings-section { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); }
.settings-section h4 { font-size: 14px; font-weight: 800; letter-spacing: 0.3px; margin-bottom: 14px; }
.form-field { margin-bottom: 15px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  font-size: 13.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input:focus, .form-field select:focus {
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}
.form-field input::placeholder { color: var(--muted-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.custom-list { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}
.trailer-frame {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.trailer-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Toasts ---------- */
.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  animation: slideIn 0.25s ease;
  max-width: 340px;
}
.toast.out { animation: slideOut 0.25s ease forwards; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.toast.success { border-color: rgba(34, 197, 94, 0.4); }
.toast.success .toast-dot { background: var(--green); }
.toast.error { border-color: rgba(255, 77, 109, 0.45); }
.toast.error .toast-dot { background: var(--accent-2); }

/* ---------- Skeletons ---------- */
.skeleton {
  background: linear-gradient(90deg, #121623 25%, #1b2233 37%, #121623 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 14px;
}
.skel-card { display: flex; flex-direction: column; gap: 9px; }
.skel-poster { aspect-ratio: 2 / 3; }
.skel-line { height: 11px; width: 85%; border-radius: 5px; }
.skel-line.short { width: 55%; }
.hero-skel { height: 540px; border-radius: 28px; margin: 24px 0 48px; }
.detail-skel { height: 520px; border-radius: 26px; margin: 24px 0 34px; }
.player-skel { aspect-ratio: 16 / 9; border-radius: 20px; }

/* ---------- Vacío / error ---------- */
.empty {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  padding: 70px 24px;
  border-radius: 20px;
  border: 1px dashed var(--border-2);
  background: rgba(255, 255, 255, 0.02);
}
.empty h2 { font-size: 22px; letter-spacing: -0.4px; }
.empty p { color: var(--muted); font-size: 14px; max-width: 460px; }
.empty .btn { margin-top: 8px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 24px 38px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.7;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto 18px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand .brand-text { font-size: 18px; font-weight: 800; }
.footer-brand p { margin-top: 6px; }
.footer-links { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-weight: 600; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.disclaimer {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 11.5px;
}

/* ---------- Animaciones ---------- */
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav { gap: 0; }
  .nav a { padding: 8px 9px; font-size: 13px; }
  .search { width: min(280px, 28vw); }
  .detail-inner { grid-template-columns: 190px 1fr; padding: 34px; gap: 26px; }
}

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .brand { order: 1; }
  .icon-btn { order: 2; margin-left: auto; }
  .search { order: 3; width: 100%; flex-basis: 100%; }
  .nav { order: 4; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { height: 0; }
  .view { padding: 0 16px 64px; }
  .hero { min-height: 470px; }
  .hero-content { padding: 30px; }
  .detail-inner { grid-template-columns: 1fr; padding: 26px; }
  .detail-poster { max-width: 180px; }
}

@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; }
  .row { grid-auto-columns: 140px; gap: 12px; }
  .card-body h3 { font-size: 12.5px; }
  .card-body p { font-size: 10.5px; }
  .hero { min-height: 420px; margin: 16px 0 34px; border-radius: 20px; }
  .hero-content { padding: 22px; }
  .hero-title { font-size: 32px; }
  .hero-desc { font-size: 14px; -webkit-line-clamp: 2; }
  .section { margin-bottom: 34px; }
  .player-frame { border-radius: 14px; }
  .player-top { align-items: flex-start; }
  .server-list { grid-template-columns: 1fr 1fr; }
  .episode-list { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { padding: 26px 0 18px; }
  .modal-backdrop { padding: 10px; }
  .modal { border-radius: 18px; }
}

@media (max-width: 520px) {
  .brand-text { font-size: 19px; }
  .brand-mark { width: 34px; height: 34px; }
  .nav a { font-size: 12.5px; padding: 7px 8px; }
  .server-list { grid-template-columns: 1fr; }
  .detail-actions .btn { flex: 1 1 auto; }
  .hero-actions .btn { flex: 1 1 auto; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (hover: none) {
  .fav-btn { opacity: 1; transform: scale(1); }
}

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