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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 900px;
    height: 700px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
}

#ui-panel {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    font-family: 'Fredoka', cursive;
    font-size: 16px;
    min-width: 220px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#ui-panel div {
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

#level-info {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    font-family: 'Fredoka', cursive;
    text-align: center;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#level-title {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 5px;
}

#level-description {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

#gameCanvas {
    display: block;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 50%, #d299c2 100%);
    border-radius: 20px;
    cursor: pointer;
}

#instructions-overlay,
#level-complete-overlay,
#game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.instructions-content,
.level-complete-content,
.game-over-content {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 30px;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    color: #333;
}

.instructions-content h1 {
    font-family: 'Fredoka', cursive;
    font-size: 2.8em;
    margin-bottom: 20px;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, #ff6b6b, #ffa500, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.instructions-content h3 {
    color: #4ecdc4;
    margin: 20px 0 10px 0;
    font-size: 1.3em;
    font-weight: 700;
}

.instructions-content ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.instructions-content li {
    margin-bottom: 8px;
    line-height: 1.5;
    font-weight: 500;
}

.instructions-content strong {
    color: #ff6b6b;
    font-weight: 700;
}

button {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    border: none;
    color: white;
    padding: 14px 28px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    font-family: 'Fredoka', cursive;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
    background: linear-gradient(135deg, #ff5252, #ff8a00);
}

.level-complete-content h2,
.game-over-content h2 {
    font-family: 'Fredoka', cursive;
    font-size: 2.2em;
    color: #ff6b6b;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.level-complete-content h2 {
    color: #4ecdc4;
}

#level-score,
#time-bonus,
#accuracy-bonus,
#total-score,
#final-score,
#final-level {
    font-size: 1.2em;
    margin: 8px 0;
    color: #333;
    font-weight: 600;
}

#time-bonus,
#accuracy-bonus {
    color: #4ecdc4;
    font-weight: 700;
}

#total-score,
#final-score {
    font-size: 1.4em;
    color: #ff6b6b;
    font-weight: 700;
}

/* Bubble popping animations */
@keyframes bubblePop {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes bubbleGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 107, 107, 0.6);
    }
}

.bubble-popping {
    animation: bubblePop 0.3s ease-out forwards;
}

.bubble-glow {
    animation: bubbleGlow 2s infinite;
}

/* Responsive design */
@media (max-width: 950px) {
    #game-container {
        width: 95vw;
        height: 95vh;
    }

    #ui-panel {
        top: 10px;
        left: 10px;
        padding: 10px;
        font-size: 14px;
        min-width: 180px;
    }

    #level-info {
        top: 10px;
        right: 10px;
        padding: 10px;
        min-width: 160px;
    }

    .instructions-content {
        padding: 20px;
        max-width: 90vw;
    }

    .instructions-content h1 {
        font-size: 2.2em;
    }
}