/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite, hueRotate 20s linear infinite;
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes hueRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.container {
    text-align: center;
    max-width: 800px;
    padding: 60px 20px 20px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(255, 71, 87, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    margin: 20px auto 0 auto;
}

header h1 {
    font-size: 3em;
    color: #ff4757;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    color: #57606f;
    margin-bottom: 30px;
}

/* Butt button styles */
.butt-container {
    position: relative;
    margin: 40px 0;
}

.butt-button {
    width: 200px;
    height: 200px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(255, 71, 87, 0.2);
    transition: all 0.3s ease;
    outline: none;
    overflow: hidden;
    padding: 0;
    animation: buttonBreathe 3s ease-in-out infinite, bobbing 4s ease-in-out infinite;
}

.butt-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.butt-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.butt-button:active {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.butt-button.wiggle {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* Fart cloud */
.fart-cloud {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2em;
    opacity: 0;
    transition: all 0.5s ease;
    pointer-events: none;
    animation: float 2s ease-out forwards;
}

.fart-cloud.visible {
    opacity: 1;
    top: -100px;
}

@keyframes float {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(0.8) translateY(-20px); }
}

/* Instructions */
.instructions {
    margin: 20px 0;
    font-size: 1.1em;
    color: #57606f;
}

.instructions p {
    margin: 5px 0;
}

/* Floating Clouds */
.floating-cloud {
    position: absolute;
    width: 120px;
    height: 80px;
    pointer-events: none;
    z-index: 1;
    animation: floatAround 8s ease-in-out infinite, bounce 2s ease-in-out infinite;
}

.floating-cloud img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes floatAround {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(100px, -50px) rotate(90deg);
    }
    50% {
        transform: translate(200px, 0) rotate(180deg);
    }
    75% {
        transform: translate(100px, 50px) rotate(270deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Cloud fly away animation */
.floating-cloud.fly-away {
    animation: flyAway 3s ease-out forwards;
}

@keyframes flyAway {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.5) rotate(360deg) translateX(500px) translateY(-200px);
        opacity: 0;
    }
}

/* Footer */
footer {
    margin-top: 40px;
    font-size: 0.9em;
    color: #a4b0be;
}

/* Responsive design */
@media (max-width: 600px) {
    header h1 {
        font-size: 2em;
    }
    
    .butt-button {
        width: 150px;
        height: 150px;
    }
    
    .cheek {
        width: 45px;
        height: 45px;
    }
    
    .cheek.left {
        top: 25px;
        left: 15px;
    }
    
    .cheek.right {
        top: 25px;
        right: 15px;
    }
    
    .crack {
        width: 30px;
    }
    
    /* Adjust rave button position for mobile to prevent overlap */
    .rave-trigger-button {
        top: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        line-height: 1;
        text-align: center;
    }
}

/* New Effects Styles */

/* Cursor Trail */
.cursor-trail {
    position: fixed;
    width: 30px;
    height: 30px;
    pointer-events: none;
    z-index: 9999;
    animation: trailFade 1.5s ease-out forwards;
    filter: hue-rotate(120deg) saturate(1.5) brightness(0.8) blur(0.5px);
    opacity: 0.7;
}

@keyframes trailFade {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.8); }
}

/* Click Ripples */
.click-ripple {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 71, 87, 0.6) 0%, transparent 70%);
    pointer-events: none;
    z-index: 100;
    animation: rippleExpand 0.8s ease-out forwards;
}

@keyframes rippleExpand {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

/* Floating Particles */
.floating-particle {
    position: absolute;
    font-size: 24px;
    pointer-events: none;
    z-index: 10;
    animation: particleDrift 20s linear infinite;
    opacity: 0.7;
}

@keyframes particleDrift {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

/* Screen Shake */
.shake {
    animation: screenShake 0.5s ease-in-out;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Container Shake */
.container.shake {
    animation: containerShake 0.6s ease-in-out;
}

@keyframes containerShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-3px) rotate(-0.5deg); }
    20% { transform: translateX(3px) rotate(0.5deg); }
    30% { transform: translateX(-2px) rotate(-0.3deg); }
    40% { transform: translateX(2px) rotate(0.3deg); }
    50% { transform: translateX(-1px) rotate(-0.1deg); }
    60% { transform: translateX(1px) rotate(0.1deg); }
    70% { transform: translateX(-1px) rotate(-0.1deg); }
    80% { transform: translateX(1px) rotate(0.1deg); }
    90% { transform: translateX(-0.5px) rotate(-0.05deg); }
}

/* Pressure Gauge */
.pressure-gauge {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pressure-gauge.visible {
    opacity: 1;
}

.pressure-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4757, #ff6b6b);
    width: 0%;
    transition: width 0.1s ease;
}

