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

body {
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFB5D4 0%, #A8D8EA 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
}

.voxel-logo {
    font-size: 80px;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.pixel-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 24px;
    color: #fff;
    text-shadow: 4px 4px 0px rgba(0,0,0,0.2);
    margin: 20px 0;
}

.loading-bar {
    width: 300px;
    height: 30px;
    background: rgba(255,255,255,0.3);
    border-radius: 15px;
    overflow: hidden;
    margin: 20px auto;
    border: 3px solid rgba(255,255,255,0.5);
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #8FD194, #FFB5D4);
    transition: width 0.3s ease;
}

.loading-text {
    color: #fff;
    font-size: 14px;
    margin-top: 10px;
}

#scene-container {
    width: 100%;
    height: 100vh;
}

#top-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
}

.top-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 181, 212, 0.5);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.top-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 181, 212, 0.4);
    background: rgba(255, 255, 255, 1);
}

.top-btn:active {
    transform: translateY(0px) scale(0.98);
}

#control-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-left: 2px solid rgba(255, 181, 212, 0.3);
    overflow-y: auto;
    z-index: 99;
    transition: transform 0.3s ease;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
}

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

.panel-header {
    background: linear-gradient(135deg, #FFB5D4, #FF9EC8);
    padding: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.panel-header h2 {
    font-size: 16px;
    color: #fff;
    margin: 0;
}

.panel-content {
    padding: 20px;
}

.section {
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 181, 212, 0.3);
}

.section-header {
    width: 100%;
    padding: 15px;
    background: rgba(255, 181, 212, 0.2);
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.section-header:hover {
    background: rgba(255, 181, 212, 0.3);
}

.section-header .chevron {
    transition: transform 0.3s ease;
}

.section.collapsed .chevron {
    transform: rotate(-90deg);
}

.section-content {
    padding: 15px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.section.collapsed .section-content {
    max-height: 0;
    padding: 0 15px;
}

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

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #3D3D3D;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 181, 212, 0.3);
    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: #FFB5D4;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 181, 212, 0.5);
}

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

.control-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid rgba(255, 181, 212, 0.3);
    border-radius: 8px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.control-group select:focus {
    outline: none;
    border-color: #FFB5D4;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.shape-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.shape-option {
    padding: 10px;
    border: 2px solid rgba(255, 181, 212, 0.3);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.shape-option:hover {
    border-color: #FFB5D4;
    transform: scale(1.05);
}

.shape-option.active {
    background: #FFB5D4;
    color: white;
    border-color: #FFB5D4;
}

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

.color-preset {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-preset.active {
    border-color: #3D3D3D;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #3D3D3D;
}

.panel-footer {
    padding: 20px;
    background: rgba(255, 181, 212, 0.1);
    border-top: 2px solid rgba(255, 181, 212, 0.3);
}

.compliment {
    font-size: 13px;
    color: #3D3D3D;
    text-align: center;
    font-style: italic;
}

#footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(255, 181, 212, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 98;
}

.footer-left, .footer-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.footer-btn {
    background: transparent;
    border: 1px solid rgba(255, 181, 212, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-btn:hover {
    background: rgba(255, 181, 212, 0.2);
}

.berrry-link {
    color: #FFB5D4;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.berrry-link:hover {
    color: #FF9EC8;
    transform: scale(1.05);
}

.credits {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

#toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid #FFB5D4;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-color: #8FD194;
}

.toast.error {
    border-color: #FF6B6B;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #control-panel {
        width: 100%;
        height: 60vh;
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: 2px solid rgba(255, 181, 212, 0.3);
    }

    #control-panel.hidden {
        transform: translateY(100%);
    }

    .pixel-text {
        font-size: 14px;
    }

    #top-bar {
        top: 10px;
        gap: 5px;
    }

    .top-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    #footer-bar {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 5px;
    }

    .footer-right {
        display: none;
    }
}

/* Scrollbar Styling */
#control-panel::-webkit-scrollbar {
    width: 8px;
}

#control-panel::-webkit-scrollbar-track {
    background: rgba(255, 181, 212, 0.1);
}

#control-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 181, 212, 0.5);
    border-radius: 4px;
}

#control-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 181, 212, 0.7);
}