    /* --- Impaginazione: campo compatto 476x556 (telefoni) oppure largo 3:2 (desktop, classe layout-wide) --- */
    :root { --ctrl-h: 0px; }
    /* Sui dispositivi touch: barra utility sopra il campo (non lo copre) + D-Pad sotto.
       --ctrl-h è lo spazio verticale che occupano insieme. */
    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.8561;                                 /* larghezza / altezza del canvas: 476 / 556 */
        --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;
    }
    html.layout-wide #crt-container { --ar: 1.5; --hmax: 2400px; }
    /* 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;
    }

    /* Layout telefono: il riquadro ha la misura esatta del canvas (px CSS), calcolata dal gioco (--mu-w / --mu-h) */
    html.ib-m.ib-flow body #crt-container.mu-phone { width: var(--mu-w); height: var(--mu-h); }

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

    /* Titolo h1 della schermata iniziale: stesso aspetto degli h2 delle altre pagine */

    .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 SCORTA / ruota / DROP; in più, sul campo, ci sono i gesti (muratore_caduta.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-hold { --tz: 0, 229, 255; font-size: 11px; }
    .mc-btn.mc-drop { --tz: 255, 149, 0; font-size: 14px; }

    /* Filo a piombo acceso: il pulsante della barra si illumina */
    #utility-bar #btn-guide.is-on { background: #39ff14; border-color: #39ff14; color: #000; }

    /* ---- 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; }

    /* 8 pulsanti nella barra: sui 320 px devono stare in una riga sola (altrimenti rubano altezza al campo) */
    @media (max-width: 350px) {
        html.ib-m body[data-game="muratore_caduta"] #utility-bar button,
        html.ib-m body[data-game="muratore_caduta"] #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; }
        .mc-btn.mc-hold { font-size: 10px; }
    }

    /* ---- 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-hold { font-size: 10px; }
    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); }

    /* Suggerimento dei gesti: più basso in orizzontale */
    .ib-hint-mu p { max-width: 90%; }
    html.ib-land .ib-hint-mu { bottom: auto; top: 18%; }
    html.ib-land .ib-hint-mu .gh-track { font-size: 20px; gap: 36px; }
    html.ib-land .ib-hint-mu .gh-finger { font-size: 30px; }
