/* ==========================================================================
   DISEÑO VISUAL PREMIUM: RUTA DEL CAMINO DEL INCA (ESTILO PIXAR)
   ========================================================================== */

:root {
    /* Paleta de Colores Andinos e Incas */
    --gold-primary: #ffd700;
    --gold-bright: #ffea79;
    --gold-dark: #b8860b;
    --gold-gradient: linear-gradient(135deg, #ffd700 0%, #f1c40f 50%, #b8860b 100%);
    --gold-metallic: linear-gradient(135deg, #FFF9C4 0%, #FBC02D 40%, #D84315 100%);
    
    --stone-bg: rgba(28, 30, 38, 0.95);
    --stone-border: rgba(184, 134, 11, 0.4);
    --stone-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(0, 0, 0, 0.6);
    --glass-panel: rgba(255, 255, 255, 0.05);
    
    /* Capas de Montaña del Paralaje */
    --mountain-far: #190f26;
    --mountain-mid: #25123e;
    --mountain-near: #0e051c;
    
    /* Fuentes */
    --font-heading: 'Cinzel', serif;
    --font-heading-deco: 'Cinzel Decorative', serif;
    --font-body: 'Outfit', sans-serif;
    
    /* Variables de Animación */
    --transition-smooth: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Dimensionamiento Dinámico del Sol Incaico */
    --wheel-size: min(44vw, 55vh, 480px);
}

/* Reset y Estilos Generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: radial-gradient(circle at center, #2e104b 0%, #0d041b 100%);
    color: #f5f5f5;
    overflow: hidden; /* Evita cualquier barra de desplazamiento */
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centrado vertical completo en pantalla */
}

/* --------------------------------------------------------------------------
   LÍNEAS Y PARTÍCULAS DEL FONDO
   -------------------------------------------------------------------------- */
#dust-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

.sky-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.sun-glow {
    position: absolute;
    bottom: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 90vh;
    height: 90vh;
    background: radial-gradient(circle, rgba(243, 112, 85, 0.3) 0%, rgba(255, 215, 0, 0.05) 50%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: pulseGlow 10s infinite alternate ease-in-out;
}

.stars-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

/* Montañas del Fondo */
.mountains-container {
    position: fixed;
    bottom: -5px;
    left: 0;
    width: 100%;
    z-index: 2;
    pointer-events: none;
    height: 25vh; /* Altura más baja para no tapar los pedestales en viewports pequeños */
}

.mountain {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.far-mountains {
    height: 100%;
    opacity: 0.75;
    animation: floatMountain 20s infinite alternate ease-in-out;
}

.mid-mountains {
    height: 85%;
    opacity: 0.85;
}

.near-mountains {
    height: 70%;
    opacity: 0.95;
    filter: drop-shadow(0 -10px 20px rgba(0,0,0,0.8));
}

/* Niebla del Valle */
.fog-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 80px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%);
    mask-image: linear-gradient(to top, black, transparent);
    -webkit-mask-image: linear-gradient(to top, black, transparent);
    z-index: 2;
    transform: translate3d(0, 0, 0);
}

.fog-back {
    animation: driftFog 60s infinite linear;
    opacity: 0.4;
}

.fog-front {
    animation: driftFog 40s infinite linear reverse;
    opacity: 0.6;
    height: 120px;
}

/* --------------------------------------------------------------------------
   DISEÑO DE LA APLICACIÓN / GRID
   -------------------------------------------------------------------------- */
.app-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    height: 100%;
    max-height: 100vh;
    padding: 15px 30px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Encabezado */
.game-header {
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.game-header h1 {
    font-family: var(--font-heading-deco);
    font-size: min(2.8rem, 5.5vh); /* Escalable dinámicamente con la altura */
    background: linear-gradient(to bottom, #FFF 0%, #ffd700 50%, #f39c12 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
    letter-spacing: 2px;
    margin-bottom: 2px;
    animation: glowText 4s infinite alternate ease-in-out;
}

.game-header .subtitle {
    font-size: min(1rem, 2vh); /* Escalable con la altura */
    color: #e5b0ff;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Grid de Contenido */
.game-content {
    display: grid;
    grid-template-columns: 360px 1fr 320px;
    gap: 25px;
    width: 100%;
    flex: 1; /* Consume todo el espacio vertical disponible */
    align-items: center;
    min-height: 0; /* Permite flex-shrink a contenedores internos */
    margin-top: 0;
}

/* --------------------------------------------------------------------------
   PANEL DE CONFIGURACIÓN - TABLETA DE PIEDRA
   -------------------------------------------------------------------------- */
.stone-tablet {
    background: var(--stone-bg);
    border: 3px solid var(--stone-border);
    box-shadow: var(--stone-shadow);
    border-radius: 24px;
    padding: 15px; /* Ajuste más compacto */
    max-height: 100%; /* Constriñe al tamaño de la fila grid */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    z-index: 5;
    animation: hoverPanel 6s infinite alternate ease-in-out;
}

.stone-tablet::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-image: radial-gradient(var(--gold-primary) 1px, transparent 0px);
    background-size: 24px 24px;
    opacity: 0.03;
    pointer-events: none;
}

.tablet-header {
    border-bottom: 2px solid var(--stone-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.tablet-header h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--gold-primary);
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.tablet-header p {
    font-size: 0.9rem;
    color: #a89bb8;
    margin-top: 4px;
}

/* Lista de Inputs */
.prize-inputs-container {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Espaciado más fino */
    flex: 1; /* Permite redimensionar y scroll interno */
    min-height: 0; /* Crucial para flex-shrink */
    max-height: calc(100vh - 380px); /* Límite dinámico basado en altura disponible */
    overflow-y: auto;
    padding-right: 5px;
}

/* Scrollbar de Piedra */
.prize-inputs-container::-webkit-scrollbar {
    width: 6px;
}
.prize-inputs-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}
.prize-inputs-container::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 4px;
}

.prize-input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px 12px;
    transition: var(--transition-smooth);
}

.prize-input-group:focus-within {
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    transform: translateX(5px);
}

.prize-num {
    font-family: var(--font-heading);
    color: var(--gold-bright);
    font-weight: 700;
    width: 30px;
    font-size: 1.1rem;
    text-align: center;
}

.prize-input-group input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
    padding: 6px;
}

