* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #000;
    color: #fff;
}

#container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.control-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 320px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.left-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 280px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.control-panel.hidden {
    transform: translateX(350px);
    opacity: 0;
}

.left-panel.hidden {
    transform: translateX(-320px);
    opacity: 0;
}

.control-panel h2 {
    margin-bottom: 20px;
    font-size: 1.4em;
    color: #4a9eff;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-section:last-child {
    border-bottom: none;
}

.control-section h3 {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #ddd;
}

.control-group label span {
    float: right;
    color: #4a9eff;
    font-weight: bold;
}

.control-group input[type="range"] {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #6ab0ff;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.control-group select {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    outline: none;
}

.control-group select option {
    background: #222;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.button-group .preset-btn:nth-child(5) {
    grid-column: 1 / -1;
}

.preset-btn, .action-btn {
    padding: 10px 15px;
    background: rgba(74, 158, 255, 0.2);
    border: 1px solid #4a9eff;
    border-radius: 6px;
    color: #4a9eff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-btn:hover, .action-btn:hover {
    background: rgba(74, 158, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.action-btn {
    width: 100%;
    background: rgba(255, 74, 74, 0.2);
    border-color: #ff4a4a;
    color: #ff4a4a;
}

.action-btn:hover {
    background: rgba(255, 74, 74, 0.3);
    box-shadow: 0 4px 12px rgba(255, 74, 74, 0.3);
}

.copy-btn {
    background: rgba(74, 255, 74, 0.2);
    border-color: #4aff4a;
    color: #4aff4a;
}

.copy-btn:hover {
    background: rgba(74, 255, 74, 0.3);
    box-shadow: 0 4px 12px rgba(74, 255, 74, 0.3);
}

.copy-btn.copied {
    background: rgba(255, 255, 74, 0.3);
    border-color: #ffff4a;
    color: #ffff4a;
}

.info-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85em;
    color: #888;
    text-align: center;
}

.info-section p {
    margin-bottom: 5px;
}

.info-section kbd {
    display: inline-block;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
    color: #fff;
}

.stats-panel {
    position: absolute;
    top: 20px;
    right: 350px;
    padding: 15px 20px;
    background: rgba(20, 20, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.9em;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.stats-panel.hidden {
    transform: translateY(-100px);
    opacity: 0;
}

.stats-panel div {
    margin-bottom: 8px;
}

.stats-panel div:last-child {
    margin-bottom: 0;
}

.stats-panel span {
    color: #4a9eff;
    font-weight: bold;
    margin-left: 5px;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 158, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 158, 255, 0.7);
}

@media (max-width: 768px) {
    .control-panel {
        width: 280px;
        right: 10px;
        top: 10px;
    }
    
    .stats-panel {
        top: auto;
        bottom: 20px;
        left: 20px;
    }
}