/* ============================================
   CLICKER GAME - Estilos CSS
   ============================================ */

/* Variables CSS para fácil personalización - Tema Violeta Neón */
:root {
    --primary-color: #9d4edd;
    --primary-hover: #b56cff;
    --primary-active: #7b2cbf;
    --secondary-color: #c77dff;
    --secondary-hover: #e0a3ff;
    --danger-color: #ff6b9d;
    --danger-hover: #ff8fb3;
    --background-color: #0d0015;
    --surface-color: #1a0a2e;
    --surface-light: #2d1b4e;
    --text-primary: #ffffff;
    --text-secondary: #d4b8ff;
    --neon-accent: #ff00ff;
    --neon-glow: rgba(255, 0, 255, 0.6);
    --shadow-color: rgba(157, 78, 221, 0.3);
    --border-radius: 12px;
    --transition-speed: 0.2s;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background-color) 0%, #150020 50%, #0d0015 100%);
    height: 100vh;
    overflow: hidden;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Contenedor principal del juego */
.game-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 12px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-container.hidden {
    display: none;
}

/* ============================================
   HEADER - Título y marcador
   ============================================ */
.game-header {
    text-align: center;
    background: var(--surface-color);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px var(--shadow-color);
}

.game-header h1 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--neon-accent);
    text-shadow: 0 0 10px var(--neon-glow), 0 0 20px var(--neon-glow), 0 0 30px var(--neon-glow);
}

.score-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.score-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.score-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--neon-accent);
    text-shadow: 0 0 10px var(--neon-glow), 0 0 20px var(--neon-glow);
    min-width: 80px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    color: var(--secondary-color);
    font-weight: bold;
    text-shadow: 0 0 8px rgba(199, 125, 255, 0.5);
}

/* ============================================
   ÁREA DE CLICK - Botón principal
   ============================================ */
.click-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    position: relative;
    flex: 1;
    justify-content: center;
}

.main-click-button {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid var(--neon-accent);
    background: linear-gradient(145deg, var(--primary-color), var(--primary-active));
    box-shadow: 
        0 0 20px var(--neon-glow),
        0 0 40px rgba(157, 78, 221, 0.4),
        0 8px 24px rgba(157, 78, 221, 0.3),
        inset 0 -4px 16px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.main-click-button::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 60%;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 50%;
}

.main-click-button:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 30px var(--neon-glow),
        0 0 60px rgba(157, 78, 221, 0.5),
        0 10px 32px rgba(157, 78, 221, 0.4),
        inset 0 -4px 16px rgba(0, 0, 0, 0.2);
}

.main-click-button:active {
    transform: scale(0.95);
    box-shadow: 
        0 0 15px var(--neon-glow),
        0 0 30px rgba(157, 78, 221, 0.3),
        0 4px 16px rgba(157, 78, 221, 0.3),
        inset 0 4px 16px rgba(0, 0, 0, 0.4);
}

.click-icon {
    font-size: 2.5rem;
    transition: transform var(--transition-speed) ease;
}

.main-click-button:active .click-icon {
    transform: scale(0.9);
}

.click-text {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Feedback visual al hacer click */
.click-feedback {
    position: absolute;
    pointer-events: none;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--neon-accent);
    text-shadow: 0 0 10px var(--neon-glow), 0 0 20px var(--neon-glow);
    opacity: 0;
    animation: none;
}

.click-feedback.show {
    animation: floatUp 0.6s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(1.3);
    }
}

/* ============================================
   MICRO-ANIMACIONES AVANZADAS
   ============================================ */

/* Contenedor de partículas */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

/* Partícula de click */
.click-particle {
    position: absolute;
    pointer-events: none;
    font-weight: bold;
    color: var(--neon-accent);
    text-shadow: 0 0 8px var(--neon-glow), 0 0 16px var(--neon-glow);
    animation: particleFloat 0.8s ease-out forwards;
    z-index: 101;
}

.click-particle.combo {
    color: var(--success-color);
    text-shadow: 0 0 10px var(--success-color), 0 0 20px var(--success-color);
    font-size: 1.4rem;
}

.click-particle.mega {
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700, 0 0 30px #ffa500;
    font-size: 1.8rem;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2) rotate(var(--rotation, 5deg));
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8) rotate(var(--rotation, -5deg));
    }
}

/* Estrella decorativa */
.click-star {
    position: absolute;
    pointer-events: none;
    font-size: 1rem;
    animation: starBurst 0.6s ease-out forwards;
}

@keyframes starBurst {
    0% {
        opacity: 1;
        transform: scale(0) translate(0, 0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translate(var(--tx, 20px), var(--ty, -20px));
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translate(calc(var(--tx, 20px) * 2), calc(var(--ty, -20px) * 2));
    }
}

/* Efecto de onda en el botón */
.main-click-button {
    position: relative;
    overflow: hidden;
}

.main-click-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(157, 78, 221, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.1s, height 0.1s;
}

.main-click-button.ripple::after {
    animation: buttonRipple 0.4s ease-out forwards;
}

@keyframes buttonRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.6;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

/* Efecto de pulso en el botón */
.main-click-button.pulse {
    animation: buttonPulse 0.15s ease-out;
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Efecto de combo (clicks rápidos) */
.main-click-button.combo-mode {
    animation: comboGlow 0.5s ease-in-out infinite;
}

@keyframes comboGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px var(--neon-glow),
            0 0 40px var(--neon-glow);
    }
    50% {
        box-shadow: 
            0 0 30px var(--neon-glow),
            0 0 60px var(--neon-glow),
            0 0 80px var(--success-color);
    }
}

/* Indicador de combo */
.combo-indicator {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, var(--success-color), #00aa5a);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.combo-indicator.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Transición suave en valores de puntos */
.score-value {
    transition: transform 0.15s ease-out, color 0.2s;
}

.score-value.updated {
    transform: scale(1.15);
    color: var(--success-color);
}

.stat-value {
    transition: transform 0.2s ease-out;
}

.stat-value.bump {
    animation: valueBump 0.3s ease-out;
}

@keyframes valueBump {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: var(--success-color);
    }
    100% {
        transform: scale(1);
    }
}

/* Animación de compra exitosa */
.upgrade-card.purchased-animation {
    animation: purchaseFlash 0.5s ease-out;
}

@keyframes purchaseFlash {
    0% {
        background-color: var(--surface-color);
    }
    50% {
        background-color: rgba(0, 200, 100, 0.3);
        box-shadow: 0 0 20px var(--success-color);
    }
    100% {
        background-color: var(--surface-color);
    }
}

/* Animación de nivel subido */
.level-up-flash {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px #ffd700, 0 0 40px #ffa500;
    animation: levelUpFlash 1s ease-out forwards;
    pointer-events: none;
    z-index: 200;
}