.prize-color-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

/* Ajustes de Configuración (Audio y Trampa) */
.tablet-settings {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px solid var(--stone-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #d1c5e7;
}

.gold-glow-text {
    color: var(--gold-primary);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* Interruptor Switch Premium */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--stone-light);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--gold-dark);
    border-color: var(--gold-primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
    background-color: var(--gold-bright);
    box-shadow: 0 0 8px var(--gold-primary);
}

/* Dropdown para Forzar Ganador */
.trick-dropdown {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--stone-border);
    border-radius: 8px;
    color: var(--gold-bright);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 10px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.trick-dropdown:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* --------------------------------------------------------------------------
   ÁREA DE LA RULETA CENTRAL
   -------------------------------------------------------------------------- */
.roulette-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Puntero de Cóndor Dorado */
.pointer-wrapper {
    position: absolute;
    top: calc(var(--wheel-size) * -0.1); /* Sincronizado con el tamaño del sol */
    z-index: 10;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
}

.pointer-wrapper svg {
    width: calc(var(--wheel-size) * 0.15); /* Puntero se escala con la ruleta */
    height: auto;
}

.pointer-glow {
    position: absolute;
    top: 20px;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: pulsePointer 1.5s infinite alternate ease-in-out;
}

.condor-pointer {
    transform-origin: 50% 10px;
    transition: transform 0.15s ease-out;
}

/* Clases de oscilación (Wobble) controladas por JS */
.condor-pointer.wobble-left {
    transform: rotate(-15deg);
}
.condor-pointer.wobble-right {
    transform: rotate(15deg);
}

/* El Marco Solar de la Ruleta */
.wheel-frame {
    width: var(--wheel-size);
    height: var(--wheel-size);
    position: relative;
    border-radius: 50%;
    padding: calc(var(--wheel-size) * 0.04);
    background: radial-gradient(circle, #3a2e2b 0%, #150f0e 100%);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9), 
                inset 0 0 40px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(218, 165, 32, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: calc(var(--wheel-size) * 0.03) solid;
    border-image: linear-gradient(135deg, #ffd700, #b8860b, #553c07, #ffd700) 1;
    clip-path: circle(50% at 50% 50%);
    z-index: 4;
}

.wheel-frame::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 5px solid var(--gold-bright);
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.6);
    pointer-events: none;
}

/* Sombra proyectada por la rueda */
.wheel-shadow {
    position: absolute;
    bottom: -40px;
    width: 90%;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 3;
    pointer-events: none;
}

/* Canvas del disco de la Ruleta */
#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: rotate(0deg);
    z-index: 4;
}

