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

body {
    overflow: hidden;
    background: #0d0a0c;
    font-family: 'DM Sans', sans-serif;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

body:active {
    cursor: grabbing;
}

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

#scene-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* --- Title --- */
#title {
    position: fixed;
    top: 24px;
    left: 28px;
    font-family: 'Playfair Display', serif;
    font-weight: 300;
    font-size: 22px;
    color: #D4A574;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(212, 165, 116, 0.4), 0 0 60px rgba(212, 165, 116, 0.1);
    z-index: 100;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1s ease, transform 1s ease;
    pointer-events: none;
}

#title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Info Button --- */
#info-btn {
    position: fixed;
    top: 24px;
    right: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid rgba(212, 165, 116, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1s ease, transform 1s ease, background 0.3s ease;
}

#info-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

#info-btn span {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 14px;
    color: #D4A574;
    line-height: 1;
}

#info-btn:hover {
    background: rgba(212, 165, 116, 0.2);
}

#info-tooltip {
    position: absolute;
    top: 44px;
    right: 0;
    width: 260px;
    padding: 16px;
    background: rgba(26, 26, 26, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 165, 116, 0.15);
    border-radius: 12px;
    font-family: 'Playfair Display', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 13px;
    line-height: 1.7;
    color: #c9a882;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#info-btn:hover #info-tooltip,
#info-btn:active #info-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* --- Controls Panel --- */
#controls-panel {
    position: fixed;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

#controls-panel.visible {
    opacity: 1;
    pointer-events: auto;
}

#controls-panel.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

#controls-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(20, 14, 18, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(212, 165, 116, 0.12);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.control-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-buttons {
    gap: 8px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(212, 165, 116, 0.5);
    white-space: nowrap;
}

/* --- Range Inputs --- */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 3px;
    background: rgba(212, 165, 116, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    touch-action: auto;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #D4A574;
    box-shadow: 0 0 10px rgba(212, 165, 116, 0.5);
    cursor: pointer;
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #D4A574;
    box-shadow: 0 0 10px rgba(212, 165, 116, 0.5);
    cursor: pointer;
    border: none;
}

#color-preview {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFE4B5;
    box-shadow: 0 0 8px rgba(255, 228, 181, 0.4);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

/* --- Buttons --- */
button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(212, 165, 116, 0.2);
    background: rgba(212, 165, 116, 0.08);
    color: rgba(212, 165, 116, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

button:hover {
    background: rgba(212, 165, 116, 0.2);
    color: #D4A574;
    border-color: rgba(212, 165, 116, 0.4);
}

button:active {
    background: rgba(212, 165, 116, 0.25);
    transform: scale(0.95);
}

button.active {
    color: #D4A574;
    background: rgba(212, 165, 116, 0.15);
    border-color: rgba(212, 165, 116, 0.35);
}

button.breeze-active {
    animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { box-shadow: 0 0 0 rgba(212, 165, 116, 0); }
    50% { box-shadow: 0 0 12px rgba(212, 165, 116, 0.3); }
}

/* --- Footer --- */
#footer {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 0;
    transition: opacity 1s ease;
}

#footer.visible {
    opacity: 1;
}

#footer a {
    font-size: 10px;
    color: rgba(212, 165, 116, 0.25);
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

#footer a:hover {
    color: rgba(212, 165, 116, 0.5);
}

/* --- Loading Overlay --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d0a0c;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 1s ease;
}

#loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#loading-text {
    font-family: 'Playfair Display', serif;
    font-weight: 300;
    font-size: 18px;
    color: #D4A574;
    letter-spacing: 4px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* --- Mobile Responsive --- */
@media (max-width: 640px) {
    #title {
        font-size: 16px;
        top: 16px;
        left: 16px;
        letter-spacing: 1.5px;
    }
    
    #info-btn {
        top: 16px;
        right: 16px;
    }
    
    #info-tooltip {
        width: 220px;
        right: -8px;
        font-size: 12px;
        padding: 12px;
    }
    
    #controls-panel {
        bottom: 24px;
        left: 8px;
        right: 8px;
        transform: none;
        width: auto;
    }
    
    #controls-inner {
        flex-direction: column;
        padding: 12px 16px;
        gap: 10px;
        border-radius: 16px;
        width: 100%;
    }
    
    .control-row {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }
    
    .control-buttons {
        gap: 12px;
    }
    
    input[type="range"] {
        width: 70px;
    }
    
    .control-group label {
        font-size: 9px;
        min-width: auto;
    }
    
    button {
        width: 44px;
        height: 44px;
    }
    
    #footer {
        bottom: 4px;
    }
    
    #loading-text {
        font-size: 16px;
        letter-spacing: 3px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    #controls-inner {
        padding: 10px 12px;
    }
    
    input[type="range"] {
        width: 55px;
    }
    
    .control-group label {
        font-size: 8px;
        letter-spacing: 0.5px;
    }
    
    .control-row {
        gap: 8px;
    }
}