* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 24px;
    font-family:
        "Hiragino Kaku Gothic ProN",
        "Yu Gothic",
        sans-serif;
    color: #243447;
    background:
        linear-gradient(180deg,
            #dff6ff 0%,
            #fff7d6 100%);
}

.game-container {
    width: min(100%, 1040px);
    margin: 0 auto;
    text-align: center;
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 5vw, 48px);
    color: #236b4e;
}

.description {
    margin: 0 0 20px;
    font-size: 16px;
}

.game-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 8px solid #ffffff;
    border-radius: 20px;
    background-color: #9ddcff;
    box-shadow: 0 12px 30px rgb(0 0 0 / 18%);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    background-color: #9ddcff;
}

.message-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgb(0 0 0 / 45%);
}

.message-screen.hidden {
    display: none;
}

.message-box {
    width: min(90%, 420px);
    padding: 32px 24px;
    border-radius: 18px;
    background-color: #ffffff;
    box-shadow: 0 10px 25px rgb(0 0 0 / 25%);
}

.message-box h2 {
    margin: 0 0 12px;
    font-size: 32px;
    color: #e15b3d;
}

.message-box p {
    margin: 0 0 24px;
    font-size: 18px;
}

button {
    padding: 12px 28px;
    border: none;
    border-radius: 999px;
    font-size: 17px;
    font-weight: bold;
    color: #ffffff;
    background-color: #2a9d6f;
    cursor: pointer;
    transition:
        transform 0.2s,
        background-color 0.2s;
}

button:hover {
    background-color: #207a56;
    transform: translateY(-2px);
}

button:focus-visible {
    outline: 4px solid #ffd166;
    outline-offset: 3px;
}

.controls {
    margin-top: 20px;
    padding: 16px;
    border-radius: 14px;
    background-color: rgb(255 255 255 / 80%);
}

.controls h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.control-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 24px;
}

.control-list span {
    font-size: 15px;
    font-weight: bold;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .game-wrapper {
        border-width: 4px;
        border-radius: 12px;
    }

    .description {
        font-size: 13px;
    }

    .control-list {
        flex-direction: column;
        gap: 8px;
    }
}