@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:optional; src:url('../../public/fonts/inter-v20-latin-regular.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:optional; src:url('../../public/fonts/inter-v20-latin-600.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:optional; src:url('../../public/fonts/inter-v20-latin-700.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:800; font-display:optional; src:url('../../public/fonts/inter-v20-latin-800.woff2') format('woff2'); }

        :root {
            --bg-primary: #06060b;
            --accent-cyan: #00f0ff;
            --accent-violet: #7b2ff7;
            --accent-magenta: #ff006e;
            --accent-yellow: #ffd700;
            --accent-green: #00ff88;
            --border-subtle: rgba(255, 255, 255, 0.06);
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body { 
            background-color: var(--bg-primary); color: white; 
            font-family: 'Inter', sans-serif; overflow: hidden; 
            touch-action: none; user-select: none;
            transition: filter 0.5s ease;
        }

        /* --- EFFETS VISUELS GLOBAUX --- */
        .crt::before {
            content: " "; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
            background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
            z-index: 20; background-size: 100% 2px, 3px 100%; pointer-events: none;
        }
        .crt::after {
            content: " "; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
            background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.4) 100%);
            z-index: 21; pointer-events: none;
        }
        
        #darkWebOverlay {
            position: absolute; inset: 0; pointer-events: none; z-index: 19; opacity: 0;
            background: radial-gradient(circle at 50% 80%, transparent 10%, #000 60%);
            transition: opacity 1s ease;
        }
        #darkWebOverlay.active { opacity: 1; }

        body.wipe-mode { filter: grayscale(100%) contrast(150%) brightness(80%); }
        body.wipe-mode #gameCanvas { filter: invert(1); }
        
        #gameContainer { position: relative; width: 100vw; height: 100vh; }
        #gameCanvas { display: block; width: 100%; height: 100%; background: #06060b; }

        /* --- NOUVELLE UI LAYER (ALIGNEMENT PARFAIT) --- */
        .ui-layer {
            position: absolute; top: 20px; left: 0; right: 0; padding: 0 30px;
            display: flex; justify-content: space-between; align-items: flex-start;
            pointer-events: none; z-index: 25;
        }

        .center-hud {
            display: flex; flex-direction: column; align-items: center; gap: 15px;
        }

        #header-404 { text-align: center; pointer-events: none; }
        #header-404 h1 { font-family: 'Press Start 2P', monospace; font-size: 1.5rem; color: var(--accent-magenta); text-shadow: 2px 2px 0px var(--accent-cyan); margin-bottom: 5px; }
        #header-404 p { font-size: 0.9rem; color: #c0c0d1; margin-bottom: 5px; display: none; /* Masqué pendant le jeu pour alléger l'UI */ }
        .realtime-pulse { display: inline-block; font-size: 0.75rem; font-family: 'Press Start 2P', monospace; color: var(--accent-green); text-shadow: 0 0 8px var(--accent-green); animation: pulse 1.5s infinite; }
        
        #bossHud {
            width: 300px; text-align: center; font-family: 'Press Start 2P', monospace;
            opacity: 0; visibility: hidden; transition: opacity 0.5s;
        }
        #bossHud.active { opacity: 1; visibility: visible; }
        #bossName { font-size: 0.8rem; color: #ff006e; margin-bottom: 10px; text-shadow: 0 0 10px #ff006e; }
        .boss-bar-bg { width: 100%; height: 20px; background: rgba(0,0,0,0.8); border: 2px solid #ff006e; border-radius: 10px; overflow: hidden; }
        .boss-bar-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff006e, #7b2ff7); transition: width 0.1s; }

        .hud-box {
            background: rgba(16, 16, 26, 0.85); border: 1px solid rgba(0, 240, 255, 0.3);
            border-radius: 12px; padding: 15px 25px; backdrop-filter: blur(5px);
            font-family: 'Press Start 2P', monospace; box-shadow: 0 0 20px rgba(0, 240, 255, 0.1); position: relative;
        }

        .score-title { font-size: 0.6rem; color: #9a9ab0; margin-bottom: 8px; line-height: 1.5; }
        .score-value { font-size: 1.2rem; color: var(--accent-cyan); text-shadow: 0 0 10px var(--accent-cyan); transition: color 0.3s; }
        .level-display { font-size: 0.8rem; color: var(--accent-yellow); margin-top: 10px; }
        
        #comboContainer {
            position: absolute; right: -20px; top: 50%; transform: translateY(-50%) rotate(5deg);
            font-size: 1.5rem; color: var(--accent-yellow); text-shadow: 0 0 15px var(--accent-yellow); opacity: 0; transition: opacity 0.2s, transform 0.1s;
        }
        #comboContainer.active { opacity: 1; transform: translateY(-50%) rotate(0deg) scale(1.2); }
        #comboBarBg { width: 100%; height: 4px; background: rgba(255,255,255,0.1); margin-top: 10px; border-radius: 2px; }
        #comboBarFill { height: 100%; width: 0%; background: var(--accent-yellow); transition: width 0.1s linear; }

        .health-bar-bg { width: 200px; height: 14px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; margin-top: 8px; border: 1px solid rgba(255,0,110,0.3); }
        .health-bar-fill { height: 100%; width: 100%; background: var(--accent-magenta); box-shadow: 0 0 10px var(--accent-magenta); transition: width 0.2s ease; }
        .lives-display { margin-top: 10px; font-size: 0.8rem; letter-spacing: 2px;}

        /* --- ÉVÉNEMENTS SPÉCIAUX --- */
        #warningOverlay { position: absolute; inset: 0; background: rgba(255,0,0,0.2); z-index: 8; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
        #warningOverlay.active { opacity: 1; animation: flashWarning 1s infinite; }
        @keyframes flashWarning { 0% { opacity: 0.1; } 50% { opacity: 0.4; } 100% { opacity: 0.1; } }
        
        #glitchScreen { position: absolute; inset: 0; pointer-events: none; z-index: 22; }

        /* --- MODALES --- */
        .modal-overlay {
            position: fixed; inset: 0; background: rgba(6, 6, 11, 0.9); backdrop-filter: blur(8px);
            display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; visibility: hidden; transition: all 0.4s ease;
        }
        .modal-overlay.active { opacity: 1; visibility: visible; }
        
        .retro-card {
            text-align: center; font-family: 'Press Start 2P', monospace; padding: 40px; border: 4px solid var(--accent-cyan); background: #000; 
            box-shadow: 0 0 30px var(--accent-cyan), inset 0 0 20px var(--accent-cyan); max-width: 800px; width: 90%; pointer-events: auto;
        }
        
        .retro-title { font-size: 2.2rem; color: #fff; text-shadow: 3px 3px 0 var(--accent-magenta), -3px -3px 0 var(--accent-cyan); line-height: 1.4; margin-bottom: 20px;}
        .retro-title span { color: var(--accent-yellow); text-shadow: none; font-size: 1.8rem; }
        .retro-text { color: #fff; font-size: 0.8rem; line-height: 2; margin-bottom: 25px; }

        .controls-box {
            background: rgba(0, 240, 255, 0.1); border: 1px solid var(--accent-cyan);
            padding: 20px; border-radius: 8px; color: var(--accent-cyan); font-size: 0.8rem; font-family: 'Inter', sans-serif;
            margin: 0 auto 30px auto; line-height: 1.8; max-width: 400px; box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
        }

        .btn-retro {
            background: var(--accent-cyan); color: #000; font-family: 'Press Start 2P', monospace; border: none; padding: 15px 30px; font-size: 1rem; cursor: pointer;
            box-shadow: 0 0 15px var(--accent-cyan); margin-top: 10px; transition: all 0.2s;
        }
        .btn-retro:hover, .btn-retro:focus { background: #fff; box-shadow: 0 0 25px #fff; transform: scale(1.05); outline: none; color: #000 !important; }

        .btn-audio {
            position: absolute; bottom: 20px; right: 20px; background: rgba(16, 16, 26, 0.85); border: 1px solid var(--accent-cyan);
            border-radius: 50%; width: 45px; height: 45px; color: var(--accent-cyan); font-size: 1.2rem; cursor: pointer; z-index: 100;
            display: flex; align-items: center; justify-content: center; pointer-events: auto; transition: all 0.2s ease; box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
        }
        .btn-audio:hover { background: var(--accent-cyan); color: #000; transform: scale(1.1); box-shadow: 0 0 20px rgba(0, 240, 255, 0.5); }

        .modern-card {
            background: #10101a; border: 1px solid var(--accent-violet); border-radius: 20px; padding: 50px 40px; text-align: center;
            max-width: 600px; width: 90%; box-shadow: 0 20px 50px rgba(123,47,247,0.3); font-family: 'Inter', sans-serif; pointer-events: auto;
        }
        .modern-card h2 {
            font-size: 2.5rem; margin-bottom: 15px; font-weight: 900; background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
            background-clip: text; -webkit-background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
        }
        .modern-card p { color: #c0c0d1; line-height: 1.6; margin-bottom: 25px; font-size: 1.05rem; }
        
        .coupon-box {
            background: rgba(0, 240, 255, 0.1); border: 2px dashed var(--accent-cyan); padding: 20px; font-size: 2.5rem; font-weight: 900; color: var(--accent-cyan);
            letter-spacing: 5px; margin-bottom: 10px; border-radius: 10px; font-family: 'Press Start 2P', monospace; text-shadow: 0 0 15px var(--accent-cyan);
        }

        .btn-modern {
            display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 18px; background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
            color: #06060b; text-decoration: none; font-weight: 800; font-size: 1.1rem; border-radius: 10px; border: none; cursor: pointer; margin-bottom: 15px; transition: transform 0.2s;
        }
        .btn-modern:hover, .btn-modern:focus { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(123, 47, 247, 0.4); outline: 2px solid var(--accent-cyan); }
        
        .input-pseudo {
            width: 100%; padding: 15px; background: rgba(0,0,0,0.5); border: 1px solid var(--accent-cyan); color: white; border-radius: 8px; margin-bottom: 15px; font-family: 'Press Start 2P', monospace; font-size: 0.8rem; text-align: center;
        }
        .input-pseudo:focus { outline: none; box-shadow: 0 0 15px rgba(0, 240, 255, 0.3); }

        @keyframes shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-3px, -2px); } }
        .shake { animation: shake 0.3s cubic-bezier(.36,.07,.19,.97) both; }
        
        #flashOverlay { position: absolute; inset: 0; background: white; z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.5s ease-out; }
        #flashOverlay.active { opacity: 1; transition: none; }
        #playerSprite { display: none; }

        @media (max-width: 600px) {
            .ui-layer { flex-direction: column; gap: 10px; align-items: center; padding: 10px; }
            .retro-card { padding: 25px 15px; } .retro-title { font-size: 1.4rem; margin-bottom: 15px; text-shadow: 2px 2px 0 var(--accent-magenta), -2px -2px 0 var(--accent-cyan); } .retro-title span { font-size: 1.1rem; } .retro-text { font-size: 0.7rem; margin-bottom: 15px; line-height: 1.6; } .controls-box { padding: 15px; margin-bottom: 15px; font-size: 0.7rem; } .btn-retro { padding: 12px 15px; font-size: 0.8rem; width: 100%; } .modern-card { padding: 30px 20px; } .modern-card h2 { font-size: 1.8rem; } .coupon-box { font-size: 1.8rem; padding: 15px; } .btn-audio { bottom: 10px; width: 35px; height: 35px; font-size: 1rem; }
            #pauseToggle { right: 55px; }
            #audioToggle { right: 10px; }
        }

/* --- INLINE STYLE OVERRIDES (remplace tous les style="" du HTML) --- */
#healthHud { border-color: rgba(255, 0, 110, 0.3); }
#healthHud .score-title { color: var(--accent-magenta); font-family: 'Inter', sans-serif; }

#pauseToggle { right: 80px; }

#transitionModal .retro-card { border-color: var(--accent-yellow); box-shadow: 0 0 30px var(--accent-yellow); }
#transitionModal .retro-title { color: var(--accent-yellow); text-shadow: none; }
#btnNextLevel { background: var(--accent-yellow); }

#winFinalModal .modern-card { border-color: var(--accent-green); }
#winFinalModal .modern-card h2 { background: var(--accent-green); background-clip: text; -webkit-background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
#winFinalModal .coupon-box { color: var(--accent-green); border-color: var(--accent-green); text-shadow: 0 0 15px var(--accent-green); }
.win-discount-note { font-size: 0.85rem; color: #9a9ab0; }
#btnLeaderboardWin { margin-bottom: 15px; }
.btn-modern--ghost { background: transparent; border: 1px solid var(--accent-cyan); color: white; }

#loseModal .retro-card { border-color: var(--accent-magenta); box-shadow: 0 0 30px var(--accent-magenta); }
#loseModal .retro-title { color: var(--accent-magenta); text-shadow: none; }
#btnRetry { background: var(--accent-magenta); color: white; width: 100%; margin-bottom: 15px; }
#btnLeaderboardLose { background: transparent; border: 1px solid var(--accent-cyan); color: var(--accent-cyan); width: 100%; }

#leaderboardModal .modern-card { border-color: var(--accent-cyan); }
#leaderboardTitle { font-size: 1.8rem; margin-bottom: 25px; }
#scoreInputSection { margin-bottom: 30px; }
.score-input-label { font-size: 0.9rem; margin-bottom: 15px; }
#finalScoreDisplay { color: var(--accent-cyan); font-weight: bold; font-family: 'Press Start 2P', monospace; }
#highScoresList { font-family: 'Press Start 2P', monospace; font-size: 0.75rem; color: var(--accent-yellow); text-align: left; background: rgba(0, 0, 0, 0.5); padding: 20px; border-radius: 8px; line-height: 2; }
#btnCloseLeaderboard { margin-top: 25px; background: transparent; border: 1px solid rgba(255, 255, 255, 0.06); color: white; }