html,
body {
    overscroll-behavior: none;
}

body {
    height: 100dvh;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: calc(var(--safe-top) + var(--space-4));
    padding-right: calc(var(--safe-right) + var(--space-3));
    padding-bottom: calc(var(--safe-bottom) + var(--space-3));
    padding-left: calc(var(--safe-left) + var(--space-3));
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    overflow: hidden;
}

.app {
    width: min(94vw, 660px);
    margin-top: var(--space-5);
    display: grid;
    gap: var(--space-3);
    touch-action: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-size: 14px;
}

.stats {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-subtle);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.score,
.high-score {
    font-weight: 700;
}

#board {
    display: block;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    background: #f7f8f8;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.status {
    min-height: 16px;
    text-align: center;
    color: var(--text-subtle);
    font-size: 13px;
}

.status:empty {
    display: none;
}

@media (max-width: 640px) {
    body {
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .topbar {
        gap: var(--space-1);
        font-size: 13px;
    }

    .stats {
        gap: var(--space-1);
    }

    .status {
        font-size: 12px;
    }
}
