:root {
  --arancio: #e94e1b;
  --arancio-scuro: #c93d10;
  --sfondo: #121214;
  --carta: #1f1f22;
  --carta-2: #29292d;
  --linea: #333338;
  --testo: #f4f4f2;
  --tenue: #a3a3a8;
  --kid: #2bb3a3;
  --gara: #f2c230;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--sfondo); color: var(--testo); }
body { padding: 0 0 calc(24px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
.fascia-logo { padding: calc(20px + env(safe-area-inset-top)) 16px 18px; display: flex; justify-content: center; max-width: 560px; margin: 0 auto; }
.fascia-logo img { width: 100%; max-width: 420px; height: auto; display: block; }
main { max-width: 560px; margin: 0 auto; padding: 0 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.testa { max-width: 560px; margin: 0 auto; padding: 16px 16px 12px; display: flex; justify-content: space-between; align-items: flex-start; }
.marchio { color: var(--arancio); font-weight: 800; letter-spacing: .14em; font-size: 12px; }
h1 { margin: 0; line-height: 1; font-size: 22px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.aggiornato { color: var(--tenue); text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.aggiornato b { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: .06em; color: var(--testo); line-height: 1; }
.aggiornato small { display: block; font-size: 12px; margin-top: 2px; }
.aggiornato.fermo b { color: var(--tenue); font-size: 16px; }
.aggiornato .punto { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #3ccf6e; box-shadow: 0 0 0 0 rgba(60,207,110,.6); animation: pulsa 2s infinite; }
.aggiornato.fermo .punto { background: var(--tenue); animation: none; }
@keyframes pulsa { 70% { box-shadow: 0 0 0 7px rgba(60,207,110,0); } 100% { box-shadow: 0 0 0 0 rgba(60,207,110,0); } }

.cerca { display: flex; align-items: center; gap: 10px; background: var(--carta); border: 1px solid var(--linea); border-radius: 14px; padding: 0 14px; height: 48px; margin-bottom: 14px; }
.cerca svg { width: 20px; height: 20px; fill: none; stroke: var(--tenue); stroke-width: 2; stroke-linecap: round; flex: none; }
.cerca input { flex: 1; background: none; border: 0; color: var(--testo); font-size: 17px; outline: none; text-transform: uppercase; min-width: 0; }
.cerca input::placeholder { text-transform: none; color: var(--tenue); }
.cerca:focus-within { border-color: var(--arancio); }

.mia { background: var(--arancio); color: #fff; border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mia .eti { font-size: 13px; opacity: .9; }
.mia .tit { font-size: 19px; font-weight: 750; margin-top: 2px; }
.mia .min { text-align: right; line-height: 1; }
.mia .min b { font-size: 40px; font-weight: 800; display: block; }
.mia .min span { font-size: 13px; }

.titolo-sez { font-size: 17px; color: var(--tenue); text-transform: uppercase; letter-spacing: .06em; margin: 22px 4px 10px; font-weight: 800; }

.inpista { background: var(--carta); border-radius: 18px; padding: 16px 18px; border: 1px solid var(--linea); }
.inpista .riga { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.inpista .nome { font-size: 18px; font-weight: 700; }
.inpista .fine { font-size: 14px; color: var(--tenue); white-space: nowrap; }
.barra { height: 8px; border-radius: 4px; background: var(--carta-2); margin-top: 12px; overflow: hidden; }
.barra div { height: 100%; background: linear-gradient(90deg, var(--arancio-scuro), var(--arancio)); border-radius: 4px; transition: width 1s; }

.carta { background: var(--carta); border: 1px solid var(--linea); border-radius: 18px; margin-bottom: 10px; overflow: hidden; }
.carta.sua { border-color: var(--arancio); box-shadow: 0 0 0 1px var(--arancio); }
.carta .capo { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; }
.carta .pos { width: 30px; height: 30px; border-radius: 50%; background: var(--carta-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--tenue); flex: none; }
.carta .info { flex: 1; min-width: 0; }
.carta .nome { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.carta .quando { font-size: 13px; color: var(--tenue); margin-top: 3px; }
.carta .min { text-align: right; line-height: 1; flex: none; }
.carta .min b { font-size: 30px; font-weight: 800; display: block; font-variant-numeric: tabular-nums; }
.carta .min span { font-size: 12px; color: var(--tenue); }
.carta .min.ora b { font-size: 20px; color: var(--arancio); }

.etichetta { font-size: 11px; font-weight: 800; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; background: var(--arancio); color: #fff; }
.etichetta.kid { background: var(--kid); color: #06302b; }
.etichetta.gara { background: var(--gara); color: #3a2c00; }

.campana { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linea); background: var(--carta-2); color: var(--testo); display: flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.campana svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.campana.attiva { background: var(--arancio); border-color: var(--arancio); color: #fff; }
.campana:active { transform: scale(.94); }

.piloti { list-style: none; margin: 0; padding: 0 16px 6px; border-top: 1px solid var(--linea); }
.piloti li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 16px; font-weight: 600; letter-spacing: .02em; }
.piloti li + li { border-top: 1px solid var(--linea); }
.piloti li.io { color: var(--arancio); }
.kart { font-size: 15px; font-weight: 800; background: #fff; color: #111; padding: 3px 8px; border-radius: 6px; min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.stato-avviso { font-size: 13px; color: var(--arancio); padding: 0 16px 10px; margin-top: -4px; }

.vuoto { text-align: center; color: var(--tenue); padding: 40px 20px; background: var(--carta); border-radius: 18px; border: 1px solid var(--linea); }
.vuoto b { display: block; color: var(--testo); font-size: 18px; margin-bottom: 6px; }
.nota { font-size: 13px; color: var(--tenue); text-align: center; margin: 22px 10px 0; line-height: 1.5; }

.velo { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10; }
.foglio { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; background: var(--carta); border-radius: 22px 22px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; border-top: 1px solid var(--linea); }
.maniglia { width: 40px; height: 5px; border-radius: 3px; background: var(--linea); margin: 0 auto 14px; }
.foglio h2 { font-size: 19px; margin: 0 0 6px; }
.foglio p { color: var(--tenue); font-size: 15px; line-height: 1.5; margin: 0 0 16px; }
.foglio ol { color: var(--tenue); font-size: 15px; line-height: 1.6; padding-left: 20px; margin: 0 0 16px; }
.foglio ol b { color: var(--testo); }
.scelte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.bottone { height: 52px; border-radius: 14px; border: 1px solid var(--linea); background: var(--carta-2); color: var(--testo); font-size: 17px; font-weight: 700; cursor: pointer; width: 100%; }
.bottone.primario { background: var(--arancio); border-color: var(--arancio); color: #fff; }
.bottone.leggero { background: none; font-weight: 600; color: var(--tenue); }
.bottone:disabled { opacity: .45; }

.avviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); background: var(--testo); color: #111; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600; z-index: 20; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.avviso.grande { background: var(--arancio); color: #fff; font-size: 17px; }