@keyframes levelUpFlash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* ============================================
   PANEL DE IA / TIPS DEL JUGADOR
   ============================================ */
.ai-tips-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 280px;
    background: linear-gradient(145deg, var(--surface-color), #120822);
    border: 2px solid var(--accent-color);
    border-radius: 16px;
    box-shadow: 
        0 0 20px rgba(138, 43, 226, 0.3),
        0 0 40px rgba(138, 43, 226, 0.1);
    z-index: 500;
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ai-tips-panel.hidden {
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
}

.ai-tips-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(145deg, var(--accent-color), #6a2c91);
}

.ai-tips-icon {
    font-size: 1.2rem;
    animation: aiIconPulse 2s ease-in-out infinite;
}

@keyframes aiIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.ai-tips-title {
    flex: 1;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
}

.ai-tips-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-tips-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-tips-body {
    padding: 14px;
}

.ai-tips-message {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
}

.ai-tips-message .highlight {
    color: var(--neon-accent);
    font-weight: bold;
}

.ai-tips-message .tip-icon {
    margin-right: 6px;
}

/* Diferentes estados del tip */
.ai-tips-panel.tip-suggestion {
    border-color: var(--accent-color);
}

.ai-tips-panel.tip-achievement {
    border-color: var(--success-color);
}

.ai-tips-panel.tip-achievement .ai-tips-header {
    background: linear-gradient(145deg, var(--success-color), #00aa5a);
}

.ai-tips-panel.tip-warning {
    border-color: #ffa500;
}

.ai-tips-panel.tip-warning .ai-tips-header {
    background: linear-gradient(145deg, #ffa500, #cc8400);
}

.ai-tips-panel.tip-motivation {
    border-color: #ff6b9d;
}

.ai-tips-panel.tip-motivation .ai-tips-header {
    background: linear-gradient(145deg, #ff6b9d, #cc5580);
}

/* Responsive AI Tips */
@media (max-width: 480px) {
    .ai-tips-panel {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
}

/* Sin animaciones */
body.no-animations .click-particle,
body.no-animations .click-star,
body.no-animations .main-click-button::after,
body.no-animations .combo-indicator,
body.no-animations .level-up-flash {
    display: none !important;
}

body.no-animations .main-click-button.pulse,
body.no-animations .main-click-button.combo-mode,
body.no-animations .score-value.updated,
body.no-animations .stat-value.bump,
body.no-animations .upgrade-card.purchased-animation {
    animation: none !important;
    transform: none !important;
}

/* ============================================
   PANEL DE MEJORAS
   ============================================ */
.upgrades-panel {
    background: var(--surface-color);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px var(--shadow-color);
}

.upgrades-panel h2 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--secondary-color);
    text-shadow: 0 0 8px rgba(199, 125, 255, 0.5);
}

.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upgrade-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-light);
    padding: 10px 14px;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: all var(--transition-speed) ease;
}

.upgrade-card:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.3);
    transform: translateX(5px);
}

.upgrade-info {
    flex: 1;
}

.upgrade-info h3 {
    font-size: 0.95rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.upgrade-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.upgrade-owned {
    font-size: 0.8rem;
    color: var(--neon-accent);
    text-shadow: 0 0 6px var(--neon-glow);
}

.upgrade-button {
    background: linear-gradient(145deg, var(--primary-color), var(--primary-active));
    border: 1px solid var(--secondary-color);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    min-width: 80px;
    box-shadow: 0 0 10px rgba(199, 125, 255, 0.3);
}

.upgrade-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(199, 125, 255, 0.5);
    border-color: var(--neon-accent);
}

.upgrade-button:active:not(:disabled) {
    transform: scale(0.95);
}