/* Botón SPIN central (Cara del Dios Sol Inti) */
.spin-button {
    position: absolute;
    width: calc(var(--wheel-size) * 0.22);
    height: calc(var(--wheel-size) * 0.22);
    min-width: 80px;
    min-height: 80px;
    border-radius: 50%;
    background: var(--gold-metallic);
    border: calc(var(--wheel-size) * 0.015) solid #3c2904;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6), 
                inset 0 4px 10px rgba(255,255,255,0.6),
                0 0 20px rgba(255, 215, 0, 0.4);
    z-index: 9;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: scale(1);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.spin-button:hover {
    transform: scale(1.12);
    box-shadow: 0 12px 35px rgba(0,0,0,0.7), 
                inset 0 4px 12px rgba(255,255,255,0.8),
                0 0 35px rgba(255, 215, 0, 0.8);
}

.spin-button:active {
    transform: scale(0.92);
    box-shadow: 0 4px 10px rgba(0,0,0,0.8);
}

/* Cara de Inti estilo Pixar */
.inti-face {
    position: relative;
    width: 70%;
    height: 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
}

.inti-eyes {
    display: flex;
    gap: 14px;
    margin-bottom: 4px;
}

.eye {
    width: 16px;
    height: 16px;
    background: #FFF;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pupil {
    width: 8px;
    height: 8px;
    background: #2e1c0c;
    border-radius: 50%;
    position: absolute;
    transition: transform 0.1s ease;
}

.inti-nose {
    width: 10px;
    height: 8px;
    background: #d49c00;
    border-radius: 4px 4px 50% 50%;
    margin-bottom: 2px;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.4);
}

.inti-mouth {
    width: 20px;
    height: 10px;
    border-bottom: 3px solid #2e1c0c;
    border-radius: 0 0 12px 12px;
    transition: var(--transition-smooth);
}

/* Animación de los ojos al girar (se marean) */
.spin-button.dizzy .pupil {
    animation: dizzyPupils 0.8s infinite linear;
}

.spin-button.dizzy .inti-mouth {
    width: 12px;
    height: 12px;
    border: 3px solid #2e1c0c;
    border-radius: 50%;
}

.spin-text {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.9rem;
    color: #3c2904;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
    margin-top: 2px;
}

/* Pedestal de la Ruleta */
.wheel-pedestal {
    width: 160px;
    height: 50px;
    background: linear-gradient(to bottom, #42302b 0%, #1a1210 100%);
    border: 3px solid var(--stone-border);
    border-top: none;
    border-radius: 0 0 18px 18px;
    box-shadow: var(--stone-shadow);
    margin-top: -10px;
    z-index: 3;
    position: relative;
}

.wheel-pedestal::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 10%;
    width: 80%;
    height: 6px;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
    filter: blur(2px);
}

/* --------------------------------------------------------------------------
   MASCOTA LLAMA Y GLOBO DE DIÁLOGO
   -------------------------------------------------------------------------- */
.mascot-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    height: 100%;
}

.llama-container {
    width: 250px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 5;
    animation: floatMascot 4s infinite alternate ease-in-out;
}

.llama-img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.6));
    transition: var(--transition-smooth);
}

.llama-shadow {
    position: absolute;
    bottom: -15px;
    left: 15%;
    width: 70%;
    height: 15px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* Animaciones/Reacciones de la Llama controladas por JS */
.llama-container.excited {
    animation: llamaExcited 0.5s infinite alternate ease-in-out;
}

.llama-container.happy {
    animation: llamaHappy 1.2s infinite ease-in-out;
}

/* Globo de Diálogo */
.speech-bubble {
    background: rgba(26, 17, 39, 0.92);
    border: 2px solid var(--stone-border);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), inset 0 0 15px rgba(255,215,0,0.05);
    color: #e3d9fc;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    width: 280px;
    margin-bottom: 25px;
    position: relative;
    backdrop-filter: blur(10px);
    z-index: 6;
    animation: floatBubble 5s infinite alternate ease-in-out;
}

