/* =========================================
   CONFIGURACIÓN GENERAL
========================================= */

* {
    box-sizing: border-box;
}


body {

    margin: 0;

    min-height: 100vh;

    font-family: Arial, sans-serif;

    background:
        radial-gradient(
            circle at center,
            #202b48 0%,
            #090b12 75%
        );

    color: white;

    display: flex;

    justify-content: center;

    align-items: center;
}


/* =========================================
   CONTENEDOR
========================================= */

.game {

    width: 100%;

    max-width: 1200px;

    padding: 20px;

    text-align: center;
}


h1 {

    margin-top: 0;

    margin-bottom: 15px;
}


/* =========================================
   PITY
========================================= */

.pity-container {

    display: flex;

    justify-content: center;

    gap: 35px;

    margin-bottom: 15px;

    font-size: 18px;
}


.pity-container strong {

    font-size: 22px;
}


/* =========================================
   PANTALLA
========================================= */

.screen {

    position: relative;

    width: 100%;

    height: 680px;

    overflow: hidden;

    background: black;

    border-radius: 15px;

    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.7);

}


/* =========================================
   VIDEO
========================================= */

.wish-video {

    position: absolute;

    inset: 0;

    width: 100%;

    height: 100%;

    object-fit: contain;

    background: black;

    display: none;

    z-index: 10;
}


/* =========================================
   RESULTADO
========================================= */

.result {

    position: absolute;

    inset: 0;

    z-index: 5;

    display: flex;

    justify-content: center;

    align-items: center;

    flex-direction: column;

    pointer-events: none;
}


.result img {

    max-width: 95%;

    max-height: 90%;

    object-fit: contain;

    animation: characterAppear 0.7s ease-out;

    filter:
        drop-shadow(
            0 0 25px
            rgba(255,255,255,0.5)
        );
}


.character-name {

    position: absolute;

    bottom: 65px;

    left: 0;

    right: 0;

    font-size: 25px;

    font-weight: bold;

    text-shadow:
        0 2px 5px black;
}


.start-text {

    font-size: 28px;

    color: #cccccc;
}


/* =========================================
   INSTRUCCIONES
========================================= */

.instruction {

    position: absolute;

    left: 0;

    right: 0;

    bottom: 20px;

    z-index: 50;

    font-size: 20px;

    font-weight: bold;

    text-shadow:
        0 2px 5px black;

    pointer-events: none;
}


/* =========================================
   BOTONES
========================================= */

.buttons {

    display: flex;

    justify-content: center;

    gap: 20px;

    margin-top: 20px;
}


button {

    border: none;

    border-radius: 10px;

    padding: 15px 30px;

    font-size: 18px;

    font-weight: bold;

    cursor: pointer;

    background: #d7b56d;

    color: #151515;

    transition:
        transform 0.15s,
        opacity 0.15s;
}


button:hover {

    transform: scale(1.05);
}


button:disabled {

    opacity: 0.5;

    cursor: not-allowed;

    transform: none;
}


/* =========================================
   BOTÓN RESET
========================================= */

.reset-button {

    margin-top: 15px;

    padding: 8px 15px;

    font-size: 13px;

    background: #555;

    color: white;
}


/* =========================================
   ANIMACIÓN PERSONAJE
========================================= */

@keyframes characterAppear {

    from {

        opacity: 0;

        transform:
            scale(0.85)
            translateY(20px);
    }

    to {

        opacity: 1;

        transform:
            scale(1)
            translateY(0);
    }
}


/* =========================================
   PANTALLA DE REVELACIÓN
========================================= */

.screen.ready {

    cursor: pointer;
}


.screen.showing {

    cursor: pointer;
}
/* =========================================
   BOTÓN GALERÍA
========================================= */

.gallery-button {

    margin-top: 10px;

    padding: 10px 22px;

    font-size: 15px;

    background: #4b5268;

    color: white;
}


/* =========================================
   VENTANA DE GALERÍA
========================================= */

.gallery-modal {

    position: fixed;

    inset: 0;

    z-index: 1000;

    display: none;

    justify-content: center;

    align-items: center;

    padding: 25px;

    background: rgba(0, 0, 0, 0.8);
}


.gallery-modal.open {

    display: flex;
}


/* =========================================
   CONTENIDO DE GALERÍA
========================================= */

.gallery-content {

    position: relative;

    width: min(1000px, 95vw);

    max-height: 90vh;

    overflow-y: auto;

    padding: 30px;

    border-radius: 18px;

    background:
        linear-gradient(
            180deg,
            #20263a,
            #0e111b
        );

    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.8);
}


.gallery-content h2 {

    margin-top: 0;

    margin-bottom: 25px;

    font-size: 30px;

}


/* =========================================
   CERRAR GALERÍA
========================================= */

.close-gallery {

    position: absolute;

    top: 12px;

    right: 12px;

    padding: 8px 12px;

    background: #555;

    color: white;

    font-size: 16px;
}


/* =========================================
   CUADRÍCULA
========================================= */

.gallery-grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(150px, 1fr));

    gap: 18px;
}


/* =========================================
   CARTA
========================================= */

.gallery-card {

    position: relative;

    min-height: 190px;

    padding: 10px;

    border-radius: 12px;

    background: rgba(255,255,255,0.08);

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    overflow: hidden;
}


.gallery-card img {

    width: 100%;

    height: 135px;

    object-fit: contain;

    display: block;

}


.gallery-name {

    margin-top: 7px;

    font-weight: bold;

    font-size: 16px;
}


.gallery-rarity {

    font-size: 14px;

    margin-top: 3px;
}


.gallery-count {

    position: absolute;

    top: 8px;

    right: 8px;

    padding: 3px 7px;

    border-radius: 8px;

    background: rgba(0,0,0,0.75);

    font-size: 13px;

    font-weight: bold;
}


/* =========================================
   PERSONAJE NO DESCUBIERTO
========================================= */

.gallery-locked {

    width: 100%;

    height: 135px;

    display: flex;

    justify-content: center;

    align-items: center;

    font-size: 48px;

    font-weight: bold;

    color: #777;

    background: rgba(0,0,0,0.25);

}


/* =========================================
   COLORES DE RAREZA
========================================= */

.gallery-card.rarity-3 {

    border: 2px solid #aaa;
}


.gallery-card.rarity-4 {

    border: 2px solid #b477ff;
}


.gallery-card.rarity-5 {

    border: 2px solid #ffd15c;
}


/* =========================================
   MÓVIL
========================================= */

@media (max-width: 600px) {

    .gallery-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }

    .gallery-content {

        padding: 20px;

    }

}

/* =========================================
   VISOR DE IMAGEN AMPLIADA
========================================= */

.image-viewer {

    position: fixed;

    inset: 0;

    z-index: 2000;

    display: none;

    justify-content: center;

    align-items: center;

    padding: 40px;

    background: rgba(0, 0, 0, 0.9);

}


.image-viewer.open {

    display: flex;

}


.image-viewer img {

    max-width: 90vw;

    max-height: 90vh;

    object-fit: contain;

    border-radius: 10px;

    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.9);

}


.close-image-viewer {

    position: absolute;

    top: 20px;

    right: 25px;

    z-index: 10;

    padding: 8px 13px;

    background: #555;

    color: white;

    font-size: 18px;

}