/* CACCIA AI GATTI 3D · demo — l'impaginazione: lo schermo del gioco sopra, i tasti sotto */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { background: #111; height: 100%; overflow: hidden; touch-action: none;
             font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif; color: #fff; }
[hidden] { display: none !important; }

#app { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 8px; }
#schermo { position: relative; width: min(96vw, calc((100dvh - 190px) * 4 / 3), 960px); aspect-ratio: 4 / 3;
           background: #000; border-radius: 10px; overflow: hidden; container-type: inline-size; }
#gioco { width: 100%; height: 100%; display: block; }
#gioco.ds { image-rendering: pixelated; }

/* ---------- le scritte sopra la scena ---------- */
#hud > div { position: absolute; font-weight: 700; font-size: 3.4cqw; }
#ora { top: 2.2cqw; left: 2.2cqw; background: rgba(0, 0, 0, 0.5); padding: 0.6cqw 1.8cqw; border-radius: 99px; }
#spirito { top: 2cqw; right: 2.2cqw; display: flex; gap: 1cqw; }
/* i tre gattini dello Spirito: una testina con le orecchie */
#spirito i { width: 6cqw; height: 5cqw; background: rgba(255, 255, 255, 0.92); border: 0.5cqw solid rgba(0, 0, 0, 0.45);
             border-radius: 45% 45% 50% 50%; position: relative; transition: background 0.3s; }
#spirito i::before, #spirito i::after { content: ""; position: absolute; top: -1.9cqw; width: 0; height: 0;
             border-left: 1.2cqw solid transparent; border-right: 1.2cqw solid transparent; border-bottom: 2.2cqw solid rgba(255, 255, 255, 0.92); transition: border-color 0.3s; }
#spirito i::before { left: 0.1cqw; } #spirito i::after { right: 0.1cqw; }
#spirito i.pieno { background: #f0c860; animation: salto 0.5s; }
#spirito i.pieno::before, #spirito i.pieno::after { border-bottom-color: #f0c860; }
#spirito.luce i { box-shadow: 0 0 2.5cqw 1cqw rgba(255, 220, 90, 0.9); }
@keyframes salto { 40% { transform: translateY(-1.6cqw); } }
#obiettivo { top: 9.5cqw; left: 2.2cqw; background: rgba(40, 32, 48, 0.72); padding: 0.7cqw 1.8cqw; border-radius: 1.6cqw;
             font-size: 2.9cqw !important; font-weight: 600 !important; border-left: 0.9cqw solid #f0c860; max-width: 52%; }
#obiettivo:empty { display: none; }
#suggerimento { bottom: 3cqw; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.62); padding: 0.8cqw 2.4cqw;
             border-radius: 99px; font-size: 3cqw !important; white-space: nowrap; }
#suggerimento b { display: inline-block; background: #4b9ec1; border-radius: 50%; width: 4.4cqw; height: 4.4cqw; line-height: 4.4cqw; text-align: center; margin-right: 1cqw; }

/* ---------- il dialogo ---------- */
#dialogo { position: absolute; left: 3%; right: 3%; bottom: 3%; background: rgba(28, 24, 40, 0.95); border: 0.6cqw solid #fff;
           border-radius: 2.4cqw; padding: 3.2cqw 3.6cqw 3.6cqw; min-height: 21cqw; }
#chi { position: absolute; top: -3.4cqw; left: 3cqw; background: #f0c860; color: #2a2030; font-weight: 800; font-size: 3.2cqw;
       padding: 0.5cqw 2.2cqw; border-radius: 1.4cqw; }
#testo { font-size: 3.7cqw; line-height: 1.35; font-weight: 500; }
#avanti { position: absolute; right: 3cqw; bottom: 1.6cqw; color: #f0c860; font-weight: 800; font-size: 3cqw; animation: lampo 0.9s infinite; }
@keyframes lampo { 50% { opacity: 0.2; } }
#scelte { list-style: none; margin-top: 1.6cqw; display: flex; gap: 2cqw; flex-wrap: wrap; }
#scelte li { font-size: 3.5cqw; font-weight: 700; padding: 0.8cqw 2.6cqw; border-radius: 1.6cqw; border: 0.5cqw solid #6a6480; color: #cfc9e0; }
#scelte li.sel { background: #f0c860; border-color: #f0c860; color: #2a2030; }

