/* Phi: token e componenti condivisi. Nelle schermate niente colori o misure scritti a mano: solo queste variabili. */

@font-face {
  font-family: "Lexend";
  src: url("../fonts/Lexend-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: block;
}

:root {
  /* Rampe a 11 passi, generate da _controllo/rampe.mjs: non modificare a mano */
/*RAMPE*/
  /* grigio */
  --grigio-50: #F2F2F2;
  --grigio-100: #E6E6E6;
  --grigio-200: #CFCFCF;
  --grigio-300: #B3B3B3;
  --grigio-400: #969696;
  --grigio-500: #808080;
  --grigio-600: #5C5C5C;
  --grigio-700: #383838;
  --grigio-800: #2A2A2A;
  --grigio-900: #1C1C1C;
  --grigio-950: #141414;
  /* giallo */
  --giallo-50: #FAF8F2;
  --giallo-100: #F3EBCC;
  --giallo-200: #F5E39D;
  --giallo-300: #FFE066;
  --giallo-400: #FAD43D;
  --giallo-500: #F3C616;
  --giallo-600: #CBA510;
  --giallo-700: #9C8011;
  --giallo-800: #705C10;
  --giallo-900: #453A0C;
  --giallo-950: #1D1906;
  /* arancio */
  --arancio-50: #FAF6F2;
  --arancio-100: #F3E0CF;
  --arancio-200: #F1CBA6;
  --arancio-300: #F5B578;
  --arancio-400: #FF9F43;
  --arancio-500: #F8861A;
  --arancio-600: #D46F0D;
  --arancio-700: #A2570F;
  --arancio-800: #723F0F;
  --arancio-900: #45280C;
  --arancio-950: #1B1006;
  /* corallo */
  --corallo-50: #FAF2F4;
  --corallo-100: #F4D4DB;
  --corallo-200: #F3B2BF;
  --corallo-300: #F68AA0;
  --corallo-400: #FF5E7E;
  --corallo-500: #F93058;
  --corallo-600: #E60E39;
  --corallo-700: #AF1130;
  --corallo-800: #7B1026;
  --corallo-900: #4B0D19;
  --corallo-950: #1D060B;
  /* turchese */
  --turchese-50: #F3FAF9;
  --turchese-100: #D2F2EE;
  --turchese-200: #AAF0E7;
  --turchese-300: #7CF5E6;
  --turchese-400: #54EEDB;
  --turchese-500: #2EE4CE;
  --turchese-600: #1FC4B0;
  --turchese-700: #1C9788;
  --turchese-800: #176C62;
  --turchese-900: #11443D;
  --turchese-950: #081D1A;
  /* verde */
  --verde-50: #F3F9F5;
  --verde-100: #D0EBDA;
  --verde-200: #A8E2BD;
  --verde-300: #7BDE9F;
  --verde-400: #4ADE80;
  --verde-500: #2CD068;
  --verde-600: #28A756;
  --verde-700: #238045;
  --verde-800: #1C5B33;
  --verde-900: #133720;
  --verde-950: #08150D;
  /* ambra */
  --ambra-50: #FAF7F3;
  --ambra-100: #EFE3CC;
  --ambra-200: #EAD09F;
  --ambra-300: #EBC06D;
  --ambra-400: #F2B134;
  --ambra-500: #E49E15;
  --ambra-600: #B78017;
  --ambra-700: #8C6316;
  --ambra-800: #624713;
  --ambra-900: #3C2C0E;
  --ambra-950: #171106;
  /*FINE-RAMPE*/

  /* Ruoli */
  --fondo: var(--grigio-950);
  --superficie: var(--grigio-900);
  --superficie-alta: var(--grigio-800);
  --slot: var(--grigio-700);
  --bordo: rgba(255, 255, 255, .12);
  --bordo-forte: rgba(255, 255, 255, .32);
  --testo: var(--grigio-50);
  --testo-2: var(--grigio-300);
  --testo-spento: var(--grigio-500);
  --tela: #2C2C2C;

  /* Colori delle esperienze: QUESTO e' l'unico punto da cambiare quando arriva la palette della brochure.
     Per ognuna: colore pieno, tono scuro (pezzi di secondo tipo), tono scurissimo (bordo inferiore dei pulsanti). */
  --c-area: var(--giallo-300);   --c-area-2: var(--giallo-600);   --c-area-dark: var(--giallo-700);
  --c-k: var(--arancio-400);     --c-k-2: var(--arancio-600);     --c-k-dark: var(--arancio-700);
  --c-compasso: var(--corallo-400); --c-compasso-2: var(--corallo-600); --c-compasso-dark: var(--corallo-700);
  --c-origami: var(--turchese-300); --c-origami-2: var(--turchese-600); --c-origami-dark: var(--turchese-700);

  /* Stato. Giusto = verde. Da rivedere = grigio "Quasi." (scelta di Divan, niente rosso negli esiti). */
  --giusto-fondo: var(--verde-900);
  --giusto-titolo: var(--verde-300);
  --giusto-btn: var(--verde-400);
  --giusto-btn-bordo: var(--verde-700);
  --rivedere-fondo: var(--grigio-800);
  --rivedere-titolo: var(--grigio-50);
  --ambra-fondo: var(--ambra-900);
  --ambra-titolo: var(--ambra-300);

  /* Misure di Fibonacci */
  --f5: 5px; --f8: 8px; --f13: 13px; --f21: 21px; --f34: 34px; --f55: 55px;
  --f89: 89px; --f144: 144px; --f233: 233px; --f377: 377px;
  --track-h: 12px;
  --raggio: var(--f34);
  --raggio-s: var(--f21);

  /* Movimento (durate di Fibonacci) */
  --d-tocco: 89ms;
  --d-stato: 144ms;
  --d-espr: 233ms;
  --d-pezzo: 377ms;
  --d-risultato: 610ms;
  --d-festa: 987ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --font: "Lexend", system-ui, sans-serif;
}

/* Piattaforme */
body.lim {
  --W: 1920px; --H: 1080px;
  --t-num: 144px; --t-titolo: 89px; --t-istr: 34px; --t-btn: 34px; --t-small: 21px; --t-chip: 28px;
  --btn-h: 89px; --btn-edge: 6px; --pad: var(--f55);
  --bar-h: calc(var(--f89) + var(--f21)); --x: var(--f55); --bar-track: var(--f21);
  --m: 144px;
  --hit: var(--f89); --handle: var(--f55); --handle-dot: var(--f21);
  --panel-pad: var(--f34);
}
body.tel {
  --buco-w: 5px;
  --W: 412px; --H: 915px;
  --t-num: 89px; --t-titolo: 34px; --t-istr: 21px; --t-btn: 21px; --t-small: 13px; --t-chip: 16px;
  --btn-h: 55px; --btn-edge: 4px; --pad: var(--f21);
  --bar-h: calc(var(--f55) + var(--f21)); --x: 48px; --bar-track: var(--f13);
  --m: 55px;
  --hit: var(--f55); --handle: var(--f34); --handle-dot: var(--f13);
  --panel-pad: var(--f21);
}

/* Esperienze: assegnano i colori scelti sopra */
[data-exp="area"] { --exp: var(--c-area); --exp-2: var(--c-area-2); --exp-dark: var(--c-area-dark); }
[data-exp="k"] { --exp: var(--c-k); --exp-2: var(--c-k-2); --exp-dark: var(--c-k-dark); }
[data-exp="compasso"] { --exp: var(--c-compasso); --exp-2: var(--c-compasso-2); --exp-dark: var(--c-compasso-dark); }
[data-exp="origami"] { --exp: var(--c-origami); --exp-2: var(--c-origami-2); --exp-dark: var(--c-origami-dark); }

* { box-sizing: border-box; margin: 0; }
html { background: var(--fondo); }
body {
  font-family: var(--font); color: var(--testo); background: var(--fondo);
  width: var(--W); height: var(--H); overflow: hidden; position: relative;
  -webkit-user-select: none; user-select: none; touch-action: none;
  font-size: var(--t-small); line-height: 1.5;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.screen { position: absolute; inset: 0; }

/* Carattere */
.num { font-weight: 700; font-size: var(--t-num); line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.titolo { font-weight: 700; font-size: var(--t-titolo); line-height: 1.1; letter-spacing: -.01em; }
.istr { font-weight: 400; font-size: var(--t-istr); line-height: 1.5; }
/* Righe mai orfane: titoli e frasi si bilanciano, il testo corrente evita la parola sola */
.titolo, .esito-titolo, .scheda .nome { text-wrap: balance; }
.istr, .piccolo, .esito-testo, .gancio { text-wrap: pretty; }
body .phi-mascot .bubble { text-wrap: balance; }
.piccolo { font-size: var(--t-small); line-height: 1.5; color: var(--testo-2); }
.etichetta { font-weight: 500; font-size: var(--t-btn); line-height: 1.2; }
.spento { color: var(--testo-spento); }

/* Barra di avanzamento */
.bar { display: flex; align-items: center; gap: var(--f21); height: var(--bar-h); padding: 0 var(--pad); }
.bar .x { flex: none; width: var(--x); height: var(--x); border: 0; border-radius: 50%; background: transparent; color: var(--testo-2); display: grid; place-items: center; }
.bar .x svg { width: 55%; height: 55%; stroke: currentColor; stroke-width: 3; stroke-linecap: round; fill: none; }
.bar .track { flex: 1; height: var(--bar-track); border-radius: 999px; background: var(--superficie-alta); overflow: hidden; }
.bar .fill { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 999px; background: var(--exp, var(--testo)); transition: width var(--d-pezzo) var(--ease-io); }

.bar .snd { flex: none; width: var(--x); height: var(--x); border: 0; border-radius: 50%; background: transparent; color: var(--testo-2); display: grid; place-items: center; }
.bar .snd svg { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bar .snd .onde { transition: opacity var(--d-stato); }
.bar .snd .barra-muto { opacity: 0; transition: opacity var(--d-stato); }
.bar .snd[aria-pressed="false"] { color: var(--testo-spento); }
.bar .snd[aria-pressed="false"] .onde { opacity: 0; }
.bar .snd[aria-pressed="false"] .barra-muto { opacity: 1; }
.bar .snd:focus-visible { outline: 3px solid var(--testo); outline-offset: 3px; }

/* Pulsanti */
.btn {
  position: relative; height: var(--btn-h); padding: 0 var(--f55); border: 0; border-radius: 999px;
  background: var(--testo); color: var(--fondo); font-weight: 500; font-size: var(--t-btn); line-height: 1;
  box-shadow: 0 var(--btn-edge) 0 var(--grigio-300); margin-bottom: var(--btn-edge);
  transition: transform var(--d-tocco) var(--ease-out), box-shadow var(--d-tocco) var(--ease-out), background var(--d-stato);
}
.btn:active, .btn.premuto { transform: translateY(var(--btn-edge)); box-shadow: 0 0 0 var(--grigio-300); }
.btn.exp { background: var(--exp); box-shadow: 0 var(--btn-edge) 0 var(--exp-dark); }
.btn.exp:active, .btn.exp.premuto { box-shadow: 0 0 0 var(--exp-dark); }
.btn.verde { background: var(--giusto-btn); box-shadow: 0 var(--btn-edge) 0 var(--giusto-btn-bordo); }
.btn.verde:active, .btn.verde.premuto { box-shadow: 0 0 0 var(--giusto-btn-bordo); }
.btn.ambra { background: var(--ambra-400); box-shadow: 0 var(--btn-edge) 0 var(--ambra-700); }
.btn.ambra:active, .btn.ambra.premuto { box-shadow: 0 0 0 var(--ambra-700); }
.btn.sec { background: transparent; color: var(--testo); box-shadow: inset 0 0 0 3px var(--bordo-forte); margin-bottom: var(--btn-edge); }
.btn.sec:active { transform: none; background: rgba(255, 255, 255, .08); }
.btn:disabled, .btn.off { background: var(--superficie-alta); color: var(--testo-spento); box-shadow: none; transform: none; cursor: default; }
.btn.piena { width: 100%; }
.btn:focus-visible, .x:focus-visible, .choice:focus-visible { outline: 3px solid var(--testo); outline-offset: 3px; }

@media (hover: hover) {
  .btn:not(:disabled):not(.off):not(.sec):hover { filter: brightness(1.06); }
  .btn.sec:hover { background: rgba(255, 255, 255, .06); }
  .bar .x:hover, .bar .snd:hover { background: rgba(255, 255, 255, .08); color: var(--testo); }
  .choice:hover { background: var(--superficie-alta); }
}
.bar .x:active, .bar .snd:active { background: rgba(255, 255, 255, .14); }
a:focus-visible { outline: 3px solid var(--testo); outline-offset: 3px; border-radius: var(--raggio); }
.choice:active { transform: scale(.97); }

/* Scelte (risposte a scelta) */
.choices { display: flex; gap: var(--f21); }
.choice {
  position: relative; flex: 1; height: var(--btn-h); border-radius: var(--raggio-s); background: var(--superficie);
  border: 0; box-shadow: inset 0 0 0 2px var(--bordo-forte); color: var(--testo);
  font-weight: 700; font-size: var(--t-istr); transition: box-shadow var(--d-stato), background var(--d-stato), transform 120ms var(--ease-out);
}
.choice.sel { box-shadow: inset 0 0 0 5px var(--testo); }
.choice.ok { box-shadow: inset 0 0 0 5px var(--giusto-btn); background: var(--giusto-fondo); }
.choice.neutro { box-shadow: inset 0 0 0 2px var(--bordo); color: var(--testo-2); }
.choice .mark { position: absolute; top: var(--f8); right: var(--f13); width: var(--f21); height: var(--f21); }
.choice.ok .mark::after { content: ""; position: absolute; left: 30%; top: 8%; width: 30%; height: 58%; border: solid var(--giusto-titolo); border-width: 0 4px 4px 0; transform: rotate(40deg); }
.choice.neutro .mark::after { content: ""; position: absolute; left: 15%; top: 45%; width: 70%; height: 4px; border-radius: 4px; background: var(--testo-spento); }

/* Maniglia da trascinare (HTML). L'area di presa invisibile e' ::before */
.handle {
  position: absolute; width: var(--handle); height: var(--handle); margin: calc(var(--handle) / -2) 0 0 calc(var(--handle) / -2);
  border-radius: 50%; background: var(--testo); touch-action: none; cursor: grab;
  box-shadow: 0 0 0 var(--f13) rgba(255, 255, 255, .14), 0 var(--f8) var(--f21) rgba(0, 0, 0, .5);
  transition: box-shadow var(--d-stato);
}
.handle::after { content: ""; position: absolute; inset: 0; margin: auto; width: var(--handle-dot); height: var(--handle-dot); border-radius: 50%; background: var(--fondo); }
.handle::before { content: ""; position: absolute; inset: calc((var(--hit) - var(--handle)) / -2); border-radius: 50%; }
.handle.presa, .handle:active { cursor: grabbing; box-shadow: 0 0 0 var(--f21) rgba(255, 255, 255, .2), 0 var(--f13) var(--f34) rgba(0, 0, 0, .6); }
.handle:focus-visible { outline: 3px solid var(--testo); outline-offset: 6px; }
.handle.exp { box-shadow: 0 0 0 var(--f13) color-mix(in srgb, var(--exp) 25%, transparent), 0 var(--f8) var(--f21) rgba(0, 0, 0, .5); }

/* Cursore */
.slider { position: relative; height: var(--hit); touch-action: none; }
.slider .s-track { position: absolute; left: 0; right: 0; top: 50%; height: var(--track-h); margin-top: calc(var(--track-h) / -2); border-radius: 999px; background: var(--slot); }
.slider .s-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(clamp(0, var(--v, 0) + var(--gomma, 0), 1.2) * 100%); border-radius: 999px; background: var(--exp, var(--testo-2)); opacity: .55; }
.slider .handle { top: 50%; left: calc((var(--v, 0) + var(--gomma, 0)) * 100%); }
.slider .ticks { position: absolute; left: 0; right: 0; top: 50%; }
.slider .tick { position: absolute; width: 3px; height: var(--f21); margin-left: -1.5px; top: calc(var(--track-h) / 2 + var(--f5)); background: var(--testo-2); border-radius: 2px; }
.slider .tick span { position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + var(--f5)); font-size: var(--t-small); line-height: 1; color: var(--testo-2); white-space: nowrap; }
.slider .tick.s1 { height: var(--f55); } .slider .tick.s2 { height: var(--f89); }

/* Pannello d'esito */
.panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--f34);
  padding: var(--panel-pad) var(--pad) calc(var(--panel-pad) + var(--btn-edge));
  transform: translateY(105%); transition: transform var(--d-espr) var(--ease-out);
  border-top: 2px solid var(--bordo);
}
.panel.on { transform: none; }
.panel .testi { min-width: 0; }
.panel .esito-titolo { font-weight: 700; font-size: var(--t-titolo); line-height: 1.1; letter-spacing: -.01em; }
.panel .esito-testo { font-size: var(--t-istr); line-height: 1.4; margin-top: var(--f8); }
.panel .azioni { display: flex; align-items: center; gap: var(--f21); flex: none; }
.panel.giusto { background: var(--giusto-fondo); border-top-color: var(--verde-700); }
.panel.giusto .esito-titolo { color: var(--giusto-titolo); }
.panel.giusto .esito-testo { color: var(--verde-100); }
.panel.rivedere { background: var(--rivedere-fondo); border-top-color: var(--bordo-forte); }
.panel.rivedere .esito-testo { color: var(--testo-2); }
.panel.ambra { background: var(--ambra-fondo); border-top-color: var(--ambra-700); }
.panel.ambra .esito-titolo { color: var(--ambra-titolo); }
.panel.ambra .esito-testo { color: var(--ambra-100); }
/* Telefono: il pulsante principale e la Phi restano nel dock, sempre nello stesso punto, sopra il pannello. Il pannello tiene solo testo e secondario */
body.tel .panel { flex-direction: column; align-items: stretch; gap: var(--f13); padding-bottom: calc(var(--btn-h) + var(--btn-edge) + var(--f21) + var(--f21)); }
body.tel .panel .azioni { flex-direction: column; align-items: stretch; gap: var(--f13); }
body.tel .panel .azioni .btn { width: 100%; height: var(--f55); }
body.tel .dock { z-index: 6; }