.upgrade-button:disabled {
    background: #2a1a3d;
    border-color: #4a3a5d;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.upgrade-price {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* ============================================
   FOOTER - Botones
   ============================================ */

.reset-button {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.reset-button:hover {
    background: var(--danger-color);
    color: var(--text-primary);
    transform: scale(1.05);
}

.reset-button:active {
    transform: scale(0.95);
}

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */

/* Pulso para el botón principal */
@keyframes pulse {
    0%, 100% {
        box-shadow: 
            0 0 20px var(--neon-glow),
            0 0 40px rgba(157, 78, 221, 0.4),
            0 8px 24px rgba(157, 78, 221, 0.3),
            inset 0 -4px 16px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 
            0 0 30px var(--neon-glow),
            0 0 60px rgba(157, 78, 221, 0.5),
            0 8px 32px rgba(157, 78, 221, 0.4),
            inset 0 -4px 16px rgba(0, 0, 0, 0.3);
    }
}

.main-click-button {
    animation: pulse 2s infinite ease-in-out;
}

/* ============================================
   EFECTOS VISUALES DE TIENDA
   ============================================ */

/* Efecto: Brillo Neón Extra */
.main-click-button.neon-glow-effect {
    box-shadow: 
        0 0 30px var(--neon-glow),
        0 0 60px var(--neon-glow),
        0 0 90px rgba(157, 78, 221, 0.4),
        0 8px 24px rgba(157, 78, 221, 0.3),
        inset 0 -4px 16px rgba(0, 0, 0, 0.3);
}

/* Efecto: Borde Arcoíris */
@keyframes rainbowBorder {
    0% { border-color: #ff0000; }
    17% { border-color: #ff8800; }
    33% { border-color: #ffff00; }
    50% { border-color: #00ff00; }
    67% { border-color: #0088ff; }
    83% { border-color: #8800ff; }
    100% { border-color: #ff0000; }
}

.main-click-button.rainbow-border-effect {
    border-width: 4px;
    animation: pulse 2s infinite ease-in-out, rainbowBorder 3s linear infinite;
}

/* Efecto: Partículas (usando pseudo-elemento) */
@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.5);
    }
}

.main-click-button.particle-effect::after {
    content: '✨💫⭐';
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 1.5rem;
    pointer-events: none;
    opacity: 0;
}

.main-click-button.particle-effect:active::after {
    animation: particleFloat 0.8s ease-out;
}

/* Efecto de brillo en mejoras disponibles */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 0, 255, 0.3);
        border-color: transparent;
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
        border-color: var(--neon-accent);
    }
}

.upgrade-card.affordable {
    animation: glow 1.5s infinite ease-in-out;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 480px) {
    .game-container {
        padding: 8px;
        gap: 8px;
    }

    .game-header {
        padding: 10px 12px;
    }

    .game-header h1 {
        font-size: 1.2rem;
        margin-bottom: 6px;
    }

    .score-value {
        font-size: 1.5rem;
        min-width: 60px;
    }

    .stats {
        gap: 8px;
    }

    .stat-item {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    .main-click-button {
        width: 120px;
        height: 120px;
    }

    .click-icon {
        font-size: 2rem;
    }

    .click-text {
        font-size: 0.85rem;
    }

    .click-area {
        padding: 10px 8px;
    }

    .upgrades-panel {
        padding: 10px 12px;
    }

    .upgrades-panel h2 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .upgrade-card {
        padding: 8px 10px;
        gap: 8px;
    }

    .upgrade-info h3 {
        font-size: 0.85rem;
    }

    .upgrade-description {
        font-size: 0.7rem;
    }

    .upgrade-button {
        padding: 6px 10px;
        min-width: 70px;
    }

    .game-footer {
        padding: 6px 0;
    }

    .reset-button {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .game-container {
        padding: 10px;
    }

    .main-click-button {
        width: 130px;
        height: 130px;
    }
}

/* Efecto de hover deshabilitado en dispositivos táctiles */
@media (hover: none) {
    .main-click-button:hover {
        transform: none;
        box-shadow: 
            0 0 20px var(--neon-glow),
            0 0 40px rgba(157, 78, 221, 0.4),
            0 8px 24px rgba(157, 78, 221, 0.3),
            inset 0 -4px 16px rgba(0, 0, 0, 0.3);
    }
    
    .upgrade-card:hover {
        border-color: transparent;
        box-shadow: none;
        transform: none;
    }
    
    .upgrade-button:hover:not(:disabled) {
        transform: none;
        box-shadow: 0 0 10px rgba(199, 125, 255, 0.3);
    }
}

/* ============================================
   MENÚ PRINCIPAL
   ============================================ */
.menu-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.menu-container.hidden {
    display: none;
}

.menu-content {
    text-align: center;
    max-width: 400px;
}

.menu-title {
    font-size: 2.5rem;
    color: var(--neon-accent);
    text-shadow: 0 0 15px var(--neon-glow), 0 0 30px var(--neon-glow), 0 0 45px var(--neon-glow);
    margin-bottom: 12px;
    animation: menuPulse 2s infinite ease-in-out;
}

@keyframes menuPulse {
    0%, 100% {
        text-shadow: 0 0 15px var(--neon-glow), 0 0 30px var(--neon-glow);
    }
    50% {
        text-shadow: 0 0 20px var(--neon-glow), 0 0 40px var(--neon-glow), 0 0 60px var(--neon-glow);
    }
}

.menu-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Grilla de botones del menú */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 320px;
    margin: 0 auto;
}

.menu-grid-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--surface-color), var(--surface-light));
    border: 2px solid var(--surface-light);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.menu-grid-btn:hover {
    border-color: var(--neon-accent);
    box-shadow: 0 0 20px var(--neon-glow), 0 0 40px rgba(157, 78, 221, 0.3);
    transform: scale(1.05);
}

.menu-grid-btn:active {
    transform: scale(0.95);
}

.menu-grid-icon {
    font-size: 2.5rem;
}

.menu-grid-text {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   PANTALLAS SECUNDARIAS (Tienda, Perfil, Ajustes)
   ============================================ */
.screen-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
    padding: 12px;
}

.screen-container.hidden {
    display: none;
}

.screen-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.screen-header h2 {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 1.3rem;
    color: var(--neon-accent);
    text-shadow: 0 0 10px var(--neon-glow);
    padding-right: 40px;
}

.back-btn {
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.back-btn:hover {
    background: var(--secondary-color);
    color: var(--background-color);
}

.screen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.coming-soon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ============================================
   PERFIL DEL JUGADOR
   ============================================ */
.profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tarjetas del perfil */
.profile-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 16px;
    border: 1px solid transparent;
    transition: all var(--transition-speed) ease;
}

.profile-card:hover {
    border-color: rgba(199, 125, 255, 0.3);
}

.profile-card-title {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--surface-light);
}

/* Sección de identidad (avatar + nombre + nivel) */
.profile-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--surface-light), var(--surface-color));
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--shadow-color);
    transition: all var(--transition-speed) ease;
}

.profile-avatar:hover {
    border-color: var(--neon-accent);
    box-shadow: 0 0 25px var(--neon-glow);
}

.profile-avatar-btn {
    padding: 4px 12px;
    font-size: 0.7rem;
    border-radius: 12px;
    background: var(--surface-light);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.profile-avatar-btn:hover {
    background: var(--secondary-color);
    color: var(--background-color);
}

.profile-name-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-name-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-name-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
}

.profile-name-input:focus {
    outline: none;
    border-color: var(--neon-accent);
    box-shadow: 0 0 10px var(--neon-glow);
}

.profile-name-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.profile-name-saved {
    color: #4ade80;
    font-size: 1rem;
    animation: fadeIn 0.3s ease;
}

.profile-name-saved.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.profile-level-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(145deg, var(--primary-color), var(--primary-active));
    border-radius: 12px;
    border: 2px solid var(--neon-accent);
    box-shadow: 0 0 15px var(--neon-glow);
}

.profile-level-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.profile-level-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Selector de Avatar */
.profile-avatar-selector {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 16px;
    border: 2px solid var(--secondary-color);
    animation: slideDown 0.3s ease;
}

.profile-avatar-selector.hidden {
    display: none;
}

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

.avatar-selector-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 12px;
}

.avatar-selector-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.avatar-option {
    width: 100%;
    aspect-ratio: 1;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.avatar-option:hover {
    border-color: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(199, 125, 255, 0.3);
}

.avatar-option.selected {
    border-color: var(--neon-accent);
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--neon-glow);
}

/* Estadísticas del perfil */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.profile-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-light);
    border-radius: 10px;
    transition: all var(--transition-speed) ease;
}

.profile-stat-item:hover {
    transform: translateX(4px);
    box-shadow: 0 0 10px rgba(199, 125, 255, 0.2);
}

.profile-stat-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border-radius: 10px;
}

.profile-stat-info {
    display: flex;
    flex-direction: column;
}

.profile-stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--neon-accent);
    text-shadow: 0 0 8px var(--neon-glow);
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Progreso del perfil */
.profile-progress-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-progress-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-progress-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profile-progress-value {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.profile-progress-bar {
    height: 8px;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
}

.profile-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--neon-accent));
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--neon-glow);
}

.profile-progress-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Perfil responsive */
@media (max-width: 480px) {
    .profile-identity {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
    }

    .profile-name-section {
        width: 100%;
    }

    .profile-name-input {
        text-align: center;
    }

    .profile-level-badge {
        padding: 10px 20px;
    }

    .profile-level-value {
        font-size: 1.5rem;
    }

    .avatar-selector-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .avatar-option {
        font-size: 1.3rem;
    }

    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-stat-item {
        padding: 10px;
    }

    .profile-stat-icon {
        font-size: 1.3rem;
        width: 36px;
        height: 36px;
    }

    .profile-stat-value {
        font-size: 1rem;
    }

    .profile-progress-label {
        font-size: 0.8rem;
    }
}

