/* Interfaccia — colori e forme da studio/ARTE.md sez. 3 e 7 (prima versione, Tappa 1). */
:root {
  --crema: #fff8e7; --marrone: #3b2a1a; --ombra: #b98d55; --oro: #f2b33d; --pericolo: #e5484d; --cura: #7ddc6a;
  --uscita: #ffd34d; --testo: #fff8e7;
  --margine: max(24px, env(safe-area-inset-left));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a2018; color: var(--testo);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif; font-weight: 600; -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: none; }
#tela { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.nascosto { display: none !important; }
button { font: inherit; cursor: pointer; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#barre { position: absolute; top: max(14px, env(safe-area-inset-top)); left: var(--margine); width: min(40vw, 280px); }
.barra { height: 18px; background: rgba(59, 42, 26, .8); border: 3px solid var(--crema); border-radius: 10px; overflow: hidden;
  margin-bottom: 6px; box-shadow: 0 2px 0 var(--ombra); }
.barra > div { height: 100%; width: 100%; transition: width .12s; }
#barra-vita { background: var(--pericolo); }
#stamina { height: 12px; width: 82%; }
#barra-stamina { background: var(--oro); transition: width .05s; }
#stamina.vuota { animation: lampeggia .25s infinite alternate; }
@keyframes lampeggia { to { border-color: var(--pericolo); background: rgba(229, 72, 77, .5); } }
#tempo { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: var(--crema);
  color: var(--marrone); padding: 3px 14px; border-radius: 12px; font-size: 18px; font-weight: 800; box-shadow: 0 3px 0 var(--ombra); }

#bottino { position: absolute; top: max(14px, env(safe-area-inset-top)); right: var(--margine); display: flex; gap: 8px; align-items: center; pointer-events: auto; }
.voce { background: var(--crema); color: var(--marrone); border-radius: 12px; padding: 3px 12px 3px 6px; display: flex; align-items: center;
  gap: 6px; font-size: 18px; font-weight: 800; box-shadow: 0 3px 0 var(--ombra); }
.voce.pulsa { animation: pulsa .35s; }
@keyframes pulsa { 40% { transform: scale(1.18); background: #fff0c0; } }
.moneta { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2a8, var(--oro) 55%, #b98a1c); display: inline-block; }
.icona-cassa { width: 22px; height: 16px; background: #8a5a2e; border: 2px solid var(--oro); border-radius: 4px 4px 2px 2px; display: inline-block; }
#pulsante-pausa { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--crema); color: var(--marrone); box-shadow: 0 3px 0 var(--ombra); font-size: 16px; }

#obiettivo { position: absolute; top: calc(max(14px, env(safe-area-inset-top)) + 40px); left: 50%; transform: translateX(-50%);
  background: rgba(59, 42, 26, .7); padding: 4px 14px; border-radius: 12px; font-size: 14px; text-align: center; max-width: 90vw; white-space: nowrap; }
#uscita-testo { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); background: var(--uscita); color: var(--marrone);
  padding: 6px 18px; border-radius: 12px; font-size: 20px; font-weight: 800; box-shadow: 0 3px 0 var(--ombra); opacity: 0; transition: opacity .15s; }
#uscita-testo.visibile { opacity: 1; }
#uscita-testo.pericolo { background: var(--pericolo); color: #fff; }
#freccia-uscita { position: absolute; left: 0; top: 0; font-size: 36px; color: var(--uscita); text-shadow: 0 0 3px var(--marrone), 0 0 2px var(--marrone), 0 2px 0 var(--marrone);
  opacity: 0; transition: opacity .3s; }
#freccia-uscita.visibile { opacity: 1; }
.segno-bordo { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; border-top: 16px solid transparent; border-bottom: 16px solid transparent;
  border-left: 26px solid var(--pericolo); filter: drop-shadow(0 0 1px var(--marrone)) drop-shadow(0 0 1px var(--marrone)); }
.segno-bordo.visibile { opacity: 1; animation: pulsaSegno .6s infinite alternate; }
.segno-bordo.arco::after { content: ')'; position: absolute; left: -20px; top: -11px; color: #fff; font-size: 16px; font-weight: 900; }
@keyframes pulsaSegno { to { filter: drop-shadow(0 0 1px var(--marrone)) brightness(1.4); } }
#apertura { position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50%; opacity: 0;
  background: conic-gradient(var(--oro) var(--f, 0deg), rgba(59, 42, 26, .6) 0); box-shadow: 0 0 0 3px var(--crema); }
#apertura::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--crema); }
#apertura.visibile { opacity: 1; }
#avviso { position: absolute; top: 26%; left: 50%; transform: translate(-50%, -10px); font-size: 22px; font-weight: 800; white-space: pre-line;
  text-shadow: 0 2px 0 var(--marrone), 0 0 4px var(--marrone); opacity: 0; transition: opacity .25s, transform .25s; text-align: center; max-width: 90vw; }
