:root {
    color-scheme: light;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #203149;
    background: #f4f8fc;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: clamp(1.25rem, 5vw, 4rem);
    background: radial-gradient(circle at 82% 3%, #fff2cc 0, transparent 26rem), #f4f8fc;
}

.game-page {
    width: min(100%, 68rem);
    margin: 0 auto;
}

.page-heading {
    margin: 0 0 1.6rem;
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: #e27a41;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 7vw, 4rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

h1 span {
    color: #f6ad37;
    font-size: 0.68em;
    vertical-align: 0.12em;
}

.subtitle {
    max-width: 42rem;
    margin: 0.8rem 0 0;
    color: #65748a;
    line-height: 1.6;
}

.game-card {
    padding: clamp(0.75rem, 2vw, 1.25rem);
    border: 1px solid #e3eaf1;
    border-radius: 1.3rem;
    background: #fff;
    box-shadow: 0 1.5rem 4rem rgb(41 69 98 / 12%);
}

.game-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.15rem 0 1rem;
}

.objective,
.score {
    margin: 0;
    font-weight: 750;
}

.objective {
    color: #52647c;
}

.score {
    margin-left: auto;
    color: #397e61;
    font-variant-numeric: tabular-nums;
}

.restart,
.touch-controls button {
    min-height: 2.75rem;
    border: 0;
    border-radius: 0.7rem;
    background: #e9754a;
    color: white;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    touch-action: none;
}

.restart {
    padding: 0 1rem;
}

.restart span {
    padding-left: 0.3rem;
    font-size: 1.2em;
}

.canvas-frame {
    overflow: hidden;
    border-radius: 0.85rem;
    background: #b9e8ff;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
}

.game-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3.7rem;
    gap: 1rem;
}

.keyboard-hint,
.tech-note {
    margin: 0;
    color: #78869a;
    font-size: 0.82rem;
}

kbd {
    display: inline-block;
    min-width: 1.7rem;
    margin: 0 0.15rem;
    padding: 0.22rem 0.35rem;
    border: 1px solid #dce4ed;
    border-bottom-width: 2px;
    border-radius: 0.35rem;
    background: #f8fafc;
    color: #52647c;
    font: inherit;
    font-weight: 700;
    text-align: center;
}

.tech-note {
    margin-top: 1rem;
    text-align: center;
}

.touch-controls {
    display: none;
    gap: 0.5rem;
}

.touch-controls button {
    min-width: 3.2rem;
    padding: 0 0.85rem;
    background: #edf4f7;
    color: #39566d;
    font-size: 1.2rem;
}

#jump {
    background: #e9754a;
    color: #fff;
    font-size: 0.95rem;
}

button:hover {
    filter: brightness(0.96);
}

button:focus-visible {
    outline: 3px solid #80b9e8;
    outline-offset: 3px;
}

@media (pointer: coarse), (max-width: 700px) {
    body {
        padding: 1.25rem 0.75rem;
    }

    .touch-controls {
        display: flex;
    }

    .keyboard-hint {
        display: none;
    }

    .game-footer {
        justify-content: center;
        padding-top: 0.75rem;
    }
}

@media (max-width: 420px) {
    .game-toolbar {
        flex-wrap: wrap;
        gap: 0.7rem;
    }

    .score {
        margin-left: 0;
    }

    .restart {
        margin-left: auto;
    }
}
