﻿/* =========================================
   BlueGrammar Balloon Pop Game
   ========================================= */

.balloon-game-wrapper {
    width: 100%;
    max-width: 680px;
    margin: 20px auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.balloon-card {
    background: #ddf1fe;
    border: 2px solid #f7d8da;
    border-radius: 20px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(6, 95, 208, 0.1);
    position: relative;
    overflow: hidden;
}

.balloon-hidden {
    display: none !important;
}

.game-title {
    color: #065fd0;
    font-size: 28px;
    margin-bottom: 8px;
}

.game-desc {
    color: #475569;
    font-size: 15px;
    margin-bottom: 24px;
}

/* Header Info */
.balloon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.level-badge {
    background: #065fd0;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 14px;
}

.score-badge {
    background: #ffffff;
    color: #065fd0;
    border: 2px solid #b3d8f8;
    padding: 6px 10px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 14px;
}

/* Top Target Reference Bar */
.target-bar {
    background: #ffffff;
    border: 2px solid #b3d8f8;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.target-label {
    font-size: 12px;
    font-weight: 700;
    color: #065fd0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.target-balloons-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    max-width: 100%;
}

/* Mini Target Balloons */
.mini-balloon {
    position: relative;
    width: 20px;
    height: 24px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.2);
}

.mini-balloon-knot {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-bottom: 4px solid currentColor;
}

/* Arena Field */
.balloon-arena {
    position: relative;
    width: 100%;
    height: 480px;
    background: #ffffff;
    border: 3px solid #f7d8da;
    border-radius: 16px;
    overflow: hidden;
}

.danger-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: #ce434b;
    box-shadow: 0 0 10px #ce434b;
    z-index: 10;
}

/* Dynamic Floating Balloons */
.balloon {
    position: absolute;
    bottom: -90px;
    width: 58px;
    height: 72px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    box-shadow: inset -6px -6px 12px rgba(0, 0, 0, 0.15), inset 6px 6px 12px rgba(255, 255, 255, 0.4);
    z-index: 5;
}

.balloon-knot {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 7px solid currentColor;
}

.balloon-thread {
    position: absolute;
    bottom: -22px;
    left: 50%;
    width: 2px;
    height: 18px;
    background: #1e293b;
    transform: translateX(-50%);
    pointer-events: none;
}

/* Popping Animation */
.balloon.popping {
    transform: scale(1.4);
    opacity: 0;
    transition: transform 0.15s ease-out, opacity 0.15s ease-out;
    pointer-events: none;
}

/* Wrong Pop Explosion Effect */
.balloon.exploding {
    background: #ef4444 !important;
    border-radius: 50%;
    transform: scale(2.2);
    box-shadow: 0 0 30px #ef4444, 0 0 60px #f59e0b;
    animation: flashExplode 0.3s infinite alternate;
    z-index: 20;
}

@keyframes flashExplode {
    0% {
        filter: brightness(1.2) contrast(1.5);
    }

    100% {
        filter: brightness(2) contrast(2);
    }
}

/* Missed Target Reaching Top Animation */
.balloon.missed-top {
    background: #dc2626 !important;
    box-shadow: 0 0 25px #dc2626, 0 0 50px #f87171;
    animation: alertTopShake 0.15s infinite alternate;
    z-index: 25;
}

@keyframes alertTopShake {
    0% {
        transform: translateY(0) scale(1.1);
    }

    100% {
        transform: translateY(-6px) scale(1.25);
    }
}

/* Buttons */
.btn-primary {
    background: #065fd0;
    color: #ffffff;
    border: none;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

    .btn-primary:hover {
        background: #0448a0;
        transform: translateY(-2px);
    }

.btn-secondary {
    background: #ce434b;
    color: #ffffff;
    border: none;
    padding: 6px 16px;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
}

/* Game Over Card */
.game-over-title {
    color: #ce434b;
    font-size: 26px;
    margin-bottom: 8px;
}

.game-over-text {
    color: #475569;
    font-size: 16px;
    margin-bottom: 16px;
}

.final-score-box {
    font-size: 22px;
    font-weight: 800;
    color: #065fd0;
    margin-bottom: 24px;
}
