/* =========================================================================
 * ESTILOS DEL MINIJUEGO DEL SEÑUELO (SHELL GAME)
 * SOLUCIONADO: La animación de vibración ahora se ejecuta una sola vez de forma continua.
 * ========================================================================= */

/* --- Layout y Colores --- */
.modal--shell-game .modal__content { flex-direction: row; align-items: center; gap: 25px; max-width: 900px; width: 95%; background: #0d0221; border: 2px solid #d946ef; box-shadow: 0 0 25px rgba(217, 70, 239, 0.5); color: #e5e7eb; padding: clamp(15px, 2vh, 25px); position: relative; overflow: hidden; }
.sg-text-col { flex: 0 0 35%; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; height: 70vh; max-height: 400px; }
.sg-grid-col { flex: 1 1 65%; display: flex; align-items: center; justify-content: center; perspective: 1200px; }

/* --- Elementos del Panel --- */
#shell-game-title { color: #22d3ee; text-shadow: 0 0 8px #22d3ee; font-size: clamp(1.2rem, 3vh, 1.6rem); }
#shell-game-instructions { font-size: clamp(0.8rem, 2vh, 0.9rem); opacity: 0.9; }
#budi-shell-game-prize-holder.shell-gift { width: 13vh; height: 13vh; flex-shrink: 0; }
#budi-shell-game-draggable-prize { width: 85%; height: 85%; object-fit: contain; }
#shell-game-shuffle-btn { width: 100%; max-width: 200px; padding: 10px 20px; font-size: 0.9em; background-color: #d946ef; border: 1px solid #fbcfe8; }
#budi-shell-game-prize-holder.is-waiting { animation: prize-holder-glow-cyberpunk 2.5s infinite ease-in-out; }
@keyframes prize-holder-glow-cyberpunk { 0%, 100% { box-shadow: 0 0 15px rgba(217, 70, 239, 0.6); border-color: #f472b6; } 50% { box-shadow: 0 0 25px rgba(217, 70, 239, 1); border-color: #fbcfe8; } }

/* --- Cuadrícula y Casillas --- */
#budi-shell-game-grid { display: grid; grid-template-columns: repeat(6, max-content); gap: 1vh; width: auto; transform-style: preserve-3d; transition: opacity 0.4s ease-out; }
.shell-gift { width: 13vh; height: 13vh; transform-style: preserve-3d; border: 1px solid rgba(217, 70, 239, 0.3); border-radius: 8px; transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s ease; }
.shell-gift.can-place:hover, #budi-shell-game-grid.selection-active .shell-gift:hover { transform: scale(1.1) translateZ(10px); }
.shell-gift-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.7s cubic-bezier(0.7, 0, 0.3, 1); }
.shell-gift.is-revealing .shell-gift-inner { transform: rotateY(180deg); }
.shell-gift-front, .shell-gift-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; align-items: center; justify-content: center; border-radius: 6px; overflow: hidden; }
.shell-gift-front { background: linear-gradient(145deg, #2c1255, #11052C); }
.shell-gift-front img { width: 85%; height: 85%; object-fit: contain; }
.shell-gift-back { background: #1e1b4b; transform: rotateY(180deg); font-size: clamp(2em, 8vh, 3em); color: #22d3ee; }
.prize-inside { max-width: 80%; max-height: 80%; object-fit: contain; }

/* --- Animación de Barajado --- */
#budi-shell-game-grid.is-lifting { animation: lift-up 0.3s ease-out forwards; }
@keyframes lift-up { 100% { transform: translateZ(40px) scale(1.05) rotateX(-10deg); } }
#budi-shell-game-grid.is-landing { animation: land-down 0.3s ease-in forwards; }
@keyframes land-down { 0% { transform: translateZ(40px) scale(1.05) rotateX(-10deg); } 100% { transform: translateZ(0) scale(1) rotateX(0deg); } }
#budi-shell-game-grid.is-landing::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 50%; background: transparent; box-shadow: 0 0 50px 30px #22d3ee; animation: landing-ripple 0.5s ease-out forwards; }
@keyframes landing-ripple { 0% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(10); } }

/* --- Animación de Vuelo Inicial (del panel a la cuadrícula) --- */
#sg-prize-animator { position: fixed; display: none; z-index: 1200; pointer-events: none; transition: transform 0.8s cubic-bezier(0.5, 0, 0.5, 1), opacity 0.8s ease-in-out, width 0.8s, height 0.8s; }
#sg-prize-animator.is-flying { opacity: 0; }
#sg-prize-animator img { width: 100%; height: 100%; object-fit: contain; }
#budi-shell-game-prize-holder.is-taking-off { animation: takeoff-glow-cyberpunk 0.4s ease-out; }
@keyframes takeoff-glow-cyberpunk { 50% { transform: scale(1.1); box-shadow: 0 0 35px #22d3ee; } }
#sg-prize-animator.burst::before { content: ''; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; background: #22d3ee; border-radius: 50%; box-shadow: 0 0 10px #fff, 0 0 20px #22d3ee, 0 0 30px #67e8f9; animation: particle-burst 0.6s ease-out forwards; }
@keyframes particle-burst { 0% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(15); opacity: 0; } }
.shell-gift.impact-pulse { animation: impact-pulse-cyberpunk 0.5s ease-out; }
@keyframes impact-pulse-cyberpunk { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.7); } 70% { box-shadow: 0 0 0 20px rgba(34, 211, 238, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); } }

/* --- Animación de Revelación --- */
.shell-gift.is-fading-out-hard { opacity: 0.1 !important; transform: scale(0.9); }

/* ===== INICIO DE LA SOLUCIÓN ===== */
.shell-gift.is-vibrating-intense {
    /* ANTES: animation: intense-shake 0.5s linear 3; */
    /* AHORA: Se ejecuta una sola vez por 1.5s para una vibración continua */
    animation: intense-shake 1.5s linear 1;
}
/* ===== FIN DE LA SOLUCIÓN ===== */

@keyframes intense-shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
    40%, 60% { transform: translate3d(5px, 0, 0); }
}
.budi-universal-overlay.screen-flash { background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, rgba(34, 211, 238, 0.3) 50%, rgba(217, 70, 239, 0.1) 70%, transparent 80%); animation: screen-flash-anim 0.5s ease-out forwards; z-index: 1250; }
@keyframes screen-flash-anim { from { opacity: 1; } to { opacity: 0; } }
#budi-shell-game-grid.is-hiding { opacity: 0; }

/* --- Animaciones de Idle (Vibrar y Brillar) --- */
@keyframes sg-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 sg-glow-anim { 0%, 100% { box-shadow: 0 0 10px rgba(217, 70, 239, 0.5); } 50% { box-shadow: 0 0 25px rgba(217, 70, 239, 1); } }
.shell-gift.is-vibrating { animation: sg-vibrate-anim 0.5s ease-in-out; }
.shell-gift.is-glowing { animation: sg-glow-anim 1.5s infinite ease-in-out; border-color: #f472b6; }

/* --- Ajustes Responsive --- */
@media (orientation: landscape) and (max-height: 550px) {
    .modal--shell-game .modal__content { padding: 2vh; gap: 2vh; }
    .sg-text-col { height: auto; justify-content: center; gap: 2vh; }
    .shell-gift, #budi-shell-game-prize-holder.shell-gift { width: 11vh; height: 11vh; }
    #shell-game-title { font-size: 1.2rem; }
    #shell-game-instructions { font-size: 0.8rem; }
}