/* Il simulatore di volo. Classi con prefisso volo-. Lingua: DIREZIONE.md (carta nautica): piastre inchiostro a tinta
   piatta, cifre B612 Mono, cartigli col righello, rombi rossi. Niente sfumature, ombre, raggi, sfocature. */
.volo-pagina { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--inchiostro); overscroll-behavior: none; }
.volo-pagina .avviso { flex: none; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); padding-top: 7px; padding-bottom: 7px; line-height: 1.3; }
.volo-scena { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--golfo); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* il titolo per i lettori di schermo non si vede, ma prende comunque un colore che sul fondo della scena si leggerebbe */
.volo-scena > h1 { color: var(--carta); }
.volo-fermo, .volo-tela { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; }
/* l'immagine d'attesa è la stessa inquadratura del titolo: su schermo largo si taglia al centro (come fa la camera), su quello stretto tiene il castello */
.volo-fermo { object-fit: cover; object-position: 50% 50%; }
@media (max-aspect-ratio: 8/5) { .volo-fermo { object-position: 78% 46%; } }
.volo-tela { opacity: 0; outline: none; }
.volo-scena.viva .volo-tela { opacity: 1; }
.volo-scena.viva .volo-fermo { display: none; }

/* --- strumenti --- */
.volo-strumenti { position: absolute; inset: 0; pointer-events: none; --bordo: max(10px, env(safe-area-inset-left)); }
.volo-strumenti > * { position: absolute; }
.volo-piastra { background: var(--piastra); color: var(--carta); padding: 8px 12px 9px; display: grid; grid-template-columns: auto auto; gap: 2px 12px; align-items: baseline; }
.volo-voce { font-size: 14px; line-height: 1.2; }
.volo-cifra { font-family: var(--cifre); font-weight: 700; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.volo-punti { left: var(--bordo); top: 10px; }
.volo-punti .volo-cifra:first-of-type { font-size: var(--c-strumento); }
.volo-anello { right: max(10px, env(safe-area-inset-right)); top: 64px; }
.volo-quota { left: var(--bordo); bottom: max(10px, env(safe-area-inset-bottom)); }
.volo-comandi-alti { right: max(10px, env(safe-area-inset-right)); top: 10px; display: flex; gap: 8px; pointer-events: auto; }
.volo-tasto { width: 46px; height: 46px; display: grid; place-items: center; background: var(--piastra); color: var(--carta); border: 1px solid var(--carta); cursor: pointer; padding: 0; }
.volo-tasto:active { transform: translateY(var(--premuto)); }
.volo-tasto .volo-barra { display: none; }
.volo-tasto[aria-pressed="true"] .volo-barra { display: block; }
.volo-tasto[aria-pressed="true"] .volo-onde { display: none; }
.volo-tasto:focus-visible, .volo-batti:focus-visible { outline: 3px solid var(--carta); outline-offset: 2px; }

/* il nastro di prua: la bussola srotolata, col rombo rosso verso il prossimo anello */
.volo-prua { left: 50%; top: 10px; width: min(340px, 44vw); height: 46px; transform: translateX(-50%); background: var(--piastra); overflow: hidden; border-bottom: 1px solid var(--carta); }
.volo-nastro { position: absolute; left: 50%; top: 0; height: 100%; width: 1440px; margin-left: -720px; will-change: transform;
  /* le tacche sono un disegno, come nel resto del sito: una lunga ogni 90 gradi, una corta ogni 10 */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='15'%3E%3Cpath d='M1 0v15' stroke='%23E9E8DD' stroke-width='2'/%3E%3Cpath d='M20.5 7v8M40.5 7v8M60.5 7v8M80.5 7v8M100.5 7v8M120.5 7v8M140.5 7v8M160.5 7v8' stroke='%23E9E8DD'/%3E%3C/svg%3E") repeat-x 0 100%; }
.volo-nastro span { position: absolute; top: 5px; width: 40px; margin-left: -20px; text-align: center; color: var(--carta); font-family: var(--cifre); font-weight: 700; font-size: 15px; line-height: 1; }
/* lancetta e rombo stanno dentro il nastro, non fra gli strumenti: la posizione assoluta va detta qui (senza, il rombo
   restava incollato al bordo sinistro e indicava sempre «a sinistra») */
.volo-lancetta, .volo-rotta { position: absolute; }
.volo-lancetta { left: 50%; bottom: 0; width: 2px; height: 20px; margin-left: -1px; background: var(--carta); }
.volo-rotta { left: 50%; top: 27px; margin-left: -7px; will-change: transform; }

.volo-luogo { left: 0; right: 0; top: 68px; margin: 0 auto; width: fit-content; max-width: calc(100% - 20px); font-size: 18px; opacity: 0; }
.volo-luogo.si { opacity: 1; }
.volo-premio { left: 0; right: 0; top: 31%; margin: 0 auto; width: fit-content; max-width: calc(100% - 20px); background: var(--rosso); color: var(--bianco); font-family: var(--cifre); font-weight: 700; font-size: 26px; line-height: 1; padding: 8px 12px; white-space: nowrap; opacity: 0; }
.volo-premio.si { opacity: 1; }
.volo-premio.meno { background: var(--inchiostro); color: var(--carta); }
.volo-suggerimento { left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); margin: 0 auto; width: fit-content; max-width: min(520px, calc(100% - 440px)); white-space: normal; text-wrap: balance; font-family: var(--testi); font-weight: 400; font-size: 15px; line-height: 1.35; padding: 8px 12px; text-align: center; opacity: 0; }
.volo-suggerimento.si { opacity: 1; }
.volo-batti { right: max(14px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: 104px; height: 104px; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--piastra); color: var(--carta); border: 2px solid var(--carta); font-family: var(--testi); font-weight: 700; font-size: 14px; line-height: 1.1; pointer-events: auto; cursor: pointer; touch-action: none; padding: 0; }
.volo-batti:active, .volo-batti.giu { background: var(--rosso); border-color: var(--rosso); color: var(--bianco); transform: translateY(var(--premuto)); }
.volo-scena.tocco .volo-batti { display: flex; }
.volo-testa-vista { right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); width: 132px; background: var(--piastra); border: 1px solid var(--carta); }
.volo-testa-quadro { aspect-ratio: 4 / 3; overflow: hidden; background: var(--golfo); }
.volo-testa-quadro video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.volo-testa-stato { display: block; color: var(--carta); font-size: 14px; line-height: 1.2; padding: 4px 6px 5px; }
.volo-testa-stato.persa { background: var(--rosso); color: var(--bianco); }
@media (prefers-reduced-motion: no-preference) {
  .volo-luogo, .volo-suggerimento { transition: opacity var(--secco-durata) var(--secco); }
  .volo-premio.si { animation: volo-su var(--ago-comando) var(--ago) both; }
  @keyframes volo-su { from { transform: translateY(14px); } to { transform: translateY(0); } }
}

