body {
    background-color: #1a1a1a;
    color: #eee;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Header & Preset */
.preset-bar {
    width: 100%; max-width: 900px; margin-bottom: 10px;
    display: flex; gap: 10px; align-items: center;
    background: #2b2b2b; padding: 10px; border-radius: 8px; border: 1px solid #444;
    box-sizing: border-box;
}
.preset-bar label { font-weight: bold; color: #fff; white-space: nowrap; }
.preset-bar select {
    flex-grow: 1; font-size: 16px; padding: 8px;
    background: #111; color: #fff; border: 1px solid #555; cursor: pointer;
}

.synth-container {
    background: #2b2b2b; padding: 20px; border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.6); border: 1px solid #444;
    max-width: 900px; width: 100%;
    box-sizing: border-box;
}

.status-bar {
    margin-bottom: 15px; padding: 5px; background: #000; color: #0f0;
    font-family: monospace; text-align: center; font-size: 12px; border-radius: 4px;
}
.indicators-row {
    text-align: center; font-size: 11px; color: #aaa; margin-bottom: 10px;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.control-group {
    background: #3a3a3a; padding: 12px; border-radius: 6px; border-top: 3px solid #555;
}

.g-osc1 { border-top-color: #ff5555; }
.g-osc2 { border-top-color: #ff8855; }
.g-filter { border-top-color: #55ff55; }
.g-env { border-top-color: #5555ff; }
.g-fx { border-top-color: #ff55ff; }
.g-master { border-top-color: #ffffff; }

h3 { margin: 0 0 10px 0; font-size: 14px; color: #ddd; display: flex; justify-content: space-between; }
label { display: block; margin-bottom: 2px; font-size: 11px; color: #aaa; }

input[type=range] { 
    width: 100%; cursor: pointer; margin-bottom: 8px; height: 6px; 
    border-radius: 3px; background: #555; outline: none; -webkit-appearance: none; 
}
input[type=range]::-webkit-slider-thumb { 
    -webkit-appearance: none; width: 14px; height: 14px; background: #fff; border-radius: 50%; 
}

select { width: 100%; padding: 4px; background: #222; color: #fff; border: 1px solid #555; border-radius: 4px; margin-bottom: 5px;}
.opt-sample { color: #0cf; font-weight: bold; }
.lbl-lpg { color: #55ff55; }
.checkbox-row { margin-top: 10px; font-size: 11px; display: flex; align-items: center; }
.checkbox-row input { margin-right: 5px; }

/* Sampler Section */
.sampler-section {
    background: #222;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #00ccff;
    margin-top: 20px;
    position: relative;
}
.sampler-section h3 { margin: 0 0 10px 0; color: #00ccff; font-size: 16px; border-bottom: 1px solid #333; padding-bottom: 5px; }

.wave-label-row {
    display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 2px;
}

.waveform-container {
    position: relative;
    width: 100%;
    background: #000;
    border: 1px dashed #444;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.overview-container { height: 60px; margin-bottom: 2px; border-color: #666; }
.zoomed-container { height: 120px; margin-bottom: 5px; border-color: #00ccff; }
.waveform-container.dragover { border-color: #00ccff; background: #112233; }

canvas { width: 100%; height: 100%; display: block; }
.overlay-text { position: absolute; pointer-events: none; color: #666; font-size: 14px; }

/* Sliders */
.full-width-slider-group {
    width: 100%;
    margin-bottom: 20px;
    background: #2a2a2a;
    padding: 10px;
    border-radius: 4px;
    box-sizing: border-box;
}
.slider-label-row { display: flex; justify-content: space-between; font-size: 11px; color: #ccc; margin-bottom: 2px; }

input[type=range].slider-yellow { background: #333; height: 6px; margin-bottom: 2px; }
input[type=range].slider-yellow::-webkit-slider-thumb { background: #ffcc00; width: 12px; height: 12px; border: 1px solid #000; }

input[type=range].slider-green { background: #333; height: 8px; }
input[type=range].slider-green::-webkit-slider-thumb { background: #0f0; width: 16px; height: 16px; border: 2px solid #000; }

input[type=range].slider-red { background: #333; height: 8px; }
input[type=range].slider-red::-webkit-slider-thumb { background: #f00; width: 16px; height: 16px; border: 2px solid #000; }

/* Sampler Controls */
.sampler-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    border-top: 1px solid #333;
    padding-top: 15px;
}
.col { display: flex; flex-direction: column; }

input[type=file] { display: none; }
.file-btn {
    background: #444; color: #fff; padding: 6px 10px; border-radius: 4px; cursor: pointer;
    font-size: 12px; display: block; text-align: center; border: 1px solid #666; margin-bottom: 5px;
}
.file-btn:hover { background: #555; }

.loop-select {
    width: 100%; padding: 4px; font-size: 12px;
    background: #333; color: #fff; border: 1px solid #555; border-radius: 4px;
}

/* Colors & Helpers */
.txt-green { color: #0f0; }
.txt-red { color: #f00; }
.txt-cyan { color: #00ccff; }
.txt-yellow { color: #ffcc00; font-weight: bold; }
.txt-sub { font-size: 10px; color: #aaa; text-align: right; }
#s-info { font-size: 11px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.indicator { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #333; margin-left: 5px; }
.indicator.active { background: #0f0; box-shadow: 0 0 5px #0f0; }

button#init-btn {
    background: linear-gradient(45deg, #007bff, #00d4ff);
    color: white; border: none; padding: 20px 40px;
    font-size: 18px; border-radius: 50px; cursor: pointer; margin-bottom: 20px;
}
.hidden { display: none; }