* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;

    width: 100%;
    min-height: 100%;

    background:
        radial-gradient(
            circle at top,
            #17345c 0%,
            #050912 55%,
            #010205 100%
        );

    color: white;

    font-family:
        "Courier New",
        monospace;
}

body {
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    padding: 10px;

    overflow-x: hidden;
}

.game-container {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: min(
        100%,
        calc((100vh - 150px) * 0.8)
    );

    max-width: 700px;

    margin-bottom: 5px;
}

h1 {
    margin: 0 0 5px;

    color: #65ddff;

    font-size: clamp(
        18px,
        3vw,
        30px
    );

    letter-spacing: 4px;

    text-align: center;

    text-shadow:
        0 0 5px #2bbcff,
        0 0 15px #2bbcff;
}

.hud {
    display: flex;
    justify-content: space-between;

    padding: 6px 12px;

    background: #05080d;

    border: 2px solid #507fa5;

    color: #ffd966;

    font-size: clamp(
        12px,
        2vw,
        16px
    );
}


/*
|--------------------------------------------------------------------------
| Canvas responsive
|--------------------------------------------------------------------------
|
| Le canvas conserve son ratio 700 / 1000.
|
| Il s'adapte :
| - à la largeur de l'écran
| - à la hauteur disponible
|
*/

canvas {
    display: block;

    width: min(
        100%,
        calc((100vh - 150px) * 0.8)
    );

    max-width: 700px;

    height: auto;

    background: #020713;

    border: 3px ridge #8596a8;

    box-shadow:
        0 0 20px
        rgba(
            50,
            180,
            255,
            0.35
        );
}

.controls {
    width: min(
        100%,
        calc((100vh - 150px) * 0.8)
    );

    max-width: 700px;

    margin-top: 5px;

    padding: 4px;

    color: #b8c7d8;

    font-size: clamp(
        9px,
        1.5vw,
        12px
    );

    text-align: center;
}

.controls p {
    margin: 2px;
}


/*
|--------------------------------------------------------------------------
| Très petits écrans
|--------------------------------------------------------------------------
*/

@media (
    max-height: 750px
) {

    body {
        padding: 4px;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .hud {
        padding: 3px 8px;
        font-size: 11px;
    }

    canvas {
        width: min(
            100%,
            calc((100vh - 105px) * 0.7)
        );
    }

    header,
    .controls {
        width: min(
            100%,
            calc((100vh - 105px) * 0.7)
        );
    }

    .controls {
        font-size: 9px;
    }

    .controls p {
        display: inline;
        margin-right: 5px;
    }
}