/* ---------- velo nero (cambio stanza), flash della foto, polaroid ---------- */
#velo, #flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
#velo { background: #000; transition: opacity 0.35s; } #velo.su { opacity: 1; }
#flash { background: #fff; } #flash.su { animation: flash 0.5s; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
#polaroid { position: absolute; right: 4%; top: 12%; width: 38%; background: #fbf8f0; padding: 1.6cqw 1.6cqw 0.8cqw; border-radius: 0.8cqw;
            box-shadow: 0 1.2cqw 3cqw rgba(0, 0, 0, 0.5); transform: rotate(4deg); animation: esce 0.4s; }
#polaroid img { width: 100%; display: block; border-radius: 0.4cqw; }
#polaroid p { color: #3a3040; font-size: 2.8cqw; text-align: center; padding: 1cqw 0 0.6cqw; font-weight: 700; }
@keyframes esce { from { transform: translateY(-20%) rotate(-6deg); opacity: 0; } }

/* ---------- titolo e fine demo ---------- */
#pannello { position: absolute; inset: 0; background: rgba(18, 16, 26, 0.9); display: flex; flex-direction: column; align-items: center;
            justify-content: center; text-align: center; gap: 2.6cqw; padding: 6cqw; }
#pannello:empty { display: none; }
#pannello h1 { font-size: 8.5cqw; letter-spacing: 0.3cqw; line-height: 1.05; }
#pannello h1 small { display: block; font-size: 3.4cqw; letter-spacing: 0.9cqw; color: #f0c860; margin-top: 1.4cqw; }
#pannello p { font-size: 3.3cqw; line-height: 1.4; color: #dcd6ea; max-width: 80%; }
#pannello button { font: inherit; font-weight: 800; font-size: 4.2cqw; padding: 1.6cqw 6cqw; border: 0; border-radius: 99px;
                   background: #f0c860; color: #2a2030; margin-top: 1.4cqw; cursor: pointer; }
#pannello .tasti { font-size: 2.6cqw; color: #a8a2b8; }
#menu { position: absolute; left: 50%; top: 2cqw; transform: translateX(-50%); font: inherit; font-size: 2.5cqw; font-weight: 700;
         background: rgba(0, 0, 0, 0.5); color: #ddd; border: 0.3cqw solid rgba(255, 255, 255, 0.35); border-radius: 99px; padding: 0.5cqw 2cqw; cursor: pointer; }

/* ---------- i tasti del telefono ---------- */
#comandi { width: 100%; max-width: 480px; display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
#croce { position: relative; width: 132px; height: 132px; border-radius: 50%; background: #23232e; border: 2px solid #3c3c4c; touch-action: none; }
#croce span { position: absolute; color: #8a8aa0; font-size: 18px; pointer-events: none; transition: color 0.1s; }
#croce .su { top: 8px; left: 50%; transform: translateX(-50%); } #croce .giu { bottom: 8px; left: 50%; transform: translateX(-50%); }
#croce .sx { left: 10px; top: 50%; transform: translateY(-50%); } #croce .dx { right: 10px; top: 50%; transform: translateY(-50%); }
#croce span.on { color: #f0c860; }
#tasti { display: flex; gap: 16px; align-items: center; }
.tasto { width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800;
         font-size: 22px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45); touch-action: none; }
.tasto.a { background: #4b9ec1; } .tasto.b { background: #c14b4b; margin-top: 26px; }
.tasto.giu { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); }

/* sul computer (mouse): niente tasti a schermo, il gioco più grande */
@media (hover: hover) and (pointer: fine) {
  #comandi { display: none; }
  #schermo { width: min(96vw, calc((100dvh - 24px) * 4 / 3), 1100px); }
}
/* telefono girato: croce a sinistra, gioco al centro, A e B a destra */
@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  #app { flex-direction: row; gap: 10px; padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); }
  #schermo { width: min(calc(100vw - 330px), calc((100dvh - 12px) * 4 / 3)); order: 2; }
  #comandi { display: contents; }
  #croce { order: 1; flex: none; } #tasti { order: 3; flex: none; }
}

