/* =========================================================================
 * ESTILOS DEL MODAL DE SELECCIÓN DE COFRES (PRIZE GRID)
 * MODIFICADO: Cambiado el color y espaciado del título.
 * ========================================================================= */

/* 1. ESTILOS DEL CONTENEDOR PRINCIPAL DEL MODAL */
.modal--prizegrid .modal__content {
    flex-direction: row;
    align-items: center;
    gap: 25px;
    max-width: 900px;
    width: 95%;
    background-image: radial-gradient(circle, #4a4e69, #22223b);
    border: 2px solid #c9ada7;
}
.modal--prizegrid .prize-chest-text-col {
    flex: 0 0 35%;
    text-align: left;
    color: #fff;
}
.modal--prizegrid .prize-chest-grid-col {
    flex: 1 1 65%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- MODIFICACIÓN INICIA --- */
.modal--prizegrid .modal__title {
    color: #f59e0b; /* Color naranja dorado */
    margin-bottom: 2vh; /* Margen inferior para separarlo del texto */
}
/* --- MODIFICACIÓN TERMINA --- */

.modal--prizegrid .budi-modal-subtitle {
    font-size: 0.9em;
    font-weight: 300;
    opacity: 0.9; 
    margin: -10px 0 5px 0;
}

/* 2. ESTILOS DE LA CUADRÍCULA Y LOS COFRES */
.budi-prize-grid-container {
    display: grid;
    grid-template-columns: repeat(6, max-content); 
    gap: 1vh; 
    width: auto;
    perspective: 1000px;
}
.budi-prize-chest {
    width: 13vh; 
    height: 13vh; 
    transform-style: preserve-3d;
    transition: transform 0.2s ease, opacity 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}
.budi-prize-grid-container.selection-active .budi-prize-chest {
    cursor: pointer;
}
.budi-prize-grid-container.selection-active .budi-prize-chest:hover {
    transform: scale(1.1);
}
.budi-prize-chest img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 3. ESTILOS PARA LA ANIMACIÓN DE REVELACIÓN */
.budi-prize-chest.is-hidden-reveal {
    opacity: 0;
    pointer-events: none;
}
.budi-prize-chest.is-flying-reveal {
    position: fixed !important;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 1102;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.budi-prize-chest.is-shaking-reveal {
    animation: shake-reveal 0.8s ease;
}
.prize-chest-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1);
}
.budi-prize-chest.is-revealing-reveal .prize-chest-inner {
    transform: rotateY(180deg);
}
.prize-chest-front, .prize-chest-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden; 
}
.prize-chest-front {
    background: linear-gradient(145deg, #4b79a1, #283e51);
}
.prize-chest-back {
    background: linear-gradient(145deg, #a7d7c5, #74b49b);
    transform: rotateY(180deg);
    font-size: 4em;
    color: #fff;
}
.prize-chest-back img {
    max-width: 80%;
    max-height: 80%;
}

/* 4. AJUSTES RESPONSIVE (PRIORIDAD HORIZONTAL) */
@media (orientation: landscape) and (max-height: 550px) {
    .modal--prizegrid .modal__content {
        flex-direction: row;
        text-align: left;
        padding: 2vh;
        max-height: 90vh;
        width: auto;
        margin: auto;
        gap: 2vh;
    }
    .prize-chest-text-col {
        flex: 0 0 35%;
        text-align: left;
    }
    .prize-chest-grid-col {
        flex: 1 1 65%;
    }
    .modal--prizegrid .budi-modal-subtitle {
        font-size: clamp(0.8em, 2.2vh, 0.9em);
    }
}

/* 5. ANIMACIONES DE COFRE */
@keyframes prize-chest-vibrate-anim {
    10%, 90% { transform: translate3d(-1px, 0, 0) scale(1.02); }
    20%, 80% { transform: translate3d(2px, 0, 0) scale(1.02); }
    30%, 50%, 70% { transform: translate3d(-2px, 0, 0) scale(1.02); }
    40%, 60% { transform: translate3d(2px, 0, 0) scale(1.02); }
}

@keyframes prize-chest-glow-anim {
    0%, 100% { box-shadow: 0 0 10px rgba(253, 224, 71, 0.5); }
    50% { box-shadow: 0 0 25px rgba(253, 224, 71, 1); }
}

.budi-prize-chest.chest-vibrate {
    animation: prize-chest-vibrate-anim 0.5s ease-in-out;
}

.budi-prize-chest.chest-glow {
    animation: prize-chest-glow-anim 1.5s infinite ease-in-out;
    border-color: #fde047;
}