/* ==========================================================================
   web/css/game.css — schermate di gioco (agente "ingame"): schieramento, conto alla rovescia, HUD di
   partita, effetti one-shot, fine partita. Token e cornici smussate da app.css (.frame/.panel/.btn/.chip).
   Regole: si animano solo transform/opacity; prefers-reduced-motion in fondo; la mappa sotto
   (#map-layer) resta interattiva: le schermate hanno pointer-events:none, solo i controlli li riattivano.
   ========================================================================== */

/* ---------------------------------------------------------------- base */
.screen.game, .screen.deploy, .screen.countdown, .screen.end { pointer-events: none; }
.screen.game .g-bar, .screen.deploy .g-bar, .g-panel, .g-actions__left, .g-actions__center > .btn,
.g-radio, .dep-panel, .dep-role, .hud-chip, .fx-card, .fx-caught, .fx-scan,
.end-hero, .end-panel, .g-heat, .g-sos__btn, .g-pause__card { pointer-events: auto; }
.screen.game .g-radio:empty, .screen.deploy .g-radio:empty { pointer-events: none; }

/* spazi riservati all'HUD sopra la mappa (variabili di map.css) */
body[data-screen="game"] .radar { --radar-status-top: calc(env(safe-area-inset-top, 0px) + 158px); --radar-attrib-bottom: calc(env(safe-area-inset-bottom, 0px) + 150px); }
body[data-screen="deploy"] .radar { --radar-status-top: calc(env(safe-area-inset-top, 0px) + 138px); --radar-attrib-bottom: calc(env(safe-area-inset-bottom, 0px) + 300px); }
body[data-screen="countdown"] .radar { --radar-attrib-bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); }
body[data-screen="end"] .radar { --radar-attrib-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--end-panel-h, 42dvh) + 16px); --radar-status-top: 45%; }
/* banner dell'HUD visibili (GRAZIA, fantasma...): l'etichetta "120 M" dell'anello Soliton finirebbe sotto */
body.has-hud-banner .rm-ring--soliton .rm-ring__label { opacity: 0; }

/* ---------------------------------------------------------------- barra alta */
.g-top {
  position: absolute; z-index: 3; left: 0; right: 0; top: 0;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: calc(var(--sat) + 6px) calc(var(--sar) + 8px) 18px calc(var(--sal) + 8px);
  background: linear-gradient(180deg, rgba(1, 10, 4, .72), rgba(1, 10, 4, .38) 62%, rgba(1, 10, 4, 0));
  pointer-events: none;
}
.g-bar {
  --cut: 10px; --bw: 1.5px; --frame-c: var(--ph-3);
  --fill:
    linear-gradient(var(--ph-2), var(--ph-2)) top right / 12px 2px no-repeat,
    linear-gradient(var(--ph-2), var(--ph-2)) top right / 2px 12px no-repeat,
    linear-gradient(180deg, rgba(4, 26, 13, .94), rgba(1, 10, 4, .9));
  width: 100%; max-width: 560px; min-height: 58px;
  display: flex; align-items: center; gap: 8px;
  /* 14 px a destra: la tacca decorativa dell'angolo (12×2 + 2×12) resta fuori dal tasto menu */
  padding: 5px 14px 5px 12px;
}
.g-bar__center { flex: 1; min-width: 0; display: flex; justify-content: center; }
.g-bar__right { display: flex; align-items: center; gap: 8px; flex: none; }
.g-menu { flex: none; }

/* timer */
.g-timer { display: flex; flex-direction: column; flex: none; min-width: 74px; line-height: 1; }
.g-timer__lbl, .g-obj__lbl { font-size: 10px; letter-spacing: .28em; color: var(--ph-dim); text-shadow: none; }
.g-timer__val {
  font-family: var(--font-pixel); font-size: 40px; line-height: .86; letter-spacing: .02em;
  color: var(--ph-1); text-shadow: var(--ph-glow); font-variant-numeric: tabular-nums;
}
.g-timer[data-tone="caution"] .g-timer__val { color: var(--caution); text-shadow: var(--caution-glow); }
.g-timer[data-tone="alert"] .g-timer__val { color: var(--alert); text-shadow: var(--alert-glow); animation: blink 1s steps(1) infinite; }

