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

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background: #000;
    color: #E0E0E0;
    overflow: hidden;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    color: #E0E0E0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    border-top: 3px solid #00F5FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #00F5FF;
}

.loading-content p {
    font-size: 16px;
    opacity: 0.8;
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
}

/* Bottom Controls */
.bottom-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 40px;
    pointer-events: auto;
}

.hint-text {
    color: #888;
    font-size: 14px;
    opacity: 0.8;
}

.morph-button {
    background: rgba(0, 245, 255, 0.1);
    border: 2px solid #00F5FF;
    color: #00F5FF;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.morph-button:hover {
    background: rgba(0, 245, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.morph-button:active {
    transform: scale(0.95);
}

.auto-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
}

.toggle-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: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #00F5FF;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.toggle-label {
    color: #E0E0E0;
    font-size: 14px;
}

/* Panel Toggle */
.panel-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #333;
    color: #E0E0E0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.panel-toggle:hover {
    background: rgba(0, 245, 255, 0.1);
    border-color: #00F5FF;
    transform: scale(1.1);
}

/* Control Panel */
.control-panel {
    position: absolute;
    top: 0;
    right: -350px;
    width: 340px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    border-left: 1px solid #333;
    transition: right 0.3s ease;
    pointer-events: auto;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    padding: 80px 20px 20px;
}

.control-panel.open {
    right: 0;
}

.panel-section {
    margin-bottom: 30px;
}

.panel-section h3 {
    color: #00F5FF;
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

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

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #E0E0E0;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00F5FF;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00F5FF;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.control-group select {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    border-radius: 4px;
    color: #E0E0E0;
    font-size: 14px;
}

.control-group select:focus {
    border-color: #00F5FF;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 245, 255, 0.3);
}

/* Shape Grid */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.shape-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shape-item:hover {
    background: rgba(0, 245, 255, 0.1);
    border-color: #00F5FF;
    transform: translateY(-2px);
}

.shape-item.active {
    background: rgba(0, 245, 255, 0.2);
    border-color: #00F5FF;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-panel {
        width: 300px;
        right: -310px;
    }
    
    .bottom-controls {
        gap: 20px;
        padding: 0 20px;
    }
    
    .hint-text {
        display: none;
    }
    
    .morph-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .panel-toggle {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .control-panel {
        width: 280px;
        right: -290px;
    }
    
    .bottom-controls {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .shape-grid {
        grid-template-columns: 1fr;
    }
}

/* Custom Scrollbar */
.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.control-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 245, 255, 0.5);
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 245, 255, 0.7);
}