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

body {
    font-family: 'Fredoka', sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
}

body.chaos-mode {
    animation: chaosBackground 0.5s infinite;
}

@keyframes chaosBackground {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

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

#header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
}

#header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 20px rgba(255, 200, 100, 0.5);
    letter-spacing: 0.05em;
}

#header p {
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

#shake-status {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

#shake-indicator {
    padding: 6px 14px;
    background: rgba(30, 20, 50, 0.7);
    border-radius: 20px;
    transition: all 0.3s ease;
}

#shake-indicator.active {
    background: rgba(76, 175, 80, 0.8);
    color: white;
    transform: scale(1.1);
}

#shake-counter {
    padding: 6px 14px;
    background: rgba(30, 20, 50, 0.7);
    border-radius: 20px;
}

#big-shake-btn-container {
    position: fixed;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

#big-shake-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #ffd93d 100%);
    border: none;
    padding: 20px 50px;
    border-radius: 25px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a0a2e;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.5), 0 0 60px rgba(255, 107, 107, 0.3);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 8px 30px rgba(255, 107, 107, 0.5), 0 0 60px rgba(255, 107, 107, 0.3); }
    50% { box-shadow: 0 8px 40px rgba(255, 107, 107, 0.7), 0 0 80px rgba(255, 107, 107, 0.5); }
}

#big-shake-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 107, 107, 0.7), 0 0 100px rgba(255, 107, 107, 0.5);
}

#big-shake-btn:active,
#big-shake-btn.pulsing {
    transform: translateY(0) scale(0.95);
}

#controls {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: row;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(30, 20, 50, 0.85);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.control-group label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 8px;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.85rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

input[type="range"] {
    width: 70px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #d4af37;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #d4af37;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#mobile-motion-btn-container {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 100;
}

#mobile-motion-btn {
    background: rgba(30, 20, 50, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 14px;
    border-radius: 10px;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

#mobile-motion-btn:hover {
    background: rgba(50, 40, 70, 0.9);
}

#mobile-motion-btn.enabled {
    background: rgba(76, 175, 80, 0.7);
    color: white;
}

#footer {
    position: fixed;
    bottom: 30px;
    left: 20px;
    z-index: 100;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

#footer a {
    color: rgba(255, 200, 100, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

#footer a:hover {
    color: #d4af37;
}

#instructions {
    position: fixed;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

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

.peep {
    position: absolute;
    background: rgba(255, 255, 100, 0.95);
    color: #333;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    transform: translate(-50%, -50%);
    animation: peepFloat 1.5s ease-out forwards;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.peep::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(255, 255, 100, 0.95);
}

@keyframes peepFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150%) scale(1);
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    #header h1 {
        font-size: 1.8rem;
    }
    
    #header p {
        font-size: 0.85rem;
    }
    
    #shake-status {
        top: 85px;
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    #big-shake-btn-container {
        bottom: 180px;
    }
    
    #big-shake-btn {
        padding: 16px 40px;
        font-size: 1.3rem;
    }
    
    #controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 10px 15px;
        bottom: 100px;
        max-width: 90%;
    }
    
    #instructions {
        top: 160px;
        font-size: 0.65rem;
        padding: 0 20px;
    }
    
    #mobile-motion-btn-container {
        bottom: 55px;
        right: 50%;
        transform: translateX(50%);
    }
    
    #footer {
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    #header {
        top: 15px;
    }
    
    #header h1 {
        font-size: 1.5rem;
    }
    
    #shake-status {
        top: 70px;
        font-size: 0.8rem;
    }
    
    #big-shake-btn-container {
        bottom: 200px;
    }
    
    #big-shake-btn {
        padding: 14px 35px;
        font-size: 1.2rem;
    }
    
    #controls {
        bottom: 110px;
    }
    
    #instructions {
        display: none;
    }
}