.game_overlay {
    display: flex;
    justify-content: center;
    align-items: center;

    position: absolute;
    inset: 0;
    z-index: 20;

    width: 100%;

    background:
        radial-gradient(circle at 50% 28%, rgba(37, 188, 222, 0.22), transparent 22rem),
        rgba(0, 0, 0, 0.78);
}

.loading_screen {
    z-index: 40;

    background:
        radial-gradient(circle at 50% 28%, rgba(93, 246, 255, 0.28), transparent 24rem),
        linear-gradient(180deg, rgba(3, 32, 70, 0.96), rgba(0, 8, 22, 0.96));
}

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

    min-width: min(420px, 78vw);
    padding: 34px 42px;
    gap: 18px;

    color: white;
    background:
        linear-gradient(180deg, rgba(10, 48, 88, 0.82), rgba(0, 18, 42, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 26px;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.loading_box h2 {
    margin: 0;

    font-family: "Luckiest Guy", Arial, sans-serif;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 400;
    letter-spacing: 2px;
    text-shadow:
        0 3px 0 rgba(0, 0, 0, 0.35),
        0 0 14px rgba(93, 246, 255, 0.46);
}

.loading_bar {
    overflow: hidden;

    width: 100%;
    height: 24px;

    background: rgba(0, 0, 0, 0.38);
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
}

.loading_bar_fill {
    width: 0%;
    height: 100%;

    background:
        linear-gradient(90deg, rgba(111, 255, 236, 0.95), rgba(43, 149, 255, 0.95));
    border-radius: 999px;

    transition: width 120ms ease;
}

.loading_box p {
    margin: 0;

    font-family: "Luckiest Guy", Arial, sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
}


.start_screen,
.win_screen {
    width: 100%;
    height: 100%;
}

.game_over_screen {
    position: absolute;
    top: 25%;
    width: 60%;
    height: 60%;

    object-fit: contain;
}

.start_button {
    position: absolute;
    bottom: 14%;
    left: 50%;

    transform: translateX(-50%);
}

.image_button.start_button:active {
    transform: translateX(-50%) scale(0.96) translateY(1px);
}

.restart_overlay_button {
    position: absolute;
    bottom: 12%;
    left: 50%;

    transform: translateX(-50%);
}

.image_button.restart_overlay_button:active {
    transform: translateX(-50%) scale(0.96) translateY(1px);
}

.start_button,
.restart_overlay_button {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile_controls {
    display: none;
}

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

    font-family: "Luckiest Guy", Arial, sans-serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 1px;
    text-align: center;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.4),
        0 0 10px rgba(93, 246, 255, 0.42);

    position: absolute;
    top: 26%;
    left: 50%;
    z-index: 25;

    min-width: 240px;
    padding: 18px 34px;
    gap: 8px;

    color: white;
    background:
        linear-gradient(180deg, rgba(5, 28, 55, 0.78), rgba(0, 0, 0, 0.76));
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: 20px;
    box-shadow:
        0 16px 32px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    transform: translate(-50%, -50%);
}

.score_box p {
    margin: 0;
}

@media (max-width: 900px),
(max-height: 570px) {

    .game_overlay {
        z-index: 30;
    }

    .image_button img {
        width: 84px;
    }

    .start_button {
        bottom: 16%;
    }

    .restart_overlay_button {
        bottom: 14%;
    }

    .mobile_controls {
        position: absolute;
        left: 0;
        right: 0;
        bottom: clamp(18px, 8vh, 64px);
        z-index: 30;

        display: flex;
        justify-content: space-between;
        align-items: flex-end;

        padding: 0 24px;
        pointer-events: none;
        user-select: none;
        touch-action: none;
    }

    .mobile_controls button {
        pointer-events: auto;
        min-width: 58px;
        min-height: 52px;
        border: none;
        border-radius: 14px;

        background: rgba(31, 41, 55, 0.55);
        color: white;

        font-family: "Luckiest Guy", Arial, sans-serif;
        font-size: 18px;
        font-weight: 400;
        letter-spacing: 1px;
    }

    .mobile_controls button:active {
        transform: scale(0.96);
        background: rgba(55, 65, 81, 0.75);
    }

    .mobile_dpad {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .mobile_dpad div {
        display: flex;
        gap: 8px;
    }

    .mobile_actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile_actions button {
        min-width: 86px;
    }

    .score_box {
        top: 26%;
        padding: 14px 24px;
        font-size: 22px;
    }
}

@media (max-width: 400px) {

    .mobile_controls button {
        font-family: "Luckiest Guy", Arial, sans-serif;
        font-size: 18px;
        font-weight: 400;
        letter-spacing: 1px;
        text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);

        min-width: 58px;
        min-height: 52px;

        color: #ffffff;

        background:
            linear-gradient(180deg, rgba(113, 255, 236, 0.78), rgba(28, 128, 203, 0.72));
        box-shadow:
            0 8px 18px rgba(0, 0, 0, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.42);
        border: 1px solid rgba(255, 255, 255, 0.42);
        border-radius: 16px;

        pointer-events: auto;
    }

}