/* TotoMisto (Views/TotoMisto): grafica "schedina", pensata prima per il telefono.
   Riusa --brand-primary / --brand-gold di site.css. */
.toto {
  --toto-blu: var(--brand-primary, #2A2B67);
  --toto-oro: var(--brand-gold, #FBB632);
  --toto-carta: #fffdf6;
  --toto-verde: #1e8e3e;
  --toto-rosso: #c62828;
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: 6rem; /* spazio per la barra fissa in basso */
}

/* Testata */
.toto-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  padding: 1.25rem 1.25rem 1.1rem;
  color: #fff;
  background:
    radial-gradient(circle at 110% -20%, rgba(251, 182, 50, .55) 0, rgba(251, 182, 50, 0) 55%),
    radial-gradient(circle at -10% 120%, rgba(255, 255, 255, .18) 0, rgba(255, 255, 255, 0) 45%),
    linear-gradient(135deg, #2A2B67 0%, #3d3f93 60%, #5b3f93 100%);
  box-shadow: 0 10px 30px rgba(42, 43, 103, .25);
}
.toto-hero::after {
  /* pallone stilizzato sullo sfondo */
  content: "";
  position: absolute;
  right: -2.5rem;
  bottom: -3rem;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .12);
  background:
    radial-gradient(circle at 30% 30%, transparent 46%, rgba(255, 255, 255, .12) 47%, transparent 49%),
    radial-gradient(circle at 75% 60%, transparent 46%, rgba(255, 255, 255, .12) 47%, transparent 49%);
}
.toto-logo {
  font-weight: 900;
  font-size: clamp(2rem, 8vw, 2.8rem);
  letter-spacing: -.02em;
  line-height: 1;
  margin: 0;
}
.toto-logo span {
  color: var(--toto-oro);
}
.toto-sottotitolo {
  opacity: .85;
  margin: .4rem 0 0;
  font-size: .95rem;
}
.toto-hero-dati {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}
.toto-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
}
.toto-chip-oro {
  background: var(--toto-oro);
  color: var(--toto-blu);
}
.toto-countdown {
  font-variant-numeric: tabular-nums;
}

/* Schede di navigazione */
.toto-tabs {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  margin: 1rem 0;
  padding-bottom: .15rem;
  scrollbar-width: none;
}
.toto-tabs::-webkit-scrollbar { display: none; }
.toto-tabs a {
  flex: 1 0 auto;
  text-align: center;
  padding: .55rem .9rem;
  border-radius: 999px;
  background: #eef0fb;
  color: var(--toto-blu);
  font-weight: 600;
  text-decoration: none;
  font-size: .92rem;
}
.toto-tabs a.attiva {
  background: var(--toto-blu);
  color: #fff;
}

/* Schedina */
.toto-girone {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1.5rem 0 .6rem;
  font-weight: 800;
  color: var(--toto-blu);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .9rem;
}
.toto-girone::after {
  content: "";
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--toto-oro) 0 8px, transparent 8px 14px);
}
.toto-partita {
  position: relative;
  background: var(--toto-carta);
  border: 1px solid #ece6d3;
  border-radius: 1rem;
  padding: .8rem .8rem .75rem;
  margin-bottom: .75rem;
  box-shadow: 0 2px 8px rgba(42, 43, 103, .06);
  transition: box-shadow .15s, border-color .15s;
}
.toto-partita.compilata {
  border-color: #d9cf9f;
}
.toto-partita.jolly-attivo {
  border-color: var(--toto-oro);
  box-shadow: 0 0 0 3px rgba(251, 182, 50, .35), 0 4px 14px rgba(251, 182, 50, .25);
}
.toto-partita-info {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .75rem;
  color: #6c6a78;
  margin-bottom: .55rem;
}
.toto-sfida {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  margin-bottom: .7rem;
}
.toto-squadra {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.15;
  color: #1d1d33;
}
.toto-squadra.ospite {
  flex-direction: row-reverse;
  text-align: right;
}
.toto-squadra-nome {
  overflow-wrap: anywhere;
}
.toto-stemma {
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ece6d3;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: .8rem;
  font-weight: 800;
  color: var(--toto-blu);
}
.toto-stemma img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.toto-vs {
  font-weight: 900;
  color: var(--toto-oro);
  font-size: .85rem;
}
.toto-risultato-finale {
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--toto-blu);
  white-space: nowrap;
}

