/* === Reset & Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #0a0a0a url('sakky.jpg') center center / cover no-repeat fixed;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    padding: 20px 15px 40px;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.87);
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* === Header === */
.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #e50914, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
}

#status {
    text-align: center;
    font-size: 0.85rem;
    margin-bottom: 15px;
    min-height: 20px;
}

/* === Grid === */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

@media (min-width: 700px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 900px;
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
    }
}

/* === Cards === */
.card {
    background: #161616;
    border: 1px solid #222;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    transform: scale(1.03);
    border-color: #e50914;
}

.card-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

.card-no-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.card-info {
    padding: 10px 12px 12px;
}

.card-nombre {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #eee;
    line-height: 1.3;
    margin-bottom: 4px;
}

.card-meta {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 4px;
}

.card-generos {
    font-size: 0.65rem;
    color: #888;
    margin-bottom: 4px;
}

/* === Modal casting (fullscreen overlay) === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.modal-overlay.visible {
    display: flex;
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal-titulo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff;
}

.modal-peli {
    font-size: 1.1rem;
    color: #e50914;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

.modal-texto {
    color: #999;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 350px;
    margin-bottom: 35px;
}

.modal-disconnect {
    background: #e50914;
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: background 0.2s, transform 0.1s;
}

.modal-disconnect:hover {
    background: #ff1a25;
}

.modal-disconnect:active {
    transform: scale(0.97);
}

.no-pelis {
    text-align: center;
    color: #555;
    margin-top: 60px;
    font-size: 0.95rem;
    grid-column: 1 / -1;
}

/* === Login === */
.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.login-wrap h1 {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #e50914, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-sub {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 40px;
}

.login-box {
    background: #161616;
    border: 1px solid #222;
    border-radius: 18px;
    padding: 35px 30px;
    width: 100%;
    max-width: 360px;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #333;
    background: #0a0a0a;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 3px;
    outline: none;
    transition: border-color 0.2s;
}

.login-box input[type="password"]:focus {
    border-color: #e50914;
}

.login-box button {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #e50914, #ff4454);
    color: white;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.1s;
}

.login-box button:active {
    transform: scale(0.97);
}

.login-error {
    color: #e50914;
    font-size: 0.85rem;
    margin-top: 12px;
    font-weight: 600;
}

.logout-btn {
    background: none;
    border: 1px solid #333;
    color: #666;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: border-color 0.2s, color 0.2s;
}

.logout-btn:hover {
    border-color: #e50914;
    color: #e50914;
}

/* === Choice Modal (3-step) === */
.choice-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 900;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.choice-modal.visible {
    display: flex;
}

.choice-modal-title {
    font-size: 1.1rem;
    color: #e50914;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 30px;
    letter-spacing: 0.5px;
}

.choice-step {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 340px;
}

.choice-step.active {
    display: flex;
}

.choice-step h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.choice-step p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.choice-btn {
    width: 100%;
    padding: 16px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: transform 0.1s, background 0.2s;
    border: none;
}

.choice-btn:active {
    transform: scale(0.97);
}

.choice-btn.primary {
    background: linear-gradient(135deg, #e50914, #ff4454);
    color: #fff;
}

.choice-btn.primary:hover {
    background: linear-gradient(135deg, #ff1a25, #ff5566);
}

.choice-btn.secondary {
    background: #222;
    color: #ccc;
    border: 1px solid #333;
}

.choice-btn.secondary:hover {
    border-color: #555;
    color: #fff;
}

.choice-btn.cancel {
    background: none;
    color: #666;
    font-size: 0.85rem;
    padding: 10px;
    margin-top: 6px;
}

.choice-btn.cancel:hover {
    color: #999;
}

/* Time input */
.time-input-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 20px;
}

.time-input {
    width: 80px;
    padding: 14px 10px;
    border-radius: 12px;
    border: 1px solid #333;
    background: #0a0a0a;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.time-input::-webkit-outer-spin-button,
.time-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-input:focus {
    border-color: #e50914;
}

.time-separator {
    font-size: 1.6rem;
    font-weight: 800;
    color: #666;
}

/* Summary step */
.choice-summary {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 10px;
    background: #161616;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 18px 24px;
    width: 100%;
}

.choice-summary strong {
    color: #fff;
}

.choice-summary .dest-label {
    color: #e50914;
    font-weight: 700;
}

/* === Player overlay (native) === */
.player-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    flex-direction: column;
}

.player-overlay.visible {
    display: flex;
}

.player-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2001;
    background: rgba(0,0,0,0.6);
    border: 1px solid #444;
    color: #fff;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.player-close:hover {
    background: rgba(229,9,20,0.8);
}

.player-video {
    width: 100%;
    height: 100%;
    background: #000;
}
