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

body {
    overflow: hidden;
    font-family: 'Space Grotesk', sans-serif;
    background: #0a0a1a;
    color: #ffefd5;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #2c1654 0%, #d4776b 100%);
}

#scene-container canvas {
    display: block;
}

/* Grain overlay */
#scene-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    mix-blend-mode: overlay;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#title-container {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    transition: opacity 0.8s ease;
}

#title-container.faded {
    opacity: 0.3;
}

#title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-shadow: 0 0 30px rgba(255, 239, 213, 0.5);
    filter: blur(0.3px);
    margin-bottom: 0.5rem;
}

#subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-weight: 300;
    opacity: 0.7;
    letter-spacing: 0.2em;
}

#nostalgia-dial {
    position: absolute;
    bottom: 15%;
    left: 5%;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 15px 20px;
    min-width: 140px;
}

#dial-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.dial-text {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.7;
}

#balance-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #4a3f6b 0%, #90ee90 100%);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#balance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffefd5 30%, #d4a574 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 239, 213, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#balance-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffefd5 30%, #d4a574 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 239, 213, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#time-slider-container {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 12px 25px;
}

.time-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.7;
}

#time-slider {
    width: 150px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #f4a460 0%, #d4776b 50%, #1a1a3a 100%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #ffefd5;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 239, 213, 0.6);
}

#time-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ffefd5;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 239, 213, 0.6);
    border: none;
}

#memory-counter {
    position: absolute;
    top: 5%;
    right: 5%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 10px 18px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

#counter-label {
    opacity: 0.7;
    margin-right: 8px;
}

#counter-value {
    font-weight: 400;
    color: #ffd700;
}

#audio-toggle {
    position: absolute;
    top: 5%;
    left: 5%;
    pointer-events: auto;
}

#audio-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffefd5;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

#audio-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

#audio-btn.active {
    background: rgba(255, 215, 0, 0.3);
    opacity: 1;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

#instructions {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.85rem;
    opacity: 0.5;
    letter-spacing: 0.1em;
    animation: fadeInOut 4s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 0.7rem;
    opacity: 0.4;
    z-index: 10;
    letter-spacing: 0.1em;
}

#footer a {
    color: #ffefd5;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

#footer a:hover {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #nostalgia-dial {
        bottom: 20%;
        left: 3%;
        padding: 12px 15px;
        min-width: 120px;
    }
    
    #time-slider-container {
        bottom: 8%;
        padding: 10px 18px;
    }
    
    #time-slider {
        width: 100px;
    }
    
    #memory-counter {
        top: 3%;
        right: 3%;
        padding: 8px 12px;
        font-size: 0.65rem;
    }
    
    #audio-toggle {
        top: 3%;
        left: 3%;
    }
    
    #audio-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    #instructions {
        display: none;
    }
    
    #title {
        letter-spacing: 0.1em;
    }
    
    #subtitle {
        letter-spacing: 0.1em;
    }
}

@media (max-width: 480px) {
    #nostalgia-dial {
        bottom: auto;
        top: 15%;
        left: 3%;
    }
    
    #time-slider-container {
        bottom: 12%;
    }
}