/* --- 1. LAYOUT DE INMERSIÓN TOTAL --- */
body {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    margin: 0;
}

/* --- 2. EL CONTENEDOR DEL JUEGO (VIEWPORT) --- */
#experience-viewport {
    perspective: 1000px;
    z-index: 10;
}

#game-container {
    transform: scale(1);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    /* Sombra dinámica con resplandor del color de la temática */
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7), 
                0 0 40px -10px rgba(var(--primary-rgb, 147, 51, 234), 0.2);
}

/* --- 3. OVERLAYS Y MODALES --- */
.fixed.inset-0 {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#initial-modal {
    background-color: var(--bg, #0F172A); 
    z-index: 100;
    transition: background-color 0.8s ease, opacity 0.5s ease;
}

/* Tarjetas de Categorías (Presets) */
#initial-modal .glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

#initial-modal .glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px -10px rgba(var(--primary-rgb, 147, 51, 234), 0.3);
}

/* --- 4. INPUT PERSONALIZADO (FIX RING & OUTLINE) --- */
#user-idea {
    font-family: var(--font-body);
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    
    /* Matamos el 'ring' de Tailwind y el focus nativo */
    --tw-ring-offset-shadow: 0 0 #0000 !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-ring-color: transparent !important;
    --tw-ring-width: 0px !important;
    
    appearance: none;
    -webkit-appearance: none;
}

/* Contenedor exterior del input con brillo al hacer focus */
.focus-within\:border-purple-500:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 0 25px -5px rgba(var(--primary-rgb, 147, 51, 234), 0.5);
    background: rgba(255, 255, 255, 0.07);
    transition: all 0.3s ease;
}

/* --- 5. BOTONES DE NAVEGACIÓN BLANCOS Y SIMÉTRICOS --- */
header, nav {
    pointer-events: none;
}

header *, nav * {
    pointer-events: auto;
}

.btn-nav-white {
    min-width: 160px; /* Evita deformaciones */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Color del icono Ajustar: por defecto el de la temática */
.btn-nav-white i.fa-sparkles {
    color: var(--primary);
    transition: color 0.3s ease;
}

/* Hover inteligente: fondo cambia al color del tema */
.btn-nav-white:hover {
    background-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 15px 30px -5px rgba(var(--primary-rgb), 0.5);
}

/* Al hacer hover, forzamos que el icono pase a blanco */
.btn-nav-white:hover i {
    color: white !important;
}

.btn-nav-white:active {
    transform: scale(0.92);
}

/* --- 6. PANEL DE REFINAMIENTO (SLIDE-UP) --- */
#refinement-panel {
    align-items: flex-end;
}

#refinement-panel > div {
    background-color: var(--bg);
    border-color: rgba(255, 255, 255, 0.1);
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* --- 7. SELECTOR DE TEMA --- */
#theme-selector {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.8rem;
    padding-right: 2rem;
}

/* --- 8. ANIMACIONES GLOBALES --- */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* --- 9. RESPONSIVE --- */
@media (max-width: 640px) {
    #game-container {
        scale: 0.85;
    }

    #initial-modal h2 {
        font-size: 2rem;
    }

    .btn-nav-white {
        min-width: 140px;
        padding-left: 1rem;
        padding-right: 1rem;
        font-size: 10px;
    }
}