body {
    background: url('opengates4backM.png') no-repeat center center fixed;
    background-size: cover;
    color: #00ffe1;
    font-family: monospace;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Header */
header h1 {
    text-align: center;
    margin: 5px;
    font-size: 3em;
    color: #00ffe1;
    text-shadow: 0 0 10px #00ffe1;
}

header h2 {
    text-align: center;
    margin: 5px;
    font-size: 1.2em;
    color: #00bcd4;
    text-shadow: 0 0 8px #00bcd4;
}

/* Oscillateurs horizontaux responsive */
#controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 95%;
    max-width: 1200px;
}

.module {
    flex: 1 1 18%; /* 5 modules par ligne approximativement */
    min-width: 120px;
    max-width: 200px;
    border: 1px solid #00ffe1;
    padding: 8px;
    background: rgba(17,17,17,0.85);
    border-radius: 5px;
    box-sizing: border-box;
}

/* Inputs, select et boutons */
input, select, button {
    background: rgba(17,17,17,0.85);
    color: #00ffe1;
    border: 1px solid #00ffe1;
    width: 100%;
    margin-top: 4px;
    border-radius: 3px;
    font-family: monospace;
}

/* Visualisation 3D et Portal */
#visualization {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    width: 95%;
    max-width: 1200px;
    margin-bottom: 10px;
}

#pyramid, #portal {
    flex: 1 1 48%;
    max-width: 100%;
    aspect-ratio: 1.5;
}

#visualization canvas {
    background: rgba(0,0,0,0.5);
    border: 1px solid #00ffe1;
    border-radius: 5px;
}

/* Spectre 2D audio en bas */
#visualizer {
    width: 95%;
    max-width: 1200px;
    height: 200px;
    background: rgba(0,0,0,0.5);
    border: 1px solid #00ffe1;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Global controls */
#globalControls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 1200px) {
    .module { flex: 1 1 22%; }
    #pyramid, #portal { flex: 1 1 100%; aspect-ratio: 1.2; }
    #visualizer { width: 95%; height: 150px; }
}

@media (max-width: 800px) {
    .module { flex: 1 1 45%; min-width: 100px; }
    #pyramid, #portal { width: 90%; height: auto; aspect-ratio: 1.1; }
    #visualizer { width: 90%; height: 120px; }
}

@media (max-width: 500px) {
    .module { flex: 1 1 90%; min-width: 80px; }
    #pyramid, #portal { width: 95%; height: auto; aspect-ratio: 1; }
    #visualizer { width: 95%; height: 100px; }
}