/* --- cartigli sopra la scena --- */
.volo-cartiglio { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); width: min(470px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; overscroll-behavior: contain; z-index: 3; touch-action: pan-y; user-select: text; -webkit-user-select: text; }
.volo-cartiglio h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.05; margin-bottom: 10px; }
.volo-cartiglio h2 em { display: block; }
.volo-sopra { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; margin: 0 0 12px; }
.volo-casa { font-family: var(--titoli); font-weight: 700; font-size: 20px; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.volo-riga { font-size: 16px; line-height: 1.45; margin: 0 0 16px; }
.volo-carico { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; height: 5px; }
.volo-carico-barra { display: block; width: 100%; height: 100%; }
.volo-carico-barra span { display: block; height: 100%; background: var(--rosso); transform: scaleX(0); transform-origin: 0 50%; }
.volo-carico.fatto { visibility: hidden; }
.volo-avvio { padding-bottom: calc(var(--aria) + 2px); }
.volo-avvio h2 { margin-bottom: 18px; }
.volo-pausa, .volo-fine, .volo-testa { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(520px, calc(100% - 24px)); max-height: calc(100% - 20px); display: flex; flex-direction: column; overflow: hidden; }
.volo-pausa > .righello, .volo-fine > .righello, .volo-testa > .righello { flex: none; }
.volo-cartiglio > .righello:first-child { margin-bottom: 16px; }
.volo-corpo { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; }
.volo-corpo > :last-child { margin-bottom: 0; }
.volo-azioni { flex: none; margin-top: 14px; padding-top: 14px; border-top: var(--filo) solid var(--inchiostro); }
.volo-velo { position: absolute; inset: 0; background: var(--piastra); z-index: 2; }
.volo-voci { display: grid; gap: 10px; margin-bottom: 4px; }
.volo-voci .comando { width: 100%; justify-content: flex-start; min-height: 48px; }
.volo-voci .comando.principale { min-height: 56px; }
.volo-scelta { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; min-height: 48px; padding-top: 10px; border-top: var(--filo) solid var(--inchiostro); font-weight: 700; font-size: 16px; }
.volo-scelta-nota { display: block; font-weight: 400; font-size: 14px; line-height: 1.3; }
.volo-scelta select { flex: none; height: 46px; min-width: 150px; padding: 0 34px 0 12px; border: var(--filo) solid var(--inchiostro); border-radius: 0; background: var(--carta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2322271F' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--inchiostro); font: inherit; font-weight: 700; appearance: none; -webkit-appearance: none; cursor: pointer; }
.volo-scelta select:focus-visible { outline: 3px solid var(--rosso); outline-offset: 2px; }
.volo-scena.tocco .volo-tasti { display: none; }
@media (hover: none) and (pointer: coarse) { .volo-tasti { display: none; } }
.volo-gesti { margin-bottom: 0; }
.volo-gesti li { min-height: 40px; padding: 8px 0 7px; font-size: 15px; }
.volo-testa-prova { display: grid; grid-template-columns: 148px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.volo-testa-prova .volo-testa-quadro { border: 1px solid var(--inchiostro); }
.volo-testa-prova .volo-riga { margin: 0; font-size: 15px; }
.volo-errore { border: 2px solid var(--rosso); padding: 10px 12px; font-size: 15px; margin: 0 0 14px; }
.volo-totale { font-family: var(--titoli); font-weight: 700; font-size: 20px; margin: 0 0 8px; display: flex; align-items: baseline; gap: 10px; }
.volo-totale .cifra { font-family: var(--titoli); font-size: clamp(46px, 9vw, 68px); line-height: 1; }
.volo-conti th, .volo-conti td { padding-top: 7px; padding-bottom: 6px; }
.volo-conti tbody th { font-family: var(--testi); font-weight: 400; font-size: 16px; }
.volo-firma { margin: 16px 0 12px; }
.volo-firma.fatta { margin-top: 12px; }
.volo-firma.fatta label, .volo-firma.fatta .volo-firma-riga { display: none; }
.volo-firma label { display: block; font-size: 15px; margin-bottom: 2px; }
.volo-firma-riga { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.volo-firma input { flex: 1 1 170px; min-width: 0; height: 48px; background: transparent; border: 0; border-bottom: 2px solid var(--inchiostro); font-family: var(--titoli); font-weight: 700; font-size: 22px; padding: 0 2px; outline-offset: 2px; }
.volo-firma .comando { min-height: 48px; }
.volo-esito { min-height: 22px; font-size: 15px; margin: 8px 0 0; }
.volo-esito.errore { color: var(--rosso); font-weight: 700; }
.volo-classifica { margin-bottom: 0; }
/* a firma fatta, su uno schermo largo: i conti a sinistra, la classifica a destra */
@media (min-width: 900px) { .volo-fine.firmato { width: min(900px, calc(100% - 24px)); } .volo-fine.firmato .volo-corpo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; align-items: start; } .volo-fine.firmato .volo-firma.fatta { margin-top: 0; } }
.volo-classifica td, .volo-classifica th { padding-top: 6px; padding-bottom: 5px; }
.volo-classifica .rombo { margin-right: 6px; }
.volo-demo { display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 14px; width: auto; max-width: min(520px, calc(100% - 16px)); overflow: visible; }
.volo-demo .volo-riga { margin: 0; font-size: 14px; line-height: 1.3; }
.volo-demo .comando { flex: none; min-height: 44px; padding: 0 16px; }
.volo-guasto, .volo-senza { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100% - 24px)); padding: 18px 20px; z-index: 5; margin: 0; }
.volo-senza { position: fixed; }

/* telefono in verticale e schermi bassi */
@media (max-width: 640px) {
  .volo-pagina .avviso { font-size: 14px; padding-top: 6px; padding-bottom: 6px; }
  .volo-cifra { font-size: 18px; }
  .volo-punti .volo-cifra:first-of-type { font-size: 22px; }
  .volo-piastra { padding: 6px 9px 7px; gap: 1px 9px; }
  .volo-prua { top: 62px; width: min(300px, calc(100% - 20px)); }
  .volo-anello { top: 62px; right: auto; left: var(--bordo); top: 116px; }
  .volo-luogo { top: 116px; left: auto; right: 10px; margin: 0; max-width: 56%; text-align: right; }
  .volo-quota { bottom: max(10px, env(safe-area-inset-bottom)); }
  .volo-suggerimento { bottom: 136px; max-width: calc(100% - 24px); }
  .volo-scena.tocco .volo-suggerimento { bottom: 136px; }
  .volo-testa-vista { width: 104px; bottom: 132px; }
  .volo-cartiglio { left: 8px; bottom: 8px; width: calc(100% - 16px); }
  .volo-pausa, .volo-fine, .volo-testa { left: 50%; bottom: auto; width: calc(100% - 16px); }
  .volo-testa-prova { grid-template-columns: 112px 1fr; }
}
@media (max-height: 520px) {
  .volo-pagina .avviso { font-size: 14px; line-height: 1.2; padding-top: 4px; padding-bottom: 4px; }
  .volo-cartiglio h2 { font-size: 24px; margin-bottom: 6px; }
  .volo-cartiglio > .righello:first-child { margin-bottom: 10px; }
  .volo-pausa, .volo-fine, .volo-testa { width: min(720px, calc(100% - 20px)); max-height: calc(100% - 12px); padding-bottom: 12px; }
  .volo-voci { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  .volo-voci .comando.principale { min-height: 48px; }
  .volo-scelta { grid-column: 1 / -1; }
  .volo-pausa .volo-riga { margin-bottom: 10px; }
  .volo-tasti { display: none; }
  .volo-gesti { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
  /* a webcam accesa su uno schermo basso restano l'anteprima e la riga sulla posa: l'elenco dei gesti si è già letto */
  .volo-testa-prova:not([hidden]) ~ .volo-gesti { display: none; }
  .volo-testa .volo-riga { font-size: 15px; margin-bottom: 10px; }
  .volo-azioni { margin-top: 10px; padding-top: 10px; }
  .volo-fine .volo-corpo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
  .volo-totale .cifra { font-size: 40px; }
  .volo-conti th, .volo-conti td { height: 36px; padding-top: 4px; padding-bottom: 3px; }
  .volo-firma { margin-top: 0; }
  .volo-suggerimento { max-width: min(420px, calc(100% - 380px)); }
  .volo-batti { width: 92px; height: 92px; }
  .volo-prua { width: min(280px, 34vw); }
  .volo-anello { top: 62px; }
}
/* telefono piccolo coricato: gli strumenti tornano nella disposizione larga, se no nastro e anello si coprono */
@media (max-width: 640px) and (max-height: 520px) {
  .volo-prua { top: 10px; width: min(230px, 34vw); }
  .volo-anello { left: auto; right: max(10px, env(safe-area-inset-right)); top: 64px; }
  .volo-luogo { top: 64px; left: 0; right: 0; margin: 0 auto; max-width: calc(100% - 300px); text-align: center; }
  .volo-suggerimento, .volo-scena.tocco .volo-suggerimento { bottom: max(14px, env(safe-area-inset-bottom)); max-width: calc(100% - 300px); }
  .volo-testa-vista { bottom: max(10px, env(safe-area-inset-bottom)); }
  .volo-cartiglio { left: 8px; bottom: 8px; width: min(430px, calc(100% - 16px)); }
  .volo-pausa, .volo-fine, .volo-testa { left: 50%; bottom: auto; width: calc(100% - 16px); }
}
