/* Number Bubbles Game Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #10B981;
    --primary-light: #6EE7B7;
    --primary-dark: #059669;
    --secondary: #F59E0B;
    --background: #ECFDF5;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-muted: #64748B;
    --error: #EF4444;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, #0D9488 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#game-container {
    width: 100%;
    max-width: 500px;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

/* Header */
#game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--background);
    border-bottom: 1px solid #D1FAE5;
}

.game-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

.target-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.target-label {
    font-size: 12px;
    color: var(--text-muted);
}

.target-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.score-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary);
}

/* Current Sum Display */
#current-sum {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    background: var(--background);
}

#sum-display {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    min-width: 80px;
    text-align: center;
}

.clear-btn {
    padding: 8px 16px;
    background: #FEE2E2;
    color: var(--error);
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #FECACA;
    transform: scale(1.05);
}

/* Selected Numbers */
#selected-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    min-height: 40px;
}

.selected-num {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Bubble Container */
#bubble-container {
    position: relative;
    height: 300px;
    overflow: hidden;
    background: linear-gradient(180deg, #F0FDF4 0%, #DCFCE7 100%);
}

.bubble {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
    animation: float 3s ease-in-out infinite;
    box-shadow:
        inset 0 -5px 10px rgba(0, 0, 0, 0.1),
        inset 0 5px 10px rgba(255, 255, 255, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.1);
}

.bubble:hover {
    transform: scale(1.15);
}

.bubble.popped {
    animation: pop 0.3s ease forwards;
    pointer-events: none;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pop {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.bubble.color-1 {
    background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
    color: #92400E;
}

.bubble.color-2 {
    background: linear-gradient(135deg, #A5B4FC 0%, #6366F1 100%);
    color: white;
}

.bubble.color-3 {
    background: linear-gradient(135deg, #6EE7B7 0%, #10B981 100%);
    color: white;
}

.bubble.color-4 {
    background: linear-gradient(135deg, #FDA4AF 0%, #F43F5E 100%);
    color: white;
}

.bubble.color-5 {
    background: linear-gradient(135deg, #67E8F9 0%, #06B6D4 100%);
    color: white;
}

/* Level Info */
#level-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--background);
    font-size: 14px;
    color: var(--text-muted);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #D1FAE5;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Feedback */
#feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    border-radius: 16px;
    font-size: 24px;
    font-weight: 700;
    z-index: 50;
    animation: feedbackPop 0.5s ease;
}

#feedback.hidden {
    display: none;
}

#feedback.correct {
    background: var(--primary);
    color: white;
}

#feedback.wrong {
    background: var(--error);
    color: white;
}

@keyframes feedbackPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.stars {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
}

.result-stat {
    display: flex;
    flex-direction: column;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.result-label {
    font-size: 14px;
    color: var(--text-muted);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0D9488 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 2px solid #D1FAE5;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}