/* ---------- l'avvio (js/avvio.js) ---------- */
#gioco.ricordo { filter: sepia(0.6) saturate(0.85) brightness(0.97); }
#cartello { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 7cqw; font-weight: 800;
            letter-spacing: 1.2cqw; color: #f0e6d0; pointer-events: none; }
#cartello.su { animation: cartello 2.2s ease-in-out both; }
@keyframes cartello { 0% { opacity: 0; transform: scale(0.96); } 25%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }

#scheda { position: absolute; color: #fff; }
#scheda h1 { font-size: 8.5cqw; letter-spacing: 0.3cqw; line-height: 1.05; text-shadow: 0 0.6cqw 0 rgba(0, 0, 0, 0.35); }
#scheda h1 small { display: block; font-size: 3.4cqw; letter-spacing: 0.9cqw; color: #f0c860; margin-top: 1.4cqw; }
#scheda h2 { font-size: 4.2cqw; line-height: 1.2; margin-bottom: 1.6cqw; }
#scheda p { font-size: 3.2cqw; line-height: 1.4; color: #e6e0f0; }
#scheda .tasti { font-size: 2.5cqw; color: #b8b2c8; }
#scheda .bottoni { display: flex; gap: 2.4cqw; justify-content: center; flex-wrap: wrap; margin-top: 1.4cqw; }
#scheda button { font: inherit; font-weight: 800; font-size: 3.8cqw; padding: 1.4cqw 5cqw; border: 0.5cqw solid #f0c860; border-radius: 99px;
                 background: #f0c860; color: #2a2030; cursor: pointer; }
#scheda button.secondario { background: transparent; color: #f0c860; }
#scheda button.sel { box-shadow: 0 0 0 0.7cqw rgba(255, 255, 255, 0.85); }
#scheda .freccia { display: inline-flex; align-items: center; justify-content: center; width: 6.5cqw; height: 6.5cqw; border-radius: 50%;
                   background: rgba(255, 255, 255, 0.12); color: #f0c860; font-size: 3cqw; cursor: pointer; flex: none; }
#scheda .freccia:active { background: rgba(240, 200, 96, 0.45); }

/* il titolo: al centro, sopra la camera che gira */
#scheda.titolo { inset: 0; background: linear-gradient(rgba(20, 16, 30, 0.35), rgba(20, 16, 30, 0.85)); display: flex; flex-direction: column;
                 align-items: center; justify-content: center; text-align: center; gap: 2.4cqw; padding: 6cqw; }
#scheda.titolo p { max-width: 78%; }
/* scrivere un nome: riquadro in basso */
#scheda.piccola { left: 6%; right: 6%; bottom: 6%; background: rgba(28, 24, 40, 0.96); border: 0.6cqw solid #fff; border-radius: 2.4cqw; padding: 3cqw 3.6cqw; }
#scheda .domanda { font-size: 3.9cqw; font-weight: 700; color: #fff; margin-bottom: 1.6cqw; }
#scheda form.nome { display: flex; gap: 2cqw; }
#scheda form.nome input { flex: 1; min-width: 0; font: inherit; font-size: max(16px, 4.4cqw); font-weight: 700; padding: 1.2cqw 2.4cqw; border-radius: 1.6cqw;
                          border: 0.5cqw solid #6a6480; background: #15121e; color: #fff; user-select: text; -webkit-user-select: text; }
#scheda form.nome input:focus { outline: none; border-color: #f0c860; }
#scheda .errore { color: #ff9a9a !important; margin-top: 1cqw; }
/* le righe "< valore >" del personaggio: a destra */
#scheda.laterale { right: 2.5%; top: 3%; bottom: 3%; width: 54%; background: rgba(28, 24, 40, 0.92); border-radius: 2.4cqw; padding: 2.6cqw 2.6cqw;
                   overflow-y: auto; border: 0.4cqw solid rgba(255, 255, 255, 0.25); }
