    /* --- Pacco Pazzo: campo 480x640 (3:4) sempre intero; su touch barra sopra e tasti sotto --- */
    :root { --ctrl-h: 0px; }
    html.has-touch { --ctrl-h: 150px; }
    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.75;                                   /* larghezza / altezza del canvas: 480 / 640 */
        --hmax: 2400px;
        --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;
        -webkit-touch-callout: none;
    }
    #gameCanvas {
        position: absolute;
        top: 0; left: 0;
        width: 100% !important;
        height: 100% !important;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Palette di Natale (variabili di assets/css/arcade-ui.css) */
    body[data-game="pacco_pazzo"] {
        --ui-accent: #ff3b3b;
        --ui-accent2: #3ddc84;
        --ui-bg: #140c0a;
        --ui-start: #3ddc84;
        --ui-start-sub: #ffd24a;
        --ui-rules: #3ddc84;
        --ui-rules-key: #ffd24a;
        --ui-cta: #ff3b3b;
        --ui-cta-ink: #fff;
    }
    body[data-game="pacco_pazzo"] #start-screen { background-color: rgba(20, 10, 8, 0.86); }

    .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) ---
       Tasti "vetro neon" come in Pinball e Voxelia: sfondo scuro, bordo e alone del colore del tasto (--tz).
       A sinistra ◀ ▼ ▶, a destra ruota / POSA; in più, sul campo, ci sono i gesti (pacco_pazzo.js). */
    .arcade-mobile-controls {
        display: none;
        width: min(100vw, 480px);
        height: 84px;
        padding: 0 10px;
        gap: 12px;
        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-lt, .mc-rt { display: flex; flex: 1 1 0; justify-content: center; gap: 6px; }
    .mc-btn {
        --tz: 57, 255, 20;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 0;
        min-width: 0;
        max-width: 84px;
        height: 60px;
        padding: 0;
        font-family: 'Courier New', monospace;
        font-weight: bold;
        font-size: 24px;
        line-height: 1;
        letter-spacing: 0;
        color: rgb(var(--tz));
        background: rgba(10, 10, 14, 0.82);
        border: 2px solid rgba(var(--tz), 0.75);
        border-radius: 12px;
        box-shadow: 0 0 8px rgba(var(--tz), 0.25), inset 0 0 14px rgba(var(--tz), 0.12);
        text-shadow: 0 0 6px rgba(var(--tz), 0.8);
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.06s linear, box-shadow 0.06s linear, transform 0.06s linear;
    }
    .mc-btn:active, .mc-btn.is-down {
        color: #fff;
        background: rgba(var(--tz), 0.3);
        box-shadow: 0 0 18px rgba(var(--tz), 0.7), inset 0 0 22px rgba(var(--tz), 0.35);
        transform: scale(0.97);
    }
    .mc-btn.mc-rot { --tz: 255, 214, 10; font-size: 30px; }
    .mc-btn.mc-drop { --tz: 255, 149, 0; font-size: 14px; }

    /* ---- Telefono in verticale: una sola riga di tasti, alti quanto lo schermo permette
       (selettori piu' specifici di quelli di mobile.css, che viene caricato dopo) ---- */
    html.ib-m.ib-flow:not(.ib-land) body #mobile-controls {
        --mc-h: clamp(54px, calc(var(--app-h, 100dvh) * 0.085), 72px);
        max-width: 520px;
        padding: 5px 8px 7px;
        gap: 12px;
        justify-content: center;
    }
    html.ib-m.ib-flow:not(.ib-land) body #mobile-controls .mc-btn { height: var(--mc-h); max-width: 84px; }

    /* Schermi da 320 px: tasti un po' piu' stretti */
    @media (max-width: 350px) {
        html.ib-m body[data-game="pacco_pazzo"] #utility-bar button,
        html.ib-m body[data-game="pacco_pazzo"] #utility-bar .ib-info-btn { min-width: 33px; padding: 0 3px; }
        html.ib-m.ib-flow:not(.ib-land) body #mobile-controls { padding: 4px 5px 6px; gap: 8px; }
        html.ib-m.ib-flow:not(.ib-land) body #mobile-controls .mc-lt,
        html.ib-m.ib-flow:not(.ib-land) body #mobile-controls .mc-rt { gap: 4px; }
    }

    /* ---- Telefono in orizzontale: ai due lati, in basso (la barra dei pulsanti sta in colonna a sinistra) ---- */
    html.ib-land.ib-flow body #mobile-controls { --mc-h: clamp(46px, 15dvh, 62px); }
    html.ib-land.ib-flow body #mobile-controls .mc-lt,
    html.ib-land.ib-flow body #mobile-controls .mc-rt { flex: none; }
    html.ib-land.ib-flow body #mobile-controls .mc-btn { flex: none; width: clamp(46px, 7.5vw, 64px); height: var(--mc-h); font-size: 22px; }
    html.ib-land.ib-flow body #mobile-controls .mc-btn.mc-rot { font-size: 26px; }
    html.ib-land.ib-flow body #mobile-controls .mc-btn.mc-drop { font-size: 12px; }
    html.ib-land.ib-flow[data-sidebar="land"] body #mobile-controls { padding-left: calc(env(safe-area-inset-left, 0px) + 56px); }

