* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;

    font-family:
        Arial,
        "Segoe UI",
        sans-serif;

    color: #ffffff;

    background:
        radial-gradient(
            circle at top,
            #3b1d5e 0%,
            #21102f 40%,
            #0d0814 100%
        );
}


.arcade {
    width: 100%;
    max-width: 1100px;

    margin: 0 auto;

    padding: 60px 25px 30px;
}


/* ================================
   Header
================================ */

.arcade-header {
    text-align: center;

    margin-bottom: 35px;
}

.arcade-header h1 {
    font-size: clamp(2.2rem, 7vw, 4.5rem);

    letter-spacing: 5px;

    font-weight: 700;

    text-shadow:
        0 0 15px rgba(255,255,255,.15);
}

.tagline {
    margin-top: 12px;

    font-size: .9rem;

    letter-spacing: 4px;

    color: #b9a9c9;
}


/* ================================
   Status
================================ */

.status-panel {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 25px;

    flex-wrap: wrap;

    margin-bottom: 35px;

    font-size: .85rem;

    color: #aaa;
}

#connectionStatus {
    display: flex;

    align-items: center;

    gap: 8px;
}

.status-dot {

    width: 9px;
    height: 9px;

    border-radius: 50%;

    display: inline-block;

    background: #999;
}

.status-dot.online {
    background: #36d67a;

    box-shadow:
        0 0 8px rgba(54,214,122,.7);
}

.status-dot.offline {
    background: #e05252;

    box-shadow:
        0 0 8px rgba(224,82,82,.5);
}


/* ================================
   Games
================================ */

.games {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(240px, 1fr)
        );

    gap: 20px;

    max-width: 900px;

    margin: 0 auto;
}


.game-card {

    appearance: none;

    border: 1px solid
        rgba(255,255,255,.1);

    border-radius: 18px;

    padding: 30px 20px;

    min-height: 250px;

    color: #ffffff;

    background:
        rgba(255,255,255,.055);

    box-shadow:
        0 10px 30px
        rgba(0,0,0,.25);

    cursor: pointer;

    transition:
        transform .2s ease,
        background .2s ease,
        border-color .2s ease;
}

.game-card:hover {

    transform:
        translateY(-5px);

    background:
        rgba(255,255,255,.09);

    border-color:
        rgba(255,255,255,.22);
}

.game-card:active {

    transform:
        translateY(-1px)
        scale(.99);
}


.game-icon {

    font-size: 4rem;

    margin-bottom: 20px;
}

.game-name {

    font-size: 1.3rem;

    font-weight: 700;

    letter-spacing: 3px;
}

.game-description {

    margin-top: 10px;

    font-size: .9rem;

    color: #aaa;
}

.game-best {

    margin-top: 25px;

    font-size: .75rem;

    letter-spacing: 1px;

    color: #8f829c;
}


/* ================================
   Footer
================================ */

.arcade-footer {

    margin-top: 50px;

    display: flex;

    justify-content: center;

    gap: 25px;

    flex-wrap: wrap;

    font-size: .7rem;

    color: #665d6c;
}


/* ================================
   Mobile
================================ */

@media (max-width: 600px) {

    .arcade {
        padding:
            40px 15px 25px;
    }

    .arcade-header h1 {
        letter-spacing: 3px;
    }

    .games {
        grid-template-columns: 1fr;
    }

    .game-card {
        min-height: 210px;
    }

}

/* ================================
   Game Screen
================================ */

.game-screen {

    width: 100%;

    min-height: 80vh;

    display: flex;

    flex-direction: column;
}


.game-header {

    display: grid;

    grid-template-columns:
        1fr auto 1fr;

    align-items: center;

    gap: 15px;

    margin-bottom: 20px;
}


.game-title {

    text-align: center;

    font-size: 1.2rem;

    font-weight: 700;

    letter-spacing: 3px;
}


.game-button {

    padding:
        9px 14px;

    border:
        1px solid
        rgba(255,255,255,.15);

    border-radius: 8px;

    background:
        rgba(255,255,255,.06);

    color: #fff;

    cursor: pointer;

    font-size: .75rem;
}

.game-header
.game-button:last-child {

    justify-self: end;
}


.game-container {

    flex: 1;

    min-height: 500px;

    border:
        1px solid
        rgba(255,255,255,.08);

    border-radius: 18px;

    background:
        rgba(0,0,0,.2);

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;
}


/* ================================
   Temporary test game
================================ */

.test-game {

    text-align: center;

    max-width: 500px;

    padding: 30px;
}


.test-game-title {

    font-size: 2rem;

    font-weight: 700;

    letter-spacing: 3px;

    margin-bottom: 20px;
}


.test-game p {

    color: #aaa;

    margin-bottom: 10px;
}


.primary-game-button,
.secondary-game-button {

    border: none;

    border-radius: 9px;

    padding:
        12px 22px;

    margin:
        10px 5px;

    cursor: pointer;

    font-size: .8rem;

    letter-spacing: 1px;
}


.primary-game-button {

    background:
        rgba(255,255,255,.15);

    color: #fff;
}


.secondary-game-button {

    background:
        rgba(255,255,255,.06);

    color: #aaa;
}


.game-over {

    text-align: center;
}


.game-over-title {

    font-size: 2rem;

    font-weight: 700;

    letter-spacing: 4px;
}


.game-over-score {

    margin:
        20px 0;

    font-size: 4rem;

    font-weight: 700;
}


.game-error {

    text-align: center;

    color: #aaa;
}


@media (max-width: 600px) {

    .game-header {

        grid-template-columns:
            auto 1fr auto;
    }


    .game-title {

        font-size: .9rem;

        letter-spacing: 2px;
    }


    .game-container {

        min-height: 450px;
    }

}

/* ================================
   Runner
================================ */

.runner-canvas {

    display: block;

    width: 100%;

    height: 100%;

    touch-action: none;

    user-select: none;

    -webkit-user-select: none;
}


/* ================================
   Runner / Game polish
================================ */

.game-screen {
    animation:
        gameScreenIn .25s ease-out;
}

@keyframes gameScreenIn {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-container {
    position: relative;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.035),
            rgba(255,255,255,.015)
        );
}

.runner-canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.game-over {
    padding: 35px 25px;
}

.game-over-title {
    font-size: clamp(2rem, 7vw, 3.2rem);
    text-shadow:
        0 4px 0 rgba(0,0,0,.25);
}

.game-over-score {
    line-height: 1;
    font-family: monospace;
    letter-spacing: 2px;
}

.game-over-best {
    margin:
        -5px
        0
        20px;

    min-height: 20px;

    font-size: .78rem;

    letter-spacing: 2px;

    color:
        rgba(255,255,255,.68);
}

