body {
    background-color: #0a0f1e;
    color: #f8fafc;
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#main-header {
    width: 100%;
    padding: 10px 0;
    text-align: center;
    background: rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid #1e293b;
}

#main-header h1 {
    margin: 0;
    font-size: 1.6rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

#main-container {
    display: flex;
    width: 100%;
    flex: 1;
    align-items: center;
    min-height: 0;
}

/* Panneau de gauche */
#left-panel {
    width: 20%;
    padding: 20px;
    background: rgba(255,255,255,0.02);
    height: 100%;
}

.control-group h3 { color: #38bdf8; font-size: 0.9rem; margin-bottom: 20px; }

input[type=range] { width: 100%; accent-color: #38bdf8; margin: 10px 0; }

.instruction-box {
    margin-top: 30px;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
    padding: 10px;
    border-left: 2px solid #38bdf8;
}

/* Zone Centrale */
#builder-zone {
    width: 60%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#mainCanvas {
    max-height: 60vh;
    max-width: 95%;
    background: #fdfdfd; /* Fond clair pour la lisibilité de la piste */
    border-radius: 10px;
}

#controls { margin-top: 20px; }

#controls button {
    padding: 10px 20px;
    margin: 0 5px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    font-size: 0.8rem;
}

/* Zone Énergie à droite */
#info-zone { 
    width: 20%; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    padding: 20px;
}

#info-title { font-size: 1.1rem; color: #38bdf8; margin-bottom: 30px; }

.energy-gauges {
    display: flex;
    gap: 15px;
    height: 250px;
}

.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40px;
}

.bar-bg {
    width: 15px;
    height: 180px;
    background: #1e293b;
    border: 1px solid #334155;
    position: relative;
    border-radius: 30px;
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    position: absolute;
    bottom: 0;
    height: 0%;
    transition: height 0.1s ease-out;
}

#pot-f { background: #2ecc71; }
#kin-f { background: #e74c3c; }
#mec-f { background: #38bdf8; }
#th-f { background: #fbbf24; }

.label { font-size: 0.75rem; margin-top: 8px; font-weight: bold; }
.val { font-size: 0.7rem; color: #94a3b8; font-family: monospace; }

/* Responsive pour mobiles */
@media (max-width: 768px) {
    #main-container {
        flex-direction: column;
        height: auto;
    }
    #left-panel, #builder-zone, #info-zone {
        width: 100%;
        height: auto;
    }
    #left-panel {
        order: 1;
        padding: 10px;
    }
    #builder-zone {
        order: 2;
        padding: 10px;
    }
    #info-zone {
        order: 3;
        padding: 10px;
    }
    #mainCanvas {
        max-height: 50vh;
        width: 100%;
    }
    .energy-gauges {
        flex-direction: row;
        justify-content: space-around;
        height: auto;
    }
    .gauge-container {
        width: auto;
    }
}