:root {
    --sx-bg: #0b0b0b;
    --sx-elev: #141414;
    --sx-text: #f5f5f5;
    --sx-muted: #b3b3b3;
    --sx-accent: #e50914;
    --sx-accent-2: #f40612;
    --sx-radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--sx-bg);
    color: var(--sx-text);
    font-family: Outfit, "Segoe UI", system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }

.sx-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.sx-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(11, 11, 11, 0.78) 70%, transparent);
    backdrop-filter: blur(12px);
}

.sx-nav-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
}

.sx-logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sx-logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--sx-accent), #7c3aed);
    font-size: 0.75rem;
}

.sx-nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    scrollbar-width: none;
}

.sx-nav-links::-webkit-scrollbar { display: none; }

.sx-nav-links a {
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
}

.sx-nav-links a:hover,
.sx-nav-links a.is-active {
    color: #fff;
}

.sx-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}

.sx-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.2rem 0.35rem 0.2rem 0.85rem;
}

.sx-search input {
    width: 140px;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    outline: none;
}

.sx-search button {
    border: 0;
    background: transparent;
    color: #fff;
    width: 36px;
    height: 32px;
    cursor: pointer;
}

.sx-login {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.sx-login:hover { background: #fff; color: #111; }

.sx-hero {
    position: relative;
    min-height: min(78vh, 720px);
    overflow: hidden;
}

.sx-hero-slides { position: relative; min-height: min(78vh, 720px); }

.sx-hero-slide {
    position: absolute;
    inset: 0;
    background: #1a1a1a center/cover no-repeat;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.sx-hero-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.sx-hero-shade,
.sx-detail-hero::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.88) 8%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0.2)),
        linear-gradient(0deg, #0b0b0b 0%, transparent 42%);
    pointer-events: none;
}

.sx-hero-shade { z-index: 1; }

.sx-hero-copy {
    position: absolute;
    left: 4%;
    bottom: 14%;
    z-index: 2;
    max-width: min(560px, 88vw);
}

.sx-kicker {
    margin: 0 0 0.4rem;
    color: var(--sx-accent-2);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
}

.sx-hero-copy h1,
.sx-detail-copy h1,
.sx-page-head h1,
.sx-empty h1 {
    margin: 0 0 0.7rem;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    line-height: 1.1;
    font-weight: 800;
}

.sx-hero-syn {
    margin: 0 0 1.1rem;
    color: var(--sx-muted);
    font-size: 1.02rem;
    line-height: 1.5;
}

.sx-hero-cta { display: flex; gap: 0.7rem; flex-wrap: wrap; }

.sx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
}

