.game-hud {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 560px;
    justify-content: center;
}

.hud-box {
    flex: 1;
    min-width: 0;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: center;
}

.hud-box .label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.hud-box .value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.difficulty-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.difficulty-selector .diff-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
}

.size-selector {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.size-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 100px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.size-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.size-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 14px var(--primary-glow);
}

.game-controls .btn {
    min-height: 44px;
}

.move-counter {
    font-variant-numeric: tabular-nums;
}

.move-counter span {
    color: var(--text);
    font-weight: 700;
}

.game-container .game-status {
    max-width: 100%;
    min-width: min(100%, 340px);
}

.game-canvas {
    cursor: pointer;
    touch-action: manipulation;
    margin: 0 auto;
}

.game-canvas:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.shell-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.shell-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}

.control-hint {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: center;
}

.num-pad {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: 520px;
}

.pad-key {
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pad-key:hover {
    border-color: var(--primary);
    background: rgba(124, 108, 255, 0.12);
}

.pad-key.wide {
    font-family: var(--font-body);
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .shell-layout {
        flex-direction: column;
        align-items: center;
    }

    .shell-layout .highscore-panel {
        width: min(560px, 100%);
    }
}

@media (max-width: 600px) {
    .game-container {
        padding: 24px 12px;
        gap: 18px;
    }

    .game-header h1 {
        font-size: 1.6rem;
    }

    .game-container .game-canvas-wrapper {
        padding: 10px;
    }

    .hud-box {
        padding: 8px 6px;
    }

    .hud-box .value {
        font-size: 1.15rem;
    }

    .game-container .game-status {
        padding: 12px 16px;
    }
}