/* Fart Counter */
.fart-counter {
    font-size: 4em;
    font-weight: bold;
    color: #ff4757;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 71, 87, 0.3);
    margin: 20px 0;
    transition: transform 0.2s ease;
}

.fart-counter.bounce {
    animation: counterBounce 0.6s ease;
}

@keyframes counterBounce {
    0%, 20%, 50%, 80%, 100% { transform: scale(1); }
    40% { transform: scale(1.2); }
    60% { transform: scale(1.1); }
}

/* Stats Container */
.stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Streak Flames */
.streak-flames {
    position: relative;
    font-size: 2em;
}

.streak-flames::before {
    content: '🔥';
    position: absolute;
    left: -30px;
    animation: flameFlicker 0.3s ease-in-out infinite alternate;
}

.streak-flames::after {
    content: '🔥';
    position: absolute;
    right: -30px;
    animation: flameFlicker 0.3s ease-in-out infinite alternate-reverse;
}

@keyframes flameFlicker {
    0% { transform: scale(1) rotate(-5deg); opacity: 0.8; }
    100% { transform: scale(1.2) rotate(5deg); opacity: 1; }
}

/* Combo Multiplier */
.combo-multiplier {
    font-size: 2em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.combo-multiplier.visible {
    opacity: 1;
    animation: comboPulse 0.5s ease-in-out infinite alternate;
}

@keyframes comboPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Hold Multiplier */
.hold-multiplier {
    font-size: 2em;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hold-multiplier.visible {
    opacity: 1;
    animation: holdPulse 0.5s ease-in-out infinite alternate;
}

.hold-multiplier.approaching-max {
    color: #ffa500;
    animation: holdPulse 0.3s ease-in-out infinite alternate, warningGlow 0.5s ease-in-out infinite alternate;
}

.hold-multiplier.max-reached {
    color: #ff0000;
    font-size: 2.5em;
    animation: holdPulse 0.2s ease-in-out infinite alternate, maxGlow 0.3s ease-in-out infinite alternate;
}

@keyframes holdPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

@keyframes warningGlow {
    0% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 165, 0, 0.5); }
    100% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.8); }
}

@keyframes maxGlow {
    0% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 0, 0, 0.7); }
    100% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 0, 0, 1); }
}

/* Button Breathing */
.butt-button.breathing {
    animation: buttonBreathe 3s ease-in-out infinite;
}

@keyframes buttonBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes bobbing {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Proximity Glow */
.butt-button.glow {
    box-shadow: 0 0 30px rgba(255, 71, 87, 0.8), 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Physics Wobble */
.butt-button.wobble {
    animation: physicsWobble 0.6s ease-out;
}

@keyframes physicsWobble {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
    75% { transform: rotate(-1deg); }
    100% { transform: rotate(0deg); }
}

/* DOM Wind Effect */
.wind-effect {
    animation: windLean 0.5s ease-out;
}

@keyframes windLean {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(-2deg); }
    100% { transform: rotate(0deg); }
}

/* Text Scramble */
.text-scramble {
    animation: textScramble 0.3s ease-in-out;
}

@keyframes textScramble {
    0%, 100% { filter: blur(0px); }
    50% { filter: blur(2px); }
}

/* Achievement Popups */
.achievement-popup {
    position: fixed;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: achievementSlide 0.8s ease-out;
}

.achievement-popup.left {
    left: -300px;
    top: 50%;
    transform: translateY(-50%);
    animation: achievementSlideLeft 0.8s ease-out forwards;
}

.achievement-popup.right {
    right: -300px;
    top: 50%;
    transform: translateY(-50%);
    animation: achievementSlideRight 0.8s ease-out forwards;
}

@keyframes achievementSlideLeft {
    0% { left: -300px; }
    50% { left: 50px; }
    100% { left: 20px; }
}

@keyframes achievementSlideRight {
    0% { right: -300px; }
    50% { right: 50px; }
    100% { right: 20px; }
}

/* Random Floating Text */
.floating-text {
    position: fixed;
    font-size: 2em;
    font-weight: bold;
    color: #ff4757;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 100;
    animation: floatingText 3s ease-out forwards;
}

@keyframes floatingText {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100px) scale(0.5); opacity: 0; }
}

/* Saturation Burst */
.saturation-burst {
    animation: saturationPulse 0.5s ease-out;
}

@keyframes saturationPulse {
    0% { filter: saturate(1); }
    50% { filter: saturate(2); }
    100% { filter: saturate(1); }
}

/* Mini Farts */
.mini-fart {
    position: fixed;
    font-size: 1.5em;
    pointer-events: none;
    z-index: 50;
    animation: miniFartFloat 2s ease-out forwards;
}

@keyframes miniFartFloat {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(0.5) rotate(180deg) translateY(-50px); opacity: 0; }
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 200;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Achievements Container */
.achievements-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

