/* Il Brillo Cantante — il gioco (a schermo intero, separato dal sito) */

#gioco { position: fixed; inset: 0; z-index: 200; background: #0c0705; color: var(--crema); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#g-tela { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.g-barra { position: absolute; inset: 0 0 auto 0; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 16px;
  background: linear-gradient(180deg, rgba(12,7,5,.95), rgba(12,7,5,.7) 75%, rgba(12,7,5,0)); z-index: 3; }
.g-livello { font-style: italic; font-weight: 600; font-size: clamp(.85rem, 2.6vw, 1.1rem); color: var(--oro-chiaro); white-space: nowrap; }
.g-tempo { flex: 1; height: 10px; border-radius: 6px; background: rgba(243,234,216,.16); overflow: hidden; min-width: 40px; }
.g-tempo i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #c8372a, #c9a24b 30%, #2c8a68); transform-origin: 0 50%; }
.g-punti { display: grid; justify-items: end; line-height: 1; min-width: 74px; }
.g-punti b { font-size: clamp(1.3rem, 4.4vw, 1.8rem); font-variant-numeric: tabular-nums; font-weight: 700; }
.g-punti small { font-size: .66rem; letter-spacing: .08em; opacity: .7; white-space: nowrap; }
.g-icona { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(243,234,216,.35); background: rgba(12,7,5,.5); font-size: 1.25rem; line-height: 1; display: grid; place-content: center; flex: none; }
.g-icona[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }

.g-avviso { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-size: clamp(3.4rem, 16vw, 8rem); z-index: 4; pointer-events: none; opacity: 0; }
.g-avviso.batte { animation: batte .6s ease-out; }
@keyframes batte { 0% { opacity: 0; transform: scale(2); } 25% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.9); } }