/* Disposizione LIM principale: due zone in proporzione aurea */
.split { display: grid; grid-template-columns: 61.8% 38.2%; grid-template-rows: var(--bar-h) 1fr; width: 100%; height: 100%; }
.split .bar { grid-column: 1 / 3; }
.fig-zone { position: relative; min-width: 0; min-height: 0; }
.fig-zone svg.fig { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.side { display: flex; flex-direction: column; gap: var(--f34); padding: var(--f34) var(--pad) var(--f34) var(--f34); min-height: 0; }
.side .azioni { margin-top: auto; display: flex; flex-direction: column; gap: var(--f21); align-items: flex-start; }
.side .azioni .btn { width: 100%; }

/* Colonna centrale (alternativa LIM) */
.col { position: absolute; top: var(--bar-h); bottom: 0; left: 50%; width: 61.8%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: var(--f34); padding-bottom: var(--f34); }
.col .azioni { margin-top: auto; display: flex; justify-content: center; }

/* Telefono: colonna unica */
.tel-col { position: absolute; top: var(--bar-h); bottom: 0; left: 0; right: 0; display: flex; flex-direction: column; gap: var(--f13); padding: 0 var(--pad) var(--f21); }
.dock { display: flex; align-items: center; gap: var(--f13); margin-top: auto; position: relative; transition: transform var(--d-espr) var(--ease-out); }
.dock .btn { flex: 1; }

/* Riga della Phi vicino al testo */
.phi-row { position: relative; display: flex; align-items: flex-end; min-height: calc(var(--m) * 420 / 380); }
body.lim .phi-row { margin-top: var(--f13); }

/* La Phi (mascot.js non cambia): qui solo dimensioni, colore dell'alone e fumetto */
body .phi-mascot { margin: 0; --mascot-w: var(--m, 144px); }
body .phi-mascot .bubble {
  background: var(--testo); color: var(--fondo); font-family: var(--font); font-weight: 500;
  font-size: var(--t-btn); line-height: 1.25; padding: var(--f13) var(--f21); border-radius: var(--raggio-s);
  max-width: calc(var(--f377) + var(--f55)); text-align: left;
  left: calc(100% + var(--f13)); top: 8%; transform: translateY(0); width: max-content;
}
body .phi-mascot .bubble::before {
  content: ""; position: absolute; left: calc(var(--f13) * -1 + 2px); top: var(--f21); width: var(--f21); height: var(--f21);
  background: var(--testo); transform: rotate(45deg); border-radius: 4px; z-index: -1;
}
body.tel .phi-mascot .bubble { font-size: var(--t-btn); left: 0; top: calc(var(--f8) * -1); transform: translateY(-100%); max-width: calc(var(--W) - var(--f55)); }
body.tel .phi-mascot .bubble::before { left: var(--f21); top: auto; bottom: -8px; }
/* Il fumetto nasce dalla codina (verso la Phi), da scala .95 a 1 in 160 ms (mascot.js) */
body .phi-mascot .bubble { transform-origin: 0 calc(var(--f21) + var(--f8)); }
body.tel .phi-mascot .bubble { transform-origin: calc(var(--f21) + var(--f8)) 100%; }
body[data-exp] .phi-mascot .glow { background: radial-gradient(closest-side, color-mix(in srgb, var(--exp) 40%, transparent), color-mix(in srgb, var(--exp) 15%, transparent) 60%, transparent 75%); }
body .phi-mascot.glow-max .glow { animation: none !important; opacity: 1; transform: scale(1.2); }
body .phi-mascot.glow-max.suba .glow { filter: blur(var(--f13)); }

/* Figure: classi per gli elementi SVG */
.fig .pezzo { transition: transform var(--d-pezzo) var(--ease-io); transform-box: view-box; transform-origin: 0 0; }
.fig .pezzo.sposta, .fig .in-gesto { transition: none; }
.fig .pezzo .corpo { stroke: var(--fondo); stroke-width: 3; stroke-linejoin: round; }
.fig .pezzo.tipo-a .corpo { fill: var(--exp); }
.fig .pezzo.tipo-b .corpo { fill: var(--exp-2); }
.fig .pezzo .quadretti { stroke: var(--fondo); stroke-opacity: .35; stroke-width: 1.5; fill: none; }
/* I pezzi (o le punte) ancora da prendere "respirano" piano finche' non ne tocchi uno: classe .respira (il modulo la toglie al primo tocco) */
.fig .respira { animation: respira 1.6s var(--ease-io) infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes respira { from { scale: 1; } to { scale: 1.02; } }
/* Motore del dito: bagliore breve quando un pezzo o una maniglia si aggancia (ui.gesto) */
.fig .agganciato { filter: drop-shadow(0 0 var(--f13) color-mix(in srgb, var(--exp) 70%, transparent)); }
.fig .pezzo.alzato { filter: drop-shadow(0 var(--f21) var(--f21) rgba(0, 0, 0, .55)); }
.fig .bersaglio { fill: none; stroke: var(--bordo-forte); stroke-width: 3; stroke-dasharray: 10 10; }
.fig .guida { fill: none; stroke: var(--testo-2); stroke-width: 4; stroke-linecap: round; }
.fig .linea { fill: none; stroke: var(--testo); stroke-width: 4; stroke-linecap: round; }
.fig .linea-l { fill: none; stroke: var(--testo-2); stroke-width: 3; stroke-linecap: round; }
.fig .fantasma { fill: none; stroke: var(--exp); stroke-width: 5; stroke-dasharray: 3 14; stroke-linecap: round; opacity: .8; }
.fig .tratto { fill: none; stroke: var(--exp); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.fig .punto { fill: var(--testo); }
.fig .punto-exp { fill: var(--exp); }
.fig .lett { fill: var(--testo); font-family: var(--font); font-weight: 700; }
.fig .lett-2 { fill: var(--testo-2); font-family: var(--font); font-weight: 500; }
.fig .sovrap { stroke: none; }
.fig .sov-fondo { fill: var(--exp-dark); }
.fig .sov-riga { stroke: var(--exp); stroke-width: 5; }
.fig .bordi-sov { fill: none; stroke: var(--testo); stroke-width: 3; stroke-linejoin: round; stroke-opacity: .9; }
.fig .buco { fill: var(--fondo); stroke: var(--grigio-50); stroke-width: var(--buco-w, 10px); stroke-linejoin: round; clip-path: fill-box; }   /* il bordo non esce dagli angoli del rettangolo: si ritaglia sul riquadro del buco (le punte del buco sono gli angoli del rettangolo) */
.fig .bordo-lume { fill: none; stroke: var(--exp); stroke-width: 10; opacity: 0; filter: blur(8px); transition: opacity var(--d-stato); }
.fig .bordo-lume.on { opacity: .9; }

/* N1: il bastoncino phi (ui.bastoncino): copie dell'unita' in fila, il pezzetto che avanza nel colore del gioco */
.fig .bastoncino .stecca { stroke: var(--testo); }
.fig .bastoncino .stecca.resto { stroke: var(--exp); }
.fig .bastoncino .copia .stecca { stroke: var(--exp); }
.fig .bastoncino .copia .presa { stroke: transparent; }
.fig .bastoncino .b-valore { fill: var(--exp); }

/* Fumetto/chip/etichette piccole nelle zone */
.chip { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--f8); padding: var(--f8) var(--f21); border-radius: 999px; background: var(--superficie-alta); color: var(--testo); font-size: var(--t-chip); font-weight: 500; line-height: 1.2; }
.chip i { width: var(--f13); height: var(--f13); border-radius: 50%; display: inline-block; }
.passi { list-style: none; padding: 0; display: grid; gap: var(--f5); }
.passi li { display: flex; gap: var(--f13); align-items: baseline; font-size: var(--t-small); color: var(--testo-spento); line-height: 1.3; }
.passi li b { flex: none; width: 1.6em; font-weight: 700; }
.passi li.fatto { color: var(--testo-2); }
.passi li.ora { color: var(--fondo); background: var(--exp); border-radius: var(--f8); padding: 2px var(--f8); margin-left: -8px; font-weight: 500; }
body.tel .passi { gap: 3px; }
body.tel .passi li.ora { padding: 3px var(--f8); }

/* Schede della home */
.scheda { position: relative; display: flex; align-items: center; gap: var(--f34); background: var(--superficie); border-radius: var(--raggio); box-shadow: inset 0 0 0 2px var(--bordo); padding: var(--f34); }
.scheda .disegno { flex: none; display: grid; place-items: center; border-radius: var(--raggio-s); background: var(--fondo); }
.scheda .nome { font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.scheda .gancio { color: var(--testo-2); line-height: 1.3; }
.scheda .btn { flex: none; }

/* Movimento: con "riduci movimento" si tolgono gli spostamenti ma restano le dissolvenze (aiutano a capire cosa cambia).
   Le trasformazioni cambiano subito; opacita', colori e ombre sfumano. Il pannello d'esito compare sfumando invece di salire. */
@media (prefers-reduced-motion: reduce) {
  * { transition-property: opacity, background-color, color, box-shadow, border-color, filter !important; animation: none !important; }
  .panel { transform: none; opacity: 0; visibility: hidden; transition: opacity var(--d-espr) var(--ease-out), visibility 0s linear var(--d-espr) !important; }
  .panel.on { opacity: 1; visibility: visible; transition: opacity var(--d-espr) var(--ease-out) !important; }
}

/* Fumetto sopra la Phi (home e finale) */
.bubble-su .phi-mascot .bubble { left: 50%; top: calc(var(--f13) * -1); transform: translate(-50%, -100%); text-align: center; }
.bubble-su .phi-mascot .bubble::before { left: calc(50% - var(--f13)); top: auto; bottom: -8px; }
.bubble-su .phi-mascot .bubble { transform-origin: 50% 100%; }

/* Disegni piccoli delle schede */
.mini { width: 100%; height: 100%; display: block; }
.mini .pezzo .corpo { stroke-width: 1; }
.mini .t { stroke: var(--testo-2); stroke-width: 1.6; fill: none; stroke-linecap: round; }
.mini .e { stroke: var(--exp); stroke-width: 3.2; fill: none; stroke-linecap: round; }
.mini .ef { fill: var(--exp); }
.mini .bi { fill: var(--testo); }
body.tel .bubble-lato .phi-mascot .bubble { left: calc(100% + var(--f13)); top: 8%; transform: none; max-width: calc(var(--W) - var(--f89) - var(--f89)); }
body.tel .bubble-lato .phi-mascot .bubble::before { left: calc(var(--f13) * -1 + 2px); top: var(--f21); bottom: auto; }
body.tel .bubble-lato .phi-mascot .bubble { transform-origin: 0 calc(var(--f21) + var(--f8)); }

/* Figura k */
.fig .k-pezzo { stroke: var(--fondo); stroke-width: 3; stroke-linejoin: round; }
.fig .k-pezzo.tipo-a { fill: var(--exp); }
.fig .k-pezzo.tipo-b { fill: var(--exp-2); }
.valore { display: flex; align-items: baseline; gap: var(--f21); min-height: var(--t-num); }
.valore .etichetta { color: var(--testo-2); font-weight: 400; }
.valore .num { transition: opacity var(--d-stato) var(--ease-out); }
.valore .num.nascosto { opacity: 0; }
.valore .num.vuoto { color: var(--testo-spento); }
.chip i.sov { background: repeating-linear-gradient(45deg, var(--exp-dark) 0 2.5px, var(--exp) 2.5px 5px); box-shadow: inset 0 0 0 2px var(--exp-dark); }
.chip i.buco-i { background: var(--fondo); box-shadow: inset 0 0 0 3px var(--grigio-50); }
.chip i.ok-i { background: var(--giusto-btn); }
.chip { transition: opacity var(--d-stato); }
.azioni { transition: opacity var(--d-stato); }
body.panel-su .side .azioni, body.panel-su .col .azioni { opacity: 0; pointer-events: none; }

/* Riga e compasso */
.fig .guida-arco { fill: none; stroke: var(--exp); stroke-width: 5; stroke-dasharray: 2 14; stroke-linecap: round; opacity: .9; }
.fig .percorso { fill: none; stroke: var(--exp); stroke-width: 3; stroke-dasharray: 10 12; opacity: .8; }
.fig .cerchio { fill: none; stroke: var(--exp); stroke-width: 6; stroke-linecap: round; }
.fig .gamba { stroke: var(--testo-2); stroke-width: 9; stroke-linecap: round; fill: none; }
.fig .cerniera { fill: var(--testo); }
.fig .mina { fill: var(--exp); }
.fig .manig { fill: var(--testo); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); cursor: grab; touch-action: none; }
.fig .manig-alone { fill: color-mix(in srgb, var(--exp) 22%, transparent); }
.fig .manig-punto { fill: var(--fondo); }
.inset { position: absolute; right: var(--f34); bottom: var(--f34); width: var(--f377); background: var(--superficie); border-radius: var(--raggio-s); box-shadow: inset 0 0 0 2px var(--bordo); padding: var(--f13) var(--f21) var(--f21); }
.inset svg { width: 100%; display: block; }
.inset .t { fill: none; stroke: var(--testo-2); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.inset .e { fill: none; stroke: var(--exp); stroke-width: 6; stroke-linecap: round; }
.inset p { margin-top: var(--f8); font-size: var(--t-chip); line-height: 1.3; }

/* Nome dell'app e crediti nella casella della Phi (home) */
.titolo-app { position: absolute; z-index: 2; margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; color: var(--testo); }
body.lim .q.phi .titolo-app { left: var(--f55); top: var(--f55); font-size: var(--f89); }
body.tel .fascia.phi .titolo-app { left: var(--f13); top: var(--f8); font-size: var(--f21); }
.crediti { position: absolute; z-index: 2; margin: 0; color: var(--testo-2); line-height: 1.3; }
body.lim .q.phi .crediti { left: var(--f55); bottom: var(--f55); font-size: var(--t-small); max-width: 55%; }
body.tel .fascia.phi .crediti { left: var(--f13); bottom: var(--f8); font-size: var(--f13); }
