    /* --- Impaginazione: campo 560x640 (7:8), sempre intero nello schermo --- */
    :root { --ctrl-h: 0px; }
    /* Sui dispositivi touch: barra utility sopra il campo (non lo copre) + controlli sotto.
       --ctrl-h è lo spazio verticale che occupano insieme. */
    html.has-touch { --ctrl-h: 196px; }
    html.has-touch #utility-bar {
        position: static;
        order: -1;
        margin-top: 4px;
    }

    .game-wrapper {
        height: var(--app-h, 100vh);
        height: var(--app-h, 100dvh);
        gap: 8px;
    }
    #crt-container {
        --ar: 0.875;                                  /* larghezza / altezza del campo: 560 / 640 */
        --hmax: 2400px;               /* su desktop il campo si allarga fino a riempire lo schermo */
        --h: min(var(--hmax), calc(var(--app-h, 100dvh) - var(--ctrl-h) - 16px), calc(100vw / var(--ar)));
        height: var(--h);
        width: calc(var(--h) * var(--ar));
        max-width: none;
        max-height: none;
        flex: none;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
    }
    /* Il canvas riempie sempre il contenitore, che ha già le proporzioni giuste */
    #gameCanvas {
        position: absolute;
        top: 0; left: 0;
        width: 100% !important;
        height: 100% !important;
    }

    /* La schermata iniziale lascia intravedere il chiosco dietro */
    #start-screen { background-color: rgba(10, 8, 18, 0.9); }


    /* Schermata finale: leggera, si riparte al volo con SPAZIO o toccando lo schermo */
    .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

    /* --- Controlli touch (compaiono solo sui dispositivi touch: classe .has-touch) --- */
    .arcade-mobile-controls {
        display: none;
        width: min(100vw, 480px);
        height: 120px;
        padding: 0 14px;
        justify-content: space-between;
        align-items: center;
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    html.has-touch .arcade-mobile-controls { display: flex; }
    .mc-dpad {
        display: grid;
        grid-template-columns: repeat(3, 52px);
        grid-template-rows: repeat(2, 52px);
        gap: 6px;
    }
    .mc-btn {
        height: auto;
        padding: 0;
        font-family: 'Courier New', monospace;
        font-weight: bold;
        font-size: 20px;
        color: #fff;
        background: #1a1a2e;
        border: 2px solid #39ff14;
        border-radius: 10px;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }
    .mc-btn:active, .mc-btn.is-down { background: #39ff14; color: #000; }
    .mc-up { grid-column: 2; grid-row: 1; }
    .mc-left { grid-column: 1; grid-row: 2; }
    .mc-down { grid-column: 2; grid-row: 2; }
    .mc-right { grid-column: 3; grid-row: 2; }
    .mc-btn.mc-pepper {
        width: 96px; height: 96px; border-radius: 50%;
        font-size: 34px; line-height: 1;
        border-color: #ff2d55; background: #2a0f14;
        box-shadow: 0 0 14px rgba(255, 45, 85, 0.55);
    }
    .mc-btn.mc-pepper small { display: block; font-size: 11px; letter-spacing: 1px; margin-top: 2px; }
    .mc-btn.mc-pepper:active, .mc-btn.mc-pepper.is-down { background: #ff2d55; color: #000; }