/* tasti a schermo */
.g-tasti { position: absolute; inset: auto 0 0 0; z-index: 3; display: grid; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); justify-content: center; }
.g-tasti:empty { display: none; }
.g-tasti.sei { grid-template-columns: repeat(6, minmax(0, 92px)); }
.g-tasti.quattro { grid-template-columns: repeat(4, minmax(0, 132px)); }
.g-tasti.uno { grid-template-columns: minmax(0, 520px); }
.g-tasto { position: relative; height: 84px; border-radius: 12px; border: 2px solid #1c120a; background: linear-gradient(180deg, #f7eedb, #e2d2b0); color: #24170f;
  box-shadow: 0 4px 0 #1c120a, 0 10px 18px rgba(0,0,0,.5); display: grid; place-content: center; touch-action: none; -webkit-tap-highlight-color: transparent; padding: 0; }
.g-tasto:active, .g-tasto.giu { transform: translateY(3px); box-shadow: 0 1px 0 #1c120a; }
.g-tasto canvas { width: 58px; height: 58px; display: block; pointer-events: none; }
.g-tasto kbd { position: absolute; left: 6px; top: 4px; font-family: var(--serif); font-size: .7rem; font-weight: 700; opacity: .55; }
.g-tasto.corsia { background: var(--c); height: 76px; }
.g-tasto.versa { font-family: var(--mano); font-size: 1.7rem; background: linear-gradient(180deg, #bfe6ee, #86c4d2); }
@media (pointer: fine) { .g-tasti.sei .g-tasto { height: 78px; } .g-tasto.corsia { display: none; } }
@media (max-width: 420px) { .g-tasto canvas { width: 46px; height: 46px; } .g-tasto { height: 74px; } }

/* schermate */
.g-schermo { position: absolute; inset: 0; z-index: 6; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; user-select: text; -webkit-user-select: text;
  display: grid; justify-items: center; align-content: safe center; padding: 68px 14px 30px;
  background: radial-gradient(ellipse at 50% 30%, rgba(42,24,14,.86), rgba(12,7,5,.95) 75%); }
.g-carta { width: min(100%, 640px); background: repeating-linear-gradient(0deg, rgba(120,84,40,.05) 0 1px, transparent 1px 4px), linear-gradient(180deg, #f7eedb, #efe4cb);
  color: var(--inchiostro); border-radius: 4px; padding: clamp(20px, 4.5vw, 36px); box-shadow: 0 30px 60px rgba(0,0,0,.6); display: grid; gap: 14px; }
.g-carta h2 { font-size: clamp(1.9rem, 6.5vw, 2.8rem); font-style: italic; font-weight: 600; line-height: 1; color: var(--verde); letter-spacing: -.015em; }
.g-carta h3 { font-size: 1.25rem; font-weight: 600; color: var(--verde); }
.g-carta .gesso-scuro { font-size: 1.45rem; }
.g-regalo { background: #153a2b; color: var(--oro-chiaro); padding: 12px 16px; border-radius: 4px; font-size: .95rem; }
.g-regalo.preso { background: #5a2a20; }
.g-carta label { display: grid; gap: 5px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: #5d5446; }
.g-carta input[type="text"], .g-carta input[type="email"] { font: inherit; font-family: var(--serif); font-size: 1.15rem; letter-spacing: 0; text-transform: none; padding: 11px 13px; border: 2px solid #24170f; border-radius: 4px; background: #fffdf7; color: #1d1712; width: 100%; }
.g-clienti { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.g-cliente { border: 2px solid rgba(36,23,15,.3); border-radius: 6px; background: #fbf6ea; padding: 10px 8px 12px; display: grid; gap: 4px; justify-items: center; text-align: center; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.g-cliente { align-content: start; }
.g-cliente img { width: 100%; max-width: 170px; aspect-ratio: 1; object-fit: contain; object-position: 50% 100%; }
.g-cliente b { font-size: 1.2rem; font-style: italic; }
.g-cliente i { font-style: normal; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #8a6a35; font-weight: 700; }
.g-cliente span { font-size: .82rem; line-height: 1.3; }
.g-cliente[aria-pressed="true"] { border-color: var(--verde); box-shadow: 0 0 0 3px var(--verde), 0 12px 22px rgba(0,0,0,.3); transform: translateY(-3px); background: #fff; }
.g-errore { color: #9c2a1f; font-weight: 600; }
.g-nota { font-size: .84rem; opacity: .78; }
.g-fila { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.g-fila .bottone { font-size: 1.02rem; padding: .8em 1.5em; }
.g-esito { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; border-bottom: 1px dashed rgba(36,23,15,.35); padding-bottom: 12px; }
.g-esito .g-numero { font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 700; line-height: .9; font-variant-numeric: tabular-nums; color: var(--verde); }
.g-esito .g-numero small { font-size: .32em; font-weight: 600; opacity: .7; }
.g-pause { height: 8px; border-radius: 5px; background: rgba(36,23,15,.15); overflow: hidden; }
.g-pause i { display: block; height: 100%; background: var(--mattone); transform-origin: 0 50%; }
.g-livelli { display: grid; gap: 5px; }
.g-livelli li { display: grid; grid-template-columns: 1fr auto; gap: 10px; font-size: .95rem; align-items: center; }
.g-livelli li span:last-child { font-variant-numeric: tabular-nums; font-weight: 700; }
.g-livelli .g-riga { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: rgba(36,23,15,.13); overflow: hidden; }
.g-livelli .g-riga i { display: block; height: 100%; background: linear-gradient(90deg, var(--verde-vivo), var(--oro)); }
.g-classifica { background: radial-gradient(ellipse at 30% 20%, #2a2f2d, var(--ardesia) 70%); border: 8px solid #6b4326; border-radius: 4px; padding: 12px 18px; font-size: 1.35rem; }
.g-classifica li { display: flex; justify-content: space-between; gap: 16px; }
.g-classifica li.io { color: var(--oro-chiaro); }
.g-consenso { display: grid !important; grid-template-columns: auto 1fr; gap: 10px !important; align-items: start; text-transform: none !important; letter-spacing: 0 !important; font-size: .88rem !important; color: inherit !important; }
.g-consenso input { width: 22px; height: 22px; margin-top: 2px; }
@media (max-width: 520px) {
  .g-clienti { grid-template-columns: 1fr; }
  .g-cliente { grid-template-columns: 84px 1fr; justify-items: start; text-align: left; column-gap: 12px; padding: 8px 10px; }
  .g-cliente img { grid-row: 1 / span 3; max-width: 84px; }
}

/* quando il gioco è aperto, i pannelli (privacy, regalo) stanno sopra */
body.in-gioco .velo { z-index: 299; }
body.in-gioco .pannello { z-index: 300; }
