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

body {
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, #0a0015 0%, #1a0030 50%, #0a0025 100%);
    overflow: hidden;
    color: #fff;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0015;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease;
}

.loading-text {
    font-size: 1.5rem;
    color: #ff00ff;
    text-shadow: 0 0 20px #ff00ff;
    animation: pulse 2s infinite;
}

.loading-dots span {
    font-size: 2rem;
    color: #00ffff;
    animation: blink 1.5s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.3s; }
.loading-dots span:nth-child(3) { animation-delay: 0.6s; }

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

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

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

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

#header {
    text-align: center;
    padding-top: 20px;
}

.glitch {
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 40px #ff00ff,
        0 0 80px #ff00ff;
    position: relative;
    animation: glitch 3s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    color: #00ffff;
    animation: glitch-1 2s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    transform: translate(-2px);
}

.glitch::after {
    color: #ff6ec7;
    animation: glitch-2 2s infinite;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    transform: translate(2px);
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-5px, 2px); }
    94% { transform: translate(5px, -2px); }
    96% { transform: translate(-3px, 1px); }
    98% { transform: translate(3px, -1px); }
}

@keyframes glitch-1 {
    0%, 90%, 100% { transform: translate(0); opacity: 0.8; }
    92% { transform: translate(-8px, 0); }
    94% { transform: translate(8px, 0); }
}

@keyframes glitch-2 {
    0%, 90%, 100% { transform: translate(0); opacity: 0.8; }
    93% { transform: translate(5px, 0); }
    95% { transform: translate(-5px, 0); }
}

#subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: #00ffff;
    margin-top: 15px;
    opacity: 0.9;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 10px #00ffff;
}

#depth-counter {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    color: #ff6ec7;
    text-shadow: 0 0 15px #ff6ec7;
    writing-mode: vertical-rl;
    letter-spacing: 3px;
}

#depth-value {
    font-weight: bold;
    transition: color 0.2s;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    pointer-events: auto;
}

.neon-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    font-weight: 700;
    padding: 12px 25px;
    background: transparent;
    border: 2px solid #ff00ff;
    color: #ff00ff;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 10px rgba(255, 0, 255, 0.5),
        inset 0 0 10px rgba(255, 0, 255, 0.1);
}

.neon-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.8),
        0 0 40px rgba(255, 0, 255, 0.4),
        inset 0 0 20px rgba(255, 0, 255, 0.2);
    transform: scale(1.05);
}

.neon-btn.escape {
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.5),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
}

.neon-btn.escape:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.8),
        0 0 40px rgba(0, 255, 255, 0.4);
}

.neon-btn.audio {
    border-color: #ffff00;
    color: #ffff00;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.neon-btn.audio:hover {
    background: rgba(255, 255, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
}

.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.slider-container label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #ff6ec7;
    letter-spacing: 2px;
}

#vibe-intensity {
    -webkit-appearance: none;
    width: 150px;
    height: 6px;
    background: linear-gradient(90deg, #ff00ff, #00ffff);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#vibe-intensity::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px #ff00ff;
    cursor: pointer;
}

#vibe-intensity::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px #ff00ff;
    cursor: pointer;
    border: none;
}

#wake-up {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 0, 0, 0.8);
    color: #fff;
    font-size: 5rem;
    font-weight: 900;
    z-index: 9999;
    text-shadow: 0 0 30px #fff;
    animation: flashGlitch 0.15s;
}

@keyframes flashGlitch {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1) skewX(5deg); }
    100% { opacity: 1; transform: scale(1); }
}

#click-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    padding: 30px 50px;
    border-radius: 10px;
    font-size: 1.2rem;
    z-index: 9998;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.8);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0); }
    20% { transform: translate(-48%, -52%) rotate(-2deg); }
    40% { transform: translate(-52%, -48%) rotate(2deg); }
    60% { transform: translate(-48%, -50%) rotate(-1deg); }
    80% { transform: translate(-52%, -50%) rotate(1deg); }
}

.hidden {
    display: none !important;
}

footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
}

footer a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #ff6ec7;
    text-decoration: none;
    text-shadow: 0 0 10px #ff6ec7;
    transition: all 0.3s;
    opacity: 0.7;
}

footer a:hover {
    opacity: 1;
    text-shadow: 0 0 20px #ff6ec7, 0 0 40px #ff00ff;
}

@media (max-width: 768px) {
    #depth-counter {
        position: static;
        writing-mode: horizontal-tb;
        transform: none;
        text-align: center;
        margin-top: 10px;
    }

    #controls {
        flex-direction: column;
        gap: 10px;
    }

    .neon-btn {
        padding: 10px 20px;
        width: 200px;
    }

    #vibe-intensity {
        width: 200px;
    }

    #click-warning {
        padding: 20px;
        font-size: 1rem;
        width: 90%;
    }
}