/* =============================================================================
   THREAT-HUNTER.CSS — stili del puzzle logico "Threat Hunter".
   Riusa i design token globali di style.css (colori, radius, font, spacing).
   ========================================================================== */

.th-privacy {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .88rem; color: var(--muted); margin: .3rem 0 0;
}
.th-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.18); flex: none; }

#thRoot { max-width: 620px; margin: 0 auto; }

.th-header { display: flex; justify-content: center; gap: 40px; margin-bottom: 22px; }
.th-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.th-stat__label { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.th-stat__value { font-family: var(--font); font-weight: 800; font-size: 1.7rem; }

/* sezione "Come si gioca": spiega il ciclo di tocco + le 3 regole illustrate */
.th-guide {
  max-width: 620px; margin: 0 auto 24px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.th-guide__title { font-size: 1.02rem; font-weight: 800; margin: 0 0 8px; }
.th-guide__text { font-size: .88rem; color: var(--muted); line-height: 1.55; margin: 0 0 16px; }

.th-rules { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.th-rule {
  display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted);
  background: var(--bg-soft-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .5rem .7rem; flex: 1 1 180px; max-width: 240px; text-align: left;
}
.th-rule__text { flex: 1; }

/* mini-diagramma 3x3 che illustra la regola (icone reali del gioco, in scala) */
.th-mini {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 46px; height: 46px;
  flex: none; border-radius: 6px; overflow: hidden; background: var(--line);
}
.th-mini__cell { display: grid; place-items: center; background: var(--bg-soft-2); }
.th-mini__cell.zone { background: rgba(45,212,191,.24); }
.th-mini__cell svg { width: 60%; height: 60%; }
.th-mini__cell.shield { color: var(--accent); }
.th-mini__cell.threat { color: var(--accent-3); }

.th-grid {
  display: grid; gap: 4px; background: var(--line); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 4px; aspect-ratio: 1 / 1; margin: 0 auto 20px;
  touch-action: manipulation; /* disabilita il pinch/doppio-tap-zoom su tutta l'area di gioco */
}
.th-cell {
  aspect-ratio: 1 / 1; border: none; border-radius: 5px; cursor: pointer;
  background: var(--th-zone); color: #fff; display: grid; place-items: center;
  padding: 0; transition: transform .1s, filter .15s; min-width: 0; min-height: 0;
  touch-action: manipulation; /* il doppio tap rapido per ciclare lo stato non deve far zoomare la pagina */
  -webkit-tap-highlight-color: transparent; /* niente flash grigio di evidenziazione al tocco su mobile */
  -webkit-user-select: none; user-select: none; /* evita la selezione testo su tap ripetuti */
}
.th-cell:hover { filter: brightness(1.1); transform: scale(1.04); }
.th-cell svg { width: 55%; height: 55%; }
.th-cell .th-shield-icon { width: 82%; height: 82%; opacity: .95; } /* scudo: riempie quasi tutta la cella */
.th-cell .th-shield-icon.th-auto { opacity: .45; } /* scudo automatico (dedotto da una minaccia): più tenue di quelli manuali */
.th-conflict { box-shadow: 0 0 0 3px #f43f5e inset; animation: th-pulse 1s ease-in-out infinite; }
@keyframes th-pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }

.th-actions { display: flex; justify-content: center; gap: 10px; }

.th-win {
  text-align: center; padding: 24px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 10px;
}
.th-win p { font-weight: 700; font-size: 1.1rem; margin: 0 0 14px; color: var(--accent); }

.th-disclaimer { max-width: 560px; margin: 26px auto 0; font-size: .78rem; color: var(--muted-2); text-align: center; }

@media (max-width: 560px) {
  .th-header { gap: 26px; }
  .th-stat__value { font-size: 1.4rem; }
  .th-rule { font-size: .76rem; padding: .45rem .6rem; flex: 1 1 100%; max-width: none; }
  .th-mini { width: 38px; height: 38px; }
  .th-guide { padding: 14px 16px; }
}