#avviso.visibile { opacity: 1; transform: translate(-50%, 0); }
#suggerimento { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--crema); color: var(--marrone);
  padding: 6px 14px; border-radius: 12px; font-size: 15px; box-shadow: 0 3px 0 var(--ombra); opacity: 0; transition: opacity .15s; }
#suggerimento.visibile { opacity: 1; }
.numero { position: absolute; left: 0; top: 0; font-weight: 900; font-size: 20px; color: #fff; text-shadow: 0 2px 0 var(--marrone), 0 0 3px var(--marrone); opacity: 0; white-space: nowrap; }
.numero.subito { color: #ff8a80; }
.numero.forte { color: #fff1b0; font-size: 26px; }
.numero.grande { font-size: 30px; }
.numero.parato { color: #e6f0ff; font-size: 16px; }
.numero.perfetta { color: #fff; font-size: 24px; }
.numero.oro { color: var(--oro); font-size: 16px; }
.numero.oro.grande { font-size: 22px; }
.numero.cura { color: var(--cura); font-size: 18px; }
.numero.esclamazione { color: var(--uscita); font-size: 34px; }
.numero.grido { background: var(--crema); color: var(--marrone); font-size: 13px; padding: 3px 9px; border-radius: 10px; text-shadow: none; box-shadow: 0 2px 0 var(--ombra); }
#info-prova { position: absolute; left: var(--margine); top: 80px; font: 12px/1.4 monospace; background: rgba(0, 0, 0, .55); padding: 5px 8px; border-radius: 6px; white-space: pre; }
#tasti-prova { position: absolute; left: var(--margine); top: 128px; display: flex; flex-direction: column; gap: 4px; pointer-events: auto; }
#tasti-prova button { font-size: 11px; padding: 3px 8px; border: 0; border-radius: 8px; background: var(--crema); color: var(--marrone); box-shadow: 0 2px 0 var(--ombra); text-align: left; }

/* ---------- Telefono ---------- */
#telefono { position: fixed; inset: 0; pointer-events: none; }
#zona-levetta { position: absolute; left: 0; top: 70px; bottom: 0; width: 50%; pointer-events: auto; touch-action: none; }
#levetta-base { position: absolute; left: 110px; top: calc(100% - 110px); width: 120px; height: 120px; margin: -60px 0 0 -60px;
  border-radius: 50%; background: rgba(255, 248, 231, .18); border: 3px solid rgba(255, 248, 231, .55); opacity: .5; pointer-events: none; }
#levetta-base.attiva { opacity: 1; }
#levetta-pomello { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%;
  background: rgba(255, 248, 231, .85); box-shadow: 0 3px 0 var(--ombra); }
.azione { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 0; background: rgba(255, 248, 231, .9);
  color: var(--marrone); box-shadow: 0 4px 0 var(--ombra); font-size: 28px; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; }
.azione.premuto { background: var(--oro); transform: translateY(3px); box-shadow: 0 1px 0 var(--ombra); }
.azione.attacco { width: 90px; height: 90px; font-size: 38px; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); }
.azione.schivata { right: calc(max(24px, env(safe-area-inset-right)) + 104px); bottom: max(24px, env(safe-area-inset-bottom)); }
.azione.parata { right: calc(max(24px, env(safe-area-inset-right)) + 10px); bottom: calc(max(24px, env(safe-area-inset-bottom)) + 104px); }
.azione.usa { right: calc(max(24px, env(safe-area-inset-right)) + 104px); bottom: calc(max(24px, env(safe-area-inset-bottom)) + 88px);
  font-size: 16px; font-weight: 800; background: var(--oro); display: none; }
.azione.usa.visibile { display: flex; }
#hud.telefono #suggerimento { bottom: auto; top: 100px; }
#gira { position: fixed; inset: 0; z-index: 50; background: var(--marrone); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; text-align: center; padding: 20px; }
#gira div { font-size: 60px; }

/* ---------- Schermate ---------- */
.schermo { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(59, 42, 26, .45), rgba(30, 20, 10, .8)); overflow-y: auto; }
.pannello { background: var(--crema); color: var(--marrone); border-radius: 14px; padding: 22px 26px; max-width: 560px; width: 100%;
  box-shadow: 0 6px 0 var(--ombra), 0 14px 40px rgba(0, 0, 0, .45); text-align: center; max-height: 100%; overflow-y: auto; }
.pannello.stretto { max-width: 390px; }
#logo { display: block; width: 560px; max-width: 90vw; max-width: min(560px, 100%); height: auto; margin: -6px auto 2px; }
h1 { margin: 0 0 4px; font-size: 32px; font-weight: 900; color: var(--marrone); letter-spacing: .5px; }
h2 { margin: 12px 0 2px; font-size: 22px; font-weight: 800; }
.sotto { margin: 0; opacity: .65; font-size: 13px; }
.corsivo { margin: 0 0 6px; font-style: italic; opacity: .75; }
.berto { font-style: italic; font-size: 14px; opacity: .85; }
.pannello p { line-height: 1.4; }
.pulsanti-menu { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 16px 0 8px; }
.pulsanti-menu.verticale { flex-direction: column; }
.pulsanti-menu button { padding: 12px 24px; border-radius: 12px; border: 0; background: #f3e4c4; color: var(--marrone); font-size: 17px; font-weight: 800;
  box-shadow: 0 4px 0 var(--ombra); }
.pulsanti-menu button.principale { background: var(--oro); }
.pulsanti-menu button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ombra); }
.casa { font-size: 14px; opacity: .85; }
details { text-align: left; margin: 10px 0; font-size: 13px; }
summary { cursor: pointer; font-weight: 800; text-align: center; }
table.comandi { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.comandi td, table.comandi th { padding: 3px 4px; border-bottom: 1px solid rgba(59, 42, 26, .15); }
.impostazioni { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 13px; margin-top: 8px; }
.impostazioni select { font: inherit; padding: 3px; border-radius: 6px; }
.piccolo { font-size: 12px; padding: 4px 10px; border-radius: 8px; border: 0; background: #f3e4c4; color: var(--marrone); box-shadow: 0 2px 0 var(--ombra); cursor: pointer; }
.pulsante-file input { display: none; }
#fine-bottino { font-size: 17px; margin: 8px 0; }
#fine-bottino .riga { display: flex; justify-content: space-between; padding: 4px 8px; border-bottom: 1px solid rgba(59, 42, 26, .15); }
.barra-caricamento { height: 12px; border-radius: 8px; background: #f3e4c4; overflow: hidden; }
#caricamento-barra { height: 100%; width: 0; background: var(--oro); transition: width .2s; }
#prestazioni { position: fixed; left: 8px; bottom: 8px; font: 12px monospace; background: rgba(0, 0, 0, .6); padding: 4px 8px;
  border-radius: 6px; pointer-events: none; white-space: pre; z-index: 5; }

/* ---------- Tono cupo (ARTE.md sez. 7, decisione dell'utente) ---------- */
:root { --pannello: rgba(42, 33, 26, .92); --bordo: #6b4a2b; --chiaro: #f1e4c6; --importante: #e0a43a; }
.pannello { background: var(--pannello); color: var(--chiaro); border: 2px solid var(--bordo); box-shadow: 0 6px 0 #1a140f, 0 14px 40px rgba(0, 0, 0, .6); }
h1, h2 { color: var(--chiaro); }
.pulsanti-menu button, .piccolo { background: #3a2e24; color: var(--chiaro); box-shadow: 0 4px 0 var(--bordo); border: 1px solid var(--bordo); }
.pulsanti-menu button.principale { background: var(--importante); color: #2a211a; border-color: #f2c060; }
table.comandi td, table.comandi th { border-bottom-color: rgba(241, 228, 198, .15); }
#fine-bottino .riga { border-bottom-color: rgba(241, 228, 198, .15); }
.barra-caricamento { background: #3a2e24; }
#caricamento-barra { background: var(--importante); }
.schermo { background: radial-gradient(ellipse at center, rgba(20, 16, 12, .5), rgba(10, 8, 6, .85)); }
.voce, #tempo, #pulsante-pausa, #suggerimento, .numero.grido, #tasti-prova button {
  background: var(--pannello); color: var(--chiaro); box-shadow: 0 3px 0 #1a140f; border: 1px solid var(--bordo); }
.barra { border-color: var(--bordo); background: rgba(20, 16, 12, .85); box-shadow: 0 2px 0 #1a140f; }
#obiettivo { background: var(--pannello); color: var(--chiaro); border: 1px solid var(--bordo); }
#uscita-testo { background: var(--importante); color: #2a211a; box-shadow: 0 3px 0 #1a140f; }
#apertura { box-shadow: 0 0 0 3px var(--bordo); background: conic-gradient(var(--oro) var(--f, 0deg), rgba(20, 16, 12, .8) 0); }
#apertura::after { background: #2a211a; }
.azione { background: rgba(42, 33, 26, .85); color: var(--chiaro); box-shadow: 0 4px 0 #1a140f; border: 2px solid var(--bordo); }
.azione.premuto { background: var(--importante); color: #2a211a; }
.azione.usa { background: var(--importante); color: #2a211a; }
#levetta-base { background: rgba(42, 33, 26, .35); border-color: rgba(241, 228, 198, .4); }
#levetta-pomello { background: rgba(241, 228, 198, .75); box-shadow: 0 3px 0 #1a140f; }
#gira { background: #2a211a; color: var(--chiaro); }
/* fumetto di Ruggero (ARTE.md sez. 5) */
.numero.grido.capo { background: #2a211a; color: #f1e4c6; border: 2px solid #9c2a2e; max-width: 220px; white-space: normal; text-align: center; font-size: 14px; line-height: 1.25; }

/* ---------- Crea il tuo comandante (ARTE.md sez. 9) ---------- */
#schermo-crea { position: fixed; inset: 0; pointer-events: none; }
#crea-pannello { pointer-events: auto; position: absolute; right: max(16px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%);
  width: 360px; max-height: calc(100% - 32px); overflow-y: auto; background: #2a211af0; border: 2px solid var(--bordo); border-radius: 14px;
  padding: 18px 20px; color: var(--chiaro); box-shadow: 0 6px 0 #1a140f; }
#crea-pannello h1 { color: var(--importante); margin: 0 0 10px; }
.etichetta-crea { text-transform: uppercase; font-size: 12px; letter-spacing: .6px; color: #cbb994; margin: 12px 0 6px; }
.etichetta-crea i { text-transform: none; letter-spacing: 0; color: var(--chiaro); font-weight: 700; }
#crea-nome { width: 100%; font: inherit; font-size: 18px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--bordo);
  background: #1a140f; color: var(--chiaro); outline: none; }
#crea-nome:focus { border-color: var(--importante); }
#crea-nome.errore { border-color: var(--pericolo); }
#crea-avviso { color: var(--pericolo); font-size: 13px; min-height: 16px; margin-top: 4px; }
.campioni { display: flex; flex-wrap: wrap; gap: 8px; }
.campione { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #1a140f; cursor: pointer; padding: 0; }
.campione.scelto { box-shadow: 0 0 0 3px var(--importante); }
.crea-pulsanti { display: flex; gap: 10px; margin-top: 18px; }
.crea-pulsanti button { font: inherit; font-weight: 800; border-radius: 12px; border: 1px solid var(--bordo); padding: 12px 16px;
  background: #3a2e24; color: var(--chiaro); box-shadow: 0 4px 0 #1a140f; font-size: 18px; }
.crea-pulsanti .principale { flex: 1; background: var(--importante); color: #2a211a; border-color: #f2c060; }
.crea-pulsanti button:disabled { opacity: .5; }
#crea-berto { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: 18px; max-width: min(46vw, 520px); margin: 0;
  background: var(--pannello); border: 1px solid var(--bordo); border-radius: 12px; padding: 10px 14px; font-style: italic; color: var(--chiaro); }
@media (max-aspect-ratio: 1/1) {
  #crea-pannello { left: 12px; right: 12px; top: auto; bottom: 12px; transform: none; width: auto; max-height: 58%; }
  .campione { width: 32px; height: 32px; }
  #crea-berto { display: none; }
}

/* ---------- Salvataggio online ---------- */
.online { margin: 10px auto 4px; padding: 8px 12px; border: 1px solid var(--bordo); border-radius: 10px; font-size: 13px; max-width: 440px; }
#online-stato { color: #cbb994; font-weight: 600; }
#online-codice { font-size: 20px; font-weight: 900; letter-spacing: 1.5px; color: var(--importante); margin: 4px 0; user-select: all; -webkit-user-select: all; }
.online-pulsanti { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* telefono in orizzontale (poco alto): pannello a destra, tutto su una schermata, "Si parte" sempre visibile */
@media (max-height: 480px) {
  #crea-pannello { top: 8px; bottom: 8px; right: 8px; left: auto; transform: none; width: min(430px, 56vw); max-height: none;
    border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; overflow: hidden; }
  #crea-pannello h1 { font-size: 16px; margin: 0; }
  .etichetta-crea { margin: 5px 0 3px; font-size: 11px; }
  #crea-nome { font-size: 15px; padding: 5px 8px; }
  #crea-avviso { min-height: 0; font-size: 11px; margin: 0; }
  .campioni { gap: 5px; flex-wrap: nowrap; }
  .campione { width: 26px; height: 26px; flex: 0 0 auto; }
  #crea-nome-colore, #crea-berto { display: none; }
  .crea-pulsanti { margin-top: auto; padding-top: 6px; }
  .crea-pulsanti button { padding: 8px; font-size: 15px; }
}
/* finestra di conferma nello stile del gioco */
#conferma { z-index: 60; }
#conferma .pannello { max-width: 380px; }
#conferma-testo { white-space: pre-line; }
#conferma-campo { width: 100%; font: inherit; font-size: 18px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--bordo);
  background: #1a140f; color: var(--chiaro); text-align: center; letter-spacing: 1px; text-transform: uppercase; }

/* ================= TAPPA 2 ================= */
#risorse { position: absolute; top: max(10px, env(safe-area-inset-top)); left: var(--margine); right: var(--margine); display: none; gap: 8px;
  align-items: center; flex-wrap: wrap; pointer-events: auto; }
#hud.casa #risorse { display: flex; }
#hud.casa #barre, #hud.casa #tempo, #hud.casa #bottino, #hud.casa #obiettivo { display: none; }
.pastiglia { display: flex; align-items: center; gap: 6px; background: #2a211aeb; border: 2px solid var(--bordo); border-radius: 10px;
  padding: 3px 10px 3px 5px; font-size: 16px; color: var(--chiaro); }
.pastiglia small { color: #b9a98a; font-weight: 600; font-size: 12px; }
#ris-cantiere { font-size: 14px; }
#pulsante-pausa-casa { margin-left: auto; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--bordo); background: var(--pannello);
  color: var(--chiaro); box-shadow: 0 3px 0 #1a140f; }
#ordini { position: absolute; right: var(--margine); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
#ordini button { width: 52px; height: 52px; border-radius: 12px; font-size: 24px; background: var(--pannello); color: var(--chiaro);
  border: 2px solid var(--bordo); box-shadow: 0 3px 0 #1a140f; }
#ordini button.attivo { border-color: var(--importante); background: #3a2e24; }
#hud.telefono #ordini { top: 34%; }
.etichetta { position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; font-weight: 800; text-shadow: 0 1px 2px #000; }
.etichetta.segno-posto { background: #2a211ae6; border: 2px solid var(--importante); border-radius: 14px; padding: 2px 8px; color: var(--chiaro); font-size: 13px; }
.etichetta.segno-posto img { width: 18px; height: 18px; vertical-align: -4px; }
.etichetta.segno-cantiere { background: #2a211ae6; border: 2px solid var(--bordo); border-radius: 10px; padding: 2px 8px; color: var(--chiaro); font-size: 12px; }
.etichetta.nome-posto { color: #cbb994; font-size: 12px; }
.etichetta.segno-ordine, .etichetta.segno-campana { font-size: 18px; background: #2a211ad0; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.etichetta.nome-capitano { font-size: 12px; color: #ffb4a8; }
.etichetta.nome-capitano.alleato { color: #bcd6ff; }
#fumetto { position: fixed; left: 50%; bottom: max(110px, 14vh); transform: translate(-50%, 20px); max-width: min(620px, 92vw); display: flex; gap: 12px;
  align-items: center; background: var(--pannello); border: 2px solid var(--bordo); border-radius: 14px; padding: 10px 14px; color: var(--chiaro);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; cursor: pointer; }
#fumetto.visibile { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#fumetto img { width: 72px; height: 72px; border-radius: 10px; border: 2px solid var(--bordo); flex: 0 0 auto; object-fit: cover; }
#fumetto b { display: block; color: var(--importante); font-size: 13px; }
#fumetto span { font-style: italic; line-height: 1.35; }
#scheda { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(440px, calc(100vw - 24px));
  max-height: 70vh; overflow-y: auto; background: #2a211af2; border: 2px solid var(--bordo); border-radius: 14px; padding: 14px 16px; color: var(--chiaro);
  box-shadow: 0 6px 0 #1a140f; z-index: 25; }
#scheda h2 { margin: 0 30px 2px 0; color: var(--importante); font-size: 20px; }
#scheda h2 small { color: #cbb994; font-size: 13px; font-weight: 600; }
#scheda-desc { font-style: italic; color: #cbb994; margin: 2px 0 8px; font-size: 14px; }
.riga-scheda { padding: 5px 0; border-bottom: 1px solid rgba(241, 228, 198, .12); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.riga-scheda .destra { margin-left: auto; }
.riga-scheda button { font: inherit; font-weight: 800; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--bordo); background: var(--importante);
  color: #2a211a; box-shadow: 0 3px 0 #1a140f; }
.riga-scheda button:disabled { background: #3a2e24; color: #8f8270; }
.costo { white-space: nowrap; }
.costo.manca { color: var(--pericolo); }
.icona { vertical-align: -4px; }
#scheda-pulsanti { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
#scheda-pulsanti button { flex: 1; font: inherit; font-weight: 800; font-size: 16px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--bordo);
  background: #3a2e24; color: var(--chiaro); box-shadow: 0 4px 0 #1a140f; }
#scheda-pulsanti button.principale { background: var(--importante); color: #2a211a; border-color: #f2c060; }
#scheda-pulsanti button:disabled { opacity: .45; }
.chiudi { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--bordo); background: #3a2e24; color: var(--chiaro); }
/* mappa della regione */
#mappa-regione { position: fixed; inset: 0; background: #0f0b08; z-index: 30; display: flex; align-items: center; justify-content: center; }
#mappa-cornice { position: relative; width: min(100vw, 150vh); aspect-ratio: 3 / 2; max-height: 100vh; }
#mappa-immagine { width: 100%; height: 100%; display: block; -webkit-mask-image: radial-gradient(ellipse at center, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse at center, #000 62%, transparent 100%); }
#mappa-zone > div { position: absolute; transform: translate(-50%, -50%); text-transform: uppercase; letter-spacing: 3px; font-size: clamp(9px, 1.3vw, 15px);
  color: #e8dcc0; text-shadow: 0 2px 4px #000, 0 0 8px #000; white-space: nowrap; pointer-events: none; opacity: .8; }
.punto { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.punto .cerchio { width: 38px; height: 38px; border-radius: 50%; background: #2a211af0; border: 3px solid var(--bordo); display: flex; align-items: center;
  justify-content: center; box-shadow: 0 2px 6px #000; }
.punto .cerchio img { width: 22px; height: 22px; }
.punto .nome { font-size: 12px; font-weight: 800; color: var(--chiaro); text-shadow: 0 1px 3px #000, 0 0 6px #000; white-space: nowrap; margin-top: 2px; }
.punto.casa .cerchio { border-color: #5b8fd6; }
.punto.borgo .cerchio { border-color: #b08a3a; }
.punto.contratto .cerchio { border-color: var(--importante); box-shadow: 0 0 10px var(--importante); }
.punto.scelto .cerchio { transform: scale(1.2); }
.punto.qui .nome::after { content: ' · sei qui'; color: #cbb994; font-weight: 600; }
#mappa-titolo { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); margin: 0; color: var(--importante);
  text-shadow: 0 2px 6px #000; letter-spacing: 1px; white-space: nowrap; }
#mappa-scheda { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 28px));
  background: #2a211af2; border: 2px solid var(--bordo); border-radius: 14px; padding: 12px 14px; color: var(--chiaro); box-shadow: 0 6px 0 #1a140f; }
#mappa-scheda h3 { margin: 0 0 4px; color: var(--importante); }
#mappa-scheda .corona { color: var(--importante); font-weight: 800; font-size: 13px; }
#mappa-scheda .desc { font-style: italic; color: #cbb994; margin: 4px 0; font-size: 14px; }
#mappa-scheda .info { font-size: 13px; margin: 4px 0; }
#mappa-scheda .soldati button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--bordo); background: #3a2e24; color: var(--chiaro); font-weight: 900; }
#mappa-scheda .parti { width: 100%; margin-top: 8px; font: inherit; font-weight: 900; font-size: 18px; padding: 10px; border-radius: 12px; border: 1px solid #f2c060;
  background: var(--importante); color: #2a211a; box-shadow: 0 4px 0 #1a140f; }
#mappa-arrivo { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); color: #cbb994; font-size: 13px;
  text-shadow: 0 1px 3px #000; }
#mappa-pulsanti { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); display: flex; gap: 8px; }
#mappa-pulsanti button { font: inherit; font-weight: 800; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--bordo); background: var(--pannello);
  color: var(--chiaro); box-shadow: 0 3px 0 #1a140f; }
#caricamento-testo { font-style: italic; }
@media (max-height: 480px) {
  #fumetto { bottom: 8px; }
  #fumetto img { width: 52px; height: 52px; }
  #scheda { max-height: 86vh; padding: 10px 12px; }
  #mappa-titolo { font-size: 16px; }
}

/* nel villaggio e nel Borgo non si combatte: sul telefono restano levetta e "Usa" */
#telefono.casa .azione:not(.usa) { display: none; }

/* pezzo bloccato dal fabbro: grigio col lucchetto (si può toccare per sapere perché) */
.riga-scheda button.bloccato { background: #3a2e24; color: #8f8270; }
