body {
    margin: 0;
    background: #000;
    color: #eee;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    display: flex;
    width: 100vw;
    height: 100vh;
}

#controls {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    padding: 20px;
    background: #1a1a1a;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.7);
    z-index: 10;
    box-sizing: border-box;
    border-right: 1px solid #333;
}

#controls::-webkit-scrollbar {
    width: 6px;
}

#controls::-webkit-scrollbar-track {
    background: #1a1a1a;
}

#controls::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

#controls::-webkit-scrollbar-thumb:hover {
    background: #444;
}

canvas {
    flex-grow: 1;
    height: 100vh;
    width: 0;
    cursor: crosshair;
    touch-action: none;
}

details {
    background: #242424;
    border: 1px solid #333;
    border-radius: 6px;
    margin-bottom: 12px;
    padding: 0;
    transition: all 0.2s ease;
    overflow: hidden;
}

details[open] {
    background: #2a2a2a;
    border-color: #444;
}

details details {
    margin: 5px 10px 10px 10px;
    background: #1e1e1e;
}

summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    color: #00ffcc;
    text-transform: uppercase;
    padding: 12px 15px;
    outline: none;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.03);
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '▶';
    font-size: 8px;
    transition: transform 0.2s;
}

details[open] summary::after {
    transform: rotate(90deg);
}

summary:hover {
    color: #fff;
    background: #333;
    border-radius: 4px;
}

.slider-group {
    padding: 15px;
    border-top: 1px solid #333;
}

.slider-group:first-of-type {
    border-top: none;
}

label {
    display: block;
    font-size: 10px;
    margin-bottom: 8px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

input[type=range] {
    flex-grow: 1;
    margin: 0;
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    cursor: pointer;
    background: #444;
    border-radius: 1px;
}

input[type=range]::-webkit-slider-thumb {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #00ffcc;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 0 5px rgba(0, 255, 204, 0.3);
}

select {
    width: 100%;
    padding: 6px;
    background: #333;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 12px;
}

input[type=color] {
    width: 100%;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

.val {
    flex-shrink: 0;
    color: #00ffcc;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
    padding: 2px 5px;
    width: 55px;
    text-align: right;
    border-radius: 3px;
}

#resizer:hover {
    background: #00ffcc !important;
}

h2 {
    margin: 0 0 5px 0;
    font-size: 22px;
    color: #00ffcc;
    font-weight: 300;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 11px;
    color: #666;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

button {
    width: 100%;
    padding: 12px;
    cursor: pointer;
    background: #333;
    color: #fff;
    border: 1px solid #444;
    margin-top: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
}

button:hover {
    background: #00ffcc;
    color: #000;
    border-color: #00ffcc;
}

button.danger {
    background: #400;
}

button.danger:hover {
    background: #f00;
    color: #fff;
}

button.secondary {
    background: #223;
}

button.secondary:hover {
    background: #4466aa;
    color: #fff;
}

.desc {
    font-size: 11px;
    color: #777;
    margin-top: 6px;
    line-height: 1.5;
    background: #222;
    padding: 8px;
    border-left: 2px solid #444;
    border-radius: 2px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
    font-size: 11px;
}

/* Tooltips */
.tooltip-trigger {
    border-bottom: 1px dotted #00ffcc;
    cursor: help;
    position: relative;
    display: inline-block;
}

.tooltip {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 10px;
    text-transform: none;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: 1px solid #444;
}

.tooltip-trigger:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

input[type=checkbox] {
    cursor: pointer;
    accent-color: #00ffcc;
}
