* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    font-family: Tahoma, Arial, sans-serif;
}

body {
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;

    background:
        radial-gradient(circle at 15% 20%,
            rgba(255, 255, 255, 0.35) 0 35px,
            transparent 36px),

        radial-gradient(circle at 85% 30%,
            rgba(255, 255, 255, 0.25) 0 25px,
            transparent 26px),

        linear-gradient(
            to bottom,
            #7c4dff 0%,
            #36c9ff 48%,
            #67e8a5 100%
        );
}

#game-container::before,
#game-container::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.3;
    filter: blur(1px);
}

#game-container::before {
    width: 180px;
    height: 180px;
    background: #fff176;
    top: 18%;
    left: -70px;
}

#game-container::after {
    width: 230px;
    height: 230px;
    background: #ff80ab;
    right: -100px;
    bottom: 15%;
}

#game-header {
    position: absolute;
    top: 18px;
    right: 0;
    left: 0;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 0 18px;
    pointer-events: none;
}

#game-header h1, #game-header #score-board {
    pointer-events: auto;
}

#game-header h1 {
    color: #ffffff;
    font-size: clamp(20px, 5vw, 32px);
    text-shadow:
        0 3px 0 #6a1b9a,
        0 5px 12px rgba(0, 0, 0, 0.22);
    letter-spacing: -1px;
}

#score-board {
    min-width: 105px;
    padding: 9px 15px;
    text-align: center;
    color: #54206e;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #ffffff;
    border-radius: 22px;
    box-shadow:
        0 6px 0 rgba(91, 33, 182, 0.25),
        0 10px 20px rgba(0, 0, 0, 0.15);
}

#score-board span {
    display: block;
    font-size: 12px;
    font-weight: bold;
}

#score-board strong {
    display: block;
    margin-top: 2px;
    color: #f43f5e;
    font-size: 25px;
    line-height: 1;
}

.balloon {
    width: 50px;
    height: 60px;
    position: absolute;
    z-index: 5;
    bottom: -80px;

    cursor: pointer;
    touch-action: none;

    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;

    box-shadow:
        inset -8px -10px 0 rgba(0, 0, 0, 0.12),
        inset 9px 8px 0 rgba(255, 255, 255, 0.35),
        0 5px 12px rgba(0, 0, 0, 0.2);

    animation-name: floatUp;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.balloon::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 12px;
    width: 10px;
    height: 17px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: rotate(35deg);
}

.balloon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    bottom: -5px;
    left: 20px;
    background: inherit;
    transform: rotate(45deg);
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-120vh); 
    }
}

.particle {
    position: absolute;
    z-index: 10;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 8px currentColor;
}

.game-message {
    position: absolute;
    inset: 0;
    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
    background: rgba(44, 19, 91, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.game-message.hidden {
    display: none;
}

.message-card {
    width: min(90%, 380px);
    padding: 28px 22px;
    color: #54206e;
    text-align: center;

    background: #ffffff;
    border: 5px solid #fff176;
    border-radius: 30px;

    box-shadow:
        0 8px 0 #ffb300,
        0 20px 45px rgba(0, 0, 0, 0.3);

    animation: messageIn 0.35s ease-out;
}

.message-icon {
    font-size: 52px;
    margin-bottom: 5px;
}

.message-card h2 {
    color: #f43f5e;
    font-size: 32px;
    margin-bottom: 10px;
}

.message-card p {
    color: #673ab7;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.diff-btn {
    border: none;
    border-radius: 16px;
    padding: 14px 20px;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: #ffffff;
    transition: transform 0.15s ease, filter 0.15s ease;
    touch-action: manipulation;
}

.diff-btn.easy {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    box-shadow: 0 4px 0 #1b5e20;
}

.diff-btn.medium {
    background: linear-gradient(135deg, #ffb300, #ff8f00);
    box-shadow: 0 4px 0 #e65100;
}

.diff-btn.hard {
    background: linear-gradient(135deg, #f44336, #c62828);
    box-shadow: 0 4px 0 #b71c1c;
}

.diff-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.diff-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.final-score {
    margin: 18px 0;
    padding: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #7c4dff, #ec4899);
    border-radius: 16px;
    font-size: 15px;
    font-weight: bold;
}

.final-score strong {
    margin-right: 5px;
    font-size: 24px;
    color: #fff176;
}

#restart-button {
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 13px 18px;

    color: #ffffff;
    background: linear-gradient(135deg, #ff4081, #7c4dff);

    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    touch-action: manipulation;

    box-shadow: 0 5px 0 #6a1b9a;
    transition: 0.15s ease;
}

#restart-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

#restart-button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #6a1b9a;
}

footer {
    position: absolute;
    right: 0;
    bottom: 10px;
    left: 0;
    z-index: 20;

    padding: 8px 15px;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    font-size: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

footer strong {
    color: #fff176;
    font-size: 13px;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--x), var(--y)) scale(0) rotate(360deg);
        opacity: 0;
    }
}

@keyframes messageIn {
    0% {
        opacity: 0;
        transform: scale(0.7) rotate(-4deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@media (max-width: 520px) {
    #game-header {
        align-items: flex-start;
        padding: 0 12px;
    }

    #game-header h1 {
        max-width: 190px;
        line-height: 1.4;
    }

    #score-board {
        min-width: 90px;
        padding: 8px 10px;
    }

    #score-board strong {
        font-size: 22px;
    }

    .balloon {
        width: 46px;
        height: 56px;
    }

    .message-card h2 {
        font-size: 28px;
    }
}
