
        :root {
            --dental-blue: #1e3a5f;
            --dental-dark: #0f172a;
            --dental-light: #60a5fa;
            --dental-cyan: #06b6d4;
            --dental-red: #dc2626;
            --dental-green: #16a34a;
        }

        /* Modal Styles - Solo para modales personalizados del juego, NO Bootstrap */
        #messageModal.modal,
        #gameModal.modal {
            /* Estilos específicos para modales de Bootstrap del juego */
        }
        
        /* No afectar modales de Bootstrap 5 como #authModal */

        /* Scrollbar personalizado solo para modales del juego */
        #messageModal .modal-content::-webkit-scrollbar,
        #gameModal .modal-content::-webkit-scrollbar {
            width: 8px;
        }

        #messageModal .modal-content::-webkit-scrollbar-track,
        #gameModal .modal-content::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 10px;
        }

        #messageModal .modal-content::-webkit-scrollbar-thumb,
        #gameModal .modal-content::-webkit-scrollbar-thumb {
            background: #06b6d4;
            border-radius: 10px;
        }

        #messageModal .modal-content::-webkit-scrollbar-thumb:hover,
        #gameModal .modal-content::-webkit-scrollbar-thumb:hover {
            background: #60a5fa;
        }

        /* Auth Tabs - Estilos legacy eliminados, ahora se usan los de auth-modal-bs5.php */

        .modal-close {
            position: absolute;
            top: 12px;
            right: 12px;
            width: 32px;
            height: 32px;
            background: rgba(0, 0, 0, 0.3);
            border: none;
            border-radius: 6px;
            color: white;
            font-size: 1.8rem;
            font-weight: 300;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            z-index: 1000;
            line-height: 1;
            opacity: 0.8;
            padding: 0;
        }

        .modal-close:hover {
            background: rgba(239, 68, 68, 0.9);
            opacity: 1;
            transform: scale(1.05);
            transform: scale(1.05);
        }

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

        .form-group {
            margin-bottom: 1rem;
        }

        /* No sobrescribir form-label ni form-input de Bootstrap - ya está bien definido en auth-modal-bs5.php */
        
        /* Estilos de formulario legacy eliminados - ahora se usan los de Bootstrap y auth-modal-bs5.php */
        }

        /* Prevenir scroll horizontal en elementos */
        .modal form {
            max-width: 100%;
            overflow-x: hidden;
        }

        .modal-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 1.5rem;
        }

        /* Estilos de botones personalizados del juego - NO afectar navbar */
        .game-wrapper .btn,
        .modal-content .btn:not(.btn-close),
        .dental-modal .btn:not(.btn-close),
        button.start-game-btn,
        button.action-btn,
        button.powerup-btn,
        button.restart-btn {
            padding: 0.75rem 1.25rem;
            border: none;
            border-radius: 0.75rem;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            overflow: hidden;
            white-space: nowrap;
        }

        .game-wrapper .btn::before,
        .modal-content .btn:not(.btn-close)::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        .game-wrapper .btn:active::before,
        .modal-content .btn:not(.btn-close):active::before {
            width: 300px;
            height: 300px;
        }

        .message-success {
            background: rgba(22, 163, 74, 0.15);
            border: 1px solid rgba(74, 222, 128, 0.3);
            color: #4ade80;
            padding: 0.875rem 1rem;
            border-radius: 12px;
            margin-bottom: 1rem;
            font-weight: 500;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            backdrop-filter: blur(10px);
        }

        /* ==================== BOOTSTRAP 5 OVERRIDES ==================== */
        
        /* Modal Backdrop */
        .modal-backdrop {
            background-color: rgba(0, 0, 0, 0.85) !important;
            backdrop-filter: blur(10px);
        }

        /* Dental Modal Theme */
        .dental-modal {
            background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%) !important;
            border: 2px solid rgba(96, 165, 250, 0.3) !important;
            box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(96, 165, 250, 0.1) !important;
            border-radius: 1.5rem !important;
        }

        .dental-modal .modal-header {
            padding: 2rem 2rem 1rem !important;
        }

        .dental-modal .modal-body {
            padding: 0 2rem 2rem !important;
            color: rgba(255, 255, 255, 0.9);
        }

        .dental-modal .modal-footer {
            padding: 0 2rem 2rem !important;
        }

        .dental-modal-title {
            background: linear-gradient(135deg, #60a5fa 0%, #06b6d4 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-weight: 700 !important;
        }

        /* Close button */
        .dental-modal .btn-close {
            position: absolute;
            top: 1rem;
            right: 1rem;
            opacity: 0.8;
            padding: 0.5rem;
        }

        .dental-modal .btn-close:hover {
            opacity: 1;
            transform: rotate(90deg);
            transition: all 0.3s ease;
        }

        .dental-modal .btn-close:focus {
            box-shadow: none;
            outline: none;
        }

        /* Dental Tabs - Bootstrap Nav Pills Override */
        .dental-tabs {
            border-bottom: 2px solid rgba(96, 165, 250, 0.15) !important;
            padding-bottom: 0 !important;
            margin-bottom: 1.5rem !important;
        }

        /* Dental Tabs - Solo para modales de autenticación */
        #authModal .dental-tabs .nav-link {
            background: transparent !important;
            border: none !important;
            border-bottom: 3px solid transparent !important;
            border-radius: 0 !important;
            color: rgba(255, 255, 255, 0.6) !important;
            font-weight: 600 !important;
            padding: 1rem 1.5rem !important;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        }

        #authModal .dental-tabs .nav-link:hover {
            color: rgba(255, 255, 255, 0.9) !important;
            background: rgba(96, 165, 250, 0.05) !important;
        }

        #authModal .dental-tabs .nav-link.active {
            color: #60a5fa !important;
            background: transparent !important;
            border-bottom-color: #60a5fa !important;
        }

        /* Dental Input Fields */
        .dental-input {
            background: rgba(255, 255, 255, 0.05) !important;
            border: 2px solid rgba(96, 165, 250, 0.2) !important;
            border-radius: 0.75rem !important;
            color: white !important;
            padding: 0.875rem 1rem !important;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
            backdrop-filter: blur(10px);
        }

        .dental-input:focus {
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: #60a5fa !important;
            box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25) !important;
            color: white !important;
        }

        .dental-input::placeholder {
            color: rgba(255, 255, 255, 0.4) !important;
        }

        /* Dental Buttons */
        .dental-btn-primary {
            background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
            border: none !important;
            color: white !important;
            font-weight: 600 !important;
            padding: 0.875rem 1.5rem !important;
            border-radius: 0.75rem !important;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
            box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3) !important;
        }

        .dental-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(6, 182, 212, 0.4) !important;
            background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%) !important;
        }

        .dental-btn-outline {
            background: rgba(255, 255, 255, 0.05) !important;
            border: 2px solid rgba(255, 255, 255, 0.2) !important;
            color: white !important;
            font-weight: 600 !important;
            padding: 0.875rem 1.5rem !important;
            border-radius: 0.75rem !important;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        }

        .dental-btn-outline:hover {
            background: rgba(255, 255, 255, 0.1) !important;
            border-color: rgba(255, 255, 255, 0.3) !important;
            color: white !important;
        }

        /* Alert Styles */
        .dental-modal .alert {
            border-radius: 0.75rem;
            border: none;
            padding: 1rem;
            margin-bottom: 1rem;
        }

        .dental-modal .alert-success {
            background: rgba(22, 163, 74, 0.15);
            color: #4ade80;
            border-left: 4px solid #4ade80;
        }

        .dental-modal .alert-danger {
            background: rgba(220, 38, 38, 0.15);
            color: #f87171;
            border-left: 4px solid #f87171;
        }

        /* ==================== END BOOTSTRAP OVERRIDES ==================== */

        .message-success::before {
            content: '✓';
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            background: #16a34a;
            border-radius: 50%;
            font-size: 0.75rem;
            font-weight: 700;
        }

        .message-error {
            background: rgba(220, 38, 38, 0.15);
            border: 1px solid rgba(248, 113, 113, 0.3);
            color: #f87171;
            padding: 0.875rem 1rem;
            border-radius: 12px;
            margin-bottom: 1rem;
            font-weight: 500;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            backdrop-filter: blur(10px);
        }

        .message-error::before {
            content: '⚠';
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            background: rgba(220, 38, 38, 0.3);
            border-radius: 50%;
            font-size: 0.75rem;
        }

        .message-info {
            background: rgba(6, 182, 212, 0.2);
            border: 2px solid #06b6d4;
            color: #67e8f9;
            padding: 1rem;
            border-radius: 10px;
            margin-bottom: 1rem;
            font-weight: 600;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(30px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        .modal.active {
            animation: fadeIn 0.3s ease;
        }

        /* Responsive - solo para modales del juego */

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            padding-top: env(safe-area-inset-top); /* Para el notch de iPhone */
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
            background-attachment: fixed;
            min-height: 100vh;
            min-height: 100dvh; /* Dynamic viewport height para móviles */
            min-height: -webkit-fill-available; /* Fallback para Safari iOS */
            color: white;
            overflow-x: hidden;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch; /* Smooth scrolling en iOS */
        }
        
        /* Fix para Safari iOS */
        html {
            height: -webkit-fill-available;
        }
        
        /* Fix adicional para iOS - prevenir scroll bounce */
        @supports (-webkit-touch-callout: none) {
            body {
                /* iOS Safari */
                height: -webkit-fill-available;
            }
        }

        /* Navbar - asegurar que esté siempre encima de elementos del juego */
        .navbar {
            z-index: 2000 !important;
        }

        /* Dropdown del navbar - debe estar encima de todo */
        .navbar .dropdown-menu {
            z-index: 2010 !important;
        }

        /* Backdrop del dropdown si es necesario */
        .navbar .dropdown-menu.show {
            z-index: 2010 !important;
        }

        /* Bootstrap 5 Auth Modal - Por encima del navbar */
        #authModal {
            z-index: 2100 !important;
        }
        #authModal ~ .modal-backdrop {
            z-index: 2090 !important;
        }

        /* Bootstrap 5 Message Modal */
        #messageModal {
            z-index: 2050 !important;
        }
        #messageModal ~ .modal-backdrop {
            z-index: 2040 !important;
        }

        /* Bootstrap 5 Game Modal - Por encima del navbar */
        #gameModal {
            z-index: 2150 !important;
        }
        #gameModal ~ .modal-backdrop {
            z-index: 2140 !important;
        }

        /* ===== AUTH TOAST ===== */
        #authToast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            z-index: 9000;
            min-width: 320px;
            max-width: 380px;
            background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
            border: 1px solid rgba(96, 165, 250, 0.4);
            border-radius: 1rem;
            box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(96,165,250,0.1);
            color: white;
            font-family: 'Inter', sans-serif;
        }
        #authToast .toast-header {
            background: rgba(96, 165, 250, 0.1);
            border-bottom: 1px solid rgba(96, 165, 250, 0.2);
            border-radius: 1rem 1rem 0 0;
            color: #60a5fa;
            font-weight: 700;
            padding: 0.75rem 1rem;
        }
        #authToast .toast-body {
            padding: 1rem;
            font-size: 0.9rem;
            line-height: 1.5;
            color: rgba(255,255,255,0.9);
        }
        #authToast .btn-close {
            filter: invert(1) grayscale(1) brightness(2);
            opacity: 0.7;
        }
        #authToast .btn-close:hover { opacity: 1; }
        .auth-toast-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }
        .auth-toast-actions .btn {
            flex: 1;
            font-size: 0.82rem;
            font-weight: 600;
            padding: 0.45rem 0.75rem;
            border-radius: 0.5rem;
            cursor: pointer;
        }
        @media (max-width: 480px) {
            #authToast {
                bottom: 12px;
                right: 12px;
                left: 12px;
                min-width: unset;
                max-width: unset;
            }
        }

        .logos-games {
            margin-top: 30px;
            max-width: 100%;
        }

        .game-wrapper {
            position: relative;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            padding-top: 80px; /* Espacio para el navbar sticky */
            padding-bottom: max(20px, env(safe-area-inset-bottom)); /* Safe area para iPhone */
            display: flex;
            flex-direction: column;
            min-height: calc(100vh - 60px);
            min-height: calc(100dvh - 60px);
            overflow-x: hidden;
        }

        /* Header con Score y High Score */
        .top-bar {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            gap: 20px;
            padding: 15px 30px;
            background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
            border-radius: 15px 15px 0 0;
            border: 3px solid #60a5fa;
            border-bottom: none;
        }

        .score-section {
            display: flex;
            gap: 30px;
            align-items: center;
        }

        .score-display {
            font-size: 1.8rem;
            font-weight: 800;
            letter-spacing: 2px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
        }

        .score-label {
            font-size: 1.2rem;
            font-weight: 700;
            margin-right: 10px;
            opacity: 0.9;
        }

        .quick-actions {
            display: flex;
            gap: 10px;
            align-items: center;
            justify-content: flex-end;
        }

        .action-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 16px;
            border: none;
            border-radius: 8px;
            font-weight: 700;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

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

        .btn-ranking {
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
            color: white;
        }

        .btn-ranking:hover {
            background: linear-gradient(135deg, #f59e0b, #d97706);
        }

        /* Título principal */
        .game-title-section {
            background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 50%, #1e3a5f 100%);
            padding: 25px;
            text-align: center;
            border-left: 3px solid #60a5fa;
            border-right: 3px solid #60a5fa;
            position: relative;
            overflow: hidden;
        }


        @keyframes float {
            0%, 100% { transform: translateY(-50%) rotate(0deg); }
            50% { transform: translateY(-60%) rotate(10deg); }
        }

        .game-title {
            font-size: 3rem;
            font-weight: 900;
            letter-spacing: 3px;
            text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
            margin: 0;
            background: linear-gradient(180deg, #ffffff 0%, #e0f2fe 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .game-logo {
            max-width: 600px;
            width: 90%;
            height: auto;
            display: block;
            margin: 0 auto;
            filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6)) drop-shadow(3px 3px 6px rgba(0,0,0,0.5));
        }

        /* Nivel y Tiempo */
        .level-time-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 30px;
            background: linear-gradient(90deg, #1e3a5f 0%, #3b82f6 50%, #1e3a5f 100%);
            border-left: 3px solid #60a5fa;
            border-right: 3px solid #60a5fa;
            font-size: 1.3rem;
            font-weight: 700;
        }

        /* Área del juego principal */
        .game-canvas-wrapper {
            position: relative;
            background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
            border: 3px solid #60a5fa;
            border-radius: 0 0 15px 15px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        
        .damage-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(220, 38, 38, 0);
            pointer-events: none;
            z-index: 100;
            border-radius: 0 0 15px 15px;
            transition: background 0.1s ease-out;
        }
        
        .damage-overlay.active {
            animation: damageFlash 0.6s ease-out;
        }
        
        @keyframes damageFlash {
            0% { background: rgba(220, 38, 38, 0); }
            20% { background: rgba(220, 38, 38, 0.6); box-shadow: inset 0 0 100px rgba(220, 38, 38, 0.8); }
            40% { background: rgba(220, 38, 38, 0.3); }
            60% { background: rgba(220, 38, 38, 0.5); }
            100% { background: rgba(220, 38, 38, 0); box-shadow: none; }
        }
        
        @keyframes canvasShake {
            0%, 100% { transform: translate(0, 0); }
            10% { transform: translate(-5px, 2px); }
            20% { transform: translate(5px, -2px); }
            30% { transform: translate(-3px, 3px); }
            40% { transform: translate(3px, -3px); }
            50% { transform: translate(-2px, 2px); }
            60% { transform: translate(2px, -2px); }
            70% { transform: translate(-1px, 1px); }
            80% { transform: translate(1px, -1px); }
            90% { transform: translate(0, 0); }
        }
        
        .game-canvas-wrapper.shake canvas {
            animation: canvasShake 0.5s ease-out;
        }

        canvas {
            display: block;
            width: auto !important;
            height: auto !important;
            margin: 0 auto;
            background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
            border-radius: 10px;
            border: 2px solid #475569;
            box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
            touch-action: none;
            cursor: crosshair;
            flex-shrink: 0;
        }

        /* Power-ups */
        .powerups-bar {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 15px;
            margin-top: 20px;
            margin-bottom: 20px;
            flex-wrap: wrap;
            padding: 15px;
            background: rgba(0, 33, 41, 0.3);
            border-radius: 12px;
            border: 2px solid rgba(96, 165, 250, 0.2);
            box-sizing: border-box;
        }

        .powerup-btn {
            background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
            color: white;
            border: 3px solid #fca5a5;
            padding: 12px 25px;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
            text-transform: uppercase;
            letter-spacing: 1px;
            flex: 0 1 auto;
            white-space: nowrap;
            text-align: center;
        }

        .powerup-btn:hover:not(:disabled) {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6);
        }

        .powerup-btn:active:not(:disabled) {
            transform: translateY(-1px);
        }

        .powerup-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .powerup-btn.blue {
            background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
            border-color: #7dd3fc;
            box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
        }

        .powerup-btn.blue:hover:not(:disabled) {
            box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
        }

        /* Vidas */
        .lives-display {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-shrink: 0;
            background: rgba(0, 0, 0, 0.3);
            padding: 8px 15px;
            border-radius: 20px;
            border: 2px solid rgba(96, 165, 250, 0.3);
        }

        .life-icon {
            font-size: 2rem;
            filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.5));
            animation: pulse 2s ease-in-out infinite;
            line-height: 1;
        }
        
        .life-icon:nth-child(1) {
            animation-delay: 0s;
        }
        
        .life-icon:nth-child(2) {
            animation-delay: 0.3s;
        }
        
        .life-icon:nth-child(3) {
            animation-delay: 0.6s;
        }

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

        /* Stats adicionales */
        .stats-overlay {
            position: absolute;
            top: 15px;
            left: 15px;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(10px);
            padding: 12px 16px;
            border-radius: 10px;
            border: 2px solid rgba(96, 165, 250, 0.3);
            z-index: 10;
            display: block;
        }

        .stat-item {
            margin: 5px 0;
            font-size: 1rem;
            font-weight: 600;
        }

        .stat-label {
            color: #60a5fa;
            margin-right: 8px;
        }
        
        .combo-indicator {
            animation: pulse 0.8s ease-in-out infinite;
        }
        
        .combo-indicator .stat-label {
            color: #fbbf24;
        }
        
        .combo-indicator #comboCount {
            color: #fbbf24;
            font-size: 1.2em;
            text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        
        @keyframes unlockPulse {
            0% { transform: scale(1); box-shadow: 0 0 0 rgba(251, 191, 36, 0.7); }
            50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(251, 191, 36, 0.7); }
            100% { transform: scale(1); box-shadow: 0 0 0 rgba(251, 191, 36, 0); }
        }

        /* Nivel Máximo Alcanzado */
        .max-level-display {
            text-align: center;
            margin-top: 20px;
            margin-bottom: 20px;
            padding: 15px 20px;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
            border-radius: 10px;
            border: 2px solid rgba(96, 165, 250, 0.3);
        }
        
        .max-level-display .level-text {
            font-size: 1rem;
            opacity: 0.9;
        }
        
        .max-level-display #maxLevelDisplay {
            font-size: 1.3rem;
            color: #fbbf24;
            font-weight: 700;
        }
        
        .max-level-display .bullets-info {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid rgba(96, 165, 250, 0.2);
        }
        
        .max-level-display .bullets-info p {
            margin: 4px 0;
            font-size: 0.9rem;
        }
        
        .max-level-display .bullets-info p:last-child {
            font-size: 0.85rem;
            opacity: 0.85;
        }

        /* Controles e instrucciones */
        .controls-info {
            margin-top: 20px;
            padding: 20px;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
            border-radius: 10px;
            border: 2px solid rgba(96, 165, 250, 0.3);
            text-align: center;
        }

        .controls-info p {
            margin: 8px 0;
            font-size: 0.95rem;
        }

        .controls-info strong {
            color: #60a5fa;
        }

        button.restart-btn {
            background: linear-gradient(45deg, #dc2626, #991b1b);
            color: white;
            border: none;
            padding: 14px 35px;
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 700;
            cursor: pointer;
            transition: transform 0.2s;
            margin: 15px 5px;
            box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
        }

        button.restart-btn:hover {
            transform: scale(1.05);
        }

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

        /* Level selector */
        .level-selector {
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
            text-align: center;
            border: 2px solid rgba(96, 165, 250, 0.3);
        }

        .level-progress {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: 15px;
            flex-wrap: wrap;
        }

        .level-badge {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 1.1rem;
            transition: all 0.3s;
            border: 2px solid rgba(255,255,255,0.3);
            color: white;
        }

        .level-badge.unlocked {
            background: linear-gradient(135deg, #10b981, #059669);
            border-color: #10b981;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
            cursor: pointer;
        }

        .level-badge.unlocked:hover {
            transform: scale(1.1);
        }

        .level-badge.locked {
            background: rgba(100, 100, 100, 0.3);
            color: rgba(255, 255, 255, 0.5);
            border-color: rgba(255,255,255,0.2);
        }

        .level-badge.current {
            background: linear-gradient(135deg, #3b82f6, #60a5fa);
            border-color: #3b82f6;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
            animation: pulse-badge 2s ease-in-out infinite;
        }

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

        /* Efectos de partículas y animaciones */
        @keyframes glow {
            0%, 100% { box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4); }
            50% { box-shadow: 0 4px 25px rgba(220, 38, 38, 0.8); }
        }

        .powerup-btn.active {
            animation: glow 1s ease-in-out infinite;
        }

        /* Responsive */
        @media (max-width: 1024px) {
            .game-title {
                font-size: 2.5rem;
            }
            
            .game-logo {
                max-width: 500px;
                width: 85%;
            }
            
            .game-wrapper {
                padding: 15px;
                padding-top: 75px; /* Espacio para navbar en tablets */
                padding-bottom: max(15px, env(safe-area-inset-bottom));
                min-height: calc(100vh - 60px);
                min-height: calc(100dvh - 60px);
            }
            
            .powerups-bar {
                gap: 12px;
                padding: 15px 12px;
                flex-wrap: wrap;
                margin-top: 15px;
                margin-bottom: 15px;
                border-radius: 10px;
            }
            
            .powerup-btn {
                padding: 12px 18px;
                font-size: 0.9rem;
                flex: 1 1 auto;
                min-width: 140px;
                max-width: 250px;
            }
        }

        @media (max-width: 768px) {
            .game-title {
                font-size: 1.8rem;
                letter-spacing: 1px;
            }
            
            .game-logo {
                max-width: 400px;
                width: 80%;
            }
            
            .game-wrapper {
                padding: 10px;
                padding-top: 70px; /* Espacio para navbar en móviles */
                padding-bottom: max(10px, env(safe-area-inset-bottom));
                min-height: calc(100vh - 50px);
                min-height: calc(100dvh - 50px);
                overflow-y: auto;
            }
            
            .game-canvas-wrapper {
                padding: 10px;
            }
            
            .top-bar {
                padding: 10px 15px;
                border-radius: 10px 10px 0 0;
                grid-template-columns: 1fr;
                gap: 10px;
            }
            
            .score-section {
                justify-content: center;
            }
            
            .score-display {
                font-size: 1.1rem;
            }

            .quick-actions {
                justify-content: center;
            }

            .action-btn {
                padding: 6px 12px;
                font-size: 0.8rem;
            }
            
            .level-time-bar {
                padding: 10px 15px;
                font-size: 1.1rem;
            }
            
            .score-label {
                font-size: 0.85rem;
            }
            
            .game-title-section {
                padding: 15px 10px;
            }
            
            
            .game-canvas-wrapper {
                padding: 10px;
                padding-top: 0;
                border-radius: 0 0 12px 12px;
                border-width: 2px;
            }
            
            canvas {
                border-radius: 8px;
                border-width: 1px;
                margin-top: 12px;
            }
            
            .stats-overlay {
                position: static;
                width: calc(100% - 20px);
                max-width: 100%;
                margin: 10px;
                margin-bottom: 12px;
                padding: 10px 15px;
                border-radius: 10px;
                display: flex;
                flex-direction: row;
                justify-content: space-around;
                align-items: center;
                gap: 15px;
                top: auto;
                left: auto;
            }
            
            .stat-item {
                margin: 0;
                font-size: 0.9rem;
                text-align: center;
                flex: 1;
            }
            
            .powerups-bar {
                gap: 12px;
                padding: 15px 12px;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                margin-top: 15px;
                margin-bottom: 15px;
                background: rgba(0, 33, 41, 0.5);
                border-radius: 10px;
            }
            
            .powerup-btn {
                padding: 14px 18px;
                font-size: 0.9rem;
                width: 100%;
                border-width: 2px;
                letter-spacing: 0.5px;
                min-height: 48px;
                text-align: center;
            }
            
            .lives-display {
                gap: 8px;
                padding: 6px 12px;
            }
            
            .life-icon {
                font-size: 1.6rem;
            }
        }
        
        @media (max-width: 480px) {
            .hamburger-menu {
                position: fixed;
                top: 75px;
                right: 10px;
                margin: 0;
                width: auto;
                max-width: auto;
                padding: 0;
                border-bottom: none;
                display: block;
                z-index: 1500;
            }
            
            .hamburger-btn {
                width: 36px;
                height: 36px;
                padding: 7px;
                opacity: 1;
                box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
                border-width: 2px;
            }
            
            .hamburger-btn:hover {
                transform: scale(1.05);
            }
            
            .hamburger-btn span {
                width: 18px;
                height: 2px;
            }
            
            .hamburger-btn:active {
                transform: scale(0.95);
            }
            
            .menu-overlay {
                padding: 10px;
                padding-top: 15px;
            }
            
            .menu-overlay.active {
                padding-top: 15px;
            }
            
            .menu-content {
                padding: 20px 15px;
                max-height: 88vh;
            }
            
            .menu-content::-webkit-scrollbar {
                width: 6px;
            }
            
            .instructions-modal-overlay {
                padding: 60px 10px 10px;
            }
            
            .instructions-modal-content {
                padding: 30px 15px 20px;
            }
            
            .instructions-body {
                max-height: 60vh;
            }
            
            .instructions-logo {
                max-width: 250px;
            }
            
            .subtitle-instruction {
                font-size: 0.85rem;
                margin-bottom: 15px;
            }
            
            .instruction-section {
                padding: 12px;
                margin-bottom: 12px;
            }
            
            .instruction-section h3 {
                font-size: 1rem;
                margin-bottom: 10px;
            }
            
            .instruction-section p,
            .instruction-section ul {
                font-size: 0.85rem;
                line-height: 1.6;
            }
            
            .controls-grid,
            .enemies-grid {
                grid-template-columns: 1fr;
                gap: 8px;
            }
            
            .control-item,
            .enemy-item {
                padding: 8px;
            }
            
            .start-game-btn {
                padding: 12px 20px;
                font-size: 0.95rem;
                letter-spacing: 1px;
                width: 100%;
            }
            
            .game-title {
                font-size: 1.5rem;
            }
            
            .game-logo {
                max-width: 300px;
                width: 75%;
            }
            
            .game-wrapper {
                padding: 5px;
                padding-top: 65px; /* Espacio para navbar en móviles pequeños */
                padding-bottom: max(5px, env(safe-area-inset-bottom));
                min-height: calc(100vh - 50px);
                min-height: calc(100dvh - 50px);
                overflow-y: auto;
            }
            
            .game-canvas-wrapper {
                padding: 8px;
                padding-top: 0;
            }
            
            .stats-overlay {
                position: static;
                width: calc(100% - 16px);
                max-width: 100%;
                margin: 8px;
                margin-bottom: 10px;
                padding: 8px 12px;
                border-radius: 8px;
                display: flex;
                flex-direction: row;
                justify-content: space-around;
                align-items: center;
                gap: 12px;
                border-width: 1px;
                top: auto;
                left: auto;
            }
            
            .stat-item {
                margin: 0;
                font-size: 0.85rem;
                text-align: center;
                flex: 1;
            }
            
            .top-bar {
                padding: 8px 12px;
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .score-section {
                flex-direction: column;
                gap: 5px;
            }
            
            .score-display {
                font-size: 1rem;
            }
            
            .quick-actions {
                flex-wrap: wrap;
                justify-content: center;
            }

            .action-btn {
                padding: 6px 10px;
                font-size: 0.75rem;
            }
            
            .score-label {
                font-size: 0.75rem;
                margin-right: 5px;
            }
            
            .level-time-bar {
                padding: 8px 12px;
                font-size: 0.95rem;
                gap: 10px;
            }
            
            .game-title-section {
                padding: 12px 8px;
            }
            
            
            .game-canvas-wrapper {
                padding: 10px;
                border-radius: 0 0 10px 10px;
                border-width: 2px;
            }
            
            canvas {
                margin-top: 10px;
            }
            
            .powerups-bar {
                flex-direction: column;
                gap: 10px;
                padding: 15px 12px;
                margin-top: 12px;
                margin-bottom: 12px;
                background: rgba(0, 33, 41, 0.6);
                border-radius: 8px;
                align-items: center;
                justify-content: center;
            }
            
            .powerup-btn {
                padding: 14px 16px;
                font-size: 0.95rem;
                width: 100%;
                border-width: 2px;
                letter-spacing: 0.5px;
                min-height: 48px;
                text-align: center;
            }
            
            .max-level-display {
                margin-top: 12px;
                margin-bottom: 12px;
                padding: 10px 12px;
            }
            
            .max-level-display .level-text {
                font-size: 0.9rem;
            }
            
            .max-level-display #maxLevelDisplay {
                font-size: 1.15rem;
            }
            
            .max-level-display .bullets-info {
                margin-top: 10px;
                padding-top: 10px;
            }
            
            .max-level-display .bullets-info p {
                font-size: 0.85rem;
            }
            
            .max-level-display .bullets-info p:last-child {
                font-size: 0.8rem;
            }
            
            .level-time-bar {
                padding: 8px 12px;
            }
            
            .level-badge {
                font-size: 0.75rem;
                padding: 3px 8px;
                width: 35px;
                height: 35px;
            }
            
            .level-selector {
                padding: 10px;
                margin-bottom: 10px;
            }
            
            .level-progress {
                gap: 6px;
                margin-top: 10px;
            }
            
            .lives-display {
                gap: 6px;
                padding: 5px 10px;
            }
            
            .life-icon {
                font-size: 1.4rem;
            }
        }
        
        @media (max-width: 360px) {
            .level-time-bar {
                padding: 6px 10px;
                font-size: 0.85rem;
                gap: 8px;
            }
            
            .lives-display {
                padding: 4px 8px;
                gap: 5px;
            }
            
            .life-icon {
                font-size: 1.2rem;
            }
        }
        
        /* Estilos para pantallas grandes (desktop) */
        @media (min-width: 1025px) {
            .powerups-bar {
                flex-direction: row;
                gap: 20px;
                padding: 18px 25px;
                justify-content: center;
                align-items: center;
                flex-wrap: wrap;
            }
            
            .powerup-btn {
                width: auto;
                min-width: 180px;
                max-width: 280px;
                flex: 0 1 auto;
                padding: 14px 30px;
                font-size: 1.05rem;
                letter-spacing: 1.2px;
                white-space: nowrap;
                text-align: center;
            }
        }

        /* Menú Hamburguesa */
        .hamburger-menu {
            position: fixed;
            top: 80px;
            right: 20px;
            z-index: 1500;
        }
        
        /* En desktop sigue flotante */
        @media (min-width: 769px) {
            .hamburger-menu {
                position: fixed;
                top: 80px;
                right: 20px;
            }
        }

        .hamburger-btn {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
            border: 2px solid rgba(96, 165, 250, 0.5);
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 5px;
            padding: 10px;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
            opacity: 0.85;
        }

        .hamburger-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(96, 165, 250, 0.5);
            border-color: rgba(96, 165, 250, 0.8);
            opacity: 1;
        }

        .hamburger-btn span {
            width: 25px;
            height: 3px;
            background: white;
            border-radius: 2px;
            transition: all 0.3s ease;
        }

        .hamburger-btn.active span:nth-child(1) {
            transform: rotate(45deg) translate(7px, 7px);
        }

        .hamburger-btn.active span:nth-child(2) {
            opacity: 0;
        }

        .hamburger-btn.active span:nth-child(3) {
            transform: rotate(-45deg) translate(7px, -7px);
        }

        .menu-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(10px);
            z-index: 1600;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
            overflow-y: auto;
            padding: 20px;
        }

        .menu-overlay.active {
            display: flex;
            opacity: 1;
            justify-content: center;
            align-items: flex-start;
            padding-top: 40px;
        }

        .menu-content {
            background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
            max-width: 400px;
            width: 90%;
            transform: scale(0.9);
            transition: transform 0.3s ease;
            border: 3px solid #60a5fa;
            max-height: 90vh;
            overflow-y: auto;
            margin: auto;
        }

        .menu-overlay.active .menu-content {
            transform: scale(1);
        }
        
        /* Scrollbar personalizado para el menú */
        .menu-content::-webkit-scrollbar {
            width: 10px;
        }

        .menu-content::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 10px;
        }

        .menu-content::-webkit-scrollbar-thumb {
            background: rgba(96, 165, 250, 0.5);
            border-radius: 10px;
        }

        .menu-content::-webkit-scrollbar-thumb:hover {
            background: rgba(96, 165, 250, 0.7);
        }

        .menu-title {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 30px;
            text-align: center;
            color: white;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        }

        .menu-items {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .menu-item {
            background: rgba(255, 255, 255, 0.2);
            border: 2px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 15px 25px;
            border-radius: 12px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .menu-item:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateX(5px);
            border-color: rgba(255, 255, 255, 0.5);
        }

        .menu-item:active {
            transform: translateX(5px) scale(0.98);
        }

        @media (max-width: 768px) {
            .hamburger-menu {
                position: fixed;
                top: 80px;
                right: 15px;
                margin: 0;
                width: auto;
                max-width: auto;
                padding: 0;
                border-bottom: none;
                display: block;
                z-index: 1500;
            }

            .hamburger-btn {
                width: 40px;
                height: 40px;
                padding: 8px;
                opacity: 1;
                background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
                border-width: 2px;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
            }
            
            .hamburger-btn:hover {
                transform: scale(1.05);
            }
            
            .hamburger-btn span {
                width: 20px;
                height: 2.5px;
            }
            
            .hamburger-btn.active {
                opacity: 1;
            }

            .menu-overlay {
                padding: 15px;
                padding-top: 20px;
            }
            
            .menu-overlay.active {
                padding-top: 20px;
            }
            
            .menu-content {
                padding: 25px 18px;
                max-height: 85vh;
            }

            .menu-title {
                font-size: 1.5rem;
                margin-bottom: 20px;
            }

            .menu-item {
                padding: 12px 20px;
                font-size: 1rem;
            }
            
            .menu-content::-webkit-scrollbar {
                width: 8px;
            }
        }

        /* Estilos para modal del juego usando Bootstrap 5 */

        .modal-stats {
            margin: 1.5rem 0;
        }

        .modal-stat {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            padding: 1rem;
            border-radius: 12px;
            border: 2px solid rgba(96, 165, 250, 0.3);
            text-align: center;
            transition: all 0.3s ease;
        }

        .modal-stat:hover {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(96, 165, 250, 0.5);
            transform: translateY(-2px);
        }

        .modal-stat-label {
            font-size: 0.85rem;
            opacity: 0.9;
            margin-bottom: 0.5rem;
            color: rgba(255, 255, 255, 0.9);
            font-weight: 600;
        }

        .modal-stat-value {
            font-size: 1.8rem;
            font-weight: 700;
            color: #fbbf24;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
        }

        /* Modal de Instrucciones */
        /* === MODAL DE INSTRUCCIONES CUSTOM (SIN BOOTSTRAP) === */
        .instructions-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(10px);
            z-index: 1700;
            overflow-y: auto;
            padding: 80px 20px 20px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .instructions-modal-overlay.active {
            display: flex;
            justify-content: center;
            align-items: flex-start;
            opacity: 1;
        }
        
        .instructions-modal-wrapper {
            width: 100%;
            max-width: 700px;
            margin: 0 auto;
        }
        
        .instructions-modal-content {
            position: relative;
            background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
            border: 3px solid #60a5fa;
            border-radius: 20px;
            padding: 40px 30px 30px;
            color: white;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
            transform: translateY(-30px);
            transition: transform 0.4s ease;
        }
        
        .instructions-modal-overlay.active .instructions-modal-content {
            transform: translateY(0);
        }
        
        .instructions-close-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            color: white;
            padding: 0;
        }
        
        .instructions-close-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: rotate(90deg);
        }
        
        .instructions-body {
            max-height: 70vh;
            overflow-y: auto;
            overflow-x: hidden;
            padding-right: 10px;
            -webkit-overflow-scrolling: touch;
        }
        
        .instructions-logo {
            max-width: 400px;
            width: 80%;
            display: block;
            margin: 0 auto 20px auto;
            filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
        }
        
        .subtitle-instruction {
            text-align: center;
            font-size: 1.1rem;
            margin-bottom: 25px;
            opacity: 0.9;
            color: white;
        }
        
        .ammo-warning,
        .combo-info {
            background: rgba(251, 191, 36, 0.15);
            padding: 12px;
            border-radius: 8px;
            margin-top: 15px;
            border-left: 4px solid #fbbf24;
        }
        
        .combo-info ul {
            margin: 10px 0 5px 20px;
            font-size: 0.9em;
        }
        
        .esc-hint {
            text-align: center;
            opacity: 0.7;
            font-size: 0.85rem;
            color: white;
        }
        
        .start-game-btn {
            background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
            color: white;
            border: 2px solid #60a5fa;
            padding: 15px 40px;
            font-size: 1.2rem;
            font-weight: 600;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
            min-width: 250px;
        }
        
        .start-game-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
        }
        
        .start-game-btn:active {
            transform: translateY(0);
        }

        /* Scrollbar personalizado para los modales */
        .modal-content::-webkit-scrollbar,
        .instructions-body::-webkit-scrollbar {
            width: 10px;
        }

        .modal-content::-webkit-scrollbar-track,
        .instructions-body::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 10px;
        }

        .modal-content::-webkit-scrollbar-thumb,
        .instructions-body::-webkit-scrollbar-thumb {
            background: rgba(96, 165, 250, 0.5);
            border-radius: 10px;
        }

        .modal-content::-webkit-scrollbar-thumb:hover,
        .instructions-body::-webkit-scrollbar-thumb:hover {
            background: rgba(96, 165, 250, 0.7);
        }
        
        /* Scrollbar más visible en móvil */
        @media (max-width: 768px) {
            .modal-content::-webkit-scrollbar,
            .instructions-body::-webkit-scrollbar {
                width: 8px;
            }
        }
        
        @media (max-width: 480px) {
            .modal-content::-webkit-scrollbar,
            .instructions-body::-webkit-scrollbar {
                width: 6px;
            }
        }
        
        /* Backdrop de Bootstrap modales (NO aplica al modal custom de instrucciones) */
        .modal-backdrop {
            z-index: 1050 !important;
        }

        .instruction-section {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            padding: 20px;
            border-radius: 12px;
            margin-bottom: 20px;
            border: 2px solid rgba(255, 255, 255, 0.2);
        }

        .instruction-section h3 {
            font-size: 1.5rem;
            margin-bottom: 15px;
            color: #fbbf24;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .instruction-section p,
        .instruction-section ul {
            font-size: 1rem;
            line-height: 1.8;
            margin-bottom: 10px;
        }

        .instruction-section ul {
            list-style: none;
            padding-left: 0;
        }

        .instruction-section li {
            padding: 8px 0;
            padding-left: 25px;
            position: relative;
        }

        .instruction-section li:before {
            content: "→";
            position: absolute;
            left: 0;
            color: #60a5fa;
            font-weight: bold;
        }

        .controls-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }

        .control-item {
            background: rgba(0, 0, 0, 0.3);
            padding: 15px;
            border-radius: 10px;
            text-align: center;
        }

        .control-key {
            display: inline-block;
            background: rgba(255, 255, 255, 0.2);
            padding: 8px 16px;
            border-radius: 8px;
            font-weight: 700;
            font-size: 1.1rem;
            margin-bottom: 8px;
            border: 2px solid rgba(255, 255, 255, 0.3);
        }

        .enemies-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-top: 15px;
        }

        .enemy-item {
            background: rgba(0, 0, 0, 0.3);
            padding: 15px;
            border-radius: 10px;
            text-align: center;
        }

        .enemy-icon {
            font-size: 2.5rem;
            margin-bottom: 8px;
        }
        
        .enemy-icon img {
            width: 50px;
            height: 50px;
            object-fit: contain;
            image-rendering: pixelated;
        }

        .powerups-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 12px;
            margin-top: 15px;
        }

        .powerup-item {
            background: rgba(0, 0, 0, 0.3);
            padding: 12px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

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

        .powerup-text {
            flex: 1;
            text-align: left;
        }

        .powerup-text strong {
            color: #fbbf24;
            font-size: 1.1rem;
        }

        .start-game-btn {
            width: 100%;
            background: linear-gradient(45deg, #dc2626, #991b1b);
            color: white;
            border: none;
            padding: 18px 40px;
            border-radius: 12px;
            font-size: 1.3rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 25px;
            box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
            text-transform: uppercase;
            letter-spacing: 2px;
            animation: pulse-button 2s ease-in-out infinite;
        }

        @keyframes pulse-button {
            0%, 100% {
                box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
                transform: scale(1);
            }
            50% {
                box-shadow: 0 8px 30px rgba(220, 38, 38, 0.8);
                transform: scale(1.02);
            }
        }

        .start-game-btn:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 25px rgba(220, 38, 38, 0.7);
            animation: none;
        }

        .start-game-btn:active {
            transform: translateY(-1px) scale(1);
        }

        @media (max-width: 768px) {
            .instructions-modal-overlay {
                padding: 70px 15px 15px;
            }
            
            .instructions-modal-wrapper {
                max-width: 95%;
            }
            
            .instructions-modal-content {
                padding: 35px 20px 25px;
            }
            
            .instructions-body {
                max-height: 65vh;
            }
            
            .instructions-logo {
                max-width: 300px;
            }
            
            .subtitle-instruction {
                font-size: 0.95rem;
                margin-bottom: 20px;
            }
            
            .instruction-section {
                padding: 15px;
                margin-bottom: 15px;
            }

            .controls-grid,
            .enemies-grid {
                grid-template-columns: 1fr 1fr;
                gap: 10px;
            }
            
            .control-item,
            .enemy-item {
                padding: 10px;
            }

            .instruction-section h3 {
                font-size: 1.1rem;
            }
            
            .instruction-section p,
            .instruction-section ul {
                font-size: 0.9rem;
            }
            
            .start-game-btn {
                padding: 14px 25px;
                font-size: 1rem;
                margin-top: 20px;
            }
            
            .max-level-display {
                margin-top: 15px;
                margin-bottom: 15px;
                padding: 12px 15px;
            }
            
            .max-level-display .level-text {
                font-size: 0.95rem;
            }
            
            .max-level-display #maxLevelDisplay {
                font-size: 1.2rem;
            }
            
            .max-level-display .bullets-info {
                margin-top: 10px;
                padding-top: 10px;
            }
            
            .max-level-display .bullets-info p {
                font-size: 0.88rem;
            }
            
            .max-level-display .bullets-info p:last-child {
                font-size: 0.83rem;
            }
            
            .controls-info {
                padding: 15px;
                margin-top: 15px;
            }
            
            .controls-info p {
                font-size: 0.85rem;
            }
        }
        
        @media (max-width: 480px) {
            .instructions-modal-overlay {
                padding: 60px 10px 10px;
            }
            
            .instructions-modal-content {
                padding: 30px 15px 20px;
            }
            
            .instructions-body {
                max-height: 55vh;
            }
            
            .instructions-logo {
                max-width: 200px;
            }

            .controls-grid,
            .enemies-grid {
                grid-template-columns: 1fr;
                gap: 10px;
            }

            .instruction-section h3 {
                font-size: 1rem;
            }
            
            .instruction-section ul {
                font-size: 0.85rem;
            }
            
            .control-item,
            .enemy-item {
                padding: 10px;
            }
            
            .control-key {
                font-size: 0.75rem;
                padding: 6px 10px;
            }
            
            .enemy-icon {
                font-size: 2rem;
            }
            
            .enemy-icon img {
                width: 40px;
                height: 40px;
            }
            
            .controls-info {
                padding: 12px;
                margin-top: 12px;
            }
            
            .controls-info p {
                font-size: 0.8rem;
                margin: 5px 0;
            }
        }
    


        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }
    
