@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#controls {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    background: linear-gradient(135deg, rgba(10, 15, 25, 0.95) 0%, rgba(5, 10, 20, 0.98) 100%);
    border: 1px solid rgba(100, 180, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 0 40px rgba(0, 100, 200, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 100;
    max-height: 90vh;
    overflow-y: auto;
}

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

#controls::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

#controls::-webkit-scrollbar-thumb {
    background: rgba(100, 180, 255, 0.3);
    border-radius: 2px;
}

#controls h2 {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 2px;
    color: rgba(150, 200, 255, 0.9);
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
}

.control-group {
    margin-bottom: 16px;
}

.control-group label {
    display: block;
    font-size: 10px;
    letter-spacing: 1px;
    color: rgba(180, 200, 220, 0.7);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.control-group input[type="range"] {
    width: calc(100% - 50px);
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(100, 150, 200, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    vertical-align: middle;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #5af 0%, #38f 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(80, 160, 255, 0.5);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(80, 160, 255, 0.8);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #5af 0%, #38f 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(80, 160, 255, 0.5);
}

.control-group .value {
    display: inline-block;
    width: 45px;
    text-align: right;
    font-size: 11px;
    color: rgba(100, 200, 255, 0.9);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: rgba(100, 150, 200, 0.1);
    border: 1px solid rgba(100, 180, 255, 0.25);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-group input[type="checkbox"]:checked {
    background: linear-gradient(135deg, rgba(80, 160, 255, 0.4) 0%, rgba(60, 140, 255, 0.3) 100%);
    border-color: rgba(100, 180, 255, 0.5);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(150, 220, 255, 0.95);
    font-size: 12px;
}

.checkbox-group .checkbox-label {
    font-size: 11px;
    letter-spacing: 0.5px;
    color: rgba(180, 200, 220, 0.8);
}

.control-section {
    margin: 20px 0 12px 0;
    padding-top: 15px;
    border-top: 1px solid rgba(100, 180, 255, 0.1);
}

.control-section h3 {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: rgba(100, 180, 255, 0.6);
    text-transform: uppercase;
    margin: 0;
}

#resetBtn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(80, 160, 255, 0.15) 0%, rgba(60, 140, 255, 0.1) 100%);
    border: 1px solid rgba(100, 180, 255, 0.25);
    border-radius: 6px;
    color: rgba(150, 200, 255, 0.9);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

#resetBtn:hover {
    background: linear-gradient(135deg, rgba(80, 160, 255, 0.25) 0%, rgba(60, 140, 255, 0.2) 100%);
    border-color: rgba(100, 180, 255, 0.4);
    box-shadow: 0 0 20px rgba(80, 160, 255, 0.2);
}

#stats {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 11px;
    color: rgba(100, 180, 255, 0.5);
    letter-spacing: 1px;
    z-index: 100;
}

#startBtn {
    position: fixed;
    /* Position will be set dynamically by JS */
    transform: translate(-50%, -50%);
    padding: 16px 48px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(180, 220, 255, 0.95);
    background: linear-gradient(135deg, rgba(20, 40, 80, 0.8) 0%, rgba(10, 25, 50, 0.9) 100%);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 30px rgba(50, 150, 255, 0.2),
        0 0 60px rgba(50, 150, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#startBtn:hover {
    background: linear-gradient(135deg, rgba(30, 60, 120, 0.9) 0%, rgba(20, 40, 80, 0.95) 100%);
    border-color: rgba(100, 180, 255, 0.5);
    box-shadow: 
        0 0 40px rgba(50, 150, 255, 0.3),
        0 0 80px rgba(50, 150, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateX(-50%) scale(1.05);
}

#startBtn:active {
    transform: translateX(-50%) scale(0.98);
}

#startBtn.absorbing {
    animation: pulse 0.5s ease-in-out infinite;
    border-color: rgba(150, 220, 255, 0.7);
    box-shadow: 
        0 0 50px rgba(100, 200, 255, 0.5),
        0 0 100px rgba(50, 150, 255, 0.3),
        inset 0 0 20px rgba(100, 200, 255, 0.2);
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 
            0 0 50px rgba(100, 200, 255, 0.5),
            0 0 100px rgba(50, 150, 255, 0.3),
            inset 0 0 20px rgba(100, 200, 255, 0.2);
    }
    50% { 
        box-shadow: 
            0 0 70px rgba(100, 200, 255, 0.7),
            0 0 120px rgba(50, 150, 255, 0.4),
            inset 0 0 30px rgba(100, 200, 255, 0.3);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #controls {
        width: calc(100% - 40px);
        max-height: 50vh;
        top: auto;
        bottom: 20px;
        right: 20px;
    }
}