#scheda.laterale h2 { font-size: 3.4cqw; margin-bottom: 1cqw; }
#scheda ul.righe { list-style: none; display: flex; flex-direction: column; gap: 0.4cqw; }
#scheda ul.righe li { display: grid; grid-template-columns: 1fr auto 15cqw auto; align-items: center; gap: 0.8cqw; padding: 0.2cqw 1cqw;
                      border-radius: 1.4cqw; font-size: 2.7cqw; border: 0.3cqw solid transparent; }
#scheda ul.righe li .freccia { width: 5cqw; height: 5cqw; font-size: 2.4cqw; }
#scheda ul.righe li .nome { color: #b8b2c8; }
#scheda ul.righe li .valore { text-align: center; font-weight: 700; }
#scheda ul.righe li.sel { border-color: #f0c860; background: rgba(240, 200, 96, 0.12); }
#scheda ul.righe li.fatto { display: block; text-align: center; font-weight: 800; font-size: 3.4cqw; color: #2a2030; background: #f0c860; margin-top: 0.8cqw; cursor: pointer; }
#scheda ul.righe li.fatto.sel { box-shadow: 0 0 0 0.6cqw rgba(255, 255, 255, 0.85); }
/* una domanda sul gatto: in basso */
#scheda.basso { left: 4%; right: 4%; bottom: 3.5%; background: rgba(28, 24, 40, 0.94); border-radius: 2.4cqw; padding: 2.4cqw 3.2cqw;
                border: 0.4cqw solid rgba(255, 255, 255, 0.25); text-align: center; }
#scheda .contatore { font-size: 2.5cqw !important; color: #f0c860 !important; font-weight: 700; letter-spacing: 0.3cqw; }
#scheda.basso h2 { margin: 0.6cqw 0 1.2cqw; }
#scheda .scelta { display: flex; align-items: center; justify-content: center; gap: 2.4cqw; }
#scheda .scelta .valore { font-size: 4.6cqw; font-weight: 800; min-width: 38cqw; }
#scheda .nota { min-height: 4cqw; margin-top: 0.6cqw; font-style: italic; }
#scheda.basso button { font-size: 3.2cqw; padding: 1cqw 4cqw; }

/* ---------- la mappa ---------- */
#scheda.mappa { inset: 0; background: rgba(20, 16, 30, 0.82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqw; padding: 5cqw; text-align: center; }
#scheda.mappa .luoghi { display: flex; flex-direction: column; gap: 1.6cqw; width: 70%; }
#scheda.mappa .luoghi button { width: 100%; text-align: left; display: flex; gap: 2cqw; align-items: center; background: #3a3450; color: #fff; border-color: #6a6480; }
#scheda.mappa .luoghi button.meta { border-color: #f0c860; }
#scheda.mappa .luoghi button.sel { background: #f0c860; color: #2a2030; border-color: #f0c860; box-shadow: none; }
#scheda.mappa .luoghi button small { margin-left: auto; font-size: 2.6cqw; opacity: 0.8; }

/* ---------- l'incontro con un randagio (js/incontro.js) ---------- */
#incontro { position: absolute; left: 4%; right: 4%; top: 3%; background: rgba(28, 24, 40, 0.9); border-radius: 2.2cqw; padding: 1.6cqw 2.4cqw 2cqw;
            border: 0.4cqw solid rgba(255, 255, 255, 0.3); }
#incontro .testa { display: flex; justify-content: space-between; font-size: 2.7cqw; font-weight: 800; letter-spacing: 0.2cqw; color: #f0c860; }
#incontro .barra { position: relative; height: 3.2cqw; background: #15121e; border-radius: 99px; margin: 1cqw 0 1.6cqw; overflow: hidden; }
#incontro .riempi { height: 100%; background: linear-gradient(90deg, #5aa85a, #9ad06a); border-radius: 99px; transition: width 0.4s; }
#incontro .riempi.troppo { background: linear-gradient(90deg, #e8944a, #e8455f); }
#incontro .soglia { position: absolute; top: 0; bottom: 0; width: 0.5cqw; background: #fff; opacity: 0.8; }
#incontro .azioni { display: flex; gap: 2cqw; justify-content: center; }
#incontro button { font: inherit; font-weight: 800; font-size: 3.1cqw; padding: 1cqw 3cqw; border-radius: 99px; border: 0.5cqw solid #f0c860;
                   background: transparent; color: #f0c860; cursor: pointer; }
