
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f0f0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: fixed;
}

.stats {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(103, 126, 234, 0.95);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    pointer-events: none;
}


.reset-btn.mobile-only {
    display: none;
}

body.mobile .reset-btn.mobile-only {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    padding: 15px 25px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-weight: 600;
    transition: transform 0.2s;
}

body.mobile .reset-btn.mobile-only:hover {
    transform: scale(1.05);
}

body.mobile .reset-btn.mobile-only:active {
    transform: scale(0.95);
}


.burger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: none;
}

body:not(.mobile) .burger-menu {
    display: block;
}

.burger-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.burger-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.burger-btn:active {
    transform: scale(0.95);
}

.burger-content {
    position: absolute;
    top: 60px;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    min-width: 250px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.burger-menu.active .burger-content {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.menu-reset-btn {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.menu-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.menu-reset-btn:active {
    transform: translateY(0);
}

.zoom-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zoom-control label {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#zoomValue {
    color: #667eea;
    font-weight: 700;
}

#zoomSlider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

#zoomSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

#zoomSlider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

#zoomSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

#zoomSlider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.viewport {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    cursor: grab;
    position: relative;
}

.viewport.grabbing {
    cursor: grabbing;
}

.bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
}

.bubble-wrap {
    display: grid;
    gap: 20px;
    padding: 50px;
}

.bubble {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
    position: relative;
    box-shadow: 
        inset -2px -2px 8px rgba(0,0,0,0.2),
        inset 2px 2px 8px rgba(255,255,255,0.8),
        0 4px 8px rgba(0,0,0,0.2);
}


.mobile .bubble {
    box-shadow:
        inset -2px -2px 6px rgba(0,0,0,0.18),
        inset 2px 2px 6px rgba(255,255,255,0.7);
}

.bubble.blue {
    background: radial-gradient(circle at 30% 30%, #e3f2fd, #90caf9, #42a5f5);
    border: 3px solid #1976d2;
}

.bubble.green {
    background: radial-gradient(circle at 30% 30%, #e8f5e9, #81c784, #4caf50);
    border: 3px solid #2e7d32;
}

.bubble.pink {
    background: radial-gradient(circle at 30% 30%, #fce4ec, #f48fb1, #ec407a);
    border: 3px solid #c2185b;
}

.bubble.purple {
    background: radial-gradient(circle at 30% 30%, #f3e5f5, #ba68c8, #9c27b0);
    border: 3px solid #7b1fa2;
}

.bubble.orange {
    background: radial-gradient(circle at 30% 30%, #fff3e0, #ffb74d, #ff9800);
    border: 3px solid #e65100;
}

.bubble.cyan {
    background: radial-gradient(circle at 30% 30%, #e0f7fa, #4dd0e1, #00bcd4);
    border: 3px solid #0097a7;
}

.bubble:hover:not(.popped) {
    transform: scale(1.15);
}

.bubble.popped {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border-color: #bdbdbd;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    cursor: default;
    animation: pop 0.3s ease-out;
    transform: scale(1) !important;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.7);
    }
    65% {
        transform: scale(1.05);
    }
    80% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: particle-fly 0.6s ease-out forwards;
}

@keyframes particle-fly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}


.viewport, .bubble-wrap, .bubble {
    touch-action: none;
}