/* ============================================
   CONFIGURACIÓN / AJUSTES
   ============================================ */
.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

.settings-section {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
}

.settings-section-title {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--surface-light);
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--surface-light);
}

.settings-option:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-option:first-of-type {
    padding-top: 0;
}

.settings-option-info {
    flex: 1;
    margin-right: 16px;
}

.settings-option-label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 2px;
}

.settings-option-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-light);
    border-radius: 28px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-color);
    border-color: var(--neon-accent);
    box-shadow: 0 0 10px var(--neon-glow);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: var(--text-primary);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 5px var(--secondary-color);
}

/* Selector de tema */
.theme-selector {
    display: flex;
    gap: 8px;
}

.theme-btn {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    background: var(--surface-light);
    border: 2px solid transparent;
    color: var(--text-secondary);
}

.theme-btn:hover {
    border-color: var(--secondary-color);
}

.theme-btn.active {
    background: var(--primary-color);
    border-color: var(--neon-accent);
    color: var(--text-primary);
    box-shadow: 0 0 10px var(--neon-glow);
}

/* Botón de peligro (reset) */
.settings-option-danger {
    background: rgba(255, 107, 157, 0.1);
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: 8px;
}

.settings-danger-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    background: transparent;
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

.settings-danger-btn:hover {
    background: var(--danger-color);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(255, 107, 157, 0.4);
}

.settings-danger-btn:active {
    transform: scale(0.95);
}

/* Footer de configuración */
.settings-footer {
    text-align: center;
    padding: 16px 0 8px;
}

.settings-version {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Configuración responsive */
@media (max-width: 480px) {
    .settings-section {
        padding: 12px;
    }

    .settings-section-title {
        font-size: 0.9rem;
    }

    .settings-option-label {
        font-size: 0.85rem;
    }

    .settings-option-desc {
        font-size: 0.7rem;
    }

    .toggle-switch {
        width: 46px;
        height: 24px;
    }

    .toggle-slider::before {
        height: 16px;
        width: 16px;
    }

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(22px);
    }

    .theme-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .settings-danger-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* ============================================
   TEMA CLARO
   ============================================ */
body.theme-light {
    --background-color: #f0f0f5;
    --surface-color: #ffffff;
    --surface-light: #e8e8f0;
    --text-primary: #1a1a2e;
    --text-secondary: #666680;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .game-header,
body.theme-light .upgrades-panel,
body.theme-light .screen-header,
body.theme-light .settings-section,
body.theme-light .shop-balance,
body.theme-light .shop-item,
body.theme-light .profile-stat,
body.theme-light .modal-content {
    box-shadow: 0 2px 10px var(--shadow-color);
}

body.theme-light .main-click-button {
    box-shadow: 
        0 0 15px rgba(157, 78, 221, 0.3),
        0 0 30px rgba(157, 78, 221, 0.2),
        0 6px 20px rgba(157, 78, 221, 0.2),
        inset 0 -4px 16px rgba(0, 0, 0, 0.1);
}

body.theme-light .toggle-slider {
    background: #d0d0dd;
}

body.theme-light .theme-btn {
    background: #e8e8f0;
}

/* ============================================
   MODO SIN ANIMACIONES
   ============================================ */
body.no-animations,
body.no-animations * {
    animation: none !important;
    transition: none !important;
}

body.no-animations .main-click-button:hover,
body.no-animations .main-click-button:active {
    transform: none;
}

body.no-animations .toggle-slider::before {
    transition: none;
}

body.no-animations .click-feedback {
    display: none;
}

/* ============================================
   TIENDA
   ============================================ */
.shop-balance {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
}

.shop-balance-label {
    color: var(--text-secondary);
    font-size: 1rem;
}

.shop-balance-value {
    color: var(--neon-accent);
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px var(--neon-glow);
}

.shop-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.shop-items-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tarjeta de ítem de tienda */
.shop-item {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 16px;
    border: 2px solid transparent;
    transition: all var(--transition-speed) ease;
}

.shop-item:hover:not(.purchased):not(.unavailable) {
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.3);
}

.shop-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.shop-item-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-light);
    border-radius: 12px;
}

.shop-item-info {
    flex: 1;
}

.shop-item-name {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.shop-item-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.shop-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--surface-light);
}

.shop-item-price {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.shop-item-price-icon {
    font-size: 1.2rem;
}

/* Botón de compra */
.shop-buy-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
}

/* Estado: Disponible */
.shop-buy-btn.available {
    background: linear-gradient(145deg, var(--primary-color), var(--primary-active));
    color: var(--text-primary);
    border: 1px solid var(--secondary-color);
    box-shadow: 0 0 10px rgba(199, 125, 255, 0.3);
}

.shop-buy-btn.available:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(199, 125, 255, 0.5);
}

.shop-buy-btn.available:active {
    transform: scale(0.95);
}

/* Estado: No disponible (sin puntos) */
.shop-buy-btn.unavailable {
    background: #2a1a3d;
    color: #666;
    cursor: not-allowed;
    border: 1px solid #3a2a4d;
}

.shop-item.unavailable {
    opacity: 0.7;
}

.shop-item.unavailable .shop-item-price {
    color: #666;
}

/* Estado: Comprado */
.shop-buy-btn.purchased {
    background: linear-gradient(145deg, #1a4d3a, #0d3d2a);
    color: #4ade80;
    cursor: default;
    border: 1px solid #2d6b4f;
}

.shop-item.purchased {
    border-color: #2d6b4f;
    background: linear-gradient(145deg, var(--surface-color), #0d1f1a);
}

.shop-item.purchased .shop-item-icon {
    background: #1a3d2d;
}

.shop-item.purchased .shop-item-name {
    color: #4ade80;
}

.shop-item.purchased .shop-item-price {
    color: #4ade80;
    text-decoration: line-through;
    opacity: 0.6;
}

/* Indicador de comprado */
.purchased-badge {
    display: none;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #4ade80;
}

.shop-item.purchased .purchased-badge {
    display: flex;
}

/* Animación de compra exitosa */
@keyframes purchaseSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(74, 222, 128, 0.5);
    }
    100% {
        transform: scale(1);
    }
}

.shop-item.just-purchased {
    animation: purchaseSuccess 0.5s ease-out;
}

