/* Estilo "glass" (mismo del panel): fondo pastel, superficies translúcidas y botones píldora */
:root { --bg: #eef1fb; --fg: #1c1c1e; --muted: #6b6f80; --accent: #1677f2; --card: rgba(255,255,255,.62); --borde: rgba(255,255,255,.8);
        --linea: rgba(60,60,90,.12); --sombra: 0 8px 30px rgba(84,92,140,.14); --gutter: clamp(16px, 4vw, 60px); }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg); font-family: 'Inter', sans-serif; overflow-x: hidden; }
/* Degradado fijo en una capa aparte (background-attachment: fixed falla en iOS) */
body::before { content: ""; position: fixed; inset: 0; z-index: -1;
               background: radial-gradient(at 0% 0%, #fbd3de 0, transparent 50%), radial-gradient(at 100% 0%, #cfe1ff 0, transparent 55%),
                           radial-gradient(at 50% 100%, #e4dcff 0, transparent 60%); }
a { color: inherit; }
button { font: inherit; color: inherit; }
.material-icons-round { vertical-align: middle; }

/* Nav */
.nav { position: fixed; inset: 12px var(--gutter) auto; z-index: 50; display: flex; align-items: center; gap: 1rem; padding: 8px 10px 8px 20px;
       background: var(--card); border: 1px solid var(--borde); border-radius: 999px;
       backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: box-shadow .3s; }
.nav.solid { box-shadow: var(--sombra); }
.nav img { height: 30px; display: block; }
.nav .back { color: var(--fg); text-decoration: none; font-size: .9rem; font-weight: 600; opacity: .85; }
.search { margin-left: auto; display: flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.75); border: 1px solid var(--linea);
          padding: 8px 14px; border-radius: 999px; width: min(320px, 55vw); }
.search:focus-within { border-color: var(--accent); }
.search input { background: none; border: 0; outline: 0; color: var(--fg); width: 100%; font-size: .95rem; }

/* Hero */
.hero { position: relative; min-height: 68vh; margin: 84px var(--gutter) 0; display: flex; align-items: flex-end; padding: clamp(20px, 4vw, 48px);
        border-radius: 28px; overflow: hidden; box-shadow: var(--sombra); color: #fff; background-size: cover; background-position: center; }
.hero:empty { display: none; }
.hero::after { content: ""; position: absolute; inset: 0;
               background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 55%), linear-gradient(to right, rgba(0,0,0,.7) 0%, transparent 70%); }
.hero-body { position: relative; z-index: 1; max-width: 600px; }
.hero h1 { font-size: clamp(2rem, 6vw, 4rem); font-weight: 800; margin: 0 0 .5rem; line-height: 1.05; }
.hero p { font-size: clamp(.95rem, 1.6vw, 1.2rem); color: #eee; margin: 0 0 1.5rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 0; border-radius: 999px; padding: .6rem 1.4rem; font-weight: 600;
       cursor: pointer; text-decoration: none; font-size: 1rem; }
.btn-play { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(22,119,242,.4); }
.btn-info { background: rgba(255,255,255,.8); color: var(--fg); border: 1px solid var(--linea); }
.btn:hover { opacity: .85; }

/* Filas */
main { padding: 2rem 0 4rem; }
.row { margin-bottom: 2rem; }
.row h2 { font-size: clamp(1rem, 2vw, 1.4rem); margin: 0 0 .6rem; padding: 0 var(--gutter); }
.slider { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px var(--gutter) 24px; scrollbar-width: none; }
.slider::-webkit-scrollbar { display: none; }

.card { flex: 0 0 clamp(160px, 18vw, 240px); scroll-snap-align: start; background: var(--card); border: 1px solid var(--borde); border-radius: 18px;
        padding: 0; overflow: hidden; cursor: pointer; text-align: left; box-shadow: 0 4px 16px rgba(84,92,140,.12);
        transition: transform .25s, box-shadow .25s; }
.card:hover, .card:focus-visible { transform: scale(1.04); box-shadow: 0 14px 36px rgba(84,92,140,.28); z-index: 3; outline: none; }
.card:focus-visible { outline: 2px solid var(--accent); }
/* Las imágenes de series y capítulos son cuadradas (1080 × 1080): las tarjetas las muestran completas */
.thumb { position: relative; aspect-ratio: 1; background: #d9dcea center/cover; }
.thumb .num { position: absolute; left: 10px; bottom: 6px; font-size: 2.2rem; font-weight: 800; color: #fff; text-shadow: 0 2px 8px #000; }
.thumb .pf { position: absolute; right: 8px; top: 8px; font-size: .65rem; font-weight: 700; text-transform: uppercase; padding: 3px 8px;
             border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; }
.card .meta { padding: .6rem .85rem .8rem; }
.card .meta strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta small { color: var(--muted); font-size: .78rem; }
.poster { flex-basis: clamp(150px, 17vw, 230px); }

/* Resultados de búsqueda */
#results { padding: 100px var(--gutter) 4rem; }
#results h2 { font-size: 1.1rem; color: var(--muted); font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.grid .card { flex: none; }
.empty { color: var(--muted); padding: 2rem 0; }
.empty-home { padding: 120px var(--gutter); }

/* Modal */
dialog { width: min(900px, 100%); max-height: 100%; padding: 0; border: 1px solid var(--borde); border-radius: 24px; background: rgba(255,255,255,.92);
         color: var(--fg); box-shadow: 0 20px 60px rgba(40,45,80,.35); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
dialog::backdrop { background: rgba(40,45,80,.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.close { position: absolute; top: 12px; right: 12px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; border: 0;
         background: rgba(255,255,255,.9); box-shadow: 0 2px 10px rgba(0,0,0,.25); cursor: pointer; }
.player { position: relative; aspect-ratio: 16/9; background: #000 center/contain no-repeat; }
.player .fuera { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.m-body { padding: 1.5rem clamp(16px, 4vw, 40px) 2rem; }
.m-body h3 { font-size: clamp(1.3rem, 3vw, 2rem); margin: 0 0 .4rem; }
.m-body .desc { color: #444; line-height: 1.5; }
.facts { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; color: var(--muted); font-size: .9rem; margin: .8rem 0; }
.facts .material-icons-round { font-size: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
.chip { font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--linea); background: rgba(255,255,255,.7); cursor: pointer; }
.chip.v { border-color: var(--accent); color: var(--accent); }
.label { font-size: .8rem; color: var(--muted); margin-top: 1rem; }
.m-body .btn { margin-top: 1rem; }
.btn-dl { background: var(--accent); color: #fff; }
.eps h4 { margin: 2rem 0 .5rem; font-size: 1.2rem; }
.ep { display: grid; grid-template-columns: 2rem 84px 1fr auto; gap: 1rem; align-items: center; width: 100%; padding: .75rem .5rem; margin-top: 4px;
      background: none; border: 0; text-align: left; cursor: pointer; border-radius: 14px; }
.ep:hover, .ep.on { background: rgba(22,119,242,.1); }
.ep .i { font-size: 1.4rem; color: var(--muted); text-align: center; }
.ep-thumb { aspect-ratio: 1; border-radius: 10px; background: #d9dcea center/cover; }
.ep p { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }
.ep-fecha { display: block; color: var(--muted); font-size: .8rem; }

@media (max-width: 600px) {
    .nav .back span.txt { display: none; }
    .hero { min-height: 58vh; }
    dialog { border-radius: 0; height: 100%; }
    .ep { grid-template-columns: 1.5rem 68px 1fr; }
    .ep .d { display: none; }
}
