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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    overflow: hidden;
}

.container {
    width: 100vw;
    height: 100vh;
    display: flex;
}

#canvas {
    flex: 1;
    display: block;
    background-color: #0a0a0a;
}

.ui-panel {
    width: 350px;
    background-color: #2a2a2a;
    border-left: 2px solid #444;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.ui-panel.hidden {
    transform: translateX(100%);
}

.panel-header {
    padding: 15px;
    border-bottom: 2px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #aaa;
}

.panel-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.control-section {
    margin-bottom: 15px;
}

.control-section label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
}

.control-section span {
    color: #4a9eff;
    font-weight: 600;
}

.slider {
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
    transition: background 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    background: #6bb7ff;
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.slider::-moz-range-thumb:hover {
    background: #6bb7ff;
}

.number-input {
    width: 80px;
    padding: 5px;
    background-color: #3a3a3a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}

.number-input:focus {
    outline: none;
    border-color: #4a9eff;
    background-color: #404040;
}

.control-section.checkbox {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-section.checkbox label {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.control-section.checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4a9eff;
}

.force-matrix {
    margin: 20px 0;
    padding: 12px;
    background-color: #323232;
    border-radius: 4px;
}

.force-matrix h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #4a9eff;
}

.force-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.force-button {
    width: 30px;
    height: 30px;
    border: 1px solid #444;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.force-button:hover {
    transform: scale(1.1);
}

.color-controls {
    margin: 20px 0;
    padding: 12px;
    background-color: #323232;
    border-radius: 4px;
}

.color-controls h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #4a9eff;
}

.color-pickers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.color-picker input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-picker label {
    font-size: 12px;
    margin: 0;
}

.button-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #4a9eff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #6bb7ff;
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.info {
    margin-top: 20px;
    padding: 12px;
    background-color: #323232;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
}

.info p {
    margin: 4px 0;
}

.overlay-info {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 10px 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.overlay-info p {
    margin: 5px 0;
    color: #4a9eff;
}

@media (max-width: 1024px) {
    .ui-panel {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        z-index: 100;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