.speech-bubble p {
    text-align: center;
}

.bubble-arrow {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid var(--stone-border);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(26, 17, 39, 0.95);
}

/* --------------------------------------------------------------------------
   MODAL DE VICTORIA - TEMPLO DEL SOL
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 5, 20, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.temple-card {
    background: linear-gradient(180deg, #1d1829 0%, #0c0814 100%);
    border: 4px solid var(--gold-primary);
    border-radius: 32px;
    width: 90%;
    max-width: 580px;
    box-shadow: 0 30px 100px rgba(0,0,0,0.9), 
                inset 0 0 50px rgba(255, 215, 0, 0.1),
                0 0 40px rgba(255, 215, 0, 0.3);
    overflow: hidden;
    position: relative;
    transform: scale(0.7) translateY(50px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-overlay.show .temple-card {
    transform: scale(1) translateY(0);
}

#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 102;
}

.temple-roof {
    width: 100%;
    height: 60px;
    background: linear-gradient(to right, var(--gold-dark), var(--gold-bright), var(--gold-dark));
    border-bottom: 5px solid #2e1c0c;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.sun-symbol {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, var(--gold-bright) 0%, var(--gold-dark) 100%);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--gold-primary);
    position: absolute;
    bottom: -20px;
    border: 3px solid #2e1c0c;
}

.temple-body {
    padding: 40px 30px 30px;
    text-align: center;
    width: 100%;
    z-index: 101;
}

.victory-banner {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255,215,0,0.5);
    display: inline-block;
    margin-bottom: 10px;
}

.temple-body h3 {
    font-size: 1.2rem;
    color: #bd9bff;
    font-weight: 400;
    margin-bottom: 10px;
}

.winning-prize-title {
    font-family: var(--font-heading-deco);
    font-size: 2.8rem;
    background: linear-gradient(180deg, #FFF 0%, var(--gold-bright) 40%, #ff8800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
    margin-bottom: 15px;
    font-weight: 900;
    animation: goldShine 3s infinite alternate ease-in-out;
}

.prize-description {
    font-size: 0.98rem;
    color: #ded1fe;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto 25px;
}

/* Animación del Cofre del Tesoro en CSS/Pixar */
.gold-chest-wrapper {
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.gold-chest {
    width: 100px;
    height: 80px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    animation: chestBounce 2s infinite alternate ease-in-out;
}

.gold-chest:hover {
    transform: scale(1.1) rotate(2deg);
}

.chest-lid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 35px;
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
    border: 3px solid #2e1c0c;
    border-radius: 20px 20px 0 0;
    box-shadow: inset 0 4px 10px rgba(255,255,255,0.4);
    z-index: 3;
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chest-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 50px;
    background: linear-gradient(135deg, #d35400 0%, #962d00 100%);
    border: 3px solid #2e1c0c;
    border-radius: 0 0 10px 10px;
    z-index: 1;
    overflow: hidden;
}

.chest-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 42px;
    width: 16px;
    height: 12px;
    background: var(--gold-primary);
    border: 2px solid #2e1c0c;
    border-radius: 0 0 4px 4px;
}

.chest-glow {
    position: absolute;
    top: -40px;
    left: 10px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, rgba(255, 136, 0, 0) 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 2;
    pointer-events: none;
}

/* Abrir cofre con clase activa */
.gold-chest.open .chest-lid {
    transform: rotateX(-100deg) translateY(-10px);
}

.gold-chest.open .chest-glow {
    opacity: 1;
    transform: scale(2);
    animation: chestGlowAnim 1.5s infinite alternate ease-in-out;
}

/* Botón de Reclamar */
.claim-button {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--gold-gradient);
    border: 3px solid #2e1c0c;
    color: #2e1c0c;
    padding: 12px 35px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), inset 0 3px 6px rgba(255,255,255,0.5);
    cursor: pointer;
    letter-spacing: 2px;
    transition: var(--transition-smooth);
}

.claim-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 215, 0, 0.4), inset 0 3px 6px rgba(255,255,255,0.6);
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
}

.claim-button:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
}

/* --------------------------------------------------------------------------
   KEYFRAMES DE ANIMACIONES
   -------------------------------------------------------------------------- */