/* I 4 risultati: radio nascosti + etichette grandi da toccare */
.toto-scelte {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
}
.toto-scelte input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toto-scelte label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  border-radius: .75rem;
  border: 2px solid #e2dcc6;
  background: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--toto-blu);
  cursor: pointer;
  user-select: none;
  transition: transform .08s, background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.toto-scelte label small {
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #8a8799;
}
.toto-scelte label:active {
  transform: scale(.96);
}
.toto-scelte input:focus-visible + label {
  outline: 3px solid rgba(42, 43, 103, .4);
  outline-offset: 2px;
}
.toto-scelte input:checked + label {
  background: var(--toto-blu);
  border-color: var(--toto-blu);
  color: #fff;
}
.toto-scelte input:checked + label small {
  color: var(--toto-oro);
}
.toto-scelte input:disabled + label {
  cursor: default;
  opacity: .55;
}

/* Jolly */
.toto-jolly {
  display: flex;
  justify-content: flex-end;
  margin-top: .5rem;
}
.toto-jolly input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toto-jolly label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1.5px dashed #d2c68f;
  font-size: .8rem;
  font-weight: 700;
  color: #8a7a2e;
  cursor: pointer;
  user-select: none;
}
.toto-jolly input:checked + label {
  background: var(--toto-oro);
  border: 1.5px solid var(--toto-oro);
  color: var(--toto-blu);
}
.toto-jolly input:disabled + label {
  opacity: .5;
  cursor: default;
}
.toto-badge-jolly {
  position: absolute;
  top: -.55rem;
  right: .8rem;
  background: var(--toto-oro);
  color: var(--toto-blu);
  font-size: .7rem;
  font-weight: 900;
  padding: .1rem .5rem;
  border-radius: 999px;
  letter-spacing: .05em;
}

/* Barra fissa in basso con avanzamento e salvataggio */
.toto-barra {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  padding: .6rem max(1rem, env(safe-area-inset-left)) calc(.6rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px);
  box-shadow: 0 -4px 18px rgba(42, 43, 103, .15);
}
.toto-barra-interno {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.toto-avanzamento {
  flex: 1;
  min-width: 0;
}
.toto-avanzamento-testo {
  font-size: .8rem;
  font-weight: 700;
  color: var(--toto-blu);
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}
.toto-avanzamento-barra {
  height: .45rem;
  border-radius: 999px;
  background: #eceaf4;
  overflow: hidden;
  margin-top: .3rem;
}
.toto-avanzamento-barra div {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--toto-oro), #f59f00);
  transition: width .25s;
}
.toto-salva {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: .75rem 1.3rem;
  font-weight: 800;
  background: var(--toto-oro);
  color: var(--toto-blu);
  box-shadow: 0 4px 12px rgba(251, 182, 50, .45);
}
.toto-salva:disabled {
  opacity: .5;
  box-shadow: none;
}
.toto-salva.da-salvare {
  animation: toto-pulsa 1.4s ease-in-out infinite;
}
@keyframes toto-pulsa {
  50% { box-shadow: 0 4px 22px rgba(251, 182, 50, .95); }
}
@media (prefers-reduced-motion: reduce) {
  .toto-salva.da-salvare { animation: none; }
}

