/* OMNIFIT: lo Spogliatoio (js/spogliatoio.js, 5/11/2026). Prefisso spo-. NON PUBBLICARE finché Stefano non lo dice.
   Sempre scuro (è una stanza con le luci), in tutti e due i temi. Sul telefono il riquadro della maglia (nome, taglie,
   «Avvisami») sta in basso sopra la stanza; da 900 px a destra, come una colonna. La parte libera della stanza la
   calcola il file js e la passa qui: --spo-ft (dall'alto), --spo-fh (altezza), --spo-fw (larghezza); --spo-cx è il
   punto in mezzo della maglia (sul PC il mezzo dello schermo, se c'è posto) e --spo-ad quanto stanno le frecce dal mezzo. */
.spo-hbtn .spo-dot { position: absolute; top: 7px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }

#spoDlg {
  --spo-ft: 70px; --spo-fh: 50vh; --spo-fw: 100vw; --spo-cx: 50vw; --spo-ad: calc(50vw - 32px); --spo-ox: 50vw;
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; box-sizing: border-box;
  background: #0C0B0A; color: #F2EDE4; overflow: hidden; font-family: var(--f-body); color-scheme: dark;
}
#spoDlg::backdrop { background: #0C0B0A; }
#spoDlg button { font-family: inherit; -webkit-tap-highlight-color: transparent; }
#spoDlg :focus-visible { outline: 2px solid #FF7A30; outline-offset: 2px; }
.spo-stage { position: absolute; inset: 0; }
.spo-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.spo-cv:active { cursor: grabbing; }

