/* Schermo intero, niente scroll, niente zoom, niente selezione testo */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #2b2118;
  overscroll-behavior: none;          /* niente "tira per aggiornare" */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#gioco {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;                     /* altezza reale con le barre del browser */
  display: block;
  touch-action: none;                 /* i tocchi li gestisce il gioco */
  cursor: crosshair;                  /* su PC si mira col mouse */
}
/* Il gioco funziona sia in verticale sia in orizzontale: lo zoom si adatta al lato corto (camera.js) */

/* ---------- menu sopra al canvas (interfaccia.js) ---------- */
#interfaccia {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(30, 18, 8, 0.55), rgba(15, 8, 3, 0.85));
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#interfaccia.visibile { display: flex; }

.schermata {
  box-sizing: border-box;
  width: min(560px, 94vw);
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: linear-gradient(#4a301c, #33200f);
  border: 4px solid #1e120a;
  border-radius: 24px;
  box-shadow: 0 10px 0 #1e120a, 0 20px 40px rgba(0, 0, 0, 0.5);
  color: #fff6dc;
  padding: 18px 18px 22px;
  text-align: center;
}
.schermata.stretta { width: min(400px, 94vw); }

.schermata h1, .schermata h2 {
  margin: 4px 0 6px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffd65a;
  text-shadow: 3px 3px 0 #1e120a, -1px -1px 0 #1e120a, 1px -1px 0 #1e120a, -1px 1px 0 #1e120a;
}
.schermata h1 { font-size: clamp(28px, 8vw, 44px); }
.schermata h2 { font-size: clamp(20px, 5.5vw, 28px); }
.schermata h1.rosso { color: #ff8a5c; }
.sottotitolo { margin: 0 0 12px; opacity: 0.85; }
.record { color: #ffcf40; font-weight: 900; font-size: 20px; margin: 4px 0 10px; }
.comandi { font-size: 12px; opacity: 0.6; margin: 14px 0 0; }
.eroe { display: block; margin: 0 auto -6px; }

.info { display: grid; gap: 4px; margin: 0 0 12px; font-weight: 700; }

.scelta {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center;
  margin: 0 0 14px;
}
.scelta .etichetta { font-weight: 700; margin-right: 4px; }

.azioni { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.azioni.colonna { flex-direction: column; align-items: stretch; }

.bottone {
  font: 900 17px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #3a2408;
  background: linear-gradient(#ffe07a, #f2b933);
  border: 3px solid #5a3a0a;
  border-radius: 999px;
  box-shadow: 0 4px 0 #5a3a0a;
  padding: 10px 20px;
  cursor: pointer;
  touch-action: manipulation;
}
.bottone:active { transform: translateY(3px); box-shadow: 0 1px 0 #5a3a0a; }
.bottone:disabled { filter: grayscale(0.8); opacity: 0.5; cursor: default; transform: none; }
.bottone.grande { font-size: 21px; padding: 12px 30px; }
.bottone.piccolo, .bottone.chip { font-size: 14px; padding: 6px 14px; }
.bottone.chip { background: #6b4a2c; color: #fff6dc; border-color: #2b1a0c; box-shadow: 0 3px 0 #2b1a0c; }
.bottone.chip.scelto { background: linear-gradient(#ffe07a, #f2b933); color: #3a2408; }
.bottone.prezzo { font-size: 15px; padding: 8px 14px; white-space: nowrap; }

.lista { display: grid; gap: 8px; text-align: left; }
.voce {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 6px 10px 6px 6px;
}
.voce.spenta { opacity: 0.55; }
.voce .testo { display: grid; gap: 2px; }
.voce .testo span { font-size: 13px; opacity: 0.8; }
.voce .livello { color: #ffd65a; letter-spacing: 2px; opacity: 1 !important; }
.voce .motivo { font-size: 13px; opacity: 0.7; }

.tabella {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 18px;
  text-align: left; margin: 8px auto 4px; max-width: 280px; font-size: 16px;
}
.tabella strong { text-align: right; color: #ffd65a; }

/* ---------- co-op ---------- */
.campo {
  box-sizing: border-box;
  width: 100%;
  font: 700 18px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 10px 14px;
  border-radius: 14px;
  border: 3px solid #1e120a;
  background: #fff6dc;
  color: #3a2408;
  text-align: center;
  user-select: text;
  -webkit-user-select: text;
}
.campo.codice { font-size: 28px; letter-spacing: 8px; text-transform: uppercase; }
.etichetta-campo { display: block; font-weight: 700; margin: 4px 0 6px; }
.separatore { margin-top: 18px; border-top: 2px dashed rgba(255, 246, 220, 0.2); padding-top: 12px; }
.errore { background: rgba(224, 83, 61, 0.25); border-radius: 10px; padding: 8px; font-weight: 700; color: #ffc2b5; }
.codice-grande {
  font: 900 46px system-ui, sans-serif; letter-spacing: 10px; color: #ffd65a; margin: 0 0 8px;
  text-shadow: 3px 3px 0 #1e120a;
}
.voce.giocatore { grid-template-columns: 22px 1fr auto; }
.pallino { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #1e120a; }
.rotella {
  width: 40px; height: 40px; margin: 10px auto; border-radius: 50%;
  border: 5px solid rgba(255, 214, 90, 0.25); border-top-color: #ffd65a;
  animation: gira 0.9s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }
