/* --- SNAKE POPUP --- */
.snake-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 440px;
    /*background: #0f172a;*/
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Nunito', sans-serif;
}

.snake-header {
    position: relative;
    height: 45px;
    flex-shrink: 0;
}

.snake-header-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    draggable: false;
}

.snake-popup .window-controls-group {
    position: absolute;
    top: 14px
}

.snake-popup .web-link-display {
    position: absolute;
    top: 15px;
}

/* --- SCORE BAR --- */
.snake-score-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    background: #0f172a;

}

.snake-score-bar span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.snake-score-bar strong {
    color: #e6007e;
    font-size: 15px;
    font-weight: 800;
}

/* --- CANVAS WRAPPER --- */
.snake-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px 20px;
    gap: 12px;
    background: #0f172a;

}

.snake-canvas-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(230, 0, 126, 0.2);
    box-shadow: 0 0 30px rgba(230, 0, 126, 0.1);
}

#snake-canvas {
    display: block;
    width: 400px;
    height: 400px;
}

/* --- OVERLAY (inicio / game over) --- */
.snake-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 30, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.snake-overlay-emoji {
    font-size: 52px;
    animation: snakeBounce 1.5s ease-in-out infinite;
}

@keyframes snakeBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.snake-overlay h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #e6007e, #5547ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.snake-overlay p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.snake-btn {
    margin-top: 6px;
    padding: 10px 28px;
    background: linear-gradient(135deg, #e6007e, #5547ff);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.snake-btn:hover {
    opacity: 0.85;
    transform: scale(1.04);
}

/* --- D-PAD MÓVIL --- */
.snake-dpad {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.dpad-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dpad-btn {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpad-btn:active {
    background: rgba(230, 0, 126, 0.3);
}

.dpad-center {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Mostrar d-pad en móvil */
@media (max-width: 1024px) {
    .snake-dpad {
        display: flex;
    }

    .snake-popup {
        width: 95% !important;
        max-width: 440px;
    }

    #snake-canvas {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
}