:root {
    /* Palette */
    --bg-dark: #0a0a12;
    --glass-bg: rgba(15, 15, 25, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    /* Accents */
    --accent-blue: #0d47a1; 
    --accent-glow: #1565c0;
    --slider-fill: #2196f3;
    
    /* Text */
    --text-main: #e0e0e0;
    --text-muted: #6c757d;
    --header-gradient: linear-gradient(90deg, #ffffff, #90caf9);
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% -20%, #11111f, #000000);
    color: var(--text-main);
    font-family: 'Fira Code', monospace;
    user-select: none;
}

body.drawing-mode, 
body.drawing-mode canvas {
    cursor: crosshair !important;
}

/* --- UI COMPONENTS: Menu Toggle --- */
#menu-toggle {
    position: absolute;
    top: 25px; left: 25px;
    z-index: 200;
    background: rgba(10, 10, 10, 0.6);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    font-size: 20px;
    width: 45px; height: 45px;
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.3s ease;
}
#menu-toggle:hover {
    border-color: var(--slider-fill);
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.2);
}

/* --- SIDEBAR LAYOUT --- */
#sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 320px; height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 90px 30px 30px 30px;
    transform: translateX(-105%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-sizing: border-box;
    overflow-y: auto; 
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#sidebar::-webkit-scrollbar { display: none; }
#sidebar.open { transform: translateX(0); }

h2 {
    margin: 0 0 30px 0;
    font-weight: 600;
    font-size: 28px;
    background: var(--header-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- BUTTONS --- */
.action-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(2px);
}

/* Specific Button Styles */
#drawBtn {
    background: linear-gradient(145deg, #6441a5, #2a0845);
    color: #fff;
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.2);
}
#drawBtn:hover, #drawBtn.active {
    background: linear-gradient(145deg, #302b63, #0f0c29);
    box-shadow: 0 0 15px rgba(83, 4, 209, 0.4);
}
#drawBtn.active {
    background: #fff;
    color: #000;
    box-shadow: 0 0 20px #fff;
    border-color: #fff;
}

#regenBtn {
    background: linear-gradient(145deg, #0d47a1, #2196f3);
    border-color: rgba(255,255,255,0.1);
}
#regenBtn:hover {
    background: linear-gradient(145deg, #1565c0, #42a5f5);
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.3);
}

.action-btn.is-danger {
    background: linear-gradient(145deg, #300, #500);
    color: #ffcccc;
    border-color: rgba(255, 0, 0, 0.2);
}
.action-btn.is-danger:hover {
    background: linear-gradient(145deg, #500, #800);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.2);
}

/* --- SLIDERS & INPUTS --- */
.slider-container { margin-bottom: 25px; }

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.slider-header label {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.value-display {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 35px;
    text-align: center;
}

input[type=range] {
    appearance: button;
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 4px;
    border-radius: 2px;
    cursor: pointer;
    background: 
        linear-gradient(90deg, 
            transparent calc(var(--default-pos) - 1px), 
            rgba(255, 255, 255, 0.8) calc(var(--default-pos) - 1px), 
            rgba(255, 255, 255, 0.8) calc(var(--default-pos) + 1px), 
            transparent calc(var(--default-pos) + 1px)
        ),
        linear-gradient(to right, 
            var(--slider-fill) 0%, 
            var(--slider-fill) var(--progress, 0%), 
            #333 var(--progress, 0%), 
            #333 100%
        );
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px; width: 16px;
    border-radius: 50%;
    background: #e0e0e0;
    margin-top: -6px; 
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* --- WIND WIDGET --- */
.wind-circle-container {
    display: flex; flex-direction: column; align-items: center;
    margin: 20px 0; padding: 20px;
    background: rgba(0, 0, 0, 0.2); 
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}
#windControl {
    width: 60px; height: 60px;
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 50%;
    position: relative;
    cursor: crosshair;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8); 
    background: transparent;
}
#windDot {
    width: 6px; height: 6px;
    background: #2196f3;
    border-radius: 50%;
    position: absolute;
    top: 50%; left: 50%;
    margin-top: -3px; margin-left: -3px; 
    pointer-events: none;
    box-shadow: 0 0 10px #2196f3;
}
.small-label {
    font-size: 10px; letter-spacing: 2px;
    color: #666; margin-top: 15px;
    font-weight: 600; text-transform: uppercase;
}

/* --- SWITCHES --- */
.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333;
    transition: .4s; border-radius: 20px;
}
.slider:before {
    position: absolute; content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background-color: #888;
    transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-blue); }
input:checked + .slider:before { transform: translateX(20px); background-color: #fff; }

/* --- ACCORDIONS --- */
details {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}
details[open] {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}
summary {
    list-style: none; padding: 15px;
    cursor: pointer; font-size: 11px;
    font-weight: 600; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-muted);
    display: flex; justify-content: space-between; align-items: center;
    user-select: none; outline: none;
    transition: background 0.2s;
}
summary::-webkit-details-marker { display: none; }
summary:hover {
    color: #fff; background: rgba(255, 255, 255, 0.05);
}
summary::after {
    content: '›'; font-size: 16px; margin-left: 10px;
    color: var(--text-muted);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
details[open] summary::after { transform: rotate(90deg); color: #fff; }
.accordion-content { padding: 0 15px; overflow: hidden; }
.accordion-inner { padding: 15px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }

/* --- HUD --- */
#instructions {
    position: absolute; bottom: 30px; width: 100%;
    text-align: center; pointer-events: none; z-index: 10;
    opacity: 0.6; font-size: 12px; letter-spacing: 0.5px;
}