/* Navigazione 3D (modale sopra la pagina Superfici): palco 16:9 come il video registrato */
.fpt { position: fixed; inset: 0; z-index: 2147483100; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; background: rgba(3, 7, 18, 0.82); }
.fpt[hidden] { display: none; }
.fpt-shell { display: flex; flex-direction: column; gap: 10px; width: min(100%, calc((96vh - 110px) * 16 / 9)); color: #e5e7eb; }
.fpt-head { display: flex; align-items: center; gap: 12px; }
.fpt-head strong { font-size: 1.05rem; }
.fpt-msg { flex: 1; font-size: 0.9rem; color: #fbbf24; }
.fpt-close { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.fpt-close:hover { background: rgba(255, 255, 255, 0.22); }
.fpt-stage { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 12px; overflow: hidden; background: #111827; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.fpt-stage canvas { display: block; width: 100%; height: 100%; }
.fpt-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fpt-ctrl button, .fpt-dl { padding: 7px 14px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: #1f2937; color: #e5e7eb; font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: none; }
.fpt-ctrl button.fpt-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; padding: 0; }
.fpt-icon svg { width: 18px; height: 18px; }
/* interruttore «Arredi»: pulsante tondo in basso a destra sopra il video; acceso = bianco pieno, spento = vetro barrato */
.fpt-furn { position: absolute; right: 16px; bottom: 16px; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; background: rgba(17, 24, 39, 0.55); color: #fff; cursor: pointer; backdrop-filter: blur(6px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); transition: background 0.15s, color 0.15s, transform 0.15s; }
.fpt-furn:hover { transform: scale(1.06); }
.fpt-furn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }
.fpt-furn svg { width: 24px; height: 24px; }
.fpt-furn[aria-pressed="true"] { background: #fff; color: #111827; border-color: #fff; }
.fpt-furn[aria-pressed="false"]::after { content: ""; position: absolute; width: 30px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); }
.fpt-furn[hidden] { display: none; }
/* velocita': pulsante 1x con menu che si apre verso l'alto */
.fpt-speed-wrap { position: relative; }
.fpt-ctrl button.fpt-speed { min-width: 48px; font-variant-numeric: tabular-nums; }
.fpt-speed-menu { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 1; display: flex; flex-direction: column; gap: 2px; min-width: 64px; padding: 4px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: #111827; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.fpt-speed-menu[hidden] { display: none; }
.fpt-ctrl .fpt-speed-menu button { border: 0; background: transparent; text-align: center; font-variant-numeric: tabular-nums; }
.fpt-ctrl .fpt-speed-menu button[aria-checked="true"] { background: #2563eb; color: #fff; }
/* qualita': stesso menu della velocita' */
.fpt-quality-wrap { position: relative; }
.fpt-ctrl button.fpt-quality[hidden] { display: none; }
.fpt-quality-menu { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 1; display: flex; flex-direction: column; gap: 2px; min-width: 96px; padding: 4px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: #111827; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.fpt-quality-menu[hidden] { display: none; }
.fpt-ctrl .fpt-quality-menu button { border: 0; background: transparent; text-align: center; }
.fpt-ctrl .fpt-quality-menu button[aria-checked="true"] { background: #2563eb; color: #fff; }
.fpt-ctrl button:hover, .fpt-dl:hover { background: #374151; }
.fpt-ctrl button.is-primary { background: #dc2626; border-color: #dc2626; color: #fff; }
.fpt-ctrl button.is-primary.is-on { background: #fff; color: #dc2626; }
.fpt-ctrl button:disabled { opacity: 0.5; cursor: default; }
/* «Mappa» (solo CRM): interruttore della minimappa, blu quando e' accesa */
.fpt-ctrl button.fpt-mapbtn { display: inline-flex; align-items: center; gap: 6px; }
.fpt-ctrl button.fpt-mapbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.fpt-ctrl button.fpt-mapbtn[aria-pressed="true"] { background: #2563eb; border-color: #2563eb; color: #fff; }
.fpt-dl { background: #2563eb; border-color: #2563eb; color: #fff; }
#fpt-seek { flex: 1; min-width: 120px; accent-color: #2563eb; }
.fpt-time { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: #9ca3af; }

.fpt-credit{position:absolute;right:8px;bottom:8px;font-size:11px;color:#334155;background:rgba(255,255,255,.72);padding:1px 6px;border-radius:4px;pointer-events:none;z-index:3}

/* Modalita' GAME (scheda del sito): si cammina da soli; la timeline sparisce, i comandi stanno sul palco */
.fpt.is-game #fpt-play, .fpt.is-game #fpt-restart, .fpt.is-game #fpt-seek, .fpt.is-game .fpt-time, .fpt.is-game .fpt-speed-wrap { display: none; }
.fpt.is-game .fpt-stage canvas { cursor: none; } /* la vista segue il mouse: al centro c'e' gia' il mirino */
/* in basso a destra, sulla stessa riga: GAME MODE e arredi (con la scritta) */
.fpt-tools { position: absolute; right: 16px; bottom: 28px; display: flex; align-items: center; gap: 10px; }
.fpt-tools .fpt-furn { position: relative; right: auto; bottom: auto; }
.fpt-furn.has-label { width: auto; gap: 8px; padding: 0 18px 0 14px; font: inherit; font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.fpt-furn.has-label::after { display: none; }
.fpt-game, .fpt-fs { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; background: rgba(17, 24, 39, 0.55); color: #fff; cursor: pointer; backdrop-filter: blur(6px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); transition: background 0.15s, transform 0.15s; }
.fpt-game:hover, .fpt-fs:hover { transform: scale(1.06); background: rgba(17, 24, 39, 0.75); }
.fpt-game:focus-visible, .fpt-fs:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }
.fpt-game { width: auto; gap: 8px; padding: 0 18px 0 12px; font: inherit; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.fpt-game svg { width: 26px; height: 26px; }
.fpt-game[hidden], .fpt-fs[hidden] { display: none; }
.fpt-game[aria-pressed="true"] { background: #2563eb; border-color: #2563eb; }
.fpt-fs { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; }
.fpt-fs svg { width: 20px; height: 20px; }
.fpt-fs[aria-pressed="true"] svg { transform: rotate(180deg); }
/* tooltip subito (il title del browser arriva tardi), sotto l'icona dello schermo intero */
.fpt-fs::after { content: attr(data-tip); position: absolute; left: 50%; padding: 5px 10px; border-radius: 6px; background: #111827; color: #fff; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.12s, transform 0.12s; z-index: 2; }
.fpt-fs::after { top: calc(100% + 8px); left: auto; right: 0; transform: translateY(-4px); }
.fpt-fs:hover::after, .fpt-fs:focus-visible::after { opacity: 1; transform: translateY(0); }
.fpt-stage:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }
/* minimappa: in alto a sinistra, piani a schede sopra la pianta */
.fpt-map { position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 6px; width: 250px; padding: 8px; border-radius: 14px; background: rgba(17, 24, 39, 0.62); color: #fff; backdrop-filter: blur(6px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.fpt-map[hidden], .fpt-map-tabs[hidden] { display: none; }
.fpt-map-tabs { display: flex; gap: 4px; }
.fpt-map-tabs button { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 4px 6px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #fff; font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fpt-map-tabs button:hover { background: rgba(255, 255, 255, 0.26); }
.fpt-map-tabs button[aria-pressed="true"] { background: #2563eb; }
/* nel tour (fuori da GAME) la minimappa dice solo dove sei: le schede segnano il piano, non si cliccano */
.fpt:not(.is-game) .fpt-map-tabs button { pointer-events: none; }
.fpt:not(.is-game) .fpt-map-tabs kbd { display: none; }
/* ...e anzi si vede solo il nome del piano in cui sei, in bianco al centro sopra la pianta (con un piano solo le schede non ci sono) */
.fpt:not(.is-game) .fpt-map-tabs button:not([aria-pressed="true"]) { display: none; }
.fpt:not(.is-game) .fpt-map-tabs button[aria-pressed="true"] { padding: 0 2px; background: transparent; color: #fff; font-size: 0.85rem; font-weight: 700; text-align: center; }
.fpt-map canvas { display: block; width: 100%; height: 160px; }
.fpt-map-tip { min-height: 1.2em; font-size: 0.75rem; text-align: center; opacity: 0.9; }
.fpt-map-keys { font-size: 0.72rem; font-weight: 600; text-align: center; opacity: 0.9; }
.fpt-map-keys[hidden] { display: none; }
.fpt-map-tabs kbd { margin-right: 3px; padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); font: inherit; }
/* uscendo da GAME MODE: «Ricomincia tour» e «Torna al gioco» al centro del palco */
.fpt-after { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; width: max-content; max-width: calc(100% - 32px); }
.fpt-after[hidden], .fpt-resume[hidden] { display: none; }
.fpt-resume { display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px 14px 20px; border: 0; border-radius: 999px; background: #2563eb; color: #fff; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); transition: transform 0.15s, background 0.15s; }
.fpt-resume:hover { transform: scale(1.05); background: #1d4ed8; }
.fpt-resume:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.fpt-resume svg { width: 22px; height: 22px; }
.fpt-resume.is-game { background: rgba(17, 24, 39, 0.82); }
.fpt-resume.is-game:hover { background: rgba(17, 24, 39, 0.95); }
/* palco stretto (schermi piccoli, finestra ridotta): la minimappa non ci sta e si toglie; i piani restano sui tasti 1, 2, 3.
   Conta la larghezza del palco, non dello schermo: a schermo intero la mappa torna. */
.fpt-stage:has(> .fpt-map) { container-type: inline-size; }
@container (max-width: 960px) {
  .fpt-map { display: none !important; }
}
/* senza tastiera (telefono, tablet) la modalita' non serve */
@media (hover: none) and (pointer: coarse) { .fpt-game { display: none !important; } }
.fpt-game kbd, .fpt-furn kbd { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 0.35em; border: 1px solid currentColor; border-bottom-width: 2px; border-radius: 5px; font: inherit; font-size: 0.75rem; font-weight: 700; line-height: 1; opacity: 0.75; }
/* palco stretto (telefono, finestra piccola): in basso non ci stanno tutte le scritte, RICOMINCIA e Arredi restano solo icona */
.fpt-stage { container-type: inline-size; }
@container (max-width: 960px) {
  .fpt-rebuild .fpt-btn-label, .fpt-rebuild kbd, .fpt-furn .fpt-btn-label, .fpt-furn kbd { display: none; }
  .fpt-rebuild, .fpt-furn.has-label { width: 48px; padding: 0; gap: 0; justify-content: center; }
}
/* GAME: promemoria dei comandi in basso a destra, sopra i pulsanti; non si clicca (sotto passa il mouse) */
.fpt-keys { position: absolute; right: 16px; bottom: 90px; display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: rgba(17, 24, 39, 0.55); color: #fff; backdrop-filter: blur(6px); font-size: 0.8rem; font-weight: 600; pointer-events: none; }
.fpt-keys[hidden] { display: none; }
.fpt-keys-row { display: grid; grid-template-columns: 74px auto; align-items: center; gap: 10px; }
.fpt-keys-row > :first-child { justify-self: center; }
.fpt-keys kbd { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 0.35em; border: 1px solid rgba(255, 255, 255, 0.35); border-bottom-width: 3px; border-radius: 5px; background: rgba(255, 255, 255, 0.12); font: inherit; font-size: 0.72rem; font-weight: 700; line-height: 1; }
.fpt-keys .k-space { width: 70px; }
.fpt-keys-cross { display: grid; grid-template-columns: repeat(3, auto); gap: 2px; }
.fpt-keys-cross .k-up { grid-column: 2; grid-row: 1; }
.fpt-keys-cross kbd:not(.k-up) { grid-row: 2; }
.fpt-keys-mouse { width: 20px; height: 28px; overflow: visible; }
.fpt-keys-lmb { fill: #3b82f6; }
.fpt-keys.is-demo .fpt-keys-lmb { fill: #ef4444; }
@container (max-width: 960px) { .fpt-keys { display: none !important; } }
.fpt-keys-pair { display: inline-flex; gap: 3px; }
.fpt-keys.is-demo .fpt-keys-demo kbd { background: #ef4444; border-color: #ef4444; }
.fpt-keys-title { margin: 0; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; }
.fpt-keys-sep { margin-top: 4px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.22); }