.sx-btn-primary { background: #fff; color: #111; }
.sx-btn-primary:hover { background: #f3f3f3; }
.sx-btn-ghost { background: rgba(255, 255, 255, 0.14); color: #fff; }
.sx-btn-ghost:hover { background: rgba(255, 255, 255, 0.24); }

.sx-hero-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
}

.sx-hero-prev { left: 12px; }
.sx-hero-next { right: 12px; }
.sx-hero-dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 6px;
}

.sx-hero-dots button {
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
}

.sx-hero-dots button.is-active { background: #fff; width: 22px; border-radius: 999px; }

.sx-rails { padding: 0.5rem 0 2.5rem; }

.sx-rail { margin: 1.4rem 0; }

.sx-rail-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem 0.7rem;
}

.sx-rail-head h2 { margin: 0; font-size: 1.25rem; }

.sx-rail-more { color: var(--sx-muted); font-size: 0.88rem; }

.sx-rail-wrap { position: relative; }

.sx-rail-track {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 0 1.5rem 0.4rem;
    scrollbar-width: none;
}

.sx-rail-track::-webkit-scrollbar { display: none; }

.sx-rail-arrow {
    position: absolute;
    top: 32%;
    z-index: 2;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

.sx-rail-prev { left: 6px; }
.sx-rail-next { right: 6px; }

.sx-card {
    flex: 0 0 160px;
    width: 160px;
    scroll-snap-align: start;
}

.sx-card-poster {
    display: block;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #1d1d1d;
}

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

.sx-card:hover .sx-card-poster img { transform: scale(1.06); }

.sx-card-fallback {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 2.4rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.35);
}

.sx-card-meta { display: block; padding: 0.45rem 0.1rem 0; }
.sx-card-title { display: block; font-weight: 700; font-size: 0.92rem; }
.sx-card-sub { display: block; color: var(--sx-muted); font-size: 0.78rem; margin-top: 0.15rem; }

.sx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

.sx-grid .sx-card { flex: none; width: auto; }

.sx-main-pad,
.sx-page-head,
.sx-episodes,
.sx-empty {
    max-width: 1440px;
    margin: 0 auto;
}

.sx-page-head { padding: 1.5rem 1.5rem 0.5rem; }

.sx-empty {
    padding: 4rem 1.5rem;
    text-align: center;
}

.sx-empty p { color: var(--sx-muted); }

.sx-detail-hero {
    position: relative;
    min-height: 520px;
    background: #111 center/cover no-repeat;
    padding: 5rem 1.5rem 2.5rem;
}

.sx-detail-inner {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 1.5rem;
    max-width: 1440px;
    margin: 0 auto;
    align-items: flex-end;
}

.sx-detail-poster img {
    width: 210px;
    border-radius: 10px;
    display: block;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.sx-detail-copy { max-width: 640px; }

.sx-episodes { padding: 1.5rem 1.5rem 3rem; }

.sx-season-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

.sx-season-tab {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    color: #fff;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    font: inherit;
}

.sx-season-tab.is-active { background: #fff; color: #111; }

.sx-ep-list { display: none; flex-direction: column; gap: 0.65rem; }
.sx-ep-list.is-active { display: flex; }

.sx-ep {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    background: var(--sx-elev);
    border-radius: 10px;
    padding: 0.55rem;
}

.sx-ep:hover { background: #1c1c1c; }

.sx-ep-thumb {
    position: relative;
    width: 140px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #222;
    flex-shrink: 0;
}

.sx-ep-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sx-ep-num {
    position: absolute;
    left: 6px;
    bottom: 6px;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.sx-ep-body { display: flex; flex-direction: column; gap: 0.2rem; }
.sx-ep-body span { color: var(--sx-muted); font-size: 0.82rem; }

.sx-muted { color: var(--sx-muted); padding: 0 1.5rem; }

.sx-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem;
    color: var(--sx-muted);
    font-size: 0.85rem;
}

.sx-footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 820px) {
    .sx-search input { width: 90px; }
    .sx-detail-inner { flex-direction: column; align-items: flex-start; }
    .sx-detail-poster img { width: 140px; }
    .sx-card { flex-basis: 132px; width: 132px; }
    .sx-hero-copy { bottom: 10%; }
    .sx-login { display: none; }
}

@media (max-width: 560px) {
    .sx-nav-inner { padding: 0.7rem 0.9rem; }
    .sx-nav-links { display: none; }
    .sx-ep-thumb { width: 108px; }
}

/* —— Reproductor cinematográfico —— */
.nx-body {
    margin: 0;
    background: #000;
    color: #fff;
    font-family: Outfit, "Segoe UI", system-ui, sans-serif;
    overflow: hidden;
}
.nx-player {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #000;
    user-select: none;
}
/* Fallback móvil cuando la Fullscreen API no existe (p. ej. iOS en el contenedor) */
html.nx-fs-lock,
body.nx-fs-lock {
    overflow: hidden !important;
    height: 100% !important;
}
.nx-player.is-fs {
    position: fixed;
    inset: 0;
    z-index: 99999;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}
.nx-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.nx-shade-top,
.nx-shade-bottom {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    transition: opacity .35s;
}
.nx-shade-top {
    top: 0;
    height: 28%;
    background: linear-gradient(180deg, rgba(0,0,0,.82), transparent);
}
.nx-shade-bottom {
    bottom: 0;
    height: 34%;
    background: linear-gradient(0deg, rgba(0,0,0,.88), transparent);
}
.nx-player.is-idle .nx-top,
.nx-player.is-idle .nx-bar,
.nx-player.is-idle .nx-shade-top,
.nx-player.is-idle .nx-shade-bottom,
.nx-player.is-idle .nx-bigplay {
    opacity: 0;
    pointer-events: none;
}
.nx-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 22px 24px;
    transition: opacity .35s;
}
.nx-back {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(20,20,20,.55);
    flex-shrink: 0;
}
.nx-top-copy h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}
.nx-top-copy p { margin: 2px 0 0; color: rgba(255,255,255,.72); font-size: .92rem; }
.nx-kicker {
    margin: 0 0 4px !important;
    font-size: .7rem !important;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #e50914 !important;
    font-weight: 800;
}
.nx-studio {
    margin-left: auto;
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-weight: 700;
    font-size: .85rem;
}
.nx-bigplay {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 80px;
    height: 80px;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 4;
    transition: opacity .35s, transform .2s;
}
.nx-player.is-playing .nx-bigplay { opacity: 0; pointer-events: none; }
.nx-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    padding: 0 20px 18px;
    transition: opacity .35s;
}
.nx-progress {
    height: 6px;
    border-radius: 99px;
    background: rgba(255,255,255,.22);
    cursor: pointer;
    margin-bottom: 10px;
}
.nx-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: #e50914;
}
.nx-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .92rem;
}
.nx-bar-row button,
.nx-next-btn {
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 8px;
}
.nx-next-btn {
    background: #e50914;
    border-radius: 4px;
    padding: 7px 12px;
}
.nx-bar-spacer { flex: 1; }
.nx-bar-title {
    opacity: .8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 36vw;
}
.nx-time { font-variant-numeric: tabular-nums; opacity: .85; }
.nx-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 92vw);
    background: rgba(10,10,10,.94);
    z-index: 8;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255,255,255,.08);
}
.nx-drawer[hidden] { display: none !important; }
.nx-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 16px;
    font-size: 1.05rem;
}
.nx-drawer-head button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}
.nx-drawer-list { overflow: auto; padding: 0 10px 20px; }
.nx-ep {
    display: flex;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 8px;
}
.nx-ep:hover, .nx-ep.is-current { background: rgba(255,255,255,.08); }
.nx-ep.is-current { outline: 1px solid #e50914; }
.nx-ep-num { color: #e50914; font-weight: 800; min-width: 64px; }
.nx-next {
    position: absolute;
    right: 24px;
    bottom: 92px;
    z-index: 7;
    background: rgba(20,20,20,.92);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 14px 16px;
    min-width: 200px;
}
.nx-next[hidden] { display: none !important; }
.nx-next p { margin: 0; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #b3b3b3; }
.nx-next strong { display: block; margin: 6px 0 10px; }
.nx-next a {
    display: inline-block;
    background: #e50914;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 700;
}
@media (max-width: 640px) {
    .nx-bar-title { display: none; }
    .nx-top { padding: 14px; }
    .nx-top-copy h1 { font-size: 1.05rem; }
}