@keyframes driftFog {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes floatMountain {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.03) translateY(-5px); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

@keyframes pulseGlow {
    0% { opacity: 0.4; transform: translateX(-50%) scale(1); }
    100% { opacity: 0.7; transform: translateX(-50%) scale(1.1); }
}

@keyframes glowText {
    0% { filter: drop-shadow(0 0 5px rgba(255,215,0,0.2)); }
    100% { filter: drop-shadow(0 0 18px rgba(255,215,0,0.6)); }
}

@keyframes hoverPanel {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

@keyframes floatMascot {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes floatBubble {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-5px) scale(1.02); }
}

@keyframes pulsePointer {
    0% { transform: scale(0.95); opacity: 0.6; }
    100% { transform: scale(1.15); opacity: 0.9; }
}

@keyframes dizzyPupils {
    0% { transform: rotate(0deg) translate(4px) rotate(0deg); }
    100% { transform: rotate(360deg) translate(4px) rotate(-360deg); }
}

@keyframes llamaExcited {
    0% { transform: scaleY(1); }
    100% { transform: scaleY(1.08) translateY(-15px); }
}

@keyframes llamaHappy {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-10px) rotate(-3deg); }
    50% { transform: translateY(0) rotate(0); }
    75% { transform: translateY(-10px) rotate(3deg); }
}

@keyframes chestBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

@keyframes chestGlowAnim {
    0% { opacity: 0.7; transform: scale(1.8); }
    100% { opacity: 1; transform: scale(2.2); }
}

@keyframes goldShine {
    0% { filter: drop-shadow(0 0 5px var(--gold-dark)); }
    100% { filter: drop-shadow(0 0 20px var(--gold-primary)); }
}

/* --------------------------------------------------------------------------
   RESPONSIVIDAD Y ADAPTABILIDAD PRO
   -------------------------------------------------------------------------- */

/* Para Laptops Medianas (hasta 1200px) */
@media (max-width: 1200px) {
    .game-content {
        grid-template-columns: 320px 1fr;
        gap: 20px;
    }
    .mascot-section {
        grid-column: 1 / span 2;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 20px;
        margin-top: 15px;
        height: auto;
    }
    .speech-bubble {
        margin-bottom: 0;
        width: 280px;
    }
    .bubble-arrow {
        bottom: auto;
        left: auto;
        right: -12px;
        top: 50%;
        transform: translateY(-50%) rotate(90deg);
    }
    .speech-bubble::after {
        bottom: auto;
        left: auto;
        right: -10px;
        top: 50%;
        transform: translateY(-50%) rotate(90deg);
    }
}

/* Para Tablets y Celulares (hasta 1024px o viewport emulado de teléfonos) */
@media (max-width: 1024px), (max-height: 620px) {
    body {
        overflow-y: auto; /* Permite scroll vertical fluido */
        height: auto;
        min-height: 100vh;
        justify-content: flex-start;
    }
    .app-container {
        height: auto;
        max-height: none;
        padding: 10px 15px;
    }
    .game-content {
        grid-template-columns: 1fr !important; /* Fuerza una sola columna vertical */
        gap: 20px;
        flex: none;
    }
    
    /* Reordenamiento para experiencia móvil espectacular */
    .roulette-section {
        order: 1; /* Ruleta arriba del todo */
    }
    .stone-tablet {
        order: 2; /* Panel de control en medio */
        max-height: none;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    .mascot-section {
        order: 3; /* Llama al final */
        grid-column: 1;
        flex-direction: column-reverse;
        margin-top: 15px;
        height: auto;
    }
    .bubble-arrow {
        bottom: -12px;
        left: 50%;
        right: auto;
        top: auto;
        transform: translateX(-50%);
    }
    .speech-bubble::after {
        bottom: -10px;
        left: 50%;
        right: auto;
        top: auto;
        transform: translateX(-50%);
    }
}

/* Ajustes finos para celulares estándar */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 2.2rem;
    }
    .wheel-frame {
        width: min(85vw, 380px);
        height: min(85vw, 380px);
    }
    .spin-button {
        width: 85px;
        height: 85px;
    }
}

/* Celulares pequeños */
@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.8rem;
    }
    .wheel-frame {
        width: min(90vw, 310px);
        height: min(90vw, 310px);
    }
    .stone-tablet {
        padding: 12px;
    }
}