/* Tienda responsive */
@media (max-width: 480px) {
    .shop-balance {
        padding: 10px 12px;
    }

    .shop-balance-value {
        font-size: 1.3rem;
    }

    .shop-item {
        padding: 12px;
    }

    .shop-item-icon {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }

    .shop-item-name {
        font-size: 0.9rem;
    }

    .shop-item-description {
        font-size: 0.75rem;
    }

    .shop-item-price {
        font-size: 1rem;
    }

    .shop-buy-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* Botón volver al menú */
.menu-back-button {
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.menu-back-button:hover {
    background: var(--secondary-color);
    color: var(--background-color);
    transform: scale(1.05);
}

.menu-back-button:active {
    transform: scale(0.95);
}

/* Footer con múltiples botones */
.game-footer {
    text-align: center;
    padding: 8px 0;
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Menú responsive */
@media (max-width: 480px) {
    .menu-title {
        font-size: 1.8rem;
    }

    .menu-subtitle {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .menu-grid {
        gap: 12px;
        max-width: 280px;
    }

    .menu-grid-btn {
        padding: 20px 12px;
    }

    .menu-grid-icon {
        font-size: 2rem;
    }

    .menu-grid-text {
        font-size: 0.85rem;
    }

    .menu-back-button {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    .screen-header {
        padding: 12px;
    }

    .screen-header h2 {
        font-size: 1.1rem;
        padding-right: 30px;
    }

    .back-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .profile-stat {
        padding: 12px 16px;
    }

    .profile-stat-label {
        font-size: 0.85rem;
    }

    .profile-stat-value {
        font-size: 1rem;
    }
}

/* ============================================
   MODAL DE CONFIRMACIÓN - Estilo Neón Violeta
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 0, 21, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(145deg, var(--surface-color), #120822);
    border: 2px solid var(--neon-accent);
    border-radius: 16px;
    padding: 24px 32px;
    text-align: center;
    box-shadow: 
        0 0 30px var(--neon-glow),
        0 0 60px rgba(157, 78, 221, 0.4),
        inset 0 0 30px rgba(157, 78, 221, 0.1);
    transform: scale(1);
    transition: transform 0.3s ease;
    max-width: 90%;
    width: 320px;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.8);
}

.modal-title {
    font-size: 1.3rem;
    color: var(--neon-accent);
    text-shadow: 0 0 10px var(--neon-glow), 0 0 20px var(--neon-glow);
    margin-bottom: 12px;
}

.modal-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    min-width: 100px;
}

.modal-btn-cancel {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.modal-btn-cancel:hover {
    background: var(--secondary-color);
    color: var(--background-color);
    box-shadow: 0 0 20px rgba(199, 125, 255, 0.5);
}

.modal-btn-confirm {
    background: linear-gradient(145deg, var(--danger-color), #cc5580);
    border: 2px solid var(--danger-color);
    color: var(--text-primary);
    text-shadow: 0 0 5px rgba(255, 107, 157, 0.5);
}

.modal-btn-confirm:hover {
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.6);
    transform: scale(1.05);
}

.modal-btn:active {
    transform: scale(0.95);
}

/* Modal responsive */
@media (max-width: 480px) {
    .modal-content {
        padding: 20px 24px;
        width: 280px;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-message {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }

    .modal-btn {
        padding: 8px 18px;
        font-size: 0.85rem;
        min-width: 80px;
    }
}

/* ============================================
   MODAL DE GANANCIAS OFFLINE
   ============================================ */
.offline-modal-content {
    width: 360px;
    max-width: 95%;
    padding: 28px 32px;
}

.offline-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.offline-modal-icon {
    font-size: 3rem;
    animation: offlineIconFloat 2s ease-in-out infinite;
}

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

.offline-modal-title {
    font-size: 1.4rem;
    color: var(--neon-accent);
    text-shadow: 0 0 15px var(--neon-glow);
    margin: 0;
}

.offline-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.offline-time-away {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.offline-highlight {
    color: var(--accent-color);
    font-weight: bold;
}

.offline-earnings-display {
    background: linear-gradient(145deg, rgba(157, 78, 221, 0.2), rgba(157, 78, 221, 0.05));
    border: 2px solid var(--neon-accent);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 20px var(--neon-glow);
}

.offline-earnings-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.offline-earnings-value {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--success-color);
    text-shadow: 
        0 0 10px var(--success-color),
        0 0 20px var(--success-color);
    animation: offlinePointsPulse 1.5s ease-in-out infinite;
}

@keyframes offlinePointsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.offline-earnings-suffix {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.offline-efficiency-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin: 0;
    justify-content: center;
}

.offline-info-icon {
    font-size: 0.9rem;
}

.offline-modal-footer {
    display: flex;
    justify-content: center;
}

.offline-claim-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(145deg, var(--success-color), #00aa5a);
    border: none;
    border-radius: 12px;
    padding: 14px 36px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 200, 100, 0.4),
        0 0 30px rgba(0, 200, 100, 0.2);
}

.offline-claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(0, 200, 100, 0.5),
        0 0 40px rgba(0, 200, 100, 0.3);
}

.offline-claim-btn:active {
    transform: scale(0.98);
}

.offline-claim-icon {
    font-size: 1.3rem;
    animation: offlineGiftBounce 0.6s ease-in-out infinite;
}

@keyframes offlineGiftBounce {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.offline-claim-text {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Modal offline responsive */
@media (max-width: 480px) {
    .offline-modal-content {
        padding: 20px 24px;
        width: 300px;
    }
    
    .offline-modal-icon {
        font-size: 2.5rem;
    }
    
    .offline-modal-title {
        font-size: 1.2rem;
    }
    
    .offline-earnings-value {
        font-size: 1.8rem;
    }
    
    .offline-claim-btn {
        padding: 12px 28px;
        font-size: 1rem;
    }
}

/* ============================================
   MENÚ GRID 3x2
   ============================================ */
.menu-grid.menu-grid-3x2 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 420px;
}

@media (max-width: 480px) {
    .menu-grid.menu-grid-3x2 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 280px;
    }
}

/* ============================================
   ESTADÍSTICAS AVANZADAS
   ============================================ */
.stats-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tarjetas de estadísticas */
.stats-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 16px;
    border: 1px solid transparent;
    transition: all var(--transition-speed) ease;
}

.stats-card:hover {
    border-color: rgba(199, 125, 255, 0.3);
}

.stats-card-title {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--surface-light);
}

/* Sesión actual - Grid destacado */
.stats-session-current {
    background: linear-gradient(145deg, var(--surface-color), #1a0a2e);
    border: 1px solid var(--primary-color);
}

.stats-session-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stats-session-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: var(--surface-light);
    border-radius: 10px;
    transition: all var(--transition-speed) ease;
}

.stats-session-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.2);
}

.stats-session-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--neon-accent);
    text-shadow: 0 0 10px var(--neon-glow);
}

.stats-session-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Lista de estadísticas */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--surface-light);
    transition: all var(--transition-speed) ease;
}

.stats-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stats-row:first-child {
    padding-top: 0;
}

.stats-row:hover {
    background: rgba(157, 78, 221, 0.05);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
}

.stats-row-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stats-row-value {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
}

.stats-row-value.stats-highlight {
    color: var(--neon-accent);
    text-shadow: 0 0 8px var(--neon-glow);
}

