/* Rally CGFA — il carnet di gara: scheda gialla dei controlli orari, road-book a caselle, lastre scure da broadcast.
   Realizzato da CGFA. */
:root {
  --notte: #0b1220;
  --notte-2: #121b2e;
  --lastra: rgba(9, 15, 28, 0.92);
  --linea: rgba(242, 194, 48, 0.22);
  --giallo: #f2c230;
  --giallo-carta: #f4cd45;
  --inchiostro: #1a1408;
  --inchiostro-2: #4a3a12;
  --blu: #0d3a8c;
  --blu-chiaro: #4d82e6;
  --rosso: #e32b2b;
  --verde: #2fbf71;
  --bianco: #f3f5f9;
  --grigio: #a9b3c6;
  --raggio: 4px;
  --fc: "Barlow Condensed", "Arial Narrow", sans-serif;
  --ft: "Barlow", system-ui, sans-serif;
  --uscita: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--notte); color: var(--bianco); font-family: var(--ft); -webkit-tap-highlight-color: transparent; }
::selection { background: var(--giallo); color: var(--inchiostro); }
:focus-visible { outline: 3px solid var(--giallo); outline-offset: 2px; }
#scena { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num, .h-cron, .h-vel b, .tab-tempi td { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ schermate e fogli */
.schermata { position: fixed; inset: 0; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); z-index: 20; overflow-y: auto; }
.schermata.velo { background: rgba(5, 9, 18, 0.55); }
.foglio { width: min(560px, 100%); background: var(--lastra); border: 1px solid var(--linea); border-radius: var(--raggio); padding: 22px 24px 20px; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.7); max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-color: var(--giallo) transparent; scrollbar-width: thin; animation: entra 0.4s var(--uscita) both; }
.foglio.largo { width: min(900px, 100%); }
.foglio.stretto { width: min(360px, 100%); }
@keyframes entra { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.f-testa { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--giallo); }
h2, h3 { font-family: var(--fc); text-transform: uppercase; margin: 0; letter-spacing: 0.01em; line-height: 1; }
h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 900; }
h3 { font-size: 18px; font-weight: 800; color: var(--giallo); margin: 18px 0 8px; }
.f-chiudi { background: none; border: 1px solid var(--linea); border-radius: var(--raggio); width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.f-chiudi:hover { border-color: var(--giallo); }
svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.f-chiudi svg { width: 20px; height: 20px; }
.f-riga { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 14px 0; }
.f-etic { font-family: var(--fc); font-weight: 700; text-transform: uppercase; color: var(--grigio); min-width: 132px; font-size: 16px; }
.f-azioni { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.pila { display: grid; gap: 8px; margin-top: 16px; }
button, .bottone { font-family: var(--fc); font-weight: 800; text-transform: uppercase; font-size: 18px; letter-spacing: 0.02em; padding: 10px 18px; min-height: 46px; border-radius: var(--raggio); border: 1px solid rgba(243, 245, 249, 0.22); background: var(--notte-2); color: var(--bianco); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.15s, border-color 0.15s, transform 0.15s var(--uscita); }
button:hover, .bottone:hover { border-color: var(--giallo); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.pri { background: var(--giallo); color: var(--inchiostro); border-color: var(--giallo); }
button.pri:hover { background: #ffd54d; }
.scelte { display: flex; flex-wrap: wrap; gap: 6px; }
.scelte button { min-height: 40px; padding: 6px 14px; font-size: 16px; background: transparent; }
.scelte button[aria-pressed="true"] { background: var(--bianco); color: var(--notte); border-color: var(--bianco); }
.campo { display: grid; gap: 6px; margin: 12px 0; }
.campo span { font-family: var(--fc); font-weight: 700; text-transform: uppercase; color: var(--grigio); font-size: 16px; }
input, select { background: #0a1120; border: 1px solid rgba(243, 245, 249, 0.25); border-radius: var(--raggio); padding: 10px 12px; min-height: 44px; caret-color: var(--giallo); }
input::placeholder { color: #7d889c; }
input:focus, select:focus { border-color: var(--giallo); outline: none; }
input[type="range"] { accent-color: var(--giallo); padding: 0; }
.testo, .testo-lungo p, .testo-lungo li { color: #d5dbe7; line-height: 1.5; font-size: 15px; max-width: 72ch; }
.testo-lungo ul { padding-left: 20px; margin: 6px 0; }
.testo-lungo a { color: var(--giallo); text-underline-offset: 3px; }
.comandi { list-style: none; padding: 0 !important; display: grid; gap: 4px; }
.comandi li { display: grid; grid-template-columns: minmax(150px, 0.8fr) 2fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.comandi kbd { font-family: var(--fc); font-weight: 800; color: var(--giallo); font-size: 16px; }
.nota-piccola { color: var(--grigio); font-size: 13px; margin: 6px 0 0; }
.separa { text-align: center; color: var(--grigio); font-family: var(--fc); text-transform: uppercase; margin: 20px 0 6px; display: flex; align-items: center; gap: 12px; }
.separa::before, .separa::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.12); }
.errore { color: #ff8a80; font-weight: 600; margin: 12px 0 0; }
.due-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ------------------------------------------------------------------ il carnet (menu principale) */
.carnet-schermo { justify-items: start; background: linear-gradient(90deg, rgba(5, 9, 18, 0.5), rgba(5, 9, 18, 0) 55%); }
.carnet { position: relative; width: min(420px, 100%); margin-left: clamp(0px, 4vw, 64px); background: var(--giallo-carta); color: var(--inchiostro); border-radius: 3px; padding: 22px 24px 18px 40px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.75), 0 2px 0 rgba(0, 0, 0, 0.2);
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, rgba(74, 58, 18, 0.16) 31px 32px);
  animation: entra 0.5s var(--uscita) both; max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-width: none; }
/* fori del carnet sul bordo sinistro */
.carnet::before { content: ""; position: absolute; left: 12px; top: 16px; bottom: 16px; width: 12px; background: radial-gradient(circle at 6px 6px, var(--notte) 5px, transparent 5.5px) 0 0 / 12px 30px repeat-y; opacity: 0.85; }
.c-testa { display: flex; gap: 14px; align-items: center; border-bottom: 3px solid var(--inchiostro); padding-bottom: 12px; }
.c-logo { width: 54px; height: 54px; flex: none; color: var(--blu); stroke-width: 4; }
.c-testa h1 { font-family: var(--fc); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(40px, 5vw, 58px); line-height: 0.88; margin: 0; letter-spacing: -0.01em; }
.c-testa h1 span { color: var(--blu); }
.c-testa p { margin: 4px 0 0; font-family: var(--fc); font-weight: 700; text-transform: uppercase; color: var(--inchiostro-2); font-size: 15px; }
.c-voci { display: grid; margin-top: 8px; }
.c-voce { justify-content: start; background: transparent; border: 0; border-bottom: 1px dashed rgba(26, 20, 8, 0.35); border-radius: 0; color: var(--inchiostro); display: grid; justify-items: start; gap: 1px; padding: 12px 6px; text-align: left; min-height: 64px; position: relative; }
.c-voce b { font-size: 24px; font-weight: 900; line-height: 1; }
.c-voce small { font-family: var(--ft); text-transform: none; font-weight: 500; font-size: 13px; color: var(--inchiostro-2); letter-spacing: 0; }
.c-voce:hover, .c-voce:focus-visible { background: rgba(26, 20, 8, 0.07); }
.c-voce::after { content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; border-top: 3px solid var(--inchiostro); border-right: 3px solid var(--inchiostro); transform: translateY(-50%) rotate(45deg); transition: right 0.2s var(--uscita); }
.c-voce:hover::after { right: 4px; }
.c-voce.primaria b { color: var(--blu); font-size: 28px; }
.c-piccoli { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.c-piccoli button { background: transparent; color: var(--inchiostro); border: 2px solid var(--inchiostro); font-size: 15px; min-height: 40px; padding: 6px 12px; }
.c-piccoli button:hover { background: var(--inchiostro); color: var(--giallo-carta); }
.c-piede { font-size: 12px; color: var(--inchiostro-2); margin: 12px 0 0; }
.c-piede a { color: var(--inchiostro); font-weight: 600; text-underline-offset: 2px; }

/* ------------------------------------------------------------------ road-book delle prove */
.roadbook { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: ps; }
.rb-riga { display: grid; grid-template-columns: 56px 64px 1fr auto; align-items: stretch; background: #0a1120; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--raggio); cursor: pointer; overflow: hidden; transition: border-color 0.15s; min-height: 72px; }
.rb-riga:hover { border-color: rgba(242, 194, 48, 0.6); }
.rb-riga[aria-selected="true"] { border-color: var(--giallo); box-shadow: inset 0 0 0 1px var(--giallo); }
.rb-num { background: var(--giallo); color: var(--inchiostro); font-family: var(--fc); font-weight: 900; display: grid; place-items: center; font-size: 22px; line-height: 0.9; text-align: center; }
.rb-num small { display: block; font-size: 12px; font-weight: 800; }
.rb-tulip { display: grid; place-items: center; border-right: 1px solid rgba(255, 255, 255, 0.08); background: var(--bianco); color: var(--inchiostro); }
.rb-tulip svg { width: 52px; height: 52px; stroke-width: 2.6; }
.rb-testo { padding: 10px 14px; display: grid; align-content: center; gap: 2px; }
.rb-testo b { font-family: var(--fc); font-weight: 800; text-transform: uppercase; font-size: 22px; line-height: 1; }
.rb-testo span { color: var(--grigio); font-size: 13px; }
.rb-dati { padding: 10px 14px; display: grid; align-content: center; justify-items: end; gap: 2px; font-family: var(--fc); text-transform: uppercase; }
.rb-dati .fondo { font-weight: 800; font-size: 15px; padding: 2px 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); }
.rb-dati .record { font-size: 15px; color: var(--giallo); font-weight: 700; font-variant-numeric: tabular-nums; }
.rb-dati .fatto { color: var(--verde); }
.roadbook.compatto .rb-riga { min-height: 54px; grid-template-columns: 48px 1fr auto; cursor: default; }
.roadbook.compatto .rb-tulip { display: none; }
.roadbook.compatto .rb-testo b { font-size: 18px; }
.roadbook.compatto .rb-riga.attuale { border-color: var(--giallo); }

/* garage: livree */
.livree { display: flex; gap: 8px; flex-wrap: wrap; }
.livree button { width: 64px; height: 44px; padding: 0; overflow: hidden; border-width: 2px; }
.livree button[aria-pressed="true"] { border-color: var(--giallo); box-shadow: 0 0 0 2px var(--giallo); }
.livree i { display: block; width: 100%; height: 100%; }

/* tabelle tempi */
.tab-tempi { width: 100%; border-collapse: collapse; font-family: var(--fc); font-size: 18px; }
.tab-tempi th { text-align: left; color: var(--grigio); font-weight: 700; text-transform: uppercase; font-size: 14px; padding: 4px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
.tab-tempi td { padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-weight: 600; }
.tab-tempi td.pos { width: 34px; color: var(--grigio); font-weight: 800; }
.tab-tempi td.t { text-align: right; font-weight: 800; }
.tab-tempi td.d { text-align: right; color: var(--grigio); width: 90px; }
.tab-tempi tr.io td { background: rgba(242, 194, 48, 0.14); color: var(--giallo); }
.tab-tempi tr.io td.pos { color: var(--giallo); }
.schede { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.schede button { min-height: 38px; font-size: 15px; padding: 6px 12px; background: transparent; }
.schede button[aria-selected="true"] { background: var(--giallo); color: var(--inchiostro); border-color: var(--giallo); }

/* sfida online */
.codice-grande { font-family: var(--fc); font-weight: 900; font-size: clamp(44px, 9vw, 72px); letter-spacing: 0.18em; text-align: center; background: var(--giallo); color: var(--inchiostro); border-radius: var(--raggio); padding: 8px 0 4px; margin: 10px 0; }
.stato-onl { text-align: center; color: var(--grigio); font-family: var(--fc); font-size: 18px; text-transform: uppercase; }

/* ------------------------------------------------------------------ fine prova: la scheda del controllo orario timbrata */
.scheda-ct { background: var(--giallo-carta); color: var(--inchiostro); border-radius: 3px; display: grid; grid-template-columns: 1fr auto; margin-bottom: 16px; overflow: hidden; }
.ct-testa { grid-column: 1 / -1; display: flex; gap: 12px; align-items: baseline; padding: 10px 16px; border-bottom: 2px solid var(--inchiostro); font-family: var(--fc); text-transform: uppercase; }
.ct-testa span { font-weight: 900; font-size: 22px; background: var(--inchiostro); color: var(--giallo-carta); padding: 0 8px; border-radius: 2px; }
.ct-testa b { font-weight: 800; font-size: 24px; }
.ct-righe { padding: 10px 16px; display: grid; gap: 4px; font-size: 15px; align-content: center; grid-column: 1; grid-row: 2; }
.ct-righe div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed rgba(26, 20, 8, 0.3); padding: 3px 0; }
.ct-righe b { font-family: var(--fc); font-size: 18px; font-variant-numeric: tabular-nums; }
.ct-casella { grid-column: 2; grid-row: 2; position: relative; border-left: 2px solid var(--inchiostro); padding: 12px 22px; display: grid; align-content: center; justify-items: center; min-width: 220px; }
.ct-casella span { font-family: var(--fc); font-weight: 800; text-transform: uppercase; font-size: 14px; color: var(--inchiostro-2); }
.ct-casella b { font-family: var(--fc); font-weight: 900; font-size: clamp(40px, 6vw, 58px); line-height: 1; font-variant-numeric: tabular-nums; }
.timbro { position: absolute; right: 8px; bottom: 6px; font-family: var(--fc); font-weight: 900; text-transform: uppercase; font-size: 15px; color: #b3161f; border: 3px double #b3161f; border-radius: 4px; padding: 2px 8px; transform: rotate(-9deg); opacity: 0; mix-blend-mode: multiply; }
.timbro.via { animation: timbra 0.5s var(--uscita) 0.25s both; }
@keyframes timbra { 0% { opacity: 0; transform: rotate(-16deg) scale(2.4); filter: blur(3px); } 60% { opacity: 1; transform: rotate(-8deg) scale(0.94); filter: blur(0); } 100% { opacity: 0.92; transform: rotate(-9deg) scale(1); } }
.invio { gap: 8px; }
.invio input { flex: 1; min-width: 180px; }
#fEsito { color: var(--grigio); font-size: 14px; }

/* ------------------------------------------------------------------ HUD in gara */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: var(--fc); }
.h-tempo { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; background: var(--lastra); border-radius: var(--raggio); overflow: hidden; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6); }
.h-ps { background: var(--giallo); color: var(--inchiostro); font-weight: 900; font-size: 20px; padding: 6px 10px; display: grid; place-items: center; }
.h-cron { font-weight: 800; font-size: clamp(28px, 3.6vw, 40px); padding: 2px 16px; line-height: 1.2; min-width: 6.2ch; text-align: center; }
.h-delta { font-weight: 800; font-size: 20px; padding: 0 12px; display: grid; place-items: center; }
.h-delta.meglio { background: var(--verde); color: #04140b; }
.h-delta.peggio { background: var(--rosso); color: #fff; }
.h-note { position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); display: flex; gap: 6px; }
.nota { width: clamp(78px, 9vw, 104px); background: var(--bianco); color: var(--inchiostro); border-radius: var(--raggio); display: grid; justify-items: center; padding: 6px 4px 6px; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.7); opacity: 0.72; transform: scale(0.88); transform-origin: top left; transition: transform 0.25s var(--uscita), opacity 0.25s; }
.nota.prima { opacity: 1; transform: none; }
.nota.prima span { background: var(--giallo); border-radius: 2px; padding: 1px 6px 0; }
.nota svg { width: 64%; height: auto; stroke-width: 3.4; }
.nota span { font-weight: 900; font-size: clamp(16px, 1.8vw, 21px); text-transform: uppercase; line-height: 1; text-align: center; }
.nota .att { font-style: normal; background: var(--rosso); color: #fff; border-radius: 2px; padding: 0 5px; margin-right: 3px; }
.h-rivale { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 58px); left: 50%; transform: translateX(-50%); background: var(--lastra); border-radius: var(--raggio); padding: 4px 12px; display: flex; gap: 10px; font-size: 18px; text-transform: uppercase; font-weight: 700; }
.h-rivale b { color: var(--giallo); font-variant-numeric: tabular-nums; }
.h-strumenti { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: clamp(150px, 17vw, 210px); aspect-ratio: 1; }
.h-strumenti canvas { width: 100%; height: 100%; }
.h-vel { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.h-vel b { font-weight: 900; font-size: clamp(38px, 4.6vw, 58px); line-height: 0.9; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.h-vel small { font-weight: 700; font-size: 14px; color: var(--grigio); text-transform: uppercase; }
.h-marcia { position: absolute; right: 2%; bottom: 4%; width: 26%; aspect-ratio: 1; background: var(--giallo); color: var(--inchiostro); border-radius: var(--raggio); display: grid; place-items: center; font-weight: 900; font-size: clamp(22px, 2.6vw, 32px); }
.h-mappa { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); width: clamp(120px, 13vw, 176px); display: grid; gap: 6px; }
.h-mappa canvas { width: 100%; aspect-ratio: 1; background: var(--lastra); border-radius: var(--raggio); }
.h-avanz { height: 6px; background: rgba(255, 255, 255, 0.15); border-radius: 3px; overflow: hidden; }
.h-avanz i { display: block; height: 100%; width: 0; background: var(--giallo); }
.h-danni { display: flex; align-items: center; gap: 6px; background: var(--lastra); border-radius: var(--raggio); padding: 4px 8px; }
.h-danni svg { width: 18px; height: 18px; flex: none; color: var(--grigio); }
.h-danni span { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.12); border-radius: 3px; overflow: hidden; }
.h-danni i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--verde), var(--giallo) 50%, var(--rosso)); background-size: 200px 100%; }
.h-msg { position: absolute; top: 36%; left: 50%; transform: translate(-50%, -50%); background: var(--lastra); border-radius: var(--raggio); padding: 10px 26px; font-weight: 900; text-transform: uppercase; font-size: clamp(30px, 5vw, 64px); line-height: 1; text-align: center; animation: msg 0.35s var(--uscita) both; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7); }
.h-msg.via { background: var(--verde); color: #04140b; }
.h-msg.giallo { background: var(--giallo); color: var(--inchiostro); }
.h-msg small { display: block; font-size: 0.38em; font-weight: 700; margin-top: 4px; }
@keyframes msg { from { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.h-inter { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 60px); left: 50%; transform: translateX(-50%); display: flex; font-size: 22px; font-weight: 800; text-transform: uppercase; border-radius: var(--raggio); overflow: hidden; animation: msg 0.3s var(--uscita) both; }
.h-inter span { background: var(--lastra); padding: 4px 12px; }
.h-inter b { padding: 4px 12px; font-variant-numeric: tabular-nums; }
.h-pausa { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); pointer-events: auto; width: 46px; height: 46px; padding: 0; background: var(--lastra); }
.h-pausa svg { width: 22px; height: 22px; stroke-width: 3; }

/* comandi touch */
.tocco { position: absolute; inset: auto 0 0 0; height: 46%; pointer-events: none; }
.tocco button { pointer-events: auto; position: absolute; border-radius: 50%; background: rgba(9, 15, 28, 0.55); border: 2px solid rgba(243, 245, 249, 0.35); font-size: 15px; touch-action: none; user-select: none; -webkit-user-select: none; }
.tocco button.attivo { background: rgba(242, 194, 48, 0.85); color: var(--inchiostro); border-color: var(--giallo); }
.tocco svg { width: 40%; height: 40%; stroke-width: 3; }
.t-sx button { width: 19vh; height: 19vh; bottom: calc(14vh + env(safe-area-inset-bottom)); }
.t-sx button:first-child { left: calc(3vw + env(safe-area-inset-left)); }
.t-sx button:last-child { left: calc(3vw + 22vh + env(safe-area-inset-left)); }
.t-dx button { width: 18vh; height: 18vh; }
.t-gas { right: calc(2vw + env(safe-area-inset-right)); bottom: 22vh; }
.t-freno { right: calc(2vw + 21vh + env(safe-area-inset-right)); bottom: 6vh; }
.t-mano { right: calc(2vw + env(safe-area-inset-right)); bottom: 2vh; width: 15vh !important; height: 15vh !important; font-size: 12px !important; line-height: 1; }
body.tocco-on .h-strumenti { right: auto; left: 50%; transform: translateX(-50%); width: 120px; bottom: 6px; }
body.tocco-on .h-mappa { display: none; }

/* caricamento, credit, telefono in verticale */
.caricamento { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; align-content: center; gap: 14px; background: var(--notte); transition: opacity 0.5s; }
.caricamento.via { opacity: 0; pointer-events: none; }
.car-barra { width: min(320px, 70vw); height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
.car-barra i { display: block; height: 100%; width: 100%; background: var(--giallo); transform-origin: left; transform: scaleX(0); transition: transform 0.3s var(--uscita); }
.caricamento p { font-family: var(--fc); text-transform: uppercase; font-weight: 700; letter-spacing: 0.04em; color: var(--grigio); margin: 0; }
.credit { position: fixed; right: 10px; bottom: 4px; z-index: 30; font-size: 11px; }
.credit a { color: rgba(243, 245, 249, 0.7); text-decoration: none; }
body.in-gara .credit { display: none; }
.ruota-tel { position: fixed; inset: 0; z-index: 50; background: var(--notte); display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; font-family: var(--fc); text-transform: uppercase; font-size: 22px; font-weight: 800; padding: 24px; }
.ruota-tel svg { width: 80px; height: 80px; color: var(--giallo); }

@media (max-width: 760px) {
  .due-col { grid-template-columns: 1fr; }
  .rb-riga { grid-template-columns: 48px 1fr auto; }
  .rb-tulip { display: none; }
  .scheda-ct { grid-template-columns: 1fr; }
  .ct-casella { grid-column: 1; grid-row: 2; border-left: 0; border-bottom: 2px solid var(--inchiostro); }
  .ct-righe { grid-row: 3; }
  .comandi li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-height: 520px) {
  .foglio { padding: 14px 16px; }
  .carnet { padding: 14px 16px 12px 34px; }
  .c-voce { min-height: 50px; padding: 8px 6px; }
  .c-voce small { display: none; }
  .c-testa h1 { font-size: 38px; }
  .h-msg { top: 30%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* foto per le schede (parametro ?pulito): solo la scena 3D */
body.pulito #hud, body.pulito .schermata, body.pulito .credit, body.pulito #caricamento, body.pulito #centrale-cgfa { display: none !important; }