/* obiettivi */
.g-obj { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.g-obj__row { display: flex; align-items: baseline; gap: 3px; color: var(--gold); text-shadow: var(--gold-glow); }
.g-obj__star { font-size: 17px; transform: translateY(-2px); }
.g-obj__val { display: inline-block; font-family: var(--font-pixel); font-size: 34px; line-height: .86; font-variant-numeric: tabular-nums; }
.g-obj__extra { font-size: 10px; letter-spacing: .1em; color: var(--cardboard); text-shadow: none; margin-top: 1px; }
.g-obj[data-kind="threat"] .g-obj__row { color: var(--caution); text-shadow: var(--caution-glow); }
.g-obj[data-kind="threat"] .g-obj__extra { color: var(--ph-dim); }
.g-obj.is-complete .g-obj__row { animation: pulse-s 1s ease-in-out infinite; }
.g-obj[hidden] { display: none; }
/* catture (inseguitori, Impostore): mirino rosso + numero */
.g-obj[data-kind="captures"] .g-obj__row { align-items: center; gap: 5px; color: #ff5a5a; text-shadow: 0 0 8px rgba(255, 42, 42, .6); }
.g-obj[data-kind="captures"] .g-obj__star { display: inline-flex; transform: none; }
.g-obj[data-kind="captures"] .g-obj__star svg { width: 18px; height: 18px; }

/* chip di stato (GPS / collegamento / smaschera) */
.hud-status { display: flex; gap: 5px; flex-wrap: nowrap; justify-content: center; min-width: 0; }
/* una riga sola sempre (etichette più lunghe tipo "⚠ 56s" non devono far crescere la barra): il chip GPS
   si stringe con i puntini, quello del collegamento no */
.hud-status > .hud-chip { flex: 0 1 auto; min-width: 0; }
.hud-status > .hud-chip--net { flex: none; }
.hud-status .hud-chip__txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hud-chip {
  --cut: 5px; --fill: rgba(1, 10, 4, .88);
  min-height: 28px; padding: 3px 8px; gap: 5px;
  font-size: 12px; line-height: 1; letter-spacing: .08em; white-space: nowrap;
  color: var(--ph-2); text-shadow: none;
}
button.hud-chip { cursor: pointer; }
button.hud-chip:active { transform: scale(.96); }
.hud-chip__ico { display: inline-flex; }
.hud-chip__ico svg { width: 14px; height: 14px; }
.hud-chip__bars { height: 12px; }
.hud-chip__bars i { width: 3px; }
.hud-chip[data-tone="ok"] { --frame-c: var(--ph-3); color: var(--ph-1); }
.hud-chip[data-tone="warn"] { --frame-c: var(--caution); color: var(--caution); }
.hud-chip[data-tone="danger"] { --frame-c: var(--alert); color: var(--alert); animation: pulse-o 1.2s ease-in-out infinite; }

/* targa della fase (MGS) */
.g-phase { display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
.g-phase__plate {
  --pc: var(--ph-1);
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 4px 20px 4px 14px;
  color: var(--pc);
  background: linear-gradient(180deg, rgba(3, 22, 11, .92), rgba(1, 10, 4, .88));
  border: 1.5px solid var(--pc);
  box-shadow: 0 0 14px rgba(57, 255, 20, .22), inset 0 0 16px rgba(57, 255, 20, .1);
  transform: skewX(-14deg);
}
.g-phase__plate > * { transform: skewX(14deg); }
.g-phase__ico { display: inline-flex; }
.g-phase__ico svg { width: 20px; height: 20px; }
.g-phase__lbl { font-family: var(--font-display); font-size: 21px; line-height: 1; letter-spacing: .1em; text-shadow: 0 0 8px currentColor; white-space: nowrap; }
.g-phase__cnt { font-family: var(--font-pixel); font-size: 28px; line-height: .8; font-variant-numeric: tabular-nums; }
.g-phase__cnt[hidden] { display: none; }
.g-phase__sub {
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--ph-2);
  text-shadow: 0 1px 2px #000, 0 0 8px rgba(0, 0, 0, .95);
}
.g-phase[data-tone="alert"] .g-phase__plate {
  --pc: #fff; background: linear-gradient(180deg, #ff3b3b, #c30d0d); border-color: #fff;
  box-shadow: var(--alert-glow);
}
.g-phase[data-tone="alert"] .g-phase__lbl { text-shadow: 0 0 2px #400; }
.g-phase[data-tone="alert"] .g-phase__sub { color: #ffb3b3; }
.g-phase.is-blink .g-phase__plate { animation: plate-blink .5s steps(1) infinite; }
@keyframes plate-blink { 50% { opacity: .55; } }
.g-phase[data-tone="caution"] .g-phase__plate { --pc: var(--caution); box-shadow: var(--caution-glow), inset 0 0 16px rgba(255, 176, 0, .12); }
.g-phase[data-tone="caution"] .g-phase__sub { color: var(--caution); }
.g-phase[data-tone="hunt"] .g-phase__plate { --pc: #ff6060; box-shadow: 0 0 14px rgba(255, 42, 42, .3), inset 0 0 16px rgba(255, 42, 42, .12); }
.g-phase[data-tone="muted"] .g-phase__plate { --pc: var(--ph-3); box-shadow: none; }
.g-phase[data-tone="ghost"] .g-phase__plate { --pc: var(--ghost); box-shadow: 0 0 14px rgba(169, 199, 214, .3); }
.g-phase[data-tone="ghost"] .g-phase__sub { color: var(--ghost); }

/* banner di stato */
.g-banners { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 6px; }
.g-banner {
  --bc: var(--codec);
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 6px 12px;
  color: var(--bc);
  background: linear-gradient(90deg, rgba(0, 22, 30, .94), rgba(0, 12, 16, .88));
  border-left: 3px solid var(--bc);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  animation: banner-in 260ms var(--ease-out) both;
}
.g-banner.is-out { animation: banner-out 200ms ease-in both; }
@keyframes banner-in { 0% { opacity: 0; transform: translateY(-10px) scaleY(.4); } 60% { opacity: 1; transform: translateX(4px); } 100% { transform: none; } }
@keyframes banner-out { to { opacity: 0; transform: translateX(-24px); } }
.g-banner__ico { display: inline-flex; flex: none; }
.g-banner__ico svg { width: 20px; height: 20px; }
.g-banner__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.g-banner__head { display: flex; align-items: baseline; gap: 8px; }
.g-banner__title { font-family: var(--font-display); font-weight: 400; font-size: 15px; letter-spacing: .1em; text-shadow: 0 0 6px currentColor; }
.g-banner__cnt { margin-left: auto; font-family: var(--font-pixel); font-size: 26px; line-height: .8; font-variant-numeric: tabular-nums; }
.g-banner__cnt[hidden] { display: none; }
.g-banner__text { font-size: 13px; line-height: 1.25; color: #e6fbff; text-shadow: none; }
.g-banner__text[hidden] { display: none !important; }
.g-banner[data-tone="ghost"] { --bc: var(--ghost); background: linear-gradient(90deg, rgba(20, 30, 40, .94), rgba(10, 16, 22, .88)); }
.g-banner[data-tone="caution"] { --bc: var(--caution); background: linear-gradient(90deg, rgba(34, 22, 0, .95), rgba(20, 12, 0, .88)); }
.g-banner[data-tone="caution"] .g-banner__text { color: #fff1d6; }
.g-banner[data-tone="alert"] { --bc: var(--alert); background: linear-gradient(90deg, rgba(40, 0, 4, .95), rgba(20, 0, 2, .88)); }
.g-banner[data-tone="alert"] .g-banner__text { color: #ffe3e3; }
/* variante sottile: una riga di avviso fisso (es. strade non verificate nello schieramento) */
.g-banner--slim { min-height: 32px; padding: 4px 10px; gap: 8px; }
.g-banner--slim .g-banner__ico svg { width: 18px; height: 18px; }
.g-banner--slim .g-banner__text { font-size: 12px; letter-spacing: .04em; }
.dep-streets { width: 100%; max-width: 560px; }
.dep-streets[hidden] { display: none; }

/* ---------------------------------------------------------------- colonna sinistra: esposizione */
.g-left {
  position: absolute; z-index: 2; left: calc(var(--sal) + 8px); top: 52%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  pointer-events: none;
}
.g-exp { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.g-exp[hidden] { display: none; }
.g-exp__lbl { font-family: var(--font-display); font-size: 12px; letter-spacing: .14em; color: var(--ph-2); text-shadow: 0 0 4px #000, 0 0 2px #000; }
.g-exp__frame {
  --cut: 7px; --bw: 1.5px; --frame-c: var(--ph-3); --fill: rgba(1, 10, 4, .86);
  width: 26px; height: min(34vh, 250px); padding: 4px;
  transform-origin: 50% 100%;
}
.g-exp__glow { display: none; }
.g-exp__track { position: relative; height: 100%; display: flex; flex-direction: column; gap: 3px; }
.g-exp__seg { flex: 1; min-height: 0; background: currentColor; opacity: .13; transition: opacity 160ms linear; }
.g-exp__seg--low { color: var(--ph-1); }
.g-exp__seg--mid { color: var(--caution); }
.g-exp__seg--high { color: var(--alert); }
.g-exp__seg.is-on { opacity: 1; }
.g-exp__mark { position: absolute; left: -3px; right: -3px; height: 2px; margin-bottom: -1px; background: #fff; opacity: .55; }
.g-exp__val { font-family: var(--font-pixel); font-size: 22px; line-height: 1; color: var(--ph-1); text-shadow: 0 0 4px #000, 0 0 2px #000; font-variant-numeric: tabular-nums; }
.g-exp[data-level="mid"] .g-exp__frame { --frame-c: var(--caution); }
.g-exp[data-level="mid"] .g-exp__val { color: var(--caution); }
.g-exp[data-level="high"] .g-exp__frame { --frame-c: var(--alert); animation: exp-throb .45s ease-in-out infinite alternate; }
.g-exp[data-level="high"] .g-exp__val { color: var(--alert); animation: blink .45s steps(1) infinite; }
.g-exp.is-rising .g-exp__lbl { color: var(--alert); }
@keyframes exp-throb { from { transform: scale(1); } to { transform: scale(1.14, 1.02); } }
.hud-chip--unmask { min-height: 26px; font-size: 11px; }
.hud-chip--unmask[hidden] { display: none; }

/* ---------------------------------------------------------------- zona bassa */
.g-bottom {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 26px calc(var(--sar) + 10px) calc(var(--sab) + 12px) calc(var(--sal) + 10px);
  background: linear-gradient(0deg, rgba(1, 10, 4, .66), rgba(1, 10, 4, .3) 60%, rgba(1, 10, 4, 0));
  pointer-events: none;
}
.g-actions { width: 100%; max-width: 560px; display: grid; grid-template-columns: 64px minmax(0, 1fr) 80px; align-items: end; gap: 8px; }
.g-actions__left { display: flex; align-items: flex-end; }
.g-actions__center { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; min-height: 64px; }
.g-radio { display: flex; justify-content: flex-end; align-items: flex-end; min-height: 72px; }
/* colonna destra: RADIO (72 px), in flusso; il bersaglio TUTTI (scorri su) compare sopra solo mentre si preme */
.g-comms { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }

/* ricentra / area */
.btn.g-recenter { width: 60px; height: 60px; min-height: 60px; flex-direction: column; gap: 1px; }
.g-recenter .btn__icon svg { width: 24px; height: 24px; }
.g-recenter__cap { font-family: var(--font-hud); font-size: 9px; letter-spacing: .12em; }
.g-recenter[data-follow="0"] { --frame-c: var(--ph-1); color: var(--ph-1); animation: pulse-s 1.4s ease-in-out infinite; }

/* SCANSIONA */
.btn.g-scan {
  --cut: 12px; --bw: 2px; --frame-c: #fff3c4;
  --fill: linear-gradient(180deg, #ffe07a, #ffb400 70%, #e89800);
  width: 100%; max-width: 250px; min-height: 66px; padding: 0 16px; gap: 10px;
  color: #1a1000; text-shadow: none;
  animation: scan-throb 1.1s ease-in-out infinite;
}
.g-scan__ring { display: none; }
.g-scan__ico { display: inline-flex; }
.g-scan__ico svg { width: 30px; height: 30px; }
.g-scan__txt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; }
.g-scan__lbl { font-size: 23px; letter-spacing: .08em; }
.g-scan__sub { font-family: var(--font-hud); font-size: 10px; letter-spacing: .2em; opacity: .75; }
.g-actions__center:has(> .g-scan[data-state="ready"]:not([hidden]))::before {
  content: ''; position: absolute; left: 50%; bottom: 0; width: 260px; height: 110px; margin-left: -130px;
  background: radial-gradient(ellipse 50% 50% at 50% 60%, rgba(255, 200, 61, .45), transparent 70%);
  animation: scan-glow 1.1s ease-in-out infinite; pointer-events: none;
}
@keyframes scan-throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes scan-glow { 0%, 100% { opacity: .5; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }
.btn.g-scan:disabled { animation: none; color: var(--ph-2); }
.btn.g-scan[data-state="busy"] .g-scan__ico { animation: spin 1.2s linear infinite; }
/* bloccato: l'obiettivo resta sempre in vista (lucchetto + distanza dalla zona), ma spento */
.btn.g-scan[data-state="locked"] {
  --frame-c: rgba(255, 200, 61, .5); --fill: rgba(22, 15, 0, .9);
  min-height: 56px; color: rgba(255, 214, 110, .8); animation: none; cursor: default;
}
.btn.g-scan[data-state="locked"] .g-scan__lbl { font-size: 19px; }
.btn.g-scan[data-state="locked"] .g-scan__ico svg { width: 24px; height: 24px; }
.btn.g-scan[data-state="locked"] .g-scan__sub { font-size: 11px; letter-spacing: .14em; opacity: .95; }

/* prossimità: FREDDO / TIEPIDO / CALDO / BOLLENTE */
.g-prox {
  --pc: var(--codec); --cut: 8px; --bw: 1.5px; --frame-c: var(--pc); --fill: rgba(1, 10, 4, .9);
  display: flex; align-items: center; gap: 10px;
  min-height: 38px; padding: 5px 14px;
  color: var(--pc);
  pointer-events: none;
}
.g-prox[hidden] { display: none; }
.g-prox__cap { font-size: 10px; letter-spacing: .24em; opacity: .85; }
.g-prox__notches { display: flex; align-items: flex-end; gap: 4px; height: 22px; }
.g-prox__n { width: 10px; background: currentColor; opacity: .18; transform: skewX(-16deg); }
.g-prox__n--1 { height: 30%; } .g-prox__n--2 { height: 55%; } .g-prox__n--3 { height: 78%; } .g-prox__n--4 { height: 100%; }
.g-prox__n.is-on { opacity: 1; }
.g-prox__lbl { min-width: 6.6em; font-family: var(--font-display); font-size: 17px; letter-spacing: .1em; text-shadow: 0 0 8px currentColor; }
/* scala "caldo" senza rosso: il rosso resta al pericolo (radar nemici, allerta) */
.g-prox[data-key="warm"] { --pc: #ffe08a; }
.g-prox[data-key="hot"] { --pc: var(--caution); }
.g-prox[data-key="burning"] { --pc: var(--gold); animation: pulse-s .7s ease-in-out infinite; }
.g-prox[data-key="burning"] .g-prox__lbl { text-shadow: var(--gold-glow, 0 0 8px rgba(255, 200, 61, .8)); }
.g-prox[data-key="burning"] .g-prox__n.is-on { box-shadow: 0 0 6px rgba(255, 200, 61, .8); }
.g-prox.is-resolved { opacity: .72; animation: none; }

/* ping inseguitori */
.g-ping {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px;
  --cut: 10px; --bw: 1.5px; --frame-c: var(--caution); --fill: rgba(28, 18, 0, .92);
  width: 100%; max-width: 250px; padding: 8px 14px 9px;
  color: var(--caution);
  pointer-events: none;
}
.g-ping[hidden] { display: none; }
.g-ping__lbl { font-size: 11px; line-height: 1.2; letter-spacing: .2em; }
.g-ping__val { font-family: var(--font-pixel); font-size: 36px; line-height: .8; text-shadow: var(--caution-glow); font-variant-numeric: tabular-nums; }
.g-ping__track { grid-column: 1 / -1; height: 4px; margin-top: 6px; overflow: hidden; background: rgba(255, 176, 0, .18); }
.g-ping__bar { display: block; height: 100%; background: var(--caution); transform-origin: left center; transform: scaleX(0); transition: transform 250ms linear; }
.g-ping.is-urgent { animation: pulse-s .6s ease-in-out infinite; }

/* suggerimento: testo semplice (niente cornice tratteggiata da "bottone disattivato") */
.g-hint {
  max-width: 260px; padding: 2px 8px;
  text-align: center; font-size: 13px; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase;
  text-wrap: balance;
  color: var(--ph-2);
  text-shadow: 0 1px 2px #000, 0 0 8px rgba(0, 0, 0, .95), 0 0 3px rgba(0, 0, 0, .9);
  pointer-events: none;
}
.g-hint[hidden] { display: none; }
/* allerta/evasione: al massimo 2 righe bilanciate (la colonna centrale è stretta fra AREA e RADIO:
   il testo può sconfinare un po' ai lati) */
.g-hint[data-tone="alert"], .g-hint[data-tone="caution"] { max-width: none; margin-inline: -12px; padding-inline: 0; line-height: 1.12; }
.g-hint[data-tone="alert"] {
  font-family: var(--font-display); font-size: 20px; letter-spacing: .04em; color: #ff5050;
  text-shadow: 0 0 2px #300, 0 0 10px rgba(255, 42, 42, .8), 0 1px 2px #000;
  animation: pulse-s .7s ease-in-out infinite;
}
.g-hint[data-tone="caution"] {
  font-family: var(--font-display); font-size: 18px; letter-spacing: .05em; color: var(--caution);
  text-shadow: var(--caution-glow), 0 1px 2px #000;
}

/* ---------------------------------------------------------------- pannello contestuale (entità / zona / SMASCHERA) */
.g-panel {
  --cut: 12px; --bw: 1.5px; --frame-c: var(--ph-2);
  --fill: linear-gradient(180deg, rgba(6, 35, 18, .97), rgba(2, 14, 7, .97));
  width: 100%; max-width: 520px; padding: 10px 8px 12px 12px;
  transform-origin: 50% 100%;
}
.g-panel[hidden] { display: none; }
.g-panel__head { display: flex; align-items: center; gap: 10px; }
.g-panel__art { width: 44px; height: 44px; flex: none; display: grid; place-items: center; color: var(--ph-1); }
.g-panel__art svg { width: 40px; height: 40px; }
.g-panel__main { flex: 1; min-width: 0; }
.g-panel__title { font-family: var(--font-display); font-size: 17px; letter-spacing: .08em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-panel__sub { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ph-dim); text-shadow: none; }
.g-panel__dist { font-family: var(--font-pixel); font-size: 30px; line-height: 1; color: var(--ph-1); text-shadow: var(--ph-glow); white-space: nowrap; }
.g-panel__text { margin-top: 8px; font-size: 14px; line-height: 1.35; color: #eafff0; text-shadow: none; }
.g-panel__text[hidden], .g-panel__action[hidden] { display: none; }
.g-panel__action { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.g-panel__reason { font-size: 12px; line-height: 1.3; color: var(--ph-dim); text-shadow: none; }
.g-panel[data-tone="blip"] { --frame-c: #d9ffe4; }
.g-panel[data-tone="blip"] .g-panel__art { color: #d9ffe4; }
.g-panel[data-tone="alert"] { --frame-c: var(--alert); }
.g-panel[data-tone="alert"] .g-panel__art, .g-panel[data-tone="alert"] .g-panel__title { color: #ff6b6b; }
.g-panel[data-tone="caution"] { --frame-c: var(--caution); }
.g-panel[data-tone="caution"] .g-panel__title { color: var(--caution); }
.g-panel[data-tone="ally"] { --frame-c: var(--codec); }
.g-panel[data-tone="gold"] { --frame-c: var(--gold); }
.g-panel[data-tone="gold"] .g-panel__art, .g-panel[data-tone="gold"] .g-panel__title { color: var(--gold); }
.g-panel[data-tone="cardboard"] { --frame-c: var(--cardboard); }
.g-panel[data-tone="cardboard"] .g-panel__title { color: #e7c48a; }
.g-panel[data-tone="ghost"] { --frame-c: var(--ghost); }

/* tieni premuto per SMASCHERARE */
.btn.g-hold {
  --frame-c: var(--alert); --fill: rgba(34, 0, 3, .94);
  width: 100%; min-height: 62px; justify-content: flex-start; gap: 12px; padding: 0 14px;
  color: #ff8a8a; text-shadow: none;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.g-hold__fill { position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, #c30d0d, var(--alert)); transform-origin: left center; transform: scaleX(0); pointer-events: none; }
.g-hold > :not(.g-hold__fill) { position: relative; z-index: 1; }
.g-hold__ring { width: 36px; height: 36px; flex: none; overflow: visible; }
.g-hold__ring-track { fill: none; stroke: rgba(255, 42, 42, .25); stroke-width: 3; }
.g-hold__ring-bar { fill: none; stroke: currentColor; stroke-width: 3.5; transition: stroke-dashoffset 250ms linear; }
.g-hold__txt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; }
.g-hold__lbl { font-size: 21px; letter-spacing: .08em; }
.g-hold__sub { font-family: var(--font-hud); font-size: 11px; letter-spacing: .18em; opacity: .9; }
.g-hold.is-ready { color: #fff; }
.g-hold.is-ready .g-hold__ring { animation: pulse-s 1.1s ease-in-out infinite; }
.g-hold.is-pressing { transform: scale(.98); }
.g-hold.is-cooldown, .g-hold[data-reason="far"] {
  --frame-c: repeating-linear-gradient(45deg, var(--alert) 0 5px, transparent 5px 9px);
  color: #b35a5a;
}
.g-hold.is-busy .g-hold__fill { transform: scaleX(1); }

/* ---------------------------------------------------------------- allerta: vignettatura e lampo */
.g-vignette {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 78% 66% at 50% 50%, transparent 46%, rgba(255, 20, 20, .32) 74%, rgba(170, 0, 0, .8) 100%);
  transition: opacity 250ms;
}
/* cattura imminente (esposizione > 70%): battito rosso oltre alla tinta del radar */
.screen.game[data-alert="alert"] .g-vignette[data-level="high"] { opacity: 1; animation: vig-beat .5s ease-in-out infinite; }
.screen.game[data-alert="alert"] .g-vignette[data-level="mid"] { opacity: .55; animation: vig-beat .8s ease-in-out infinite; }
@keyframes vig-beat { 0%, 100% { opacity: 1; } 45% { opacity: .35; } }
.g-flash { position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 50% 50%, rgba(255, 42, 42, .35), rgba(255, 0, 0, .9)); }
.g-flash[data-tone="gold"] { background: radial-gradient(circle at 50% 42%, rgba(255, 236, 170, .95), rgba(255, 200, 61, .35) 60%, rgba(255, 200, 61, 0)); }

/* fantasma: HUD azzurrino */
.screen.game.is-ghost .g-bar { --frame-c: var(--ghost); }
.screen.game.is-ghost .g-timer__val { color: var(--ghost); text-shadow: 0 0 8px rgba(169, 199, 214, .6); }

/* ---------------------------------------------------------------- effetti one-shot */
.g-fx { position: absolute; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }

/* "!" */
.fx-bang { position: absolute; left: 0; right: 0; top: 27%; display: flex; justify-content: center; pointer-events: none; }
.fx-bang__glyph { display: block; width: 70px; height: 192px; transform-origin: 50% 90%; }
.fx-bang__glyph svg { width: 100%; height: 100%; overflow: visible; }

/* AGGANCIO */
.fx-lock { position: absolute; left: 50%; top: 45%; width: 190px; height: 190px; margin: -95px 0 0 -95px; }
.fx-lock__c { position: absolute; width: 46px; height: 46px; border: 5px solid var(--alert); opacity: 0; animation: lock-c 1.25s var(--ease-out) both; }
.fx-lock__c--tl { left: 0; top: 0; border-right: 0; border-bottom: 0; --dx: -70px; --dy: -90px; }
.fx-lock__c--tr { right: 0; top: 0; border-left: 0; border-bottom: 0; --dx: 70px; --dy: -90px; }
.fx-lock__c--bl { left: 0; bottom: 0; border-right: 0; border-top: 0; --dx: -70px; --dy: 90px; }
.fx-lock__c--br { right: 0; bottom: 0; border-left: 0; border-top: 0; --dx: 70px; --dy: 90px; }
@keyframes lock-c {
  0% { transform: translate(var(--dx), var(--dy)) scale(1.5); opacity: 0; }
  22% { transform: none; opacity: 1; }
  30% { transform: scale(.86); opacity: 1; }
  38%, 78% { transform: none; opacity: 1; }
  100% { transform: scale(1.1); opacity: 0; }
}
.fx-lock__txt {
  position: absolute; left: 50%; top: 100%; margin-top: 12px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap;
  padding: 6px 14px; background: rgba(40, 0, 4, .9); border: 1.5px solid var(--alert);
  animation: lock-t 1.25s steps(1) both;
}
.fx-lock__txt b { font-family: var(--font-display); font-weight: 400; font-size: 28px; letter-spacing: .1em; color: var(--alert); text-shadow: var(--alert-glow); }
.fx-lock__txt span { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #ffd0d0; }
@keyframes lock-t { 0%, 18% { opacity: 0; } 22%, 30% { opacity: 1; } 34% { opacity: .3; } 38%, 80% { opacity: 1; } 100% { opacity: 0; } }
.fx-lock.is-static .fx-lock__c, .fx-lock.is-static .fx-lock__txt { animation: none !important; opacity: 1; }

/* fascia centrale */
.fx-card {
  --tc: var(--ph-1);
  position: absolute; left: 0; right: 0; top: 30%;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; color: var(--tc);
  animation: card-in 300ms var(--ease-out) both;
}
.fx-card.is-out { animation: card-out 240ms ease-in both; }
@keyframes card-in { 0% { transform: scaleY(.02); opacity: 0; } 35% { transform: scaleY(.02); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes card-out { 0% { transform: none; opacity: 1; } 60% { transform: scaleY(.02); opacity: 1; } 100% { transform: scale(0, .02); opacity: 0; } }
.fx-card__art { position: relative; z-index: 1; width: 160px; height: 150px; display: grid; place-items: center; margin-bottom: -18px; }
.fx-card__band {
  position: relative; width: 100%; padding: 14px 18px 12px; text-align: center;
  background: linear-gradient(90deg, rgba(1, 10, 4, 0), rgba(1, 10, 4, .94) 14%, rgba(1, 10, 4, .94) 86%, rgba(1, 10, 4, 0));
}
.fx-card__band::before, .fx-card__band::after {
  content: ''; position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--tc) 18%, var(--tc) 82%, transparent);
  box-shadow: 0 0 10px var(--tc);
}
.fx-card__band::before { top: 0; }
.fx-card__band::after { bottom: 0; }
.fx-card__title {
  position: relative; display: inline-block;
  font-family: var(--font-display); font-size: clamp(30px, 10vw, 46px); line-height: 1; letter-spacing: .06em;
  text-shadow: 0 0 10px currentColor, 0 0 30px currentColor;
}
.fx-card__title::before, .fx-card__title::after { content: attr(data-text); position: absolute; inset: 0; text-shadow: none; opacity: 0; }
.fx-card__title::before { color: var(--alert); clip-path: inset(15% 0 55% 0); animation: glitch-a 520ms steps(1) both; }
.fx-card__title::after { color: var(--codec); clip-path: inset(60% 0 10% 0); animation: glitch-b 520ms steps(1) both; }
.fx-card__sub { margin-top: 7px; font-size: 15px; line-height: 1.35; color: #f0fff4; text-shadow: 0 1px 2px #000; }
.fx-card__note { margin-top: 6px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--tc); opacity: .85; }
.fx-card--small { top: 24%; }
.fx-card--small .fx-card__title { font-size: clamp(22px, 7vw, 30px); }
.fx-card--small .fx-card__band { padding: 10px 16px 9px; }
.fx-card--gold { --tc: var(--gold); }
.fx-card--gold .fx-card__sub { color: #fff3cf; }
.fx-card--cardboard { --tc: #e2b36f; }
/* larga come le altre fasce (copre la colonna ESP per 2 s) e centrata sotto la targa di fase: i titoli
   lunghi (RADAR NEMICI, FASE FINALE, ACCUSA SBAGLIATA) vanno a capo invece di uscire dal bordo */
.fx-card--alert { --tc: var(--alert); }
.fx-card--alert .fx-card__title { font-size: clamp(26px, 8.5vw, 40px); white-space: normal; text-wrap: balance; max-width: calc(100vw - 32px); }
.fx-card--alert .fx-card__band { background: linear-gradient(90deg, rgba(30, 0, 2, 0), rgba(30, 0, 2, .94) 14%, rgba(30, 0, 2, .94) 86%, rgba(30, 0, 2, 0)); }
.fx-card--caution { --tc: var(--caution); }
.fx-card--codec { --tc: var(--codec); }
.fx-card--ghost { --tc: var(--ghost); }
.fx-card.is-static, .fx-card.is-static * { animation: none !important; }

/* esplosione d'oro + trofeo */
.fx-burst { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.fx-burst__rays {
  position: absolute; inset: -50px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 200, 61, .6) 0 7deg, rgba(255, 200, 61, 0) 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%);
  mask: radial-gradient(circle, #000 18%, transparent 66%);
  animation: spin 7s linear infinite, rays-in 500ms var(--ease-out) both;
}
@keyframes rays-in { from { opacity: 0; } }
.fx-burst__ring { position: absolute; inset: 14px; border: 3px solid var(--gold); border-radius: 50%; opacity: 0; animation: burst-ring 900ms ease-out both; }
@keyframes burst-ring { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }
.fx-trophy { position: relative; width: 104px; height: 104px; animation: trophy-in 700ms var(--ease-snap) both; }
@keyframes trophy-in { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 60% { transform: scale(1.18) rotate(6deg); opacity: 1; } 100% { transform: none; } }
.fx-spark { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; background: #fff3c4; box-shadow: 0 0 8px var(--gold); transform: rotate(45deg); }

/* esca: scatola che cade */
.fx-box { transform-origin: 50% 100%; animation: box-drop 1s cubic-bezier(.3, 1.4, .5, 1) both; }
.fx-box svg { width: 110px; height: 110px; }
@keyframes box-drop {
  0% { transform: translateY(-160px) rotate(-14deg); opacity: 0; }
  40% { transform: translateY(0) scale(1.2, .78) rotate(0); opacity: 1; }
  55% { transform: scale(.9, 1.12); }
  70% { transform: translateY(-16px); }
  85% { transform: scale(1.04, .96); }
  100% { transform: none; opacity: 1; }
}

/* CATTURATO → SEI UN FANTASMA */
.fx-caught {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(ellipse 90% 70% at 50% 45%, rgba(70, 0, 0, .93), rgba(6, 0, 0, .97) 72%);
  animation: fade-in 180ms ease-out both;
}
.fx-caught::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 700ms ease;
  background: radial-gradient(ellipse 90% 70% at 50% 45%, rgba(40, 70, 95, .94), rgba(4, 10, 16, .97) 72%);
}
.fx-caught.is-ghost::before { opacity: 1; }
.fx-caught.is-out { opacity: 0; transition: opacity 300ms ease-in; }
.fx-caught__flash { position: absolute; inset: 0; background: #fff; opacity: 0; animation: caught-flash 650ms ease-out both; }
@keyframes caught-flash { 0% { opacity: .9; } 15% { opacity: .1; } 25% { opacity: .6; background: var(--alert); } 100% { opacity: 0; } }
.fx-caught__step {
  position: relative; grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 0 24px; text-align: center;
  transition: opacity 450ms ease, transform 450ms var(--ease-out);
}
.fx-caught__step--2 { opacity: 0; transform: translateY(24px); }
.fx-caught.is-ghost .fx-caught__step--1 { opacity: 0; transform: translateY(-24px) scale(.94); }
.fx-caught.is-ghost .fx-caught__step--2 { opacity: 1; transform: none; }
.fx-caught__art .crewmate { width: 124px; height: auto; }
.fx-caught__step--1 .fx-caught__art { animation: caught-fall 900ms var(--ease-out) both; }
@keyframes caught-fall { 0% { transform: translateY(-40px) rotate(20deg); opacity: 0; } 50% { transform: translateY(6px) rotate(-6deg); opacity: 1; } 100% { transform: none; } }
.fx-caught__title {
  position: relative; font-family: var(--font-display); font-size: clamp(42px, 13.5vw, 64px); line-height: 1; letter-spacing: .06em;
  color: var(--alert); text-shadow: var(--alert-glow);
  animation: caught-title 900ms steps(1) both;
}
.fx-caught__title::before, .fx-caught__title::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0; text-shadow: none; }
.fx-caught__title::before { color: #fff; clip-path: inset(10% 0 60% 0); animation: glitch-a 900ms steps(1) both; }
.fx-caught__title::after { color: var(--codec); clip-path: inset(55% 0 12% 0); animation: glitch-b 900ms steps(1) both; }
@keyframes caught-title { 0% { opacity: 0; } 8% { opacity: 1; transform: translateX(-8px); } 16% { opacity: .3; } 24% { opacity: 1; transform: translateX(6px); } 34%, 100% { opacity: 1; transform: none; } }
.fx-caught__title--ghost { color: var(--ghost); text-shadow: 0 0 14px rgba(169, 199, 214, .85); animation: none; font-size: clamp(34px, 10.5vw, 50px); }
.fx-caught__sub { max-width: 330px; font-size: 16px; line-height: 1.4; color: #ffd9d9; text-shadow: none; }
.fx-caught__step--2 .fx-caught__sub { color: #e2f1f8; }
.fx-caught__hint { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 28px); text-align: center; font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: rgba(255, 255, 255, .55); animation: blink 1.2s steps(1) infinite; }
.fx-caught.is-static *, .fx-caught.is-static { animation: none !important; }

/* scanner di riserva (senza AR) */
.fx-scan {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(ellipse at 50% 45%, rgba(4, 30, 14, .94), rgba(1, 8, 3, .97) 70%);
  animation: fade-in 200ms ease-out both;
}
.fx-scan.is-out { opacity: 0; transition: opacity 200ms; }
.fx-scan__reticle { position: relative; width: min(66vw, 270px); aspect-ratio: 1; perspective: 600px; overflow: hidden; }
.fx-scan__corner { position: absolute; width: 38px; height: 38px; border: 3px solid var(--ph-1); filter: drop-shadow(0 0 4px rgba(57, 255, 20, .8)); }
.fx-scan__corner--tl { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.fx-scan__corner--tr { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.fx-scan__corner--bl { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.fx-scan__corner--br { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.fx-scan__holo {
  position: absolute; inset: 22%; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-display); font-size: 92px; line-height: 1; color: var(--ph-1); text-shadow: var(--ph-glow);
  border: 2px dashed rgba(92, 255, 138, .55);
  background: radial-gradient(circle, rgba(57, 255, 20, .18), transparent 70%);
  animation: holo-spin 2.8s linear infinite;
}
@keyframes holo-spin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
.fx-scan__sweep { position: absolute; left: 0; right: 0; top: -50%; height: 100%; background: linear-gradient(180deg, transparent 44%, rgba(92, 255, 138, .5) 50%, transparent 56%); animation: scan-sweep 1.4s linear infinite; }
@keyframes scan-sweep { from { transform: translateY(0); } to { transform: translateY(100%); } }
.fx-scan__txt { font-family: var(--font-display); font-size: 20px; letter-spacing: .12em; color: var(--ph-1); text-shadow: var(--ph-glow); }
.fx-scan__txt::after { content: '_'; animation: blink .8s steps(1) infinite; }
.fx-scan__progress { width: min(66vw, 270px); height: 6px; background: var(--ph-4); overflow: hidden; }
.fx-scan__bar { display: block; height: 100%; background: var(--ph-1); box-shadow: var(--ph-glow); transform-origin: left center; transform: scaleX(0); }
.fx-scan__close { position: absolute; top: calc(var(--sat) + 12px); right: calc(var(--sar) + 12px); }
.fx-scan.is-static * { animation: none !important; }

/* ---------------------------------------------------------------- SCHIERAMENTO */
.dep-top .g-bar { padding-left: 6px; }
.dep-role { display: flex; align-items: center; gap: 8px; min-height: 46px; min-width: 0; padding: 0 6px 0 2px; text-align: left; color: var(--ph-1); flex: 0 1 auto; }
/* i chip di stato non si stringono: cede il blocco ruolo ("SQUADRA …" con i puntini) */
.dep-top .g-bar__center { flex: 1 0 auto; }
.dep-role:active { transform: scale(.97); }
.dep-role__crew { display: inline-flex; flex: none; }
.dep-role__crew .crewmate { width: 30px; height: auto; }
.dep-role__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.dep-role__name, .dep-role__team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-role__name { font-family: var(--font-display); font-weight: 400; font-size: 14px; letter-spacing: .05em; text-shadow: 0 0 6px currentColor; }
.dep-role__team { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ph-dim); text-shadow: none; }
.dep-role[data-role="chaser"] { color: #ff6060; }
.dep-role__eye { display: inline-flex; flex: none; color: var(--ph-dim); }
.dep-role__eye svg { width: 16px; height: 16px; }
.dep-plate__cnt { font-family: var(--font-pixel); font-size: 28px; line-height: .8; font-variant-numeric: tabular-nums; }
.dep-interrupted { width: 100%; max-width: 560px; animation: banner-in 260ms var(--ease-out) both, pulse-o 1s ease-in-out 3; }

.dep-bottom {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px calc(var(--sar) + 10px) calc(var(--sab) + 10px) calc(var(--sal) + 10px);
  background: linear-gradient(0deg, rgba(1, 10, 4, .7), rgba(1, 10, 4, 0));
  pointer-events: none;
}
.dep-radio { align-self: stretch; max-width: 560px; margin: 0 auto; width: 100%; min-height: 0; align-items: center; gap: 16px; }
/* riga della RADIO sopra il pannello (allineata a destra) */
.screen.deploy .dep-radio { pointer-events: none; }
.dep-panel {
  --fill:
    linear-gradient(var(--ph-2), var(--ph-2)) top right / 14px 2px no-repeat,
    linear-gradient(var(--ph-2), var(--ph-2)) top right / 2px 14px no-repeat,
    linear-gradient(180deg, rgba(4, 28, 14, .95), rgba(1, 12, 5, .94));
  width: 100%; max-width: 560px; padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.dep-panel[data-state="ready"] { --frame-c: var(--ph-1); --bw: 2px; }
.dep-nav { display: flex; align-items: center; gap: 14px; }

/* bussola */
.cmp { position: relative; width: 112px; height: 112px; flex: none; }
.cmp__rose, .cmp__arrow { position: absolute; inset: 0; will-change: transform; transition: opacity 220ms; }
.cmp svg { width: 100%; height: 100%; overflow: visible; }
.cmp__ring { fill: rgba(1, 10, 4, .75); stroke: var(--ph-3); stroke-width: 1.5; }
.cmp__ring--in { fill: none; stroke-dasharray: 2 4; }
.cmp__ticks line { stroke: var(--ph-2); }
.cmp__n { font-family: var(--font-display); font-size: 15px; fill: var(--alert); }
.cmp__c { font-family: var(--font-hud); font-size: 11px; fill: var(--ph-3); }
.cmp__arrow-glow { fill: none; stroke: rgba(57, 255, 20, .3); stroke-width: 9; stroke-linejoin: round; }
.cmp__arrow-body { fill: var(--ph-1); stroke: #062312; stroke-width: 1.5; stroke-linejoin: round; }
.cmp__arrow-shine { fill: rgba(255, 255, 255, .35); }
.cmp__arrow-tail { stroke: var(--ph-1); stroke-width: 3; stroke-dasharray: 3 4; opacity: .7; }
.cmp__core { position: absolute; inset: 30%; border-radius: 50%; background: radial-gradient(circle, #b8ffcb, var(--ph-1) 55%, #149b2c); box-shadow: var(--ph-glow); opacity: 0; transform: scale(.3); transition: opacity 260ms, transform 320ms var(--ease-snap); }
.cmp__q { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 36px; color: var(--caution); opacity: 0; }
.cmp[data-state="inside"] .cmp__arrow, .cmp[data-state="nopos"] .cmp__arrow { opacity: 0; }
.cmp[data-state="inside"] .cmp__core { opacity: 1; transform: scale(1); }
.cmp[data-state="inside"]::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 2px solid var(--ph-1); animation: ring-out 1.4s ease-out infinite; }
.cmp[data-state="nopos"] .cmp__q { opacity: 1; animation: blink 1s steps(1) infinite; }

.dep-dist { flex: 1; min-width: 0; }
.dep-dist__val { font-family: var(--font-pixel); font-size: 58px; line-height: .82; color: var(--ph-1); text-shadow: var(--ph-glow); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dep-panel[data-state="ready"] .dep-dist__val { font-family: var(--font-display); font-size: 28px; line-height: 1.05; letter-spacing: .06em; }
.dep-dist__sub { margin-top: 5px; font-size: 15px; line-height: 1.25; color: var(--ph-2); }
.dep-dist__state { margin-top: 4px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ph-dim); text-shadow: none; }
.dep-panel[data-state="inside"] .dep-dist__state, .dep-panel[data-state="ready"] .dep-dist__state { color: var(--ph-1); text-shadow: var(--ph-glow-soft); }
.dep-panel[data-state="ready"] .dep-dist__sub { font-family: var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--ph-1); animation: dep-hold 1.6s ease-in-out infinite; }
/* "NON MUOVERTI" resta leggibile al sole: pulsa il bagliore, l'opacità non scende sotto .78 (R3-06) */
@keyframes dep-hold { 0%, 100% { opacity: 1; text-shadow: var(--ph-glow); } 50% { opacity: .78; text-shadow: none; } }
.dep-gps { align-items: center; padding: 8px 10px; }
.dep-gps[hidden] { display: none; }
.dep-gps__txt { flex: 1; }
.dep-gps .btn { flex: none; }

.dep-squads { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--ph-4); }
.dep-squads__crew { flex: 1; min-width: 0; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 2px 3px; min-height: 42px; padding-top: 10px; }
.dep-squad { position: relative; display: block; }
.dep-squad .crewmate { width: 28px; height: auto; transition: opacity 300ms; }
.dep-squad.is-on::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: -4px; height: 3px; background: var(--ph-1); box-shadow: var(--ph-glow); }
.dep-squad.is-mine::before { content: '▼'; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 9px; line-height: 1; color: var(--ph-2); }
.dep-squads__txt { flex: none; text-align: right; font-size: 11px; line-height: 1.2; letter-spacing: .16em; color: var(--ph-2); max-width: 46%; }
.dep-squads__txt b { display: block; font-family: var(--font-pixel); font-weight: 400; font-size: 32px; line-height: .85; letter-spacing: .04em; color: var(--ph-1); text-shadow: var(--ph-glow); }
.dep-squads.is-all .dep-squads__txt { color: var(--ph-1); }
.dep-btns .btn { min-width: 0; padding: 0 10px; font-size: 15px; gap: 8px; }
.dep-btns .btn[hidden], .dep-btns[hidden] { display: none; }

/* ---------------------------------------------------------------- CONTO ALLA ROVESCIA */
.screen.countdown { align-items: center; justify-content: space-between; }
/* l'etichetta "IN POSIZIONE / NON MUOVERTI" del punto di partenza spunterebbe attorno alla cifra gigante */
body[data-screen="countdown"] .rm-spawn .rm-tag { visibility: hidden; }
.cd-dim { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% 48%, rgba(1, 10, 4, .74), rgba(1, 10, 4, .94) 75%); }
.screen.countdown.is-final .cd-dim { background: radial-gradient(ellipse 80% 60% at 50% 48%, rgba(30, 0, 0, .7), rgba(10, 0, 0, .94) 75%); }
.cd-top { position: relative; z-index: 1; margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 16px; }
.cd-kicker { color: var(--ph-2); letter-spacing: .34em; }
.cd-role {
  --cut: 10px; --bw: 1.5px; --frame-c: var(--ph-3); --fill: rgba(1, 10, 4, .88);
  display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 10px;
}
.cd-role .crewmate { width: 42px; height: auto; }
.cd-role b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 19px; letter-spacing: .08em; color: var(--ph-1); text-shadow: var(--ph-glow-soft); }
.cd-role span { font-size: 13px; color: var(--ph-2); }
.cd-role--chaser { --frame-c: var(--alert); }
.cd-role--chaser b { color: #ff5a5a; text-shadow: 0 0 6px rgba(255, 42, 42, .6); }
.cd-stage { position: relative; z-index: 1; flex: 1; width: 100%; display: grid; place-items: center; }
.cd-num {
  position: relative; grid-area: 1 / 1;
  font-family: var(--font-display); font-size: min(56vw, 280px); line-height: 1;
  color: var(--ph-1); text-shadow: var(--ph-glow), 0 0 70px rgba(57, 255, 20, .45);
  font-variant-numeric: tabular-nums;
}
.cd-num::before, .cd-num::after { content: attr(data-text); position: absolute; inset: 0; text-shadow: none; opacity: 0; }
.cd-num::before { color: var(--alert); clip-path: inset(18% 0 58% 0); }
.cd-num::after { color: var(--codec); clip-path: inset(62% 0 10% 0); }
.cd-num[data-g="1"]::before { animation: cd-glitch-a 300ms steps(1) both; }
.cd-num[data-g="1"]::after { animation: cd-glitch-b 300ms steps(1) both; }
.cd-num[data-g="2"]::before { animation: cd-glitch-a2 300ms steps(1) both; }
.cd-num[data-g="2"]::after { animation: cd-glitch-b2 300ms steps(1) both; }
@keyframes cd-glitch-a { 0% { transform: translateX(-12px); opacity: .8; } 35% { transform: translateX(6px); opacity: .6; } 70%, 100% { transform: none; opacity: 0; } }
@keyframes cd-glitch-b { 0% { transform: translateX(10px); opacity: .8; } 40% { transform: translateX(-7px); opacity: .5; } 70%, 100% { transform: none; opacity: 0; } }
@keyframes cd-glitch-a2 { 0% { transform: translateX(-12px); opacity: .8; } 35% { transform: translateX(6px); opacity: .6; } 70%, 100% { transform: none; opacity: 0; } }
@keyframes cd-glitch-b2 { 0% { transform: translateX(10px); opacity: .8; } 40% { transform: translateX(-7px); opacity: .5; } 70%, 100% { transform: none; opacity: 0; } }
.screen.countdown.is-final .cd-num { color: var(--alert); text-shadow: var(--alert-glow), 0 0 80px rgba(255, 42, 42, .5); }
.screen.countdown.is-go .cd-num { color: #fff; font-size: min(36vw, 180px); text-shadow: 0 0 20px var(--ph-1), 0 0 60px var(--ph-1); }
.cd-ring { grid-area: 1 / 1; width: min(76vw, 340px); aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--ph-1); opacity: 0; box-shadow: 0 0 20px rgba(57, 255, 20, .5); }
.screen.countdown.is-final .cd-ring { border-color: var(--alert); box-shadow: 0 0 20px rgba(255, 42, 42, .6); }
/* RADIO compatta in basso a destra, in flusso tra la cifra e il piede: non copre né la cifra né i testi */
.cd-svc { align-self: flex-end; margin: 0 12px 10px 0; }
.cd-foot { position: relative; z-index: 1; margin-bottom: calc(var(--sab) + 30px); padding: 0 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.cd-state { font-family: var(--font-display); font-size: 20px; letter-spacing: .1em; color: var(--ph-1); text-shadow: var(--ph-glow); }
.cd-state[data-tone="alert"] { color: var(--alert); text-shadow: var(--alert-glow); animation: blink .6s steps(1) infinite; }
.cd-squads { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--ph-2); }

/* ---------------------------------------------------------------- FINE PARTITA */
.screen.end { padding: 0; }
.end-hero {
  position: relative; z-index: 2; flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: calc(var(--sat) + 10px) 16px 10px; text-align: center;
  background: linear-gradient(180deg, rgba(1, 10, 4, .97) 74%, rgba(1, 10, 4, 0));
}
.end-kicker { font-size: 11px; letter-spacing: .3em; color: var(--ph-dim); text-shadow: none; }
.end-title {
  position: relative; margin: 0; max-width: 100%; white-space: nowrap;
  /* una riga sola: end.js rimpicciolisce ancora se il titolo non ci sta */
  font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 9vw, 56px); line-height: 1; letter-spacing: .05em;
  color: var(--ph-1); text-shadow: var(--ph-glow), 0 0 40px rgba(57, 255, 20, .35);
  animation: end-title-in 1s steps(1) both;
}
.end-title::before, .end-title::after { content: attr(data-text); position: absolute; inset: 0; text-shadow: none; opacity: 0; }
.end-title::before { color: var(--alert); clip-path: inset(14% 0 58% 0); animation: glitch-a 1s steps(1) both; }
.end-title::after { color: var(--codec); clip-path: inset(58% 0 10% 0); animation: glitch-b 1s steps(1) both; }
@keyframes end-title-in { 0% { opacity: 0; } 6% { opacity: 1; transform: translateX(-10px) skewX(-8deg); } 14% { opacity: .25; } 22% { opacity: 1; transform: translateX(6px); } 32% { opacity: .6; } 40%, 100% { opacity: 1; transform: none; } }
.screen.end[data-outcome="lose"] .end-title { color: var(--alert); text-shadow: var(--alert-glow), 0 0 40px rgba(255, 42, 42, .35); }
.screen.end[data-outcome="draw"] .end-title, .screen.end[data-outcome="pending"] .end-title { color: var(--caution); text-shadow: var(--caution-glow); }
.end-side { font-family: var(--font-display); font-size: 15px; letter-spacing: .14em; color: var(--gold); text-shadow: var(--gold-glow); }
.end-side[hidden] { display: none; }
/* intestazione compatta (≈ 60 px in meno per la mappa): omini vincitori in riga a sinistra del nome della
   squadra, motivo su una riga (bilanciata se va a capo) */
.end-winners { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; }
.end-winners:empty { display: none; }
.end-winners__crew { display: inline-flex; align-items: flex-end; padding-right: 4px; }
.end-winners__crew .crewmate { width: 28px; height: auto; margin-right: -4px; }
.end-winners__more { align-self: center; margin-left: 8px; font-family: var(--font-pixel); font-size: 18px; line-height: 1; color: var(--ph-2); }
.end-winners__team { font-family: var(--font-display); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--ph-2); text-shadow: var(--ph-glow-soft); }
.end-reason { max-width: 400px; margin: 0; font-size: 13px; line-height: 1.3; letter-spacing: 0; color: #eafff0; text-shadow: none; text-wrap: balance; }
.end-map { position: relative; flex: 0 1 clamp(140px, 28dvh, 260px); min-height: 96px; }
/* RADIO compatta nell'angolo in basso a destra della finestra sulla mappa, sopra la classifica (mai sopra i
   suoi tasti); l'attribuzione della mappa sta a sinistra */
.end-map > .end-svc { position: absolute; right: 12px; bottom: 10px; }
.end-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; pointer-events: none; }
.end-legend__i { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; font-size: 11px; letter-spacing: .14em; background: rgba(1, 10, 4, .88); border: 1px solid currentColor; }
.end-legend__i svg { width: 18px; height: 18px; }
.end-legend__i--real { color: var(--gold); }
.end-legend__i--decoy { color: #e2b36f; }
.end-panel {
  position: relative; z-index: 2; flex: 0 1 auto;
  --fill:
    linear-gradient(var(--ph-2), var(--ph-2)) top right / 14px 2px no-repeat,
    linear-gradient(var(--ph-2), var(--ph-2)) top right / 2px 14px no-repeat,
    linear-gradient(180deg, rgba(5, 30, 15, .985), rgba(2, 13, 6, .985));
  /* alta quanto serve (fino a 58dvh), agganciata in basso: la mappa è sotto, lo spazio libero la mostra */
  height: auto; max-height: 58dvh; min-height: 0; margin: auto 8px calc(var(--sab) + 8px);
  display: flex; flex-direction: column; padding: 12px 12px 10px;
}
.end-panel .panel__head { margin-bottom: 6px; }
.end-scroll-wrap { position: relative; flex: 0 1 auto; min-height: 72px; display: flex; flex-direction: column; margin: 0 -12px; }
.end-scroll { position: relative; flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px; scroll-snap-type: y proximity; }
.end-row, .end-team { scroll-snap-align: end; }
/* la riga tagliata sparisce sotto la sfumatura (niente parole a metà sotto il chip "▼") (R3-12) */
.end-scroll-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(2, 13, 6, 0), rgba(2, 13, 6, .98) 70%);
  transition: opacity 200ms;
}
.end-scroll-wrap.has-more::after { opacity: 1; }
/* chip piccolo nell'angolo della sfumatura, non centrato sopra il testo delle righe */
.end-more {
  position: absolute; z-index: 1; right: 8px; bottom: 4px;
  min-height: 26px; padding: 2px 9px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; color: var(--ph-1);
  background: rgba(1, 10, 4, .94); border: 1px solid var(--ph-3);
  animation: pulse-o 1.4s ease-in-out infinite;
}
/* area di tocco ≥ 44 px senza ingrandire il chip */
.end-more::before { content: ''; position: absolute; inset: -10px -8px -4px; }
.end-more[hidden] { display: none; }
.end-rows { display: flex; flex-direction: column; }
.end-row {
  display: grid; grid-template-columns: 26px 34px minmax(0, 1fr); gap: 8px; align-items: center;
  padding: 6px 4px; border-bottom: 1px dashed var(--ph-4);
  animation: row-in 240ms var(--ease-out) both;
}
.end-row[hidden], .end-team[hidden] { display: none; }
@keyframes row-in { from { opacity: 0; transform: translateX(-14px); } }
.end-row.is-me { background: linear-gradient(90deg, rgba(57, 255, 20, .12), rgba(57, 255, 20, 0) 80%); }
.end-row.is-left { opacity: .6; }
.end-row__pos { font-family: var(--font-pixel); font-size: 22px; line-height: 1; color: var(--ph-dim); text-shadow: none; }
.end-row.is-won .end-row__pos { color: var(--gold); text-shadow: var(--gold-glow); }
.end-row__crew { display: inline-flex; }
.end-row__crew .crewmate { width: 32px; height: auto; }
.end-row__main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.end-row__name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 16px; line-height: 1.2; }
.end-row__name b { flex: 0 1 auto; min-width: 2.5em; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.end-row__name small { flex: none; padding: 1px 5px; font-size: 10px; letter-spacing: .18em; background: var(--ph-2); color: var(--bg-0); text-shadow: none; }
.end-row__trophy { display: inline-flex; flex: none; }
.end-row__trophy svg { width: 18px; height: 18px; }
.end-row__rank { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 14px; letter-spacing: .04em; color: var(--gold); text-shadow: 0 0 6px rgba(255, 200, 61, .45); }
.end-row__team { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ph-dim); text-shadow: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.end-row__stats { min-height: 1em; font-family: var(--font-pixel); font-size: 17px; line-height: 1.05; color: var(--ph-2); word-spacing: -.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-typing::after { content: '▌'; margin-left: 1px; animation: blink .5s steps(1) infinite; }
.end-team { display: flex; align-items: center; gap: 8px; padding: 7px 4px; font-size: 13px; border-bottom: 1px dashed var(--ph-4); animation: row-in 240ms var(--ease-out) both; }
.end-team b { font-family: var(--font-display); font-weight: 400; font-size: 14px; letter-spacing: .06em; }
.end-team__swatch { width: 8px; height: 18px; flex: none; background: var(--team); box-shadow: 0 0 8px var(--team); transform: skewX(-12deg); }
.end-team__txt { color: var(--ph-2); }
.end-actions { flex: none; display: flex; flex-direction: column; gap: 6px; padding-top: 10px; }
.end-actions .btn[hidden], .end-wait[hidden] { display: none; }
.end-actions .btn-row > .btn:last-child:not([hidden]) { flex: 1.7; }
.end-wait { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ph-2); }
.end-wait .spinner { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- v1.1: REPLAY (fine partita) */
/* REPLAY nella testata della classifica: piccolo, azzurro codec, pulsa una volta per farsi notare */
.end-panel .panel__head .t-label[hidden], .end-replay-btn[hidden] { display: none; }
.btn.end-replay-btn { min-height: 40px; padding: 0 12px; gap: 6px; font-size: 14px; animation: pulse-s 1.2s ease-in-out 2; }
.end-replay-btn .btn__icon svg { width: 18px; height: 18px; }
.end-actions[hidden], .end-panel .panel__head[hidden], .end-scroll-wrap[hidden], .end-replay[hidden] { display: none; }
/* in replay l'intestazione si riduce al titoletto: più mappa per percorsi ed eventi */
.screen.end.is-replay .end-hero > :not(.end-kicker) { display: none; }
.screen.end.is-replay .end-hero { padding-bottom: 14px; }
.screen.end.is-replay .end-kicker { font-family: var(--font-display); font-size: 15px; letter-spacing: .16em; color: var(--ph-1); text-shadow: var(--ph-glow-soft); }
.screen.end.is-replay .end-map { flex: 1 1 auto; }
.rp { display: flex; flex-direction: column; gap: 8px; }
.rp__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rp__cap { min-height: 1.3em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ph-2); text-shadow: none; }
.rp__cap[data-tone="alert"], .rp__cap[data-tone="sos"] { color: #ff6b6b; }
.rp__cap[data-tone="gold"] { color: var(--gold); }
.rp__cap[data-tone="cardboard"] { color: #e2b36f; }
.rp__cap[data-tone="codec"] { color: var(--codec); }
.rp__cap[data-tone="caution"] { color: var(--caution); }
.rp__cap[data-age="old"] { opacity: .6; } /* evento di oltre 20 s fa (tempo del replay) */
.rp__time { flex: none; font-family: var(--font-pixel); font-size: 24px; line-height: 1; color: var(--ph-1); text-shadow: var(--ph-glow); font-variant-numeric: tabular-nums; }
/* barra: tacche colorate degli eventi sopra la traccia dello slider */
.rp__bar { position: relative; padding-top: 12px; }
.rp__marks { position: absolute; left: 11px; right: 11px; top: 0; height: 12px; pointer-events: none; }
.rp__mark { position: absolute; top: 0; width: 3px; height: 12px; margin-left: -1.5px; background: var(--ph-2); box-shadow: 0 0 4px currentColor; }
.rp__mark[data-tone="alert"] { background: var(--alert); color: var(--alert); }
.rp__mark[data-tone="sos"] { background: #fff; color: var(--alert); height: 12px; outline: 1.5px solid var(--alert); }
.rp__mark[data-tone="gold"] { background: var(--gold); color: var(--gold); }
.rp__mark[data-tone="cardboard"] { background: var(--cardboard); color: var(--cardboard); }
.rp__mark[data-tone="codec"] { background: var(--codec); color: var(--codec); }
.rp__mark[data-tone="caution"] { background: var(--caution); color: var(--caution); height: 7px; top: 5px; }
/* legenda delle tacche, una riga sotto la barra */
.rp__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; margin-top: -4px; font-size: 12px; line-height: 1.3; letter-spacing: .06em; text-transform: uppercase; color: var(--ph-2); text-shadow: none; }
.rp__key { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rp__key b { font-weight: 400; }
.rp__key[data-tone="alert"] b { color: var(--alert); }
.rp__key[data-tone="sos"] b { color: #fff; text-shadow: 0 0 3px var(--alert); }
.rp__key[data-tone="gold"] b { color: var(--gold); }
.rp__key[data-tone="cardboard"] b { color: var(--cardboard); }
.rp__key[data-tone="codec"] b { color: var(--codec); }
.rp__key[data-tone="caution"] b { color: var(--caution); }
.rp__range { display: block; width: 100%; height: 34px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: none; }
.rp__range::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(90deg, var(--ph-1) var(--p, 0%), var(--ph-4) var(--p, 0%)); }
.rp__range::-moz-range-track { height: 6px; background: linear-gradient(90deg, var(--ph-1) var(--p, 0%), var(--ph-4) var(--p, 0%)); }
.rp__range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; background: #eaffef; border: 3px solid var(--ph-1); transform: rotate(45deg); box-shadow: var(--ph-glow); }
.rp__range::-moz-range-thumb { width: 18px; height: 18px; background: #eaffef; border: 3px solid var(--ph-1); border-radius: 0; transform: rotate(45deg); box-shadow: var(--ph-glow); }
.rp__range:focus-visible { outline: 2px solid var(--codec); outline-offset: 2px; }
.rp__ctl { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rp__play {
  flex: none; width: 52px; height: 52px; display: grid; place-items: center;
  color: var(--bg-0); background: var(--ph-2); border: 0; box-shadow: var(--ph-glow);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  cursor: pointer;
}
.rp__play svg { width: 26px; height: 26px; }
.rp__play:active { transform: scale(.94); }
.rp__speeds { display: flex; gap: 4px; }
.rp__speed {
  min-width: 46px; min-height: 44px; padding: 0 6px;
  font-family: var(--font-pixel); font-size: 22px; line-height: 1; color: var(--ph-dim);
  background: rgba(1, 10, 4, .8); border: 0; box-shadow: inset 0 0 0 1px var(--ph-3); cursor: pointer;
}
.rp__speed.is-selected { color: var(--bg-0); background: var(--ph-1); box-shadow: none; }
.rp__speed:active { transform: scale(.95); }
.btn.rp__close { min-height: 40px; padding: 0 12px; gap: 6px; font-size: 14px; }
.rp__speeds { flex: 1; justify-content: flex-end; }
@media (max-width: 370px) { .rp__speed { min-width: 42px; font-size: 20px; } }

/* ---------------------------------------------------------------- menu di gioco */
.g-menu__who { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--ph-4); }
.g-menu__crew .crewmate { width: 44px; height: auto; }
.g-menu__id { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.g-menu__id b { font-family: var(--font-display); font-weight: 400; font-size: 19px; letter-spacing: .06em; }
.g-menu-sheet .btn--block { justify-content: flex-start; }


/* ---------------------------------------------------------------- v1.1: vite, scudo, rumore, calore */
.hud-chip[hidden] { display: none; }
.g-vitals { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.g-vitals:not(:has(> :not([hidden]))) { display: none; }
.g-lives {
  position: relative; display: flex; align-items: center; gap: 3px; padding: 4px 6px;
  background: rgba(1, 10, 4, .86); clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.g-lives[hidden] { display: none; }
.g-heart { display: inline-flex; }
.px-heart rect { fill: #ff3b4a; }
.g-heart.is-on .px-heart { filter: drop-shadow(0 0 3px rgba(255, 42, 42, .85)); }
.g-heart.is-off .px-heart rect { fill: rgba(255, 90, 95, .22); }
.g-heart.is-lost { animation: heart-lost 900ms steps(1) both; }
@keyframes heart-lost { 0%, 30%, 60% { transform: scale(1.5); filter: brightness(2); } 15%, 45%, 75% { transform: scale(1); } 100% { transform: none; } }
.hud-chip--shield { --frame-c: var(--codec); color: var(--codec); }
.hud-chip--shield[data-low="1"] { animation: blink .5s steps(1) infinite; }
.hud-chip--noisy { --frame-c: var(--caution); --fill: rgba(34, 22, 0, .92); color: var(--caution); font-weight: 700; animation: pulse-s .9s ease-in-out infinite; }
/* immune: la barra ESP non si riempie (tratteggio azzurro, cornice codec) */
.g-exp.is-immune .g-exp__frame { --frame-c: var(--codec); }
.g-exp.is-immune .g-exp__track { background: repeating-linear-gradient(135deg, rgba(127, 232, 255, .22) 0 4px, transparent 4px 9px); }
.g-exp.is-immune .g-exp__lbl, .g-exp.is-immune .g-exp__val { color: var(--codec); }

/* calore anti-campeggio (inseguitori): tacche dal basso, ambra → rosso, "OFF" quando disturbato */
.g-heat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; color: var(--caution); background: none; border: 0; cursor: pointer; }
.g-heat[hidden] { display: none; }
.g-heat__lbl { font-family: var(--font-display); font-size: 10px; letter-spacing: .08em; color: currentColor; text-shadow: 0 0 4px #000, 0 0 2px #000; }
.g-heat__frame { --cut: 7px; --bw: 1.5px; --frame-c: currentColor; --fill: rgba(22, 12, 0, .88); display: block; width: 26px; height: min(22vh, 150px); padding: 4px; }
.g-heat__track { height: 100%; display: flex; flex-direction: column; gap: 3px; }
.g-heat__seg { flex: 1; min-height: 0; background: currentColor; opacity: .14; transition: opacity 160ms linear; }
.g-heat__seg.is-on { opacity: 1; }
.g-heat__val { font-family: var(--font-pixel); font-size: 20px; line-height: 1; color: currentColor; text-shadow: 0 0 4px #000, 0 0 2px #000; font-variant-numeric: tabular-nums; }
.g-heat[data-level="high"], .g-heat[data-level="max"] { color: #ff6b3a; }
.g-heat.is-jammed { color: var(--alert); }
.g-heat.is-jammed .g-heat__frame { animation: exp-throb .45s ease-in-out infinite alternate; }

/* motivo del radar spento sotto la targa (inseguitori): "RADAR SPENTO: TROPPO VELOCE" */
.hud-chip--off { --frame-c: var(--alert); --fill: rgba(34, 0, 3, .92); max-width: calc(100vw - 24px); min-height: 30px; font-size: 12px; color: #ff7676; }
.hud-chip--off .hud-chip__txt { overflow: hidden; text-overflow: ellipsis; }
.hud-chip--off[data-key="cooldown"] { --frame-c: var(--caution); --fill: rgba(28, 18, 0, .92); color: var(--caution); }

/* FASE FINALE: timer rosso che pulsa, etichetta "FINALE"; PAUSA: timer ambra fermo */
.g-timer[data-final="1"] .g-timer__lbl { color: var(--alert); letter-spacing: .2em; }
.g-timer[data-final="1"]:not([data-tone="alert"]) .g-timer__val { color: #ff5050; text-shadow: var(--alert-glow); animation: pulse-s 1.2s ease-in-out infinite; }
.g-timer[data-paused="1"] .g-timer__lbl { color: var(--caution); }
.g-timer[data-paused="1"] .g-timer__val { color: var(--caution); text-shadow: var(--caution-glow); animation: blink 1.4s steps(1) infinite; }

/* ---------------------------------------------------------------- v1.1: SOS */
.g-sos { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.g-sos[hidden], .g-sos__row[hidden] { display: none; }
.g-sos__row {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 6px 6px 10px;
  color: #fff; background: linear-gradient(90deg, rgba(120, 0, 8, .96), rgba(60, 0, 4, .94));
  border-left: 4px solid var(--alert); box-shadow: 0 0 18px rgba(255, 42, 42, .45);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  animation: banner-in 260ms var(--ease-out) both, sos-throb 1.2s ease-in-out 260ms infinite;
}
@keyframes sos-throb { 50% { box-shadow: 0 0 4px rgba(255, 42, 42, .2); } }
.g-sos__ico { display: inline-flex; flex: none; color: #ffd0d0; animation: blink .8s steps(1) infinite; }
.g-sos__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.g-sos__title { font-family: var(--font-display); font-weight: 400; font-size: 16px; letter-spacing: .08em; color: #fff; text-shadow: 0 0 8px rgba(255, 42, 42, .9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-sos__text { font-size: 12px; line-height: 1.25; color: #ffdada; }
.g-sos__btn {
  flex: none; min-width: 64px; min-height: 44px; padding: 0 12px;
  font-family: var(--font-display); font-size: 14px; letter-spacing: .08em; color: #1a0000;
  background: #fff; border: 0; clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  cursor: pointer;
}
.g-sos__btn:active { transform: scale(.95); }
.g-sos__btn:disabled { opacity: .5; }
.g-sos__row--mine .g-sos__btn { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
/* SOS nello schieramento: stessa striscia sotto la targa */
.dep-top .g-sos { margin-top: 2px; }

/* tasto SOS del menu: tieni premuto 2 s (riempimento da sinistra) */
.btn.sos-hold { min-height: 60px; justify-content: flex-start; gap: 12px; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
.sos-hold__fill { position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, #8a0000, #ff5a5a); transform-origin: left center; transform: scaleX(0); pointer-events: none; }
.sos-hold > :not(.sos-hold__fill) { position: relative; z-index: 1; }
.sos-hold__txt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; }
.sos-hold__sub { font-family: var(--font-hud); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.sos-hold.is-pressing { transform: scale(.98); color: #fff; }
.g-menu__note { margin: -4px 0 4px; font-size: 12px; line-height: 1.3; color: var(--ph-dim); text-shadow: none; }

/* ---------------------------------------------------------------- v1.1: PAUSA */
.g-pause {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  /* la scheda sta sotto la barra alta (banner e SOS compresi: --hud-top-h) e sopra i tasti in basso */
  padding: calc(var(--hud-top-h, 150px) + 10px) 16px calc(var(--sab) + 130px);
  background: radial-gradient(ellipse 90% 70% at 50% 48%, rgba(20, 14, 0, .55), rgba(1, 6, 2, .86) 78%);
  pointer-events: none;
  animation: fade-in 220ms ease-out both;
}
.g-pause[hidden] { display: none; }
.g-pause__card {
  --cut: 14px; --bw: 2px; --frame-c: var(--caution);
  --fill: linear-gradient(180deg, rgba(34, 24, 0, .97), rgba(14, 9, 0, .97));
  width: min(100%, 360px); padding: 16px 18px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  color: var(--caution);
}
.g-pause__ico { display: inline-flex; filter: drop-shadow(0 0 8px currentColor); animation: blink 1.4s steps(1) infinite; }
.g-pause__title { font-family: var(--font-display); font-size: clamp(28px, 9vw, 40px); line-height: 1; letter-spacing: .08em; text-shadow: 0 0 10px currentColor; }
.g-pause__text { margin: 0; font-size: 15px; line-height: 1.35; color: #fff1d6; text-shadow: none; text-wrap: balance; }
.g-pause__count { font-family: var(--font-display); font-size: min(30vw, 120px); line-height: 1; color: var(--ph-1); text-shadow: var(--ph-glow), 0 0 50px rgba(57, 255, 20, .5); font-variant-numeric: tabular-nums; }
.g-pause__wait { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.g-pause__note { margin: 2px 0 0; font-size: 12px; line-height: 1.3; color: #d9c99a; text-shadow: none; }
.g-pause .btn[hidden], .g-pause__wait[hidden], .g-pause__count[hidden], .g-pause__note[hidden] { display: none; }
.g-pause[data-state="resuming"] .g-pause__card { --frame-c: var(--ph-1); --fill: linear-gradient(180deg, rgba(4, 30, 14, .97), rgba(1, 12, 5, .97)); color: var(--ph-1); }
.g-pause[data-state="resuming"] .g-pause__ico { animation: none; }
.g-pause[data-reason="sos"][data-state="paused"] .g-pause__card { --frame-c: var(--alert); --fill: linear-gradient(180deg, rgba(40, 0, 4, .97), rgba(18, 0, 2, .97)); color: #ff6b6b; }
.g-pause[data-reason="sos"][data-state="paused"] .g-pause__text { color: #ffe3e3; }
/* SOS: la scheda scende sopra i tasti e il velo si alleggerisce, il radar tra striscia SOS e scheda resta
   leggibile (VAI › inquadra lì me e chi chiede aiuto) */
.g-pause[data-reason="sos"] {
  place-items: end center;
  background: linear-gradient(180deg, rgba(1, 6, 2, .2), rgba(1, 6, 2, .35) 45%, rgba(1, 6, 2, .82) 78%);
}
/* SOS: la nota ripete la striscia rossa; scheda più bassa = più radar libero per il chip "SOS · … M" */
.g-pause[data-reason="sos"] .g-pause__note { display: none; }
/* in pausa: niente vignettatura/sirena, SCANSIONA e prossimità spenti sotto la schermata */
.screen.game.is-paused .g-vignette { opacity: 0 !important; animation: none !important; }
.screen.game.is-paused .g-prox, .screen.game.is-paused .g-ping { opacity: .45; }

/* ---------------------------------------------------------------- schermi piccoli / bassi */
@media (max-width: 360px) {
  .g-timer { min-width: 64px; }
  .g-timer__val { font-size: 34px; }
  .g-obj__val { font-size: 29px; }
  .g-phase__lbl { font-size: 18px; }
  .hud-chip { padding: 3px 6px; font-size: 11px; }
  .hud-chip--net .hud-chip__txt { display: none; }
  .btn.g-scan { padding: 0 10px; gap: 6px; }
  .g-scan__lbl { font-size: 19px; }
  .g-actions { grid-template-columns: 60px minmax(0, 1fr) 74px; gap: 6px; }
  .cmp { width: 96px; height: 96px; }
  .dep-dist__val { font-size: 48px; }
}
@media (max-height: 680px) {
  .g-exp__frame { height: min(28vh, 200px); }
  .g-heat__frame { height: min(18vh, 110px); }
  .g-pause { padding-bottom: calc(var(--sab) + 110px); }
  .g-pause__note { display: none; }
  .g-sos__text { display: none; }
  .g-banner__text { display: none; }
  .g-banner--slim .g-banner__text { display: inline; }
  .fx-card__art { width: 130px; height: 120px; }
  .cmp { width: 96px; height: 96px; }
  .dep-dist__val { font-size: 48px; }
  .end-winners__crew .crewmate { width: 24px; }
}

/* ---------------------------------------------------------------- movimento ridotto */
@media (prefers-reduced-motion: reduce) {
  .g-phase.is-blink .g-phase__plate, .g-timer[data-tone="alert"] .g-timer__val, .g-exp[data-level="high"] .g-exp__frame,
  .g-exp[data-level="high"] .g-exp__val, .btn.g-scan, .g-actions__center::before, .g-prox[data-key="burning"],
  .g-ping.is-urgent, .g-recenter[data-follow="0"], .hud-chip[data-tone="danger"], .cd-num::before, .cd-num::after,
  .cd-state[data-tone="alert"], .fx-burst__rays, .fx-scan__holo, .fx-scan__sweep, .cmp[data-state="inside"]::after, .g-hint, .end-more,
  .cmp[data-state="nopos"] .cmp__q, .dep-panel[data-state="ready"] .dep-dist__sub, .end-title::before, .end-title::after,
  .fx-card__title::before, .fx-card__title::after, .fx-caught__title::before, .fx-caught__title::after, .is-typing::after,
  .g-vignette, .dep-interrupted, .g-obj.is-complete .g-obj__row,
  .g-heart.is-lost, .hud-chip--shield[data-low="1"], .hud-chip--noisy, .g-heat.is-jammed .g-heat__frame,
  .g-timer[data-final="1"] .g-timer__val, .g-timer[data-paused="1"] .g-timer__val, .g-sos__row, .g-sos__ico,
  .g-pause, .g-pause__ico {
    animation: none !important;
  }
  .cd-num::before, .cd-num::after, .end-title::before, .end-title::after, .fx-card__title::before, .fx-card__title::after,
  .fx-caught__title::before, .fx-caught__title::after { display: none; }
  .screen.game[data-alert="alert"] .g-vignette[data-level="high"] { opacity: .8; }
  .cmp__rose, .cmp__arrow, .cmp__core, .g-ping__bar, .g-hold__ring-bar { transition: none; }
}
