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

body {
    font-family: 'Orbitron', sans-serif;
    background: #0a0015;
    color: #fff;
    overflow: hidden;
    min-height: 100vh;
}

#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;
    transition: opacity 0.3s ease;
}

#header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(10, 0, 21, 0.9), transparent);
}

#header h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 900;
    background: linear-gradient(90deg, #ff00ff, #00ffff, #ff00ff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
}

#header p {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.7rem, 2vw, 1rem);
    color: #00ffff;
    opacity: 0.8;
    margin-top: 5px;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

#vibe-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

#current-vibe {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff;
    padding: 15px 30px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#current-vibe:not(:empty) {
    opacity: 1;
}

#current-vibe.pulse {
    animation: vibe-pulse 0.5s ease;
}

@keyframes vibe-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 40px #00ffff; }
    100% { transform: scale(1); }
}

#vibe-btn {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    font-weight: 700;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #ff00ff, #9945ff);
    color: white;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    animation: button-glow 2s ease-in-out infinite;
}

#vibe-btn:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.8),
                inset 0 0 30px rgba(255, 255, 255, 0.2);
}

#vibe-btn:active {
    transform: translateX(-50%) scale(0.95);
}

@keyframes button-glow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 0, 255, 0.5); }
    50% { box-shadow: 0 0 50px rgba(0, 255, 255, 0.7); }
}

#stats-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(10, 0, 21, 0.8);
    border: 1px solid rgba(153, 69, 255, 0.3);
    border-radius: 15px;
    padding: 15px 20px;
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(153, 69, 255, 0.2);
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
}

.stat-value {
    font-weight: 700;
    font-size: 1rem;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

#milestone-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(153, 69, 255, 0.9);
    border: 2px solid #ff00ff;
    border-radius: 20px;
    padding: 30px 50px;
    text-align: center;
    animation: milestone-appear 0.5s ease;
    pointer-events: none;
}

#milestone-popup.hidden {
    display: none;
}

#milestone-text {
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

@keyframes milestone-appear {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#footer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    pointer-events: auto;
}

#footer a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s ease;
}

#footer a:hover {
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

#screenshot-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #00ffff;
    padding: 15px 30px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    z-index: 100;
}

#screenshot-hint.hidden {
    display: none;
}

/* Sparkly Mode */
.sparkly-mode {
    animation: sparkle-bg 0.5s ease infinite;
}

@keyframes sparkle-bg {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2) saturate(1.3); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #stats-panel {
        bottom: auto;
        top: auto;
        left: 10px;
        right: 10px;
        bottom: 100px;
        min-width: auto;
        padding: 10px 15px;
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
    }
    
    .stat {
        flex-direction: column;
        border-bottom: none;
        padding: 5px 10px;
    }
    
    #vibe-btn {
        bottom: 30px;
        padding: 12px 30px;
    }
    
    #footer {
        bottom: 5px;
        right: 10px;
    }
    
    #header {
        padding: 10px;
    }
}

/* Touch feedback */
@media (hover: none) {
    #vibe-btn:active {
        background: linear-gradient(135deg, #00ffff, #9945ff);
    }
}