:root {
    --panel: rgba(255, 255, 255, 0.8);
    --ink: #2a2a2a;
    --accent: #2e7d32;
    --danger: #c62828;
    --maze-wall: #3e2723;
    --ball: #1565c0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: #f7f4ea;
}

.game-shell {
    width: min(94vw, 860px);
    padding: 14px;
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 18px 45px rgba(44, 32, 16, 0.16);
    position: relative;
    user-select: none;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
}

h1 {
    margin: 0;
    font-size: clamp(1.2rem, 1.9vw, 1.55rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.timer {
    font-weight: 700;
    font-size: 1rem;
    min-width: 110px;
    text-align: right;
}

.status {
    margin: 0 0 10px;
    font-size: 0.94rem;
    min-height: 1.2em;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.control-button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 10px 18px rgba(46, 125, 50, 0.22);
    cursor: pointer;
    min-height: 44px;
}

.control-button[hidden] {
    display: none;
}

.control-button:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}

.control-hint {
    font-size: 0.88rem;
    opacity: 0.85;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: #fefcf7;
    border: 2px solid rgba(62, 39, 35, 0.18);
    cursor: crosshair;
}
