.brain-game-panel {
    box-sizing: border-box;
    width: min(400px, calc(100vw - 32px));
    margin: 0 auto;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, .95);
    border-radius: 24px;
    background:
        radial-gradient(ellipse at 18% 30%, rgba(255,255,255,.65) 0 5%, transparent 13%),
        radial-gradient(ellipse at 78% 48%, rgba(255,255,255,.48) 0 8%, transparent 18%),
        linear-gradient(180deg, #72c5ec 0%, #b5e7f7 75%, #e3f6eb 100%);
    box-shadow: 0 18px 38px rgba(36, 86, 126, .18), 0 3px 8px rgba(36, 86, 126, .1), inset 0 0 0 1px rgba(72, 157, 194, .24);
}

.brain-game-panel #question {
    position: relative;
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
    width: fit-content;
    min-width: 170px;
    max-width: calc(100% - 28px);
    margin: 16px auto 0;
    padding: 9px 24px;
    border: 1px solid rgba(255,255,255,.95);
    border-radius: 18px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 7px 20px rgba(36, 86, 126, .12), inset 0 1px 0 #fff;
    color: #214b72;
    font: 800 clamp(30px, 8vw, 42px)/1.2 Arial, sans-serif;
    letter-spacing: -.025em;
    text-align: center;
}

#game-container {
    z-index: 1;
    cursor: crosshair;
    box-sizing: border-box;
    width: 100%;
    height: 440px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

#game-container::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 22px;
    background: linear-gradient(180deg, transparent, rgba(82, 169, 128, .18));
    pointer-events: none;
}

.progress-indicator {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: fit-content;
    max-width: calc(100vw - 24px);
    margin: 18px auto 0;
    padding: 12px 16px;
    border: 1px solid #dbe8f5;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(36, 86, 126, .12), inset 0 1px 0 #fff;
}

.progress-indicator .progress-dot {
    flex: 0 0 10px;
    width: 10px;
    height: 14px;
    margin: 0;
    border-radius: 999px;
    background: #d8e2ec !important;
    box-shadow: inset 0 1px 2px rgba(37, 65, 92, .12);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.progress-indicator .progress-dot[style*="green"] {
    background: #25b78d !important;
    box-shadow: 0 0 0 2px rgba(37, 183, 141, .13), inset 0 1px 2px rgba(255,255,255,.36);
}

.progress-indicator .progress-dot[style*="red"] {
    background: #ed6b78 !important;
    box-shadow: 0 0 0 2px rgba(237, 107, 120, .13), inset 0 1px 2px rgba(255,255,255,.32);
}

.progress-indicator .progress-dot.middle,
.progress-indicator .progress-dot[style*="blue"] {
    flex-basis: 14px;
    width: 14px;
    height: 20px;
    background: #5369d7 !important;
    box-shadow: 0 0 0 4px rgba(83, 105, 215, .13), inset 0 1px 2px rgba(255,255,255,.34);
}

#message {
    min-height: 1.3em;
    margin: 14px auto 0;
    color: #233d62;
    font-weight: 700;
}

#game-container .balloon {
    margin-left: -6px;
    width: 68px;
    height: 190px;
    bottom: -85px;
    border-radius: 0;
    line-height: normal;
    background: transparent;
    overflow: visible;
    isolation: isolate;
    cursor: crosshair;
    -webkit-tap-highlight-color: transparent;
}

#game-container .balloon-envelope {
    position: absolute;
    top: 0;
    left: 0;
    width: 68px;
    height: 78px;
    border-radius: 48% 48% 46% 46% / 42% 42% 56% 56%;
    background: radial-gradient(ellipse at 28% 22%, rgba(255,255,255,.85) 0 5%, rgba(255,255,255,.32) 12%, transparent 35%),
        radial-gradient(ellipse at 72% 78%, rgba(0,0,0,.24), transparent 55%),
        var(--balloon-color, #e65b75);
    box-shadow: inset -5px -6px 9px rgba(0,0,0,.13), inset 3px 3px 7px rgba(255,255,255,.35), 2px 5px 8px rgba(0,0,0,.15);
}

#game-container .balloon-knot {
    position: absolute;
    top: 75px;
    left: 28px;
    width: 12px;
    height: 9px;
    background: var(--balloon-color, #e65b75);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
    filter: brightness(.76);
}

#game-container .balloon-string {
    position: absolute;
    top: 82px;
    left: 4px;
    width: 60px;
    height: 104px;
    transform-origin: 50% 0;
    animation: balloon-string-sway 2.4s ease-in-out infinite alternate;
}

#game-container .balloon:nth-child(even) .balloon-string { animation-delay: -1.2s; }

#game-container .balloon-string svg { width: 100%; height: 100%; overflow: visible; }
#game-container .balloon-string path { fill: none; stroke: #475569; stroke-width: 1.7; stroke-linecap: round; }

#game-container .balloon-flattened .balloon-envelope {
    transform: translateY(33px) scaleY(.16) scaleX(1.18);
    transition: transform .25s ease-in;
}

#game-container .balloon-flattened .balloon-knot,
#game-container .balloon-flattened .balloon-string {
    opacity: 0;
    transition: opacity .15s;
}

#game-container .balloon-number {
    position: absolute;
    top: 34px;
    left: 9px;
    min-width: 42px;
    padding: 3px 2px;
    border-radius: 12px;
    background: #fffdf5;
    box-shadow: 0 2px 6px rgba(32,49,70,.22);
    color: #14233b;
    font: 700 19px/1.25 Arial, sans-serif;
    text-align: center;
}

@keyframes balloon-string-sway {
    from { transform: rotate(-9deg) translateX(-2px); }
    to { transform: rotate(9deg) translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
    #game-container .balloon-string { animation: none; }
}