#incontro button.sel, #incontro .scatto button { background: #f0c860; color: #2a2030; }
#incontro .scatto { display: flex; gap: 2.4cqw; align-items: center; }
#incontro .pista { position: relative; flex: 1; height: 4.4cqw; background: #15121e; border-radius: 1cqw; overflow: hidden; }
#incontro .zona { position: absolute; top: 0; bottom: 0; background: rgba(90, 200, 90, 0.75); }
#incontro .linea { position: absolute; top: -10%; bottom: -10%; width: 0.8cqw; margin-left: -0.4cqw; background: #fff; box-shadow: 0 0 1cqw #fff; }
#schermo.in-incontro #obiettivo, #schermo.in-incontro #menu, #schermo.in-incontro #suggerimento { display: none; }
#hud[hidden] ~ #menu, #schermo.in-lucina #menu, #schermo.in-lucina #hud { display: none; }

/* ---------- "Un, due, tre... MICIO!" (js/lucina.js) ---------- */
#lucinaUI { position: absolute; inset: 0; pointer-events: auto; }
#lucinaUI .sopra { position: absolute; top: 2.4cqw; left: 3cqw; right: 3cqw; display: flex; justify-content: space-between; align-items: center;
                   font-weight: 800; font-size: 3cqw; text-shadow: 0 0.3cqw 0 rgba(0, 0, 0, 0.6); }
#lucinaUI .titolo { color: #f0c860; letter-spacing: 0.3cqw; }
#lucinaUI .tempo { position: absolute; top: 7.6cqw; left: 3cqw; right: 3cqw; height: 1.2cqw; background: rgba(0, 0, 0, 0.45); border-radius: 99px; overflow: hidden; }
#lucinaUI .tempo div { height: 100%; background: #f0c860; }
#lucinaUI .stato { position: absolute; left: 50%; bottom: 13cqw; transform: translateX(-50%); font-size: 4.6cqw; font-weight: 800; white-space: nowrap;
                   padding: 0.8cqw 3cqw; border-radius: 99px; background: rgba(0, 0, 0, 0.55); }
#lucinaUI .stato:empty { display: none; }
#lucinaUI .stato.vai { color: #9aff9a; } #lucinaUI .stato.attento { color: #ffe37a; } #lucinaUI .stato.fermo { color: #ff8a8a; animation: lampo 0.4s infinite; }
#lucinaUI .aiuto { position: absolute; left: 0; right: 0; bottom: 4cqw; text-align: center; font-size: 2.6cqw; color: #e6e0f0; text-shadow: 0 0.3cqw 0 rgba(0, 0, 0, 0.6); }

/* ---------- l'album e lo zaino (js/album.js) ---------- */
#scheda.album { inset: 3%; background: rgba(28, 24, 40, 0.96); border-radius: 2.4cqw; padding: 2.4cqw 2.8cqw; display: flex; flex-direction: column; gap: 1.4cqw;
                border: 0.4cqw solid rgba(255, 255, 255, 0.25); }
#scheda.album .intesta { display: flex; justify-content: space-between; align-items: baseline; }
#scheda.album .intesta span { color: #f0c860; font-weight: 800; font-size: 3cqw; }
#scheda.album .griglia { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.2cqw; align-content: start; }
#scheda.album .carta { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3cqw; padding: 0.8cqw 0.4cqw;
                       border-radius: 1.4cqw; background: #f4eedc; color: #3a3040; border: 0.4cqw solid #d8ccae; font-size: 2.2cqw; }
