/* Il gioco rifatto, in anteprima (15/10/2026). Veste di stazione: il valore
   scelto come una cifra del tabellone, la linea gialla sotto la testa, le
   fasce coi colori di ritardo_fascia(). Colori dai gettoni del sito, cosi'
   regge sia il tema scuro sia quello chiaro. */
.g2 {
  --g2-ok: var(--rm-green, #22c55e);
  --g2-poco: var(--rm-amber, #f5b72e);
  --g2-medio: var(--rm-orange, #fb923c);
  --g2-tanto: var(--rm-red, #f0554d);
  --g2-grave: #b91c1c;
  --g2-giallo: #ffd23f;
  display: grid; gap: 14px;
  padding: 16px; border-radius: 14px;
  background: var(--rm-surface, #0d1628); border: 1px solid var(--rm-line, #1c2a44);
  color: var(--rm-ink, #e8edf4);
}
.g2 .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.g2-testa { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 3px solid var(--g2-giallo); }
.g2-badge {
  font: 700 11px/1 'Inter', system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase;
  color: #071b33; background: var(--g2-giallo); padding: 5px 8px; border-radius: 4px;
}
.g2-n { font-size: 12px; color: var(--rm-muted); }
.g2-domanda { margin: 0; font: 700 1.15rem/1.25 'Bricolage Grotesque', 'Inter', sans-serif; text-wrap: balance; }
.g2-nota { margin: 0; font-size: .84rem; color: var(--rm-muted); }
.g2-form { display: grid; gap: 14px; margin: 0; }

/* Il valore scelto, grande, come una cifra del tabellone. */
.g2-scelta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.g2-valore {
  font-size: 2.1rem; font-weight: 700; line-height: 1; letter-spacing: -.02em;
  padding: 8px 12px; border-radius: 8px; background: #071324; color: var(--g2-giallo);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  min-width: 5.2ch; text-align: center;
}
.g2-fascia { font-weight: 700; }
.g2-storia { font-size: .86rem; color: var(--rm-muted); flex-basis: 100%; }

/* La curva. */
.g2-curva { display: grid; gap: 6px; }
.g2-curva svg { width: 100%; height: 150px; display: block; touch-action: none; cursor: ew-resize; overflow: visible; }
.g2-zona { opacity: .13; }
.g2-zona.g2-t-ok { fill: var(--g2-ok); }
.g2-zona.g2-t-poco { fill: var(--g2-poco); }
.g2-zona.g2-t-medio { fill: var(--g2-medio); }
.g2-zona.g2-t-tanto { fill: var(--g2-tanto); }
.g2-zona.g2-t-grave { fill: var(--g2-grave); }
.g2-area { fill: var(--rm-brand, #157bff); fill-opacity: .35; stroke: var(--rm-brand, #157bff); stroke-width: 2; vector-effect: non-scaling-stroke; }
.g2-tipica { stroke: var(--rm-muted); stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.g2-cursore { stroke: var(--g2-giallo); stroke-width: 3; vector-effect: non-scaling-stroke; }
.g2-asse { fill: var(--rm-muted); font: 12px 'JetBrains Mono', ui-monospace, monospace; }
.g2-range { width: 100%; accent-color: var(--g2-giallo); margin: 0; }
.g2-legenda { margin: 0; font-size: .8rem; color: var(--rm-muted); display: flex; align-items: center; gap: 6px; }
.g2-legenda i { width: 14px; border-top: 2px dashed var(--rm-muted); }

/* Le fasce: tre per riga, sei bottoni in due righe pari. */
.g2-fasce { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.g2-f {
  position: relative; display: grid; gap: 2px; text-align: left;
  padding: 9px 9px 8px; border-radius: 9px; cursor: pointer;
  background: transparent; color: inherit; font: inherit;
  border: 1px solid var(--rm-line); border-top: 4px solid var(--g2-c, var(--rm-line));
  transition: transform 160ms ease-out, background-color 160ms ease;
}
.g2-f:hover { background: rgba(var(--rm-ink-rgb, 232,237,244), .05); }
.g2-f:active { transform: scale(.97); }
.g2-f.on { background: rgba(var(--rm-ink-rgb, 232,237,244), .09); box-shadow: inset 0 0 0 2px var(--g2-c); }
.g2-f.g2-t-ok { --g2-c: var(--g2-ok); }
.g2-f.g2-t-poco { --g2-c: var(--g2-poco); }
.g2-f.g2-t-medio { --g2-c: var(--g2-medio); }
.g2-f.g2-t-tanto { --g2-c: var(--g2-tanto); }
.g2-f.g2-t-grave { --g2-c: var(--g2-grave); }
.g2-f.g2-t-sopp { --g2-c: var(--rm-muted); }
.g2-f-nome { font-size: .78rem; font-weight: 700; line-height: 1.2; }
.g2-f-pct { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.g2-f-sotto { font-size: .7rem; color: var(--rm-muted); line-height: 1.2; }
.g2-f-gioc { display: flex; gap: 3px; min-height: 7px; align-items: center; font-size: .7rem; color: var(--rm-muted); }
.g2-f-gioc i { width: 7px; height: 7px; border-radius: 50%; background: var(--g2-c); }

.g2-quota { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.g2-quota > div { display: grid; gap: 2px; padding: 10px; border-radius: 9px; background: rgba(var(--rm-ink-rgb, 232,237,244), .04); }
.g2-q-e { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rm-muted); }
.g2-quota b { font-size: 1.3rem; }
.g2-q-s { font-size: .74rem; color: var(--rm-muted); }

.g2-posta { margin: 0; }
.g2-piede a { color: inherit; }
.g2.g2-cancellato .g2-curva { opacity: .4; }

/* Il ritardo di adesso, se il treno e' in viaggio. */
.g2-adesso { margin: 0; font-size: .88rem; padding: 8px 10px; border-radius: 8px; background: rgba(var(--rm-brand-rgb, 21,123,255), .12); }
.g2-ora { stroke: var(--rm-ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.g2-ora-t { fill: var(--rm-ink); font: 700 12px 'JetBrains Mono', ui-monospace, monospace; }

/* Il nastro delle vincite: scorre di meta' (due copie in fila) e ricomincia. */
.g2-nastro { overflow: hidden; border-radius: 6px; background: #071324; color: #e8edf4; font-size: .78rem; white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.g2-nastro-in { display: inline-flex; animation: g2-scorri 60s linear infinite; padding: 7px 0; }
.g2-nastro:hover .g2-nastro-in { animation-play-state: paused; }
.g2-nastro-copia { display: inline-flex; }
.g2-nv { padding: 0 14px; border-right: 1px solid rgba(255,255,255,.12); }
.g2-nv em { font-style: normal; color: #ffd23f; font-weight: 700; }
@keyframes g2-scorri { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .g2-f { transition: none; }
  .g2-nastro { overflow-x: auto; }
  .g2-nastro-in { animation: none; }
  .g2-nastro-copia { display: none; }
}

/* Dentro il pannello della scheda: niente seconda cornice. */
.rm-predict .g2 { padding: 0; border: 0; background: transparent; }
/* Dopo il pronostico. */
.g2-mio { gap: 8px; margin-top: 10px; }
.g2-mio-svg { width: 100%; height: 110px; display: block; overflow: visible; }
.g2-l-tuo { width: 14px; border-top: 3px solid #ffd23f !important; }
.g2-l-ora { width: 14px; border-top: 2px solid var(--rm-ink) !important; }
