:root {
    --bg-color: #111;
}

body {
    margin: 0;
    background-color: #000;
    color: white;
    font-family: sans-serif;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 450px;
    height: 700px;
    border: 4px solid #555;
    display: flex;
    background: #222;
    overflow: hidden;
}

/* --- PERSONNAGES --- */

#boss {
    width: 130px;
    height: 130px;
    position: absolute;
    top: 40px; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background-image: url('boss.png'); 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: left 0.2s ease-out;
}

#player {
    width: 90px;  /* MODIFIÉ : Beaucoup plus grand (avant 60px) */
    height: 90px; /* MODIFIÉ */
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    transition: all 0.1s ease-out;
    background-image: url('player.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#player.attacking {
    transform: translateX(-50%) translateY(-40px) scale(1.2);
    filter: brightness(200%) drop-shadow(0 0 15px #00ffff);
}

/* --- DÉCORS (La Tour) --- */
#tower-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px; /* J'ai mis 180px pour qu'elle soit bien visible */
    z-index: 1;
    
    background-image: url('tower.png');
    background-size: contain; /* Garde les proportions (pas écrasé) */
    background-repeat: no-repeat;
    background-position: bottom center; /* Collé en bas */
    
    background-color: #333;
    border-top: 3px solid #555;
}

/* --- PROJECTILES & EFFETS --- */
.projectile {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #fff, #ffcc00);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%); 
    box-shadow: 0 0 10px #ffcc00;
    z-index: 5;
    transition: top 0s linear; 
}

.visual-note {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url('note.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
    animation: floatUp 0.8s ease-out;
    z-index: 20;
}

/* --- COULOIRS & INDICATEURS --- */
.lane { 
    flex: 1; 
    border-right: 1px dashed rgba(255,255,255,0.1); 
    position: relative; 
}
.lane:last-child { border-right: none; }

/* Les numéros 1, 2, 3 et flèches en bas */
.lane-indicator {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.4); /* Transparent */
    font-weight: bold;
    pointer-events: none;
    z-index: 5;
    text-shadow: 1px 1px 2px black;
}

.key-num {
    font-size: 40px;
    display: block;
    margin-bottom: -10px;
}

.key-arrow {
    font-size: 30px;
}

/* --- UI (INTERFACE) --- */
.ui-layer {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
    z-index: 100;
    pointer-events: none;
    display: flex;
    justify-content: space-between; 
    align-items: flex-start;
}

.score-container {
    text-align: left;
    text-shadow: 2px 2px 0 #000;
    font-size: 20px;
    font-weight: bold;
    color: gold;
}

.health-bar-container {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-shadow: 2px 2px 0 #000;
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.bar {
    width: 150px; 
    height: 15px;
    background: #555;
    margin-top: 5px; 
    border: 2px solid white;
}

#tower-hp-fill {
    width: 100%; 
    height: 100%;
    background: #00ff00;
    transition: width 0.2s;
}

/* --- MESSAGE NIVEAU UP --- */
#level-up-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff, 2px 2px 0 black;
    z-index: 150;
    display: none;
    pointer-events: none;
    font-family: sans-serif;
    text-transform: uppercase;
    text-align: center;
}

/* --- ÉCRAN GAME OVER --- */
#game-over {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}
button { padding: 15px 30px; font-size: 20px; cursor: pointer; background: gold; border: none; font-weight: bold; margin-top: 20px; }

/* --- ANIMATIONS --- */
@keyframes floatUp {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    100% { transform: translateY(-100px) scale(1.5); opacity: 0; }
}

@keyframes shakeScale {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    70% { transform: translate(-52%, -48%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.level-anim {
    animation: shakeScale 1.5s ease-out forwards;
}