* { 
    box-sizing: border-box; 
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #050505;
    color: white;
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
    touch-action: none; 
}

#gameArea {
    flex-grow: 1; 
    width: 100%;
    position: relative;
    background: #000;
    overflow: hidden;
    display: flex;            
    justify-content: center;  
    align-items: flex-start;      
}

#mobileControls {
    display: none; 
    height: 180px; 
    width: 100%;
    background: #111;
    border-top: 2px solid #333;
    padding: 10px 20px 30px 20px;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 20;
}

canvas {
    display: block;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    width: 100%;
    height: 100%;
    object-fit: contain; 
    touch-action: none; 
}

#ui {
    display: none; 
    position: absolute;
    top: 10px;             
    left: 0;
    width: 100%;
    padding: 0 15px;
    font-size: 14px;      
    font-weight: bold;   
    text-shadow: 2px 2px 0 #000; 
    pointer-events: none; 
    z-index: 10;
    justify-content: space-between;
    align-items: flex-start; 
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
}

/* --- HUD BONUS MICRO (v1.0.4 Final) --- */
#bonusContainer {
    position: absolute;
    right: 2px;       /* Collé au bord extrême droit */
    top: 40px;        /* Juste en dessous du texte SCORE */
    width: 30px;      /* Conteneur très étroit */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;         /* Espace minime entre les carrés */
}

.bonus-tag {
    /* FORMAT MICRO CARRÉ */
    width: 28px;
    height: 28px;
    
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid;
    border-radius: 3px;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    box-shadow: 0 1px 3px rgba(0,0,0,1);
    
    /* Animation retirée pour éviter le clignotement lors de la mise à jour du timer */
    /* animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); */
}

/* Titre (SPD/X3) */
.bonus-label {
    font-size: 7px; 
    line-height: 7px;
    opacity: 0.9;
    margin-bottom: 1px;
}

/* Timer (Chiffre) */
.bonus-val {
    font-size: 11px;
    font-weight: bold;
    line-height: 11px;
}

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

.hp-warning { color: #f00; animation: blink 0.5s infinite; }
@keyframes blink { 50% { opacity: 0.5; } }

.btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #555;
    border-radius: 50%;
    color: white;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation; 
}
.btn:active { background: rgba(255, 255, 255, 0.3); border-color: #fff; }
.d-pad { display: flex; gap: 20px; }
.btn-arrow { width: 80px; height: 80px; }
.btn-fire { 
    width: 90px; height: 90px;
    border-color: #f44; 
    background: rgba(255, 0, 0, 0.15);
    font-size: 18px;
    font-weight: bold;
}
.btn-fire:active { background: rgba(255, 0, 0, 0.5); }