/* Animación de actualización de valor */
@keyframes statUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: var(--neon-accent); }
    100% { transform: scale(1); }
}

.stats-row-value.updating {
    animation: statUpdate 0.3s ease;
}

/* Historial de sesiones */
.stats-history {
    max-height: 300px;
}

.stats-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.stats-history-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 20px 0;
    opacity: 0.6;
}

.stats-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface-light);
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
}

.stats-history-item:hover {
    border-left: 3px solid var(--secondary-color);
    padding-left: 9px;
}

.stats-history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stats-history-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stats-history-duration {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.stats-history-data {
    display: flex;
    gap: 16px;
    align-items: center;
}

.stats-history-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stats-history-stat-value {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.stats-history-stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* Estadísticas responsive */
@media (max-width: 480px) {
    .stats-session-grid {
        gap: 8px;
    }

    .stats-session-value {
        font-size: 1.2rem;
    }

    .stats-session-label {
        font-size: 0.7rem;
    }

    .stats-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }

    .stats-row-value {
        font-size: 1.1rem;
    }

    .stats-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .stats-history-data {
        width: 100%;
        justify-content: space-between;
    }

    .stats-history-stat {
        align-items: flex-start;
    }
}

/* ============================================
   MENÚ - GRID 4x2
   ============================================ */

.menu-grid.menu-grid-4x2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.menu-grid-btn {
    position: relative;
}

.menu-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--neon-pink);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 8px var(--neon-pink);
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.prestige-btn {
    background: linear-gradient(145deg, #3d1a5c, #2a1040);
    border: 2px solid #ffd700;
}

.prestige-btn:hover {
    border-color: #ffed4a;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.prestige-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    color: #ffd700;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

@media (max-width: 480px) {
    .menu-grid.menu-grid-4x2 {
        gap: 8px;
    }
}

/* ============================================
   SISTEMA DE MISIONES
   ============================================ */

.missions-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Resumen de misiones */
.missions-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(145deg, var(--card-bg), rgba(138, 43, 226, 0.15));
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.missions-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.missions-summary-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--neon-primary);
    text-shadow: 0 0 10px var(--neon-glow);
}

.missions-summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.missions-summary-progress {
    flex: 1;
    min-width: 150px;
    max-width: 300px;
}

.missions-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.missions-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-primary), var(--neon-pink));
    border-radius: 6px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--neon-glow);
    width: 0%;
}

/* Lista de misiones */
.missions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mission-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: linear-gradient(145deg, var(--card-bg), rgba(138, 43, 226, 0.1));
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mission-card:hover {
    transform: translateX(5px);
}

/* Estilos por rango */
.mission-card.mission-rank-bronze {
    border-color: rgba(205, 127, 50, 0.4);
}
.mission-card.mission-rank-bronze:hover {
    border-color: #cd7f32;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.3);
}

.mission-card.mission-rank-silver {
    border-color: rgba(192, 192, 192, 0.4);
}
.mission-card.mission-rank-silver:hover {
    border-color: #c0c0c0;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.3);
}

.mission-card.mission-rank-gold {
    border-color: rgba(255, 215, 0, 0.4);
}
.mission-card.mission-rank-gold:hover {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.mission-card.mission-rank-diamond {
    border-color: rgba(185, 242, 255, 0.4);
    background: linear-gradient(145deg, var(--card-bg), rgba(185, 242, 255, 0.1));
}
.mission-card.mission-rank-diamond:hover {
    border-color: #b9f2ff;
    box-shadow: 0 0 25px rgba(185, 242, 255, 0.5);
}

.mission-card.mission-rank-master {
    border-color: rgba(255, 107, 107, 0.4);
    background: linear-gradient(145deg, var(--card-bg), rgba(255, 107, 107, 0.1));
}
.mission-card.mission-rank-master:hover {
    border-color: #ff6b6b;
    box-shadow: 0 0 25px rgba(255, 107, 107, 0.5);
}

.mission-card.completed {
    border-color: #4ade80 !important;
    background: linear-gradient(145deg, rgba(74, 222, 128, 0.1), rgba(74, 222, 128, 0.05));
    opacity: 0.8;
}

.mission-card.completed .mission-icon {
    opacity: 0.7;
}

/* Badge de rango */
.mission-rank-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.mission-icon {
    font-size: 1.8rem;
    min-width: 40px;
    text-align: center;
}

.mission-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mission-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mission-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mission-rank-label {
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.mission-description {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Recompensa */
.mission-reward {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.mission-reward-icon {
    font-size: 0.9rem;
}

.mission-reward-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.mission-card.completed .mission-reward-value {
    color: #4ade80;
    text-decoration: line-through;
    opacity: 0.7;
}

/* Sección de completado */
.mission-completed-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mission-claimed {
    font-size: 0.7rem;
    color: #4ade80;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mission-progress-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 100px;
}

.mission-progress-text {
    font-size: 0.85rem;
    color: var(--neon-primary);
    font-weight: 500;
}

.mission-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.mission-progress-fill {
    height: 100%;
    background: var(--neon-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.mission-card.completed .mission-progress-fill {
    background: #4ade80;
}

.mission-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #4ade80;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

/* Animación al completar misión */
@keyframes missionComplete {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 30px rgba(74, 222, 128, 0.5); }
    100% { transform: scale(1); }
}

.mission-card.just-completed {
    animation: missionComplete 0.6s ease;
}

/* ============================================
   SISTEMA DE PRESTIGIO
   ============================================ */

.prestige-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Card de información de prestigio */
.prestige-info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px;
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), rgba(138, 43, 226, 0.15));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    text-align: center;
}

.prestige-star {
    font-size: 4rem;
    animation: starGlow 2s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.8));
        transform: scale(1.1);
    }
}

