/* ==========================================
   Tema per gioco (comune a tutti i giochi con un tema)
   I colori arrivano come variabili sul <body class="tg">, scritte dal generatore
   (giochi/_strumenti/temi-giochi.mjs). Qui NON ci sono colori di un gioco preciso.
   ========================================== */
body.tg { --bg: var(--tg-fondo, #fef3c7); }
body.tg .topbar { background: var(--tg-barra); color: #fff; }
body.tg .topbar .tb-title small { color: var(--tg-testo); }

.tg-hero { padding-bottom: 0; }
body.tg #app { scroll-margin-top: 72px; } /* sotto la barra in alto quando un tasto del tema porta al gioco */
.tg-hero[hidden], .tg-hero.hidden { display: none !important; }

/* Scena illustrata */
.tg-scena {
  position: relative; overflow: hidden; color: #fff;
  border: 4px solid #000; border-radius: var(--radius); box-shadow: 6px 6px 0 #000;
  background: radial-gradient(120% 95% at 50% 0%, var(--tg-notte2) 0%, var(--tg-notte) 72%);
}
.tg-titolo { position: relative; z-index: 1; text-align: center; padding: 16px 12px 0; }
.tg-titolo b {
  display: block; font-size: clamp(32px, 11vw, 46px); font-weight: 900; line-height: 1;
  text-transform: uppercase; letter-spacing: .04em; color: #fff;
  text-shadow: 3px 3px 0 var(--tg-accento), 5px 5px 0 #000;
}
.tg-titolo span {
  display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px;
  background: #000; color: var(--tg-luce);
  font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em;
}
.tg-scena svg { display: block; width: 100%; height: auto; margin-top: -4px; }

/* Un solo pulsante grande; "gioca online" è un link di testo; la scheda veloce è una riga */
.tg-cta {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; margin-top: 18px; min-height: 66px; padding: 12px 14px;
  text-decoration: none; cursor: pointer; font-weight: 900; font-size: 22px; letter-spacing: .01em; text-transform: uppercase;
  background: var(--tg-accento); color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
  border: 4px solid #000; border-radius: 18px; box-shadow: 6px 6px 0 #000; transition: transform .08s, box-shadow .08s;
}
.tg-cta:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #000; }
.tg-cta:focus-visible, .tg-online a:focus-visible { outline: 4px solid var(--tg-notte); outline-offset: 3px; }
.tg-nota { margin-top: 7px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
/* 1-2 tasti piccoli per il gioco online, affiancati */
.tg-online { display: flex; gap: 10px; margin-top: 14px; }
.tg-online a {
  flex: 1 1 0; min-width: 0; min-height: 46px; padding: 8px 6px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: #fff; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 900;
  border: 3px solid #000; border-radius: 14px; box-shadow: 3px 3px 0 #000; transition: transform .08s, box-shadow .08s;
}
.tg-online a:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
/* Giochi con le stanze: "Gioca online" pesa come il pulsante principale (a tutta larghezza, stessa altezza);
   il secondo tasto (Scansiona QR / Ho un codice) resta piccolo sotto. Non vale per i tasti con data-tema-step (non online). */
.tg-online { flex-wrap: wrap; }
.tg-online a:first-child:not([data-tema-step]) {
  flex: 1 1 100%; min-height: 66px; padding: 12px 14px; font-size: 20px; letter-spacing: .01em; text-transform: uppercase;
  background: var(--tg-notte); color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
  border: 4px solid #000; border-radius: 18px; box-shadow: 6px 6px 0 #000;
}
.tg-online a:first-child:not([data-tema-step]):active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #000; }
.tg-scheda {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px;
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.tg-scheda b { color: var(--ink); }

/* Carattere dei titoli (solo temi con font: true). File sul sito, nessun collegamento esterno.
   Montserrat, licenza SIL Open Font License 1.1 */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 900; font-display: swap; src: url(/giochi/assets/font/montserrat-900.woff2) format('woff2'); }
.tg-font .tg-titolo b, .tg-font .topbar .tb-title {
  font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: -0.025em;
}

/* Animazioni leggere dell'illustrazione (solo CSS) */
.tg-stella { animation: tgBrilla 3s ease-in-out infinite; }
.tg-stella:nth-of-type(2n) { animation-delay: -1.2s; }
.tg-stella:nth-of-type(3n) { animation-delay: -2.1s; }
.tg-occhi { transform-box: fill-box; transform-origin: center; animation: tgBatti 5s infinite; }
.tg-fluttua { animation: tgFluttua 3.2s ease-in-out infinite; }
.tg-gira { transform-box: fill-box; transform-origin: center; animation: tgGira 14s linear infinite; }
@keyframes tgGira { to { transform: rotate(360deg); } }
@keyframes tgBrilla { 0%, 100% { opacity: .9; } 50% { opacity: .25; } }
@keyframes tgBatti { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes tgFluttua { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .tg-stella, .tg-occhi, .tg-fluttua, .tg-gira { animation: none; }
}