/* Rainbow Mode */
.rainbow-mode {
    animation: rainbowRotate 2s linear infinite;
}

@keyframes rainbowRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Beans Rain */
.beans-rain {
    position: fixed;
    font-size: 2em;
    pointer-events: none;
    z-index: 150;
    animation: beansFall 4s ease-out forwards;
}

@keyframes beansFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Nuclear Mode */
.nuclear-mode {
    animation: nuclearShake 0.1s ease-in-out infinite;
}

@keyframes nuclearShake {
    0%, 100% { transform: translateX(0) translateY(0); }
    10% { transform: translateX(-2px) translateY(-1px); }
    20% { transform: translateX(2px) translateY(1px); }
    30% { transform: translateX(-1px) translateY(2px); }
    40% { transform: translateX(1px) translateY(-2px); }
    50% { transform: translateX(-2px) translateY(1px); }
    60% { transform: translateX(2px) translateY(-1px); }
    70% { transform: translateX(-1px) translateY(-2px); }
    80% { transform: translateX(1px) translateY(2px); }
    90% { transform: translateX(-2px) translateY(-1px); }
}

/* Machine Gun Mode */
.machine-gun-mode .butt-button {
    animation: machineGunPulse 0.1s ease-in-out infinite;
}

@keyframes machineGunPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Database Integration Styles */
.submit-container {
    margin: 20px 0;
    text-align: center; /* Center the button */
}

.submit-button {
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4), 0 3px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5), 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3), 0 1px 5px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-message {
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    display: none;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.submit-message.success {
    background: rgba(72, 187, 120, 0.9);
    color: white;
}

.submit-message.error {
    background: rgba(255, 71, 87, 0.9);
    color: white;
}

.global-stats {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 8px 15px;
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.9), rgba(255, 107, 107, 0.9));
    border-radius: 15px 15px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 71, 87, 0.6);
}

.global-counter {
    font-size: 2.5em;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 255, 255, 0.3);
    font-family: 'Comic Sans MS', cursive, sans-serif;
    line-height: 1;
    margin: 0;
}

.global-counter.update-flash {
    animation: counterFlash 0.6s ease-in-out;
    transform: scale(1.05);
}