/* Riquadri */
.toto-riquadro {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e9e7f2;
  padding: 1rem;
  margin-bottom: 1rem;
}
.toto-invito {
  text-align: center;
  background: linear-gradient(180deg, #fff8e6, #fff);
  border: 2px dashed var(--toto-oro);
}
.toto-btn {
  display: inline-block;
  border-radius: 999px;
  padding: .7rem 1.4rem;
  font-weight: 800;
  text-decoration: none;
  border: 0;
  background: var(--toto-blu);
  color: #fff;
}
.toto-btn:hover { color: #fff; filter: brightness(1.1); }
.toto-btn-oro { background: var(--toto-oro); color: var(--toto-blu); }
.toto-btn-oro:hover { color: var(--toto-blu); }

/* Esito dei pronostici (giornate chiuse) */
.toto-esito {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .6rem;
  padding: .45rem .6rem;
  border-radius: .6rem;
  background: #f4f3fa;
  font-size: .85rem;
}
.toto-punti {
  font-weight: 900;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: #dcdbe8;
  color: #4a4860;
  white-space: nowrap;
}
.toto-punti.esatto { background: var(--toto-verde); color: #fff; }
.toto-punti.vincente { background: #7cb342; color: #fff; }
.toto-punti.sbagliato { background: #ef9a9a; color: #5d1010; }

/* Percentuali della community */
.toto-percentuali {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
}
.toto-percentuale {
  position: relative;
  border-radius: .6rem;
  overflow: hidden;
  background: #f1f0f7;
  text-align: center;
  padding: .45rem .2rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--toto-blu);
}
.toto-percentuale .riempimento {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(42, 43, 103, .16);
}
.toto-percentuale.giusto {
  outline: 2px solid var(--toto-verde);
}
.toto-percentuale.giusto .riempimento {
  background: rgba(30, 142, 62, .25);
}
.toto-percentuale.mio::after {
  content: "tu";
  position: absolute;
  top: .1rem;
  right: .3rem;
  font-size: .6rem;
  color: var(--toto-oro);
  font-weight: 900;
}
.toto-percentuale > * {
  position: relative;
}
.toto-percentuale strong {
  display: block;
  font-size: 1rem;
}

/* Classifiche */
.toto-classifica {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toto-classifica > li {
  background: #fff;
  border: 1px solid #e9e7f2;
  border-radius: .9rem;
  margin-bottom: .5rem;
}
.toto-classifica-riga {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .8rem;
}
.toto-classifica details > summary {
  list-style: none;
  cursor: pointer;
}
.toto-classifica details > summary::-webkit-details-marker { display: none; }
.toto-posizione {
  flex: 0 0 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: #eef0fb;
  color: var(--toto-blu);
}
.toto-classifica > li.podio-1 .toto-posizione { background: var(--toto-oro); }
.toto-classifica > li.podio-2 .toto-posizione { background: #cfd3dc; }
.toto-classifica > li.podio-3 .toto-posizione { background: #e6c29b; }
.toto-classifica > li.io {
  border: 2px solid var(--toto-blu);
}
.toto-nome {
  flex: 1;
  min-width: 0;
}
.toto-nome strong {
  display: block;
  overflow-wrap: anywhere;
}
.toto-nome small {
  color: #7a7890;
}
.toto-totale {
  text-align: right;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--toto-blu);
  line-height: 1;
}
.toto-totale small {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  color: #7a7890;
}
.toto-dettaglio {
  padding: 0 .8rem .7rem 3.75rem;
  font-size: .82rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.toto-dettaglio span {
  padding: .15rem .5rem;
  border-radius: .5rem;
  background: #f4f3fa;
}
.toto-dettaglio span.esatto { background: #d7f0dc; }
.toto-dettaglio span.vincente { background: #eaf4d9; }

.toto-profeta {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #fff3cf, #ffe29a);
  border: 1px solid #f3cf6b;
  margin-bottom: 1rem;
}
.toto-profeta-icona {
  font-size: 2rem;
  line-height: 1;
}

.toto-selettore {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding-bottom: .3rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}
.toto-selettore a {
  flex: 0 0 auto;
  min-width: 2.6rem;
  text-align: center;
  padding: .45rem .7rem;
  border-radius: .7rem;
  border: 1.5px solid #dcdaea;
  color: var(--toto-blu);
  text-decoration: none;
  font-weight: 700;
}
.toto-selettore a.attiva {
  background: var(--toto-blu);
  border-color: var(--toto-blu);
  color: #fff;
}

.toto-segmenti {
  display: inline-flex;
  background: #eef0fb;
  border-radius: 999px;
  padding: .2rem;
  margin-bottom: 1rem;
}
.toto-segmenti button {
  border: 0;
  background: none;
  border-radius: 999px;
  padding: .45rem 1rem;
  font-weight: 700;
  color: var(--toto-blu);
}
.toto-segmenti button.attiva {
  background: #fff;
  box-shadow: 0 1px 4px rgba(42, 43, 103, .2);
}

@media (min-width: 576px) {
  .toto-hero { padding: 1.75rem 2rem 1.5rem; }
  .toto-partita { padding: 1rem 1.1rem .9rem; }
  .toto-squadra { font-size: 1.05rem; }
  .toto-stemma { width: 2.8rem; height: 2.8rem; }
}