/* in alto: indietro e il titolo */
.spo-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; pointer-events: none;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 22px max(14px, env(safe-area-inset-left));
  background: linear-gradient(#0C0B0A 58%, rgb(12 11 10 / .8) 78%, rgb(12 11 10 / 0)); /* (il titolo si legge anche sopra il cartello del rack) */
}
.spo-top > * { pointer-events: auto; }
.spo-back { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .09); color: #F2EDE4; cursor: pointer; }
.spo-back svg { width: 22px; height: 22px; }
.spo-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spo-tt h2 { margin: 0; padding-top: 4px; font: 600 31px/0.9 "Teko", var(--f-display); letter-spacing: .06em; text-transform: uppercase; transform: skewX(-9deg); transform-origin: left; color: #F2EDE4; }
.spo-tt small { font: 500 11px/1.2 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .18em; color: #FF7A30; }

/* in mezzo alla parte libera: il caricamento, le frecce, i tasti */
.spo-load { position: absolute; left: calc(var(--spo-cx) - 150px); width: 300px; top: calc(var(--spo-ft) + var(--spo-fh) / 2 - 30px); display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 14px; color: #A59D94; }
.spo-load[hidden] { display: none; }
.spo-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgb(255 122 48 / .25); border-top-color: #FF7A30; animation: spo-spin .9s linear infinite; }
@keyframes spo-spin { to { transform: rotate(1turn); } }
.spo-flat { position: absolute; left: 0; width: var(--spo-fw); top: var(--spo-ft); height: var(--spo-fh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 20px; box-sizing: border-box; }
.spo-flat[hidden] { display: none; }
.spo-flat img { max-width: 100%; max-height: calc(100% - 40px); border-radius: 14px; }
.spo-flat p { margin: 0; font-size: 13px; color: #A59D94; text-align: center; }
.spo-arrow {
  position: absolute; z-index: 1; top: calc(var(--spo-ft) + var(--spo-fh) / 2 - 22px); display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid rgb(255 255 255 / .12); border-radius: 50%; background: rgb(20 19 18 / .55); color: #F2EDE4; cursor: pointer;
}
.spo-arrow svg { width: 22px; height: 22px; }
.spo-arrow.is-prev { left: max(10px, env(safe-area-inset-left), calc(var(--spo-cx) - var(--spo-ad) - 22px)); }
.spo-arrow.is-next { left: calc(var(--spo-cx) + var(--spo-ad) - 22px); }
.spo-tools { position: absolute; z-index: 1; left: calc(var(--spo-cx) - 200px); width: 400px; top: calc(var(--spo-ft) + var(--spo-fh) - 56px); display: flex; justify-content: center; align-items: center; gap: 8px; pointer-events: none; }
.spo-tools > * { pointer-events: auto; }
.spo-seg { display: flex; padding: 3px; border-radius: 22px; background: rgb(20 19 18 / .72); border: 1px solid rgb(255 255 255 / .12); }
.spo-seg button { min-width: 84px; height: 38px; padding: 0 14px; border: 0; border-radius: 19px; background: none; color: #B9B1A8; font-size: 14px; font-weight: 600; cursor: pointer; }
.spo-seg button[aria-checked="true"] { background: #F2EDE4; color: #151413; }
.spo-tb { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgb(255 255 255 / .12); border-radius: 50%; background: rgb(20 19 18 / .72); color: #F2EDE4; cursor: pointer; }
.spo-tb svg { width: 21px; height: 21px; }
.spo-tb[hidden] { display: none; }

/* il riquadro della maglia */
.spo-panel {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 10px; box-sizing: border-box;
  padding: 14px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgb(17 16 15 / .88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid rgb(255 255 255 / .08); border-radius: 22px 22px 0 0;
}
.spo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.spo-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border: 1px solid rgb(255 255 255 / .14); border-radius: 17px;
  background: none; color: #D9D2CA; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.spo-chip i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1px rgb(255 255 255 / .4); }
.spo-chip[aria-selected="true"] { background: #F2EDE4; border-color: #F2EDE4; color: #151413; }
.spo-chip[aria-selected="true"] i { box-shadow: 0 0 0 1px rgb(0 0 0 / .25); }
.spo-info { display: flex; flex-direction: column; gap: 3px; }
.spo-nm { display: flex; align-items: center; gap: 12px; }
.spo-nm h3 { margin: 0; padding-top: 4px; font: 600 30px/0.9 "Teko", var(--f-display); letter-spacing: .05em; text-transform: uppercase; transform: skewX(-9deg); transform-origin: left; color: #F2EDE4; }
.spo-badge { padding: 3px 9px; border: 1px solid #FF7A30; border-radius: 10px; color: #FF7A30; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.spo-line { margin: 0; font: 500 11px/1.3 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: #A59D94; }
.spo-desc { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: #CFC8C0; }
.spo-sizes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.spo-size {
  position: relative; overflow: hidden; height: 42px; border: 1px solid rgb(255 255 255 / .12); border-radius: 11px;
  background: rgb(255 255 255 / .03); color: #8D867E; font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.spo-size::after { content: ""; position: absolute; left: -10%; right: -10%; top: 50%; height: 1px; background: rgb(255 255 255 / .22); transform: rotate(-16deg); }
.spo-size[aria-pressed="true"] { border-color: #FF7A30; color: #F2EDE4; }
.spo-size[aria-pressed="true"]::after { background: rgb(255 122 48 / .6); }
.spo-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border: 1px solid #FF7A30; border-radius: 14px;
  background: none; color: #FF7A30; font-size: 15px; font-weight: 700; cursor: pointer;
}
.spo-cta svg { width: 20px; height: 20px; }
.spo-cta.is-on { background: #FF7A30; color: #1B0E05; }
.spo-msg { margin: 0; min-height: 18px; font-size: 12.5px; line-height: 1.4; color: #A59D94; }
.spo-msg.is-err { color: #FF9C8A; }
.spo-locker { padding-top: 10px; border-top: 1px solid rgb(255 255 255 / .08); }
.spo-locker[hidden] { display: none; }
.spo-locker h4 { margin: 0 0 6px; font: 500 11px/1.3 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: #FF7A30; }
.spo-locker ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.spo-locker li { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.spo-locker li i { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1px rgb(255 255 255 / .4); }
.spo-locker li span { flex: 1; min-width: 0; font-size: 14px; color: #E4DED7; }
.spo-locker li small { display: block; font-size: 12px; color: #A59D94; }
.spo-locker li button { flex: none; min-height: 36px; padding: 0 12px; border: 1px solid rgb(255 255 255 / .14); border-radius: 18px; background: none; color: #CFC8C0; font-size: 13px; font-weight: 600; cursor: pointer; }

/* i colori veri della maglia: il tessuto e gli inchiostri */
.spo-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.spo-cols b { font: 500 11px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: #A59D94; }
.spo-sw { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #E4DED7; }
.spo-sw i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px rgb(255 255 255 / .35); }

/* tutte e tre le maglie (is-over): niente frecce né tasti della maglia, solo la frase d'aiuto in mezzo alle maglie.
   Davanti a una maglia: «Tutte e tre» per tornare (sul telefono solo l'icona). La frase arriva dopo l'apertura
   (is-lit: neon e fari accesi) */
.spo-hint { display: none; margin: 0; padding: 11px 18px; border: 1px solid rgb(255 255 255 / .16); border-radius: 22px; background: rgb(13 12 11 / .9);
  font: 500 12px/1.3 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: #F3EDE5; text-align: center; }
.spo-hint .h-touch { display: none; }
@media (hover: none) { .spo-hint .h-mouse { display: none; } .spo-hint .h-touch { display: inline; } }
#spoDlg.is-over .spo-hint { display: block; opacity: 0; transform: translateY(6px); transition: opacity .6s ease, transform .6s ease; }
#spoDlg.is-over .spo-stage.is-lit .spo-hint { opacity: 1; transform: none; }
#spoDlg.is-over .spo-arrow, #spoDlg.is-over .spo-tools > :not(.spo-hint) { display: none; }
#spoDlg.is-over .spo-tools { left: calc(var(--spo-ox) - 260px); width: 520px; }
.spo-all { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border: 1px solid rgb(255 255 255 / .12); border-radius: 22px;
  background: rgb(20 19 18 / .72); color: #F2EDE4; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.spo-all svg { width: 20px; height: 20px; }
@media (max-width: 600px) { .spo-all { width: 44px; padding: 0; justify-content: center; } .spo-all span { display: none; } .spo-hint { max-width: calc(100vw - 32px); } }

/* l'HUD sopra la teca (solo sul PC), come una scheda tecnica: linee sottili bianche, il numero (l'unico arancione),
   il dettaglio e sotto il colore dell'inchiostro col suo codice. Le etichette a sinistra si leggono verso la linea */
.spo-hud { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .6s; }
.spo-hud.is-on { opacity: 1; }
.spo-hud svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spo-hud polyline { fill: none; stroke: rgb(255 255 255 / .5); stroke-width: 1; }
.spo-hud circle { fill: #fff; }
.spo-hud circle.r { fill: none; stroke: rgb(255 255 255 / .42); stroke-width: 1; }
.spo-co {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 10px; max-width: 240px;
  font: 500 10.5px/1.35 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: #ECE8E2;
  text-align: right; text-shadow: 0 1px 8px rgb(0 0 0 / .9);
}
.spo-co.is-r { flex-direction: row; text-align: left; }
.spo-co b { font-weight: 500; color: #FF7A30; }
.spo-co span { display: flex; flex-direction: column; gap: 5px; }
.spo-co small { display: flex; align-items: center; justify-content: flex-end; gap: 7px; font-size: 9.5px; letter-spacing: .14em; color: #8F8981; }
.spo-co.is-r small { justify-content: flex-start; }
.spo-co i { flex: none; width: 8px; height: 8px; box-shadow: 0 0 0 1px rgb(255 255 255 / .35); }

@media (max-width: 899px) {
  .spo-locker ul { max-height: 92px; overflow: auto; }
  /* sul telefono la storia della maglia la dicono la stampa e i colori: più posto al 3D */
  .spo-desc { display: none; }
}
@media (max-height: 700px) and (max-width: 899px) {
  .spo-desc { display: none; }
  .spo-panel { gap: 8px; padding-top: 12px; }
}
/* PC e tablet larghi: il riquadro a destra */
@media (min-width: 900px) {
  .spo-top { padding-left: 28px; padding-top: 22px; }
  .spo-tt h2 { font-size: 36px; }
  /* a metà altezza della stanza, come la maglia */
  .spo-panel { left: auto; right: 28px; top: calc(var(--spo-ft) + var(--spo-fh) / 2); bottom: auto; transform: translateY(-50%); max-height: calc(var(--spo-fh) - 16px); width: 390px; padding: 22px; gap: 14px; border: 1px solid rgb(255 255 255 / .1); border-radius: 22px; overflow: auto; background: rgb(17 13 12 / .78); }
  .spo-nm h3 { font-size: 40px; }
  .spo-desc { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .spo-spin { animation-duration: 2.4s; } }
@media (forced-colors: active) { .spo-panel, .spo-chip, .spo-size, .spo-cta { border: 1px solid CanvasText; } }
