/* --- DIGITAL WRAP: THEME ENGINE (AI-READY) --- */

/* 1. CONFIGURACIÓN BASE Y DEFAULTS */
:root {
    /* Estas variables son las que la IA sobreescribirá desde JS */
    --primary: #9333EA;
    --primary-hover: #7E22CE;
    --accent: #06B6D4;
    --bg: #0F172A;
    
    /* Configuración de cristales */
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    
    /* Tipografía */
    --font-family: 'Inter', sans-serif;
    --title-font: 'Space Grotesk', sans-serif;
    
    /* Colores de texto */
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
}

/* 2. TEMAS PREDEFINIDOS (ACTUALIZAN VARIABLES) */
/* Mantenemos tus temas pero ahora solo cambian los valores de las variables */

.theme-navidad {
    --primary: #EF4444;
    --bg: #1a0a0a; /* Oscurecido para mantener el glassmorphism */
    --card-bg: rgba(40, 10, 10, 0.7);
    --card-border: rgba(239, 68, 68, 0.3);
    --title-font: 'Georgia', serif;
}

.theme-san-valentin {
    --primary: #F43F5E;
    --bg: #1a0a0e;
    --card-bg: rgba(40, 10, 15, 0.7);
    --card-border: rgba(244, 63, 94, 0.3);
    --title-font: 'Georgia', serif;
}

.theme-hacker {
    --primary: #22C55E;
    --bg: #000000;
    --card-bg: rgba(0, 20, 0, 0.8);
    --card-border: #22C55E;
    --font-family: 'Courier New', monospace;
    --title-font: 'Courier New', monospace;
}

.theme-aventura {
    --primary: #D97706;
    --bg: #1a120b;
    --card-bg: rgba(45, 26, 16, 0.8);
    --card-border: rgba(217, 119, 6, 0.4);
    --title-font: 'Cinzel', serif;
}

/* 3. APLICACIÓN GLOBAL REACCIONARIA */

body {
    /* Fondo dinámico: Crea un degradado usando el color de fondo de la IA */
    background: radial-gradient(circle at top right, rgba(255,255,255,0.03), transparent),
                linear-gradient(180deg, var(--bg) 0%, #000000 100%) !important;
    background-attachment: fixed !important;
    color: var(--text-main) !important;
    font-family: var(--font-family) !important;
    transition: background 0.8s ease, color 0.5s ease;
}

h1, h2, h3, .font-title {
    font-family: var(--title-font) !important;
    /* Los títulos ahora siempre usan el color primario dinámico */
    color: var(--primary) !important; 
    transition: color 0.5s ease;
}

/* 4. COMPONENTES: LA TARJETA (GLASSMORPHISM DINÁMICO) */

.glass-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 2.5rem;
    /* Resplandor sutil del color de la IA */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 
                0 0 20px -5px rgba(var(--primary-rgb, 147, 51, 234), 0.1) !important;
}

/* 5. BOTONES DINÁMICOS */

.btn-primary, 
button.bg-purple-600,
.generate-btn {
    background-color: var(--primary) !important;
    color: #FFFFFF !important;
    font-weight: 800 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 
                0 4px 6px -2px rgba(var(--primary-rgb, 147, 51, 234), 0.2) !important;
}

.btn-primary:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

/* 6. INPUTS DINÁMICOS */

#player-answer, 
#final-gift-input,
#user-idea {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text-main) !important;
    transition: all 0.3s ease;
}

#player-answer:focus, 
#user-idea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb, 147, 51, 234), 0.15) !important;
}

/* 7. DETALLES DE UI */

.text-purple-400, .text-purple-500, .text-primary {
    color: var(--primary) !important;
}

/* Marca de agua dinámica */
.watermark {
    color: var(--primary);
    opacity: 0.1;
}

/* Iconos dinámicos */
#theme-icon {
    background-color: var(--primary) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}