#scheda.album .carta.raro { background: #eaf0f6; border-color: #a8b8c8; }
#scheda.album .carta.ignoto { background: #3a3450; border-color: #4a4460; color: #8a84a0; }
#scheda.album .carta img { width: 100%; aspect-ratio: 1; object-fit: cover; }
#scheda.album .carta .punto { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 7cqw; font-weight: 800; }
#scheda.album .carta i { position: absolute; top: 0.4cqw; right: 0.8cqw; font-style: normal; font-weight: 800; color: #e8944a; }
#scheda.album .carta.sel { box-shadow: 0 0 0 0.6cqw #f0c860; }
#scheda.album .dettaglio { min-height: 7cqw; font-size: 2.8cqw !important; }
#scheda.album .bottoni { margin-top: 0; }
#scheda ul.zaino { list-style: none; width: 70%; display: flex; flex-direction: column; gap: 1cqw; }
#scheda ul.zaino li { display: flex; justify-content: space-between; font-size: 3.4cqw; padding: 1cqw 2.4cqw; background: #3a3450; border-radius: 1.4cqw; }

/* il numero dello Spirito sotto i gattini (e chi arriva alle lucine) */
#hud #spiritoNum { top: 8.4cqw; right: 2.2cqw; font-size: 2.3cqw !important; font-weight: 700; background: rgba(0, 0, 0, 0.5); padding: 0.3cqw 1.4cqw; border-radius: 99px; }
#hud #spiritoNum:empty { display: none; }

/* ---------- "HAI OTTENUTO" (la fotocamera, l'album) ---------- */
#ottenuto { position: absolute; left: 0; right: 0; bottom: 4%; display: flex; flex-direction: column; align-items: center; gap: 0.8cqw; text-align: center; padding: 0 6%; }
#ottenuto span { font-size: 3cqw; font-weight: 800; letter-spacing: 0.8cqw; color: #f0c860; }
#ottenuto b { font-size: 6.4cqw; font-weight: 900; letter-spacing: 0.2cqw; text-shadow: 0 0.5cqw 0 rgba(0, 0, 0, 0.45); animation: salto 0.6s; }
#ottenuto p { font-size: 3cqw; color: #e6e0f0; max-width: 80%; }
#ottenuto i { font-style: normal; font-weight: 800; color: #f0c860; font-size: 2.8cqw; animation: lampo 0.9s infinite; }

/* ---------- la modalità FOTOCAMERA: il mirino ---------- */
#mirino { position: absolute; inset: 7%; pointer-events: none; display: none; }
#schermo.in-foto #mirino { display: block; }
#schermo.in-foto #hud, #schermo.in-foto #menu { display: none; }
#mirino span { position: absolute; width: 9%; height: 12%; border: 0.7cqw solid rgba(255, 255, 255, 0.9); }
#mirino span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; } #mirino span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
#mirino span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; } #mirino span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
#mirino em { position: absolute; left: 50%; bottom: -1%; transform: translateX(-50%); font-style: normal; font-weight: 800; font-size: 2.8cqw;
             background: rgba(0, 0, 0, 0.55); padding: 0.5cqw 2.4cqw; border-radius: 99px; white-space: nowrap; }
#schermo.in-ottenuto #hud, #schermo.in-ottenuto #suggerimento, #schermo.in-ottenuto #menu { display: none; }
#schermo.in-ottenuto #polaroid { display: none; }
/* niente zoom sul telefono (iPhone: Safari e Chrome) */
html, body, #app, #schermo, #comandi { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#scheda input { -webkit-user-select: text; user-select: text; }

/* il dialogo sta sempre sopra i minigiochi (così sul telefono si tocca per andare avanti) */
#dialogo { z-index: 20; }
#hud #fusini { top: 12.6cqw; right: 2.2cqw; background: rgba(0, 0, 0, 0.5); padding: 0.3cqw 1.4cqw; border-radius: 99px; font-size: 2.3cqw; color: #f0d070; }
#hud #fusini:empty { display: none; }

