/* ===== NexusPlay - Player v3 ===== */
[hidden] { display: none !important; }

.player-overlay { display: none; opacity: 0; }
.player-overlay.is-open { display: grid; animation: pxFade .22s forwards; }
@keyframes pxFade { to { opacity: 1; } }
@keyframes pxIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.px-modal {
    width: min(1040px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    padding: clamp(.9rem, 2vw, 1.4rem);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 22px;
    background: linear-gradient(160deg, #0f1626, var(--card));
    box-shadow: 0 40px 120px rgba(0,0,0,.65), 0 0 60px rgba(45,212,244,.05);
    animation: pxIn .3s cubic-bezier(.2,.8,.2,1);
    scrollbar-width: none;
}
.px-modal::-webkit-scrollbar { display: none; }

/* Cabeçalho */
.px-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.px-head-info { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.px-head-logo { width: 48px; height: 48px; padding: 5px; flex: none; object-fit: contain; border-radius: 12px; background: #000; border: 1px solid var(--border); }
.px-head-text { min-width: 0; }
.px-head .eyebrow { margin-bottom: .2rem; }
.px-head h2 { font-size: clamp(1.1rem, 2.6vw, 1.55rem); letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-cat { display: block; margin-top: .15rem; color: var(--muted); font-size: .7rem; }
.px-head-actions { display: flex; gap: .5rem; flex: none; }
.px-icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 1.2rem; transition: .2s; }
.px-icon-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.px-icon-btn.is-on { color: var(--red); border-color: rgba(255,61,94,.4); background: rgba(255,61,94,.12); }

/* Palco */
.px-stage { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 16px; background: #000; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.45); user-select: none; -webkit-user-select: none; }
.px-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.px-vignette { position: absolute; inset: 0; pointer-events: none; transition: opacity .3s; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent 22%, transparent 60%, rgba(0,0,0,.82)); }
.px-top { position: absolute; top: 14px; left: 14px; z-index: 3; transition: opacity .3s; }
.px-stage.is-idle { cursor: none; }
.px-stage.is-idle .px-vignette, .px-stage.is-idle .px-top, .px-stage.is-idle .px-controls { opacity: 0; }
.px-stage.is-idle .px-controls { pointer-events: none; }

/* Play grande */
.px-bigplay { display: none; position: absolute; z-index: 4; top: 50%; left: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; place-items: center; border-radius: 50%; color: #05070e; background: var(--cyan); box-shadow: 0 0 0 10px rgba(45,212,244,.15), 0 18px 40px rgba(45,212,244,.3); transition: transform .2s; }
.px-bigplay svg { width: 34px; height: 34px; margin-left: 4px; }
.px-bigplay:hover { transform: scale(1.08); }
.px-stage:not(.is-playing):not(.is-loading):not(.is-error) .px-bigplay { display: grid; }

/* Estados */
.px-state { position: absolute; inset: 0; z-index: 5; display: none; place-items: center; align-content: center; justify-items: center; gap: .7rem; text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }
.px-loading { background: radial-gradient(circle at center, rgba(12,17,29,.72), rgba(0,0,0,.94)); }
.px-error { background: rgba(5,7,14,.93); }
.px-error strong { color: var(--foreground); font-size: 1rem; }
.px-buffering { z-index: 4; pointer-events: none; }
.px-loading-logo { width: 76px; height: 76px; object-fit: contain; border-radius: 16px; animation: pulse 1.8s infinite; }
.is-loading .px-loading, .is-error .px-error, .is-buffering .px-buffering { display: grid; }
.is-loading .px-controls, .is-error .px-controls { display: none; }

/* Controles */
.px-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: center; gap: .35rem; padding: 2.4rem .9rem .8rem; transition: opacity .3s; }
.px-btn { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: transparent; transition: .18s; }
.px-btn:hover { background: rgba(255,255,255,.14); color: var(--cyan); }
.px-btn svg { width: 20px; height: 20px; }
.px-spacer { flex: 1; }
.px-text-btn { padding: 0 .7rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; display: inline-flex; align-items: center; gap: .4rem; }
.px-live-btn { color: var(--red); }
.px-live-btn:hover { color: #fff; background: rgba(255,61,94,.25); }

.px-ico-pause, .px-ico-mute { display: none; }
.is-playing .px-ico-play { display: none; }
.is-playing .px-ico-pause { display: block; }
.is-muted .px-ico-vol { display: none; }
.is-muted .px-ico-mute { display: block; }

/* Volume */
.px-vol-wrap { display: flex; align-items: center; }
.px-volume { -webkit-appearance: none; appearance: none; width: 0; height: 4px; opacity: 0; margin: 0; border-radius: 4px; outline: none; cursor: pointer; transition: width .25s, opacity .25s, margin .25s; background: linear-gradient(90deg, var(--cyan) var(--v, 100%), rgba(255,255,255,.25) var(--v, 100%)); }
.px-vol-wrap:hover .px-volume, .px-vol-wrap:focus-within .px-volume { width: 86px; opacity: 1; margin: 0 .5rem 0 .2rem; }
.px-volume::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.5); }
.px-volume::-moz-range-thumb { width: 13px; height: 13px; border: none; border-radius: 50%; background: #fff; }
@media (hover: none) { .px-vol-wrap .px-volume { display: none; } }

/* Qualidade */
.px-qual { position: relative; }
.px-menu { position: absolute; bottom: 46px; right: 0; min-width: 140px; padding: .35rem; border-radius: 12px; border: 1px solid var(--border); background: rgba(12,17,29,.96); backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.px-menu button { display: block; width: 100%; padding: .5rem .7rem; border-radius: 8px; text-align: left; color: var(--muted); background: transparent; font-size: .75rem; }
.px-menu button:hover { color: #fff; background: rgba(255,255,255,.08); }
.px-menu button.is-active { color: var(--cyan); font-weight: 700; }

/* Tela cheia */
.px-stage:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border: 0; border-radius: 0; }
.px-stage:-webkit-full-screen { width: 100vw; height: 100vh; aspect-ratio: auto; border: 0; border-radius: 0; }

/* Favoritos nos cards */
.favorite-button.is-favorite { color: var(--red); background: rgba(255,61,94,.16); border: 1px solid rgba(255,61,94,.35); }

@media (max-width: 760px) {
    .px-modal { border-radius: 16px; padding: .8rem; }
    .px-head-logo { display: none; }
    .px-controls { padding: 2rem .5rem .55rem; gap: .1rem; }
    .px-btn { min-width: 34px; height: 34px; }
    .px-text-btn { padding: 0 .5rem; }
    .px-bigplay { width: 62px; height: 62px; margin: -31px 0 0 -31px; }
}
