/* ====== ANIMACIONES ====== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(0, 153, 204, 0.2), inset 0 0 20px rgba(0, 153, 204, 0.05);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 153, 204, 0.3), inset 0 0 20px rgba(0, 153, 204, 0.1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

/* ====== MODAL PRINCIPAL ====== */
#gamedleModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: grayscale(100%) brightness(0.5);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

#gamedleModal.open {
    display: flex;
}

/* ====== CONTENEDOR ====== */
#gamedleContainer {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border-radius: 16px;
    padding: 30px;
    max-width: 520px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-height: 90vh;
    overflow: visible;
    position: relative;
    border: 2px solid #0099cc;
    box-shadow: 0 0 30px rgba(0, 153, 204, 0.2), inset 0 0 20px rgba(0, 153, 204, 0.05);
    animation: slideUp 0.4s ease, glow 3s ease-in-out infinite;
}

/* ====== BOTÓN CERRAR ====== */
#gamedleCloseBtn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
}

#gamedleCloseBtn:hover {
    color: #fff;
    background: rgba(0, 153, 204, 0.3);
    transform: rotate(90deg);
}

/* ====== TÍTULO DEL JUEGO ====== */
#gamedleGameTitle {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    height: 28px;
    color: #0099cc;
    text-shadow: 0 0 10px rgba(0, 153, 204, 0.5);
    letter-spacing: 1px;
}

/* ====== ESTADÍSTICAS ====== */
#gamedleStats {
    width: 100%;
    text-align: center;
    font-size: 13px;
    color: #888;
    margin: -10px 0 10px 0;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: rgba(0, 153, 204, 0.05);
    border-radius: 8px;
}

#gamedlePuntaje,
#gamedleJugados {
    color: #0099cc;
    font-weight: 600;
}

/* ====== CANVAS ====== */
#gamedleCanvas {
    width: 300px;
    height: 300px;
    border: 2px solid #0099cc;
    border-radius: 8px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: #0a0a0a;
    box-shadow: 0 0 20px rgba(0, 153, 204, 0.15), inset 0 0 10px rgba(0, 0, 0, 0.8);
    transition: filter 0.3s ease;
}

/* ====== BARRA DE PROGRESO ====== */
#gamedleProgress {
    width: 100%;
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #333;
}

#gamedleProgressBar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff88, #0099cc);
    transition: width 0.3s ease, background 0.3s ease;
}

/* ====== PORCENTAJE Y INTENTOS ====== */
#gamedlePercentageContainer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

#gamedlePercentage {
    font-weight: bold;
    color: #0099cc;
    font-size: 15px;
    font-family: monospace;
}

#gamedleAttemptCounter {
    color: #0099cc;
    font-weight: bold;
    font-family: monospace;
}

/* ====== INPUT ====== */
#gamedleInput {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #333;
    background: #0a0a0a;
    color: #fff;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    transition: all 0.2s;
}

#gamedleInput::placeholder {
    color: #555;
}

#gamedleInput:focus {
    outline: none;
    border-color: #0099cc;
    box-shadow: 0 0 15px rgba(0, 153, 204, 0.3);
    background: #111;
}

/* ====== SUGERENCIAS ====== */
#gamedleSuggestions {
    display: none;
    position: absolute;
    background: #0a0a0a;
    border: 2px solid #0099cc;
    border-top: none;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000;
    top: 100%;
    left: 0;
    margin-top: -2px;
    box-shadow: 0 8px 24px rgba(0, 153, 204, 0.2);
    border-radius: 0 0 8px 8px;
}

#gamedleSuggestions::-webkit-scrollbar {
    width: 8px;
}

#gamedleSuggestions::-webkit-scrollbar-track {
    background: #0a0a0a;
}

#gamedleSuggestions::-webkit-scrollbar-thumb {
    background: #0099cc;
    border-radius: 4px;
}

#gamedleSuggestions {
    scrollbar-width: thin;
    scrollbar-color: #0099cc #0a0a0a;
}

.suggestion-item {
    padding: 14px 16px;
    color: #aaa;
    cursor: pointer;
    border-bottom: 1px solid #222;
    font-size: 14px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: rgba(0, 153, 204, 0.1);
    color: #fff;
    padding-left: 20px;
}

.suggestion-item.selected {
    background-color: rgba(0, 153, 204, 0.2);
    color: #00ff88;
    font-weight: 600;
    border-left: 4px solid #00ff88;
    padding-left: 16px;
}

/* ====== BOTÓN SIGUIENTE ====== */
#gamedleNextBtn {
    display: none;
    padding: 12px 28px;
    background: linear-gradient(135deg, #0099cc 0%, #00ccff 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.2s;
    width: 100%;
    letter-spacing: 0.5px;
}

#gamedleNextBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 153, 204, 0.4);
}

#gamedleNextBtn:active {
    transform: translateY(0);
}

#gamedleNextBtn:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 153, 204, 0.6);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 600px) {
    #gamedleContainer {
        padding: 20px;
        max-width: 90vw;
    }

    #gamedleCanvas {
        width: 250px;
        height: 250px;
    }

    #gamedleGameTitle {
        font-size: 18px;
    }

    #gamedleStats {
        flex-direction: column;
        gap: 8px;
    }
}