/* ---------- IL LAVORO (js/lavoro.js): i minigiochi dello Studio Flash ---------- */
#schermo.in-lavoro #menu, #schermo.in-lavoro #hud { display: none; }
#lavoroUI { position: absolute; inset: 0; pointer-events: auto; }
#lavoroUI .sopra { position: absolute; top: 2.4cqw; left: 3cqw; right: 3cqw; display: flex; justify-content: space-between; align-items: center; gap: 2cqw;
                   font-weight: 800; font-size: 2.8cqw; text-shadow: 0 0.3cqw 0 rgba(0, 0, 0, 0.6); }
#lavoroUI .titolo { color: #f0c860; letter-spacing: 0.3cqw; }
#lavoroUI .tempo { position: absolute; top: 7.2cqw; left: 3cqw; right: 3cqw; height: 1.2cqw; background: rgba(0, 0, 0, 0.45); border-radius: 99px; overflow: hidden; }
#lavoroUI .tempo div { height: 100%; background: #f0c860; }
#lavoroUI .aiuto { position: absolute; left: 0; right: 0; bottom: 3.4cqw; text-align: center; font-size: 2.6cqw; color: #e6e0f0; text-shadow: 0 0.3cqw 0 rgba(0, 0, 0, 0.6); }
#lavoroUI .esito { position: absolute; left: 6%; right: 6%; bottom: 10cqw; text-align: center; font-weight: 800; font-size: 3.4cqw; text-shadow: 0 0.3cqw 0 rgba(0, 0, 0, 0.7); }
#lavoroUI .esito:empty { display: none; }
#lavoroUI.gioco-quiz { background: rgba(20, 16, 30, 0.55); }
#lavoroUI.gioco-quiz .centro { position: absolute; left: 7%; right: 7%; top: 16%; bottom: 14%; background: rgba(28, 24, 40, 0.95); border: 0.6cqw solid #fff;
                              border-radius: 2cqw; padding: 3cqw 4cqw; display: flex; flex-direction: column; justify-content: space-between; }
#lavoroUI.gioco-quiz .centro:empty { display: none; }
#lavoroUI .domanda { font-size: 3.6cqw; font-weight: 700; line-height: 1.35; }
#lavoroUI.gioco-quiz .esito { position: static; font-size: 3cqw; color: #f0d890; min-height: 4cqw; }
#lavoroUI .vf { display: flex; gap: 3cqw; }
#lavoroUI .vf button { flex: 1; font: inherit; font-size: 3.6cqw; font-weight: 900; padding: 1.8cqw; border-radius: 99px; border: 0.5cqw solid #fff; color: #fff; }
#lavoroUI .vf button[data-r="v"] { background: #4a9a6a; } #lavoroUI .vf button[data-r="f"] { background: #c1443a; }
#lavoroUI .mirinoSet { position: absolute; pointer-events: none; }
#lavoroUI .mirinoSet span { position: absolute; width: 26%; height: 26%; border: 0.7cqw solid rgba(255, 255, 255, 0.95); }
#lavoroUI .mirinoSet.dentro span { border-color: #7aff8a; }
#lavoroUI .mirinoSet span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; } #lavoroUI .mirinoSet span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
#lavoroUI .mirinoSet span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; } #lavoroUI .mirinoSet span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ---------- la levetta analogica (al posto della croce) ---------- */
#croce { background: radial-gradient(circle, #2c2c3a 0 55%, #23232e 56%); }
#croce::before { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 2px dashed #3c3c4c; pointer-events: none; }
#croce .pomello { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; border-radius: 50%; transform: translate(-50%, -50%);
                  background: radial-gradient(circle at 35% 30%, #6a6a82, #3c3c50); border: 2px solid #8a8aa0; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
                  pointer-events: none; transition: transform 0.12s; }
#croce.attiva .pomello { transition: none; border-color: #f0c860; }

/* il ☰ Menu: tante voci, su due colonne */
#scheda.mappa.menu .luoghi { display: grid; grid-template-columns: 1fr 1fr; width: 88%; gap: 1.4cqw; }
#scheda.mappa.menu .luoghi button { font-size: 3.2cqw; padding: 1.4cqw 2.2cqw; }
#scheda.mappa.menu .luoghi button[data-v="chiudi"] { grid-column: 1 / -1; justify-content: center; }