/* === INLINE STYLE CLASSES (extracted from HTML) === */

/* Loader */
.dg-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.dg-loader-content {
    text-align: center;
}

.dg-loader-logo {
    max-width: 400px;
    width: 80%;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

.dg-loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(96, 165, 250, 0.2);
    border-top: 5px solid #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.dg-loader-text {
    color: #60a5fa;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    animation: pulse 2s ease-in-out infinite;
}

/* Game wrapper init state */
.dg-wrapper-init {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Top bar logo wrap */
.dg-topbar-logo-wrap {
    display: flex;
    align-items: center;
}

/* Top bar logo override */
.dg-topbar-logo {
    max-width: 200px;
}

/* Combo next indicator */
.dg-combo-next {
    font-size: 0.7em;
    opacity: 0.8;
    margin-left: 8px;
    color: #fbbf24;
}

/* Powerup key hint */
.dg-powerup-key {
    opacity: 0.7;
    font-size: 0.85em;
}

/* Modal message */
.dg-modal-message {
    white-space: pre-line;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Hidden state (for toggling via JS) */
.dg-hidden-initial {
    display: none;
}

/* Gold text color */
.dg-gold {
    color: #fbbf24;
}

/* Muted text */
.dg-muted {
    opacity: 0.8;
}

/* Start button wrap */
.dg-start-wrap {
    text-align: center;
    margin-top: 30px;
}

/* Esc hint */
.dg-esc-hint-init {
    display: none;
    margin-top: 15px;
}

/* Loader animations (small style block) */
@keyframes dg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes dg-pulse-loader {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Auth toast inline styles (shared) */
.dg-rank-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dg-rank-value {
    font-size: 2.5rem;
    margin-top: 0.3rem;
}

/* Register button inline style */
.dg-register-btn {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: white;
}
