:root {
    --bg: #0f172a;
    --panel: #111827;
    --line: #334155;
    --text: #e2e8f0;
    --accent: #22d3ee;
    --food: #f59e0b;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(circle at top, #1e293b 0%, var(--bg) 55%);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
    display: grid;
    place-items: center;
    padding: 16px;
}

.app {
    width: min(760px, 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

h1 {
    margin: 0;
    font-size: 28px;
}

.hud {
    margin: 0;
    font-size: 18px;
}

canvas {
    width: 400px;
    max-width: 100%;
    aspect-ratio: 3 / 5;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: block;
}

.game-shell {
    position: relative;
}

.game-shell.game-over canvas {
    filter: blur(4px);
}

.game-over-overlay {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(10, 15, 26, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #f8fafc;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.controls {
    display: flex;
}

.leftButtons {
    display: grid;
    grid-template-columns: repeat(3, minmax(64px, 84px));
    grid-template-areas: 'left center right'
                             'x down r';
    justify-content: center;
}

.rightButtons {
    width: 84px;
}
.small {
    font-size: 12px;
    color: #8a8a8a;
}

#btn-up {
    width: 100%;
    height: 100%;
}

#btn-left {
    grid-area: left;
}

#btn-down {
    grid-area: down;
}

#btn-right {
    grid-area: right;
}

#btn-restart {
    width: 100%;
}

.control {
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.control:active {
    transform: translateY(1px);
}

.hidden {
    display: none;
}