@keyframes counterFlash {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.global-label {
    font-size: 1.5em;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: normal;
}

/* Rave mode styles - Enhanced for CRAZY background with less spinning */
.rave-mode {
    background-color: #000000 !important; /* Darken background */
    animation: rave-background 0.1s infinite alternate, rave-pulse 0.2s infinite alternate, rave-scale 0.3s infinite ease-in-out, rave-shake 0.5s infinite ease-in-out;
}

.rave-mode .container {
    background: linear-gradient(45deg, #ff0000, #00ff00, #0000ff, #ffff00, #ff00ff, #00ffff) !important; /* Color the box with rapid colors */
    animation: rave-container-colors 0.2s infinite alternate;
}

.rave-strobe {
    background-color: white !important;
    background-image: none !important;
}

@keyframes rave-background {
    0% { background-color: #ff0000; }
    10% { background-color: #00ff00; }
    20% { background-color: #0000ff; }
    30% { background-color: #ffff00; }
    40% { background-color: #ff00ff; }
    50% { background-color: #00ffff; }
    60% { background-color: #ff8000; }
    70% { background-color: #8000ff; }
    80% { background-color: #ff0080; }
    90% { background-color: #00ff80; }
    100% { background-color: #8000ff; }
}

@keyframes rave-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes rave-scale {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.03); }
}

@keyframes rave-shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px); }
    20% { transform: translateX(2px); }
    30% { transform: translateX(-1px); }
    40% { transform: translateX(1px); }
    50% { transform: translateX(-2px); }
    60% { transform: translateX(2px); }
    70% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    90% { transform: translateX(-1px); }
}

@keyframes rave-container-colors {
    0% { background: linear-gradient(45deg, #ff0000, #00ff00); }
    25% { background: linear-gradient(45deg, #0000ff, #ffff00); }
    50% { background: linear-gradient(45deg, #ff00ff, #00ffff); }
    75% { background: linear-gradient(45deg, #ff8000, #8000ff); }
    100% { background: linear-gradient(45deg, #ff0080, #00ff80); }
}

/* Tiny rave trigger button styles */
.rave-trigger-button {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 60px; /* Increased from 50px for better mobile tap target */
    height: 60px; /* Increased from 50px for better mobile tap target */
    background: rgba(255, 0, 255, 0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    animation: combinedPulseShake 2s infinite;
    transform-origin: center center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-appearance: none;
    appearance: none; /* Added standard property for compatibility */
    touch-action: manipulation; /* Prevent zoom on double-tap */
    pointer-events: auto; /* Ensure pointer events are enabled */
    line-height: 1;
    text-align: center;
}

@keyframes combinedPulseShake {
    0% { transform: scale(1) translateX(0); }
    12.5% { transform: scale(1.05) translateX(-1px); }
    25% { transform: scale(1.1) translateX(0); }
    37.5% { transform: scale(1.05) translateX(1px); }
    50% { transform: scale(1) translateX(0); }
    62.5% { transform: scale(1.05) translateX(-1px); }
    75% { transform: scale(1.1) translateX(0); }
    87.5% { transform: scale(1.05) translateX(1px); }
    100% { transform: scale(1) translateX(0); }
}

/* Analytics Dashboard Styles - Community Theme */
.analytics-trigger-button {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gentlePulse 2s ease-in-out infinite;
}

.analytics-trigger-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.analytics-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.analytics-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.analytics-modal-content {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    width: 95%;
    max-width: 900px;
    height: 95vh;
    max-height: 850px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 3px solid #ff6b6b;
    overflow-y: auto;
    font-family: 'Comic Sans MS', cursive;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    border-bottom: 3px solid #ff4757;
}

.analytics-header h2 {
    font-size: 1.5em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.analytics-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.analytics-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.community-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #ff6b6b;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    color: #ff4757;
    font-size: 1.1em;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.stat-value {
    color: #2d3436;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 3px;
    font-family: 'Comic Sans MS', cursive;
}

.stat-subtitle {
    color: #636e72;
    font-size: 0.9em;
    margin: 0;
    font-style: italic;
}

.recent-contributions {
    padding: 25px;
    background: rgba(78, 205, 196, 0.1);
    border-top: 2px solid #4ecdc4;
    border-bottom: 2px solid #4ecdc4;
    flex: 1;
}

.recent-contributions h3 {
    color: #2d3436;
    margin: 0 0 15px 0;
    font-size: 1.4em;
    text-align: center;
}

.contributions-list {
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    border: 2px solid #4ecdc4;
}

.contribution-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f1f2f6;
    animation: slideIn 0.5s ease-out;
    transition: all 0.3s ease;
}

.contribution-item:hover {
    background: rgba(78, 205, 196, 0.1);
    transform: scale(1.02);
}

.contribution-item.last {
    border-bottom: none;
}

.contribution-icon {
    font-size: 2em;
    margin-right: 15px;
    animation: bounce 1s ease-in-out infinite;
}

.contribution-text {
    flex: 1;
    color: #2d3436;
    font-size: 1.1em;
    font-weight: bold;
}

.contribution-amount {
    color: #ff4757;
    font-size: 1.2em;
    font-weight: bold;
    font-family: 'Comic Sans MS', cursive;
}

.contribution-time {
    color: #636e72;
    font-size: 0.8em;
    font-style: italic;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

.contribution-visual {
    padding: 15px;
    background: rgba(255, 107, 107, 0.1);
    flex: 0.5;
    display: flex;
    flex-direction: column;
}

.contribution-visual h3 {
    color: #2d3436;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.4em;
}

.activity-visual {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    border: 3px solid #ff6b6b;
}

.floating-farts {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-fart {
    position: absolute;
    font-size: 2em;
    animation: floatAround 8s linear infinite, fadeInOut 4s ease-in-out infinite;
    opacity: 0.8;
}

.floating-fart.large {
    font-size: 3em;
    animation-duration: 6s;
}

.floating-fart.medium {
    font-size: 2.5em;
    animation-duration: 7s;
}

@keyframes floatAround {
    0% { transform: translateY(100%) rotate(0deg); }
    25% { transform: translateX(100%) translateY(0%) rotate(90deg); }
    50% { transform: translateX(0%) translateY(-100%) rotate(180deg); }
    75% { transform: translateX(-100%) translateY(0%) rotate(270deg); }
    100% { transform: translateY(100%) rotate(360deg); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.8; }
}

.encouragement-section {
    padding: 12px;
    background: linear-gradient(135deg, #ff9ff3, #f368e0);
    text-align: center;
    border-top: 3px solid #ff6b6b;
    flex-shrink: 0;
}

.encouragement-section h3 {
    color: white;
    margin: 0 0 8px 0;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.encouragement-section p {
    color: white;
    margin: 0 0 15px 0;
    font-size: 1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid white;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    width: 0%;
    transition: width 1s ease;
    border-radius: 10px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .analytics-modal-content {
        width: 95%;
        height: 95vh;
        margin: 10px;
    }

    .community-stats {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .contribution-item {
        padding: 10px;
        flex-direction: column;
        text-align: center;
    }

    .contribution-icon {
        margin-right: 0;
        margin-bottom: 5px;
    }

    .activity-visual {
        min-height: 150px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}