.prestige-level {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.prestige-level-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.prestige-level-value {
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.prestige-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 400px;
}

/* Card de estadísticas de prestigio */
.prestige-stats-card {
    padding: 20px;
    background: linear-gradient(145deg, var(--card-bg), rgba(138, 43, 226, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.prestige-stats-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.prestige-stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prestige-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.prestige-stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.prestige-stat-value {
    color: var(--neon-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Card de acción de prestigio */
.prestige-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(145deg, var(--card-bg), rgba(138, 43, 226, 0.15));
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.prestige-requirement,
.prestige-current {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.prestige-req-label,
.prestige-current-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.prestige-req-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffd700;
}

.prestige-current-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--neon-primary);
    text-shadow: 0 0 10px var(--neon-glow);
}

.prestige-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 40px;
    background: linear-gradient(145deg, #ffd700, #ffb700);
    border: none;
    border-radius: 30px;
    color: #1a0a2e;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.prestige-action-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.5);
}

.prestige-action-btn:disabled {
    background: linear-gradient(145deg, #666, #444);
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.prestige-btn-icon {
    font-size: 1.5rem;
}

.prestige-warning {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.8;
}

/* Historial de prestigios */
.prestige-history-card {
    padding: 20px;
    background: linear-gradient(145deg, var(--card-bg), rgba(138, 43, 226, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.prestige-history-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.prestige-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.prestige-history-empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

.prestige-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
}

.prestige-history-number {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #ffd700;
}

.prestige-history-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.prestige-history-points {
    font-size: 0.9rem;
    color: var(--neon-primary);
}

/* Animación de prestigio */
@keyframes prestigeFlash {
    0% { opacity: 0; }
    50% { opacity: 1; background: rgba(255, 215, 0, 0.2); }
    100% { opacity: 0; }
}

.prestige-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    animation: prestigeFlash 1s ease;
    z-index: 9999;
}

/* Responsive para misiones y prestigio */
@media (max-width: 600px) {
    .missions-summary {
        flex-direction: column;
        gap: 10px;
    }

    .missions-summary-progress {
        width: 100%;
        max-width: none;
    }

    .mission-card {
        flex-wrap: wrap;
        gap: 10px;
    }

    .mission-info {
        flex-basis: 100%;
        order: 2;
    }

    .mission-rank-badge {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .mission-progress-section,
    .mission-completed-section {
        width: 100%;
        order: 3;
    }

    .prestige-info-card {
        padding: 20px;
    }

    .prestige-star {
        font-size: 3rem;
    }

    .prestige-level-value {
        font-size: 2.5rem;
    }

    .prestige-action-btn {
        width: 100%;
    }

    .prestige-stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .prestige-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ============================================
   SISTEMA DE ETAPAS
   ============================================ */

.stage-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    margin-bottom: 15px;
    background: linear-gradient(145deg, var(--surface-color), rgba(157, 78, 221, 0.1));
    border: 1px solid var(--primary-color);
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.2);
}

.stage-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stage-icon {
    font-size: 1.8rem;
    animation: stageIconPulse 2s ease-in-out infinite;
}

@keyframes stageIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stage-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--neon-glow);
}

.stage-progress {
    width: 100%;
    max-width: 200px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.stage-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--neon-accent));
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--neon-glow);
    width: 0%;
}

/* ============================================
   SELECTOR DE TEMAS
   ============================================ */

.settings-section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.theme-selector {
    width: 100%;
}

.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(145deg, var(--card-bg), rgba(138, 43, 226, 0.1));
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-option:hover:not(.locked) {
    border-color: var(--neon-primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px var(--shadow-color);
}

.theme-option.active {
    border-color: #4ade80;
    background: linear-gradient(145deg, rgba(74, 222, 128, 0.1), rgba(74, 222, 128, 0.05));
}

.theme-option.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.theme-option-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

.theme-option-icon {
    font-size: 1.5rem;
}

.theme-option-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.theme-option-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-option-lock {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.theme-option-active {
    font-size: 0.75rem;
    color: #4ade80;
    font-weight: 500;
}

/* ============================================
   TEMAS VISUALES - Variables CSS
   ============================================ */

/* Tema Océano */
body.theme-ocean {
    --primary-color: #0077b6;
    --primary-hover: #0096c7;
    --primary-active: #005f92;
    --secondary-color: #00b4d8;
    --secondary-hover: #48cae4;
    --background-color: #001219;
    --surface-color: #002633;
    --surface-light: #003d4d;
    --neon-accent: #00f5ff;
    --neon-glow: rgba(0, 245, 255, 0.6);
    --shadow-color: rgba(0, 119, 182, 0.3);
    --neon-primary: #00b4d8;
    --neon-pink: #00f5ff;
}

/* Tema Bosque */
body.theme-forest {
    --primary-color: #2d6a4f;
    --primary-hover: #40916c;
    --primary-active: #1b4332;
    --secondary-color: #40916c;
    --secondary-hover: #52b788;
    --background-color: #081c15;
    --surface-color: #0d2818;
    --surface-light: #1b4332;
    --neon-accent: #52b788;
    --neon-glow: rgba(82, 183, 136, 0.6);
    --shadow-color: rgba(45, 106, 79, 0.3);
    --neon-primary: #52b788;
    --neon-pink: #95d5b2;
}

/* Tema Atardecer */
body.theme-sunset {
    --primary-color: #e85d04;
    --primary-hover: #f48c06;
    --primary-active: #dc2f02;
    --secondary-color: #f48c06;
    --secondary-hover: #faa307;
    --background-color: #1a0a00;
    --surface-color: #2d1400;
    --surface-light: #4a2200;
    --neon-accent: #ff6b35;
    --neon-glow: rgba(255, 107, 53, 0.6);
    --shadow-color: rgba(232, 93, 4, 0.3);
    --neon-primary: #f48c06;
    --neon-pink: #ff6b35;
}

/* Tema Cerezo */
body.theme-cherry {
    --primary-color: #ff69b4;
    --primary-hover: #ff85c0;
    --primary-active: #ff4da6;
    --secondary-color: #ffb6c1;
    --secondary-hover: #ffc8d0;
    --background-color: #1a0a10;
    --surface-color: #2d1020;
    --surface-light: #4a1a30;
    --neon-accent: #ff1493;
    --neon-glow: rgba(255, 20, 147, 0.6);
    --shadow-color: rgba(255, 105, 180, 0.3);
    --neon-primary: #ff69b4;
    --neon-pink: #ff1493;
}

/* Tema Oro */
body.theme-gold {
    --primary-color: #ffd700;
    --primary-hover: #ffed4a;
    --primary-active: #e6c200;
    --secondary-color: #ffed4a;
    --secondary-hover: #fff59d;
    --background-color: #1a1400;
    --surface-color: #2d2200;
    --surface-light: #4a3800;
    --neon-accent: #fff700;
    --neon-glow: rgba(255, 247, 0, 0.6);
    --shadow-color: rgba(255, 215, 0, 0.3);
    --neon-primary: #ffd700;
    --neon-pink: #fff700;
    --text-primary: #1a1400;
}

body.theme-gold .menu-title,
body.theme-gold .stage-name,
body.theme-gold h1, body.theme-gold h2, body.theme-gold h3 {
    color: #ffd700;
}

/* Tema Galaxia */
body.theme-galaxy {
    --primary-color: #7b68ee;
    --primary-hover: #9370db;
    --primary-active: #6a5acd;
    --secondary-color: #9370db;
    --secondary-hover: #ba55d3;
    --background-color: #0a0a1a;
    --surface-color: #15152d;
    --surface-light: #252550;
    --neon-accent: #ba55d3;
    --neon-glow: rgba(186, 85, 211, 0.6);
    --shadow-color: rgba(123, 104, 238, 0.3);
    --neon-primary: #9370db;
    --neon-pink: #ba55d3;
}

/* Tema Arcoíris - Animación especial */
body.theme-rainbow {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --background-color: #0d0015;
    --surface-color: #1a0a2e;
    --neon-accent: #ffe66d;
    --neon-glow: rgba(255, 230, 109, 0.6);
    --shadow-color: rgba(255, 107, 107, 0.3);
    --neon-primary: #ff6b6b;
    --neon-pink: #ffe66d;
    animation: rainbowShift 10s linear infinite;
}

@keyframes rainbowShift {
    0% { --neon-accent: #ff6b6b; }
    16% { --neon-accent: #ffe66d; }
    33% { --neon-accent: #4ecdc4; }
    50% { --neon-accent: #45b7d1; }
    66% { --neon-accent: #96c93d; }
    83% { --neon-accent: #dda0dd; }
    100% { --neon-accent: #ff6b6b; }
}

/* Tema Vacío */
body.theme-void {
    --primary-color: #4a4a6a;
    --primary-hover: #5a5a7a;
    --primary-active: #3a3a5a;
    --secondary-color: #5a5a7a;
    --secondary-hover: #6a6a8a;
    --background-color: #000000;
    --surface-color: #0a0a0f;
    --surface-light: #15151f;
    --neon-accent: #6a6aaa;
    --neon-glow: rgba(106, 106, 170, 0.4);
    --shadow-color: rgba(74, 74, 106, 0.2);
    --neon-primary: #4a4a6a;
    --neon-pink: #6a6aaa;
}

/* Tema Divino */
body.theme-divine {
    --primary-color: #ffffff;
    --primary-hover: #f0f0ff;
    --primary-active: #e0e0f0;
    --secondary-color: #f0f0ff;
    --secondary-hover: #ffffff;
    --background-color: #0a0a15;
    --surface-color: #151525;
    --surface-light: #252540;
    --neon-accent: #ffffff;
    --neon-glow: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(255, 255, 255, 0.3);
    --neon-primary: #ffffff;
    --neon-pink: #f0f0ff;
    animation: divineGlow 3s ease-in-out infinite;
}

@keyframes divineGlow {
    0%, 100% { 
        --neon-glow: rgba(255, 255, 255, 0.6);
    }
    50% { 
        --neon-glow: rgba(255, 255, 255, 1);
    }
}

/* Tema Claro */
body.theme-light {
    --primary-color: #6c63ff;
    --primary-hover: #7d75ff;
    --primary-active: #5b52e0;
    --secondary-color: #9d97ff;
    --secondary-hover: #b3aeff;
    --background-color: #f5f5f5;
    --surface-color: #ffffff;
    --surface-light: #e8e8e8;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #6a6a8a;
    --neon-accent: #6c63ff;
    --neon-glow: rgba(108, 99, 255, 0.4);
    --shadow-color: rgba(108, 99, 255, 0.2);
    --neon-primary: #6c63ff;
    --neon-pink: #9d97ff;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
}

body.theme-light .menu-title,
body.theme-light .game-header h1 {
    color: #6c63ff;
    text-shadow: none;
}

body.theme-light .screen-header h2 {
    color: #1a1a2e;
}

body.theme-light .mission-card,
body.theme-light .settings-section,
body.theme-light .profile-card {
    background: #ffffff;
    border-color: #e0e0e0;
}

/* Responsive para selector de temas */
@media (max-width: 480px) {
    .theme-selector-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .theme-option {
        padding: 10px;
    }
    
    .theme-option-preview {
        width: 50px;
        height: 50px;
    }
    
    .theme-option-icon {
        font-size: 1.2rem;
    }
    
    .theme-option-name {
        font-size: 0.75rem;
    }
    
    .stage-indicator {
        padding: 10px 15px;
    }
    
    .stage-icon {
        font-size: 1.5rem;
    }
    
    .stage-name {
        font-size: 1rem;
    }
}

/* ============================================
   DEV PANEL - Panel de Desarrollador
   ============================================ */
.dev-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    max-height: 90vh;
    background: linear-gradient(145deg, #1a1a2e, #0f0f1a);
    border: 2px solid #00ff88;
    border-radius: 12px;
    box-shadow: 
        0 0 20px rgba(0, 255, 136, 0.3),
        0 0 40px rgba(0, 255, 136, 0.1),
        inset 0 0 20px rgba(0, 255, 136, 0.05);
    z-index: 10000;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dev-panel.hidden {
    display: none;
}

.dev-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(145deg, #00ff88, #00cc6a);
    cursor: grab;
}

.dev-panel-header:active {
    cursor: grabbing;
}

.dev-panel-title {
    font-weight: bold;
    font-size: 0.95rem;
    color: #0a0a0f;
    text-shadow: none;
}

.dev-panel-close {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #0a0a0f;
    font-size: 1.3rem;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dev-panel-close:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.dev-panel-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dev-section {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    padding: 10px;
}

.dev-section-title {
    font-size: 0.8rem;
    color: #00ff88;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dev-state-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dev-state-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
}

.dev-state-row:last-child {
    border-bottom: none;
}

.dev-state-row span:first-child {
    color: #888;
}

.dev-state-row span:last-child {
    color: #00ff88;
    font-weight: bold;
}

.dev-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.dev-btn {
    background: linear-gradient(145deg, #2a2a3e, #1a1a28);
    border: 1px solid #00ff88;
    color: #00ff88;
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.dev-btn:hover {
    background: linear-gradient(145deg, #00ff88, #00cc6a);
    color: #0a0a0f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.4);
}

.dev-btn:active {
    transform: translateY(0);
}

.dev-btn-wide {
    grid-column: span 3;
}

.dev-btn-danger {
    border-color: #ff4444;
    color: #ff4444;
}

.dev-btn-danger:hover {
    background: linear-gradient(145deg, #ff4444, #cc3333);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
}

.dev-log {
    background: #0a0a0f;
    border-radius: 6px;
    padding: 8px;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.7rem;
}

.dev-log-entry {
    color: #00ff88;
    padding: 2px 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    word-break: break-all;
}

.dev-log-entry:last-child {
    border-bottom: none;
}

/* Scrollbar del dev panel */
.dev-panel-body::-webkit-scrollbar,
.dev-log::-webkit-scrollbar {
    width: 6px;
}

.dev-panel-body::-webkit-scrollbar-track,
.dev-log::-webkit-scrollbar-track {
    background: rgba(0, 255, 136, 0.05);
    border-radius: 3px;
}

.dev-panel-body::-webkit-scrollbar-thumb,
.dev-log::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 3px;
}

.dev-panel-body::-webkit-scrollbar-thumb:hover,
.dev-log::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

/* Responsive dev panel */
@media (max-width: 480px) {
    .dev-panel {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        top: 10px;
        max-height: 80vh;
    }
    
    .dev-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dev-btn-wide {
        grid-column: span 2;
    }
}
