.v3d {
  position: relative;
  --v3d-fondo: var(--bianco);
  --v3d-testo: var(--antracite);
  --v3d-scelta: var(--verde);
  --v3d-scelta-testo: var(--antracite);
}
[data-theme="chiaro"] .v3d,
[data-theme="verde"] .v3d {
  --v3d-fondo: var(--antracite);
  --v3d-testo: var(--bianco);
  --v3d-scelta: var(--antracite);
  --v3d-scelta-testo: var(--bianco);
}
.v3d-palco {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.v3d--hero { min-height: 280px; }
.v3d--hero .v3d-palco { position: absolute; inset: 0; height: auto; min-height: 0; }
.v3d-tela {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  outline: none;
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.v3d--pronto .v3d-tela { opacity: 1; }
.v3d--studio .v3d-tela { cursor: grab; }
.v3d--studio.v3d--presa .v3d-tela { cursor: grabbing; }
.v3d-tela:focus-visible { outline: 2px dashed currentColor; outline-offset: -6px; }
.v3d-fallback { display: none; }
.v3d:not(.v3d--attivo) .v3d-fallback,
.v3d--senza-webgl .v3d-fallback {
  display: block;
  position: absolute;
  inset: 0;
  width: 62%;
  height: 72%;
  margin: auto;
  object-fit: contain;
  animation: v3d-galleggia 6s ease-in-out infinite;
}
.v3d--studio:not(.v3d--attivo) .v3d-palco { min-height: 380px; }
@keyframes v3d-galleggia {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-1.2deg); }
  50% { transform: translate3d(0, -10px, 0) rotate(1.2deg); }
}
.v3d-linee {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.v3d-linea { stroke: currentColor; stroke-width: 1; }
.v3d-punto { fill: var(--v3d-fondo); stroke: currentColor; stroke-width: 1.5; }
.v3d-etichette { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.v3d-etichetta {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  max-width: min(230px, 44%);
  padding: 7px 10px 6px;
  background: var(--v3d-fondo);
  color: var(--v3d-testo);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 2px;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
}
.v3d-etichetta-num { opacity: 0.62; }
.v3d-etichetta-testo { overflow: hidden; text-overflow: ellipsis; }
.v3d--senza-webgl .v3d-etichette,
.v3d--senza-webgl .v3d-linee { display: none; }
.v3d--studio { display: flex; flex-direction: column; gap: 18px; }
.v3d--studio .v3d-palco { height: min(66vh, 680px); min-height: 360px; }
.v3d-pannello {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px 32px;
  font-family: var(--f-sans);
}
.v3d-gruppo { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v3d-gruppo-titolo {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.v3d-gruppo-valore { opacity: 0.7; text-transform: none; letter-spacing: 0.02em; }
.v3d-scelte { display: flex; flex-wrap: wrap; gap: 8px; }
.v3d-scelta {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0;
  padding: 9px 15px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.v3d-scelta:hover { border-width: 2px; padding: 8px 14px; }
.v3d-scelta[aria-pressed="true"] { background: var(--v3d-scelta); border-color: var(--v3d-scelta); color: var(--v3d-scelta-testo); }
.v3d-scelta:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.v3d-scelta.v3d-campione { width: 42px; height: 42px; min-height: 0; padding: 0; flex: none; }
.v3d-scelta.v3d-campione:hover { padding: 0; }
.v3d-scelta.v3d-campione[aria-pressed="true"] { background: transparent; border: 2px solid currentColor; color: inherit; }
.v3d-pallino { display: block; flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid currentColor; box-sizing: border-box; }
.v3d-azioni { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.v3d-aiuto { margin: 0; font-family: var(--f-mono); font-size: 12px; line-height: 1.4; opacity: 0.75; }
@media (max-width: 619px) {
  .v3d--studio .v3d-palco { height: 58vh; min-height: 320px; }
  .v3d-etichetta { font-size: 11px; padding: 6px 8px 5px; }
  .v3d-pannello { gap: 16px; }
  .v3d-scelta { padding: 8px 12px; font-size: 13px; }
  .v3d-scelta:hover { padding: 7px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .v3d-fallback { animation: none !important; }
  .v3d-tela, .v3d-scelta { transition: none; }
}
