    /* --- Impaginazione: [dashboard] [campo radar 4:3 o 5:6] [griglia risposte 2x2], sempre interi nello schermo --- */
    :root {
        --s: 1;                                        /* su desktop grande l'interfaccia cresce (la imposta giro_italia.js) */
        --gap: 8px;
        --dash-h: calc(58px * var(--s));
        --ans-h: calc(128px * var(--s));
        --bar-h: 0px;                                  /* altezza della barra pulsanti quando sta sopra (touch) */
    }
    html.has-touch { --bar-h: 56px; --ans-h: 168px; }
    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: var(--gap); padding: 4px 0; overflow: hidden; }
    .stage {
        --ar: 1.3333;                                  /* larghezza / altezza del canvas (la imposta giro_italia.js) */
        --h: min(2400px, calc(var(--app-h, 100vh) - var(--dash-h) - var(--ans-h) - var(--bar-h) - var(--gap) * 2 - 14px), calc(100vw / var(--ar)));
        width: calc(var(--h) * var(--ar));
        flex: none;
        display: flex;
        flex-direction: column;
        gap: var(--gap);
    }
    @supports (height: 100dvh) {
        .stage { --h: min(2400px, calc(var(--app-h, 100dvh) - var(--dash-h) - var(--ans-h) - var(--bar-h) - var(--gap) * 2 - 14px), calc(100vw / var(--ar))); }
    }
    #crt-container { width: 100%; height: var(--h); max-width: none; max-height: none; flex: none; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
    #gameCanvas { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; }
    #start-screen { background-color: rgba(3, 12, 5, 0.9); }

    /* Telefono in orizzontale: campo a sinistra, dashboard e risposte in colonna a destra */
    @media (orientation: landscape) and (max-height: 520px) {
        :root { --dash-h: 58px; }
        .game-wrapper { flex-direction: row; justify-content: center; align-items: center; padding: 4px; }
        .stage {
            --side-w: min(360px, 42vw);
            --h: min(calc(var(--app-h, 100vh) - 8px), calc((100vw - var(--side-w) - 24px) / var(--ar)));
            width: calc(var(--h) * var(--ar) + var(--side-w) + var(--gap));
            height: var(--h);
            display: grid;
            grid-template-columns: calc(var(--h) * var(--ar)) var(--side-w);
            grid-template-rows: 56px var(--dash-h) minmax(0, 1fr);
            grid-template-areas: "cv bar" "cv dash" "cv ans";
            column-gap: var(--gap);
            row-gap: var(--gap);
        }
        @supports (height: 100dvh) {
            .stage { --h: min(calc(var(--app-h, 100dvh) - 8px), calc((100vw - var(--side-w) - 24px) / var(--ar))); }
        }
        #crt-container { grid-area: cv; }
        #dashboard { grid-area: dash; }
        #answers { grid-area: ans; height: auto; }
        #utility-bar, html.has-touch #utility-bar, html.bar-side #utility-bar {
            position: absolute; top: 4px; right: 4px; left: auto; order: 0; margin: 0; flex-direction: row;
        }
    }

    /* --- Dashboard --- */
    .dash {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr) auto auto;
        height: var(--dash-h);
        border: 2px solid #0b5a14;
        background: #060d07;
        box-shadow: inset 0 0 14px rgba(0, 255, 0, 0.12);
        overflow: hidden;
        font-size: calc(16px * var(--s));
    }
    .dash-cell { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0 0.7em; border-right: 1px solid #0b3a12; }
    .dash-cell:last-child { border-right: 0; }
    .dash .lbl { font-size: 0.6em; letter-spacing: 0.14em; color: #4fa05a; line-height: 1.2; }
    .dash strong { display: block; font-size: 1.4em; line-height: 1.1; color: #39ff14; text-shadow: 0 0 8px rgba(57, 255, 20, 0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .dash-place strong { font-size: 1.1em; }
    .dash-place strong.long { font-size: 0.9em; }
    .dash-place strong.masked { color: #2f8a3a; text-shadow: none; letter-spacing: 0.18em; }
    #hud-sub { display: block; min-height: 1.1em; font-size: 0.62em; line-height: 1.2; color: #9fd8a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #hud-lives { display: flex; gap: 0.3em; align-items: center; height: 1.6em; }
    #hud-lives svg { width: 1.6em; height: 1.4em; display: block; }
    #hud-lives svg.lost .heart { display: none; }
    #hud-lives svg:not(.lost) .cross { display: none; }
    #hud-lives svg.gain { animation: heartGain 0.7s ease-out; }
    #hud-lives svg.hit { animation: heartHit 0.45s ease-out; }
    @keyframes heartGain { 0% { transform: scale(2.2); filter: brightness(3); } 100% { transform: scale(1); filter: none; } }
    @keyframes heartHit { 0% { transform: scale(1.5) rotate(-12deg); } 40% { transform: scale(0.8) rotate(10deg); } 100% { transform: scale(1); } }
    #hud-score.bump { animation: scoreBump 0.35s ease-out; }
    @keyframes scoreBump { 0% { transform: scale(1.35); color: #fff; } 100% { transform: scale(1); } }

    /* --- Griglia risposte 2x2 --- */
    .answers { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(0, 1fr); gap: var(--gap); height: var(--ans-h); }
    .ans {
        position: relative;
        height: 100%;
        display: flex;
        align-items: center;
        gap: 0.6em;
        text-align: left;
        padding: 0.3em 0.7em;
        font-family: 'Courier New', Courier, monospace;
        font-weight: bold;
        font-size: calc(15px * var(--s));
        line-height: 1.15;
        color: #c8ffc8;
        background: #08130a;
        border: 3px solid #0f7a1c;
        border-radius: 6px;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.08s, background 0.1s, border-color 0.1s;
    }
    .ans .key { flex: none; display: grid; place-items: center; width: 1.8em; height: 1.8em; border: 2px solid currentColor; border-radius: 4px; font-size: 0.85em; color: #39ff14; }
    .ans .txt { min-width: 0; overflow-wrap: anywhere; }
    .ans:hover, .ans.sel { border-color: #39ff14; background: #0c2210; box-shadow: 0 0 12px rgba(57, 255, 20, 0.55); }
    .ans:active { transform: scale(0.97); background: #14461c; }
    .answers.locked .ans { pointer-events: none; }
    .ans.ok { background: #39ff14; color: #02200a; border-color: #fff; box-shadow: 0 0 26px #39ff14; }
    .ans.ok .key { color: #02200a; }
    .ans.bad { background: #ff2d4a; color: #fff; border-color: #fff; box-shadow: 0 0 26px #ff2d4a; animation: ansShake 0.3s; }
    .ans.bad .key { color: #fff; }
    .ans.reveal { border-color: #39ff14; box-shadow: 0 0 18px #39ff14; animation: ansPulse 0.5s 3; }
    .ans.dim { opacity: 0.4; }
    @keyframes ansShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
    @keyframes ansPulse { 50% { background: #14461c; } }

    /* --- Schermate (iniziale, pausa, finale) --- */
    .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

    /* --- Cronometro e jolly nella dashboard --- */
    #hud-clock { font-variant-numeric: tabular-nums; min-width: 2ch; }
    #hud-clock.low { color: #ff2d4a; text-shadow: 0 0 8px rgba(255, 45, 74, 0.8); animation: clockLow 0.5s steps(2) infinite; }
    @keyframes clockLow { 50% { opacity: 0.45; } }
    .dash-jolly { align-items: flex-start; }
    #btn-jolly {
        font-family: 'Courier New', Courier, monospace; font-weight: bold; font-size: 0.95em; line-height: 1.1;
        padding: 0.18em 0.5em; color: #02200a; background: #ffe63c; border: 2px solid #fff; border-radius: 4px;
        box-shadow: 0 0 10px rgba(255, 230, 60, 0.6); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    }
    #btn-jolly:hover:not(:disabled) { background: #fff; }
    #btn-jolly:active:not(:disabled) { transform: scale(0.95); }
    #btn-jolly:focus-visible { outline: 3px solid #39ff14; outline-offset: 2px; }
    #btn-jolly:disabled { opacity: 0.35; background: #222; color: #9a9a9a; border-color: #555; box-shadow: none; cursor: default; }
    #btn-jolly.gain { animation: heartGain 0.7s ease-out; }
    .ans.gone { opacity: 0.12; filter: grayscale(1); pointer-events: none; }
    .ans.gone .txt { text-decoration: line-through; }
    @media (max-width: 480px) {
        .dash { font-size: calc(13px * var(--s)); }
        .dash-cell { padding: 0 0.5em; }
        #btn-jolly { font-size: 0.85em; padding: 0.15em 0.35em; }
    }

    /* --- Schermata iniziale: scelta di percorso e modalita' --- */
    .giro-setup { margin: 14px 0 4px; text-align: center; }
    .giro-setup h4 { color: #ffaa00; font-size: 0.95rem; letter-spacing: 1px; margin: 12px 0 8px; }
    .opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .opt-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .opt-btn {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        min-height: 54px; padding: 7px 6px; box-sizing: border-box;
        font-family: 'Courier New', Courier, monospace; font-size: 0.85rem; font-weight: bold; line-height: 1.15; text-align: center;
        color: #c8ffc8; background: #08130a; border: 2px solid #0f7a1c; border-radius: 4px;
        cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
        transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
    }
    .opt-btn.wide { grid-column: 1 / -1; }
    .opt-btn .ico { font-size: 1.25rem; line-height: 1; }
    .opt-btn small { font-weight: normal; font-size: 0.7rem; color: #7fbf88; }
    .opt-btn:hover { border-color: #39ff14; }
    .opt-btn.on { color: #fff; background: #0c2a12; border-color: #39ff14; box-shadow: 0 0 12px rgba(57, 255, 20, 0.55); }
    .opt-btn.on small { color: #b8f5b8; }
    .opt-btn:focus-visible { outline: 3px solid #ffe63c; outline-offset: 2px; }
    .setup-desc { min-height: 3.6em; margin: 10px 4px 0; font-size: 0.85rem; line-height: 1.35; color: #b8f5b8; }
    @media (max-width: 480px) {
        .opt-btn { font-size: 0.75rem; min-height: 48px; padding: 5px 3px; }
        .opt-btn small { font-size: 0.62rem; }
        .setup-desc { font-size: 0.78rem; }
    }

    /* --- Schermata finale: bottone per tornare alla scelta --- */
    .game-over-box #btn-menu {
        box-sizing: border-box; height: auto; min-width: 0; padding: 7px 14px; font-family: inherit; font-size: 0.8rem; font-weight: bold; letter-spacing: 1px; text-transform: uppercase;
        color: #aab !important; background: #000 !important; border: 2px solid #556 !important; border-radius: 0; cursor: pointer; touch-action: manipulation; box-shadow: none;
    }
    .game-over-box #btn-menu:hover { background: #fff !important; color: #000 !important; }
    .game-over-box #btn-menu:focus-visible { outline: 3px solid #ffe63c; outline-offset: 2px; }
    @container over (max-height: 490px) and (min-width: 560px) { .game-over-box > #btn-menu { grid-column: 1; } }

    /* --- Esito del round su telefono e tablet: box HTML al posto dei 4 bottoni (testo nitido e leggibile) ---
       Su desktop resta il pannello disegnato nel canvas. La dimensione del testo (--rf) la sceglie giro_italia.js. */
    .res-box { display: none; }
    html.ib-m .res-box.show {
        position: absolute; inset: 0; z-index: 2;
        display: flex; flex-direction: column; justify-content: center; gap: 0.3em;
        box-sizing: border-box; padding: 6px 10px; overflow: hidden;
        font-family: 'Courier New', Courier, monospace; font-size: var(--rf, 13px); line-height: 1.28;
        background: rgba(2, 10, 4, 0.98); border: 3px solid var(--rc, #ff2d4a); border-radius: 6px;
        box-shadow: 0 0 16px var(--rc, #ff2d4a), inset 0 0 18px rgba(0, 0, 0, 0.7);
        cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
        -webkit-user-select: none; user-select: none;
        animation: resIn 0.28s ease-out 0.25s both;
    }
    html.ib-m .res-box.tight { line-height: 1.12; gap: 0.12em; padding-top: 3px; padding-bottom: 3px; }
    .res-box.ok { --rc: #39ff14; }
    .res-box.bad { --rc: #ff2d4a; }
    .res-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 0.8em; }
    .res-title { font-size: 1.55em; font-weight: bold; line-height: 1.15; color: var(--rc, #ff2d4a); text-shadow: 0 0 8px var(--rc, #ff2d4a); }
    .res-sub { font-size: 0.95em; font-weight: bold; color: #ffe63c; }
    .res-name { font-size: 1.12em; font-weight: bold; line-height: 1.2; color: #fff; text-transform: uppercase; overflow-wrap: anywhere; }
    .res-place { font-weight: normal; color: #9fd8a6; text-transform: none; }
    .res-fact { font-size: 1em; color: #b8f5b8; overflow-wrap: anywhere; }
    /* con il box in vista i bottoni sotto si spengono (dopo mezzo secondo, il tempo di vedere il rosso/verde) */
    html.ib-m .answers.boxed .ans { opacity: 0 !important; transition: opacity 0.2s ease 0.5s; }
    @keyframes resIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
    @media (prefers-reduced-motion: reduce) { html.ib-m .res-box.show { animation: none; } }
