/* Legacy styles stay inside the preserved native controller. Idoscero owns the outer viewer. */
:where(#juego-native) .wpa-viewer,
:where(#juego-native) #wpavz-visor-container,
:where(#juego-native) #wpa-visor-container,
:where(#juego-native) .dieline-container {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 600px;
  overflow: hidden;
  cursor: grab;
}
:where(#juego-native) .wpa-viewer canvas { cursor: default; }

:where(#juego-native) .wpa-viewer-poster {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #d7d7d7;
  opacity: 1;
  visibility: visible;
  cursor: default;
  transition: opacity .28s ease, visibility .28s ease;
}

:where(#juego-native) .wpa-viewer-poster.is-ready {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

:where(#juego-native) .wpa-viewer-poster__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
}

:where(#juego-native) .wpa-viewer-poster__status {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  color: #333;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  :where(#juego-native) .wpa-viewer-poster {
    transition: none;
  }
}

:where(#juego-native) #wpa-svg-container,
:where(#juego-native) .wpa-viewer .dieline-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #808080;
  overflow: hidden;
}
:where(#juego-native) .wpa-viewer .dieline-svg.dieline-grabbing { cursor: grabbing; }
:where(#juego-native) #dl-tip, :where(#juego-native) .dieline-tip {
  position: absolute;
  pointer-events: none;
  background: #333;
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  transform: translate(-50%, -120%);
  z-index: 1000;
  display: none;
}
:where(#juego-native) .dieline-hoverable { transition: filter .12s ease, opacity .12s ease; }
:where(#juego-native) .dieline-hoverable.dl-hover {
  fill: #d7e9fb !important;
  fill-opacity: 1 !important;
  stroke: none !important;
}
:where(#juego-native) .ui-panel {
  position: absolute;
  top: 10px;
  z-index: 1000;
  background: #f5f5f5;
  padding: 10px;
  border-radius: 10px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  box-sizing: content-box;


}
:where(#juego-native) .ui-left  { left: 10px; }
:where(#juego-native) .ui-right { right: 10px; }

:where(#juego-native) .ui-title {
    margin: 0 10px;
    margin-top: 5px;
    font-size: 14px;
    text-align: center;
    font-weight: 800;
    letter-spacing: .02em;
    color: #656565;
}

:where(#juego-native) .ui-right-stack {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 260px;
}
:where(#juego-native) .ui-right-stack > .ui-panel { position: static; }
:where(#juego-native) .ui-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
:where(#juego-native) .ui-actions .wpa-action {
  display: inline-block;
  color: #fff !important;
  background: #009fe3 !important;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
  margin:0px;
  margin-bottom:20px!important;
  height: auto;
  width: auto;
  white-space: nowrap;
}
:where(#juego-native) .ui-actions .wpa-action:hover { background: #007bbf; }
:where(#juego-native) .wpa-switch-wrap {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin-bottom: 12px;
}
:where(#juego-native) .wpa-switch-label{
  opacity: .35;
  transition: .2s;
  color:#333;
 }
:where(#juego-native) .wpa-switch-label.active{ opacity: 1; font-weight: 700; color: #000; }
:where(#juego-native) .wpa-switch {
  --track: 60px;
  --knob:  24px;
  --pad:    2px;
  position: relative;
  display: inline-block;
  width: var(--track);
  height: calc(var(--knob) + 2*var(--pad));
  background-color: #dfdfdf;
  border-radius: 999px;
  cursor: pointer;
}
:where(#juego-native) .wpa-switch input { opacity: 0; width: 0; height: 0; }
:where(#juego-native) .wpa-slider {
  position: absolute;
  top:  var(--pad);
  left: var(--pad);
  width:  var(--knob);
  height: var(--knob);
  background: #007BFF !important;
  border-radius: 50%;
  transition: left .25s ease;
}
:where(#juego-native) .wpa-switch input:checked + .wpa-slider {
  left: calc(100% - var(--pad) - var(--knob));
}
:where(#juego-native) #wpa-zoom-ui {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1002;
}
:where(#juego-native) #wpa-zoom-ui .zoom-box {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,0.9);
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
:where(#juego-native) #wpa-zoom-ui .zoom-label { font-size: 13px; font-weight: 800; margin-bottom: 6px; color: black; }
:where(#juego-native) #wpa-zoom-ui .zoom-buttons { display: flex; gap: 10px; }
:where(#juego-native) #wpa-zoom-ui button {
  background: #009FE3; color: #fff; border: none; border-radius: 6px;
  padding: 6px 10px; font-size: 16px; cursor: pointer; transition: background .2s;
}
:where(#juego-native) #wpa-zoom-ui button:hover { background: #007bbf; }

:where(#juego-native) #ui-dims .dims-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: end;
    gap: 15px;
}
:where(#juego-native) #ui-dims .dim { display: inline-flex; flex-direction: column; gap: 4px; min-width: 0; }
:where(#juego-native) #ui-dims .dims-x { font-weight: 700; opacity: .85; margin: 0 2px 6px; user-select: none; }
:where(#juego-native) #ui-dims input[type="number"] {
    width: 100%!important;
    min-width: 7.5ch;
    font-variant-numeric: tabular-nums;
    padding-inline: 10px;
    margin: 0px;
    text-align: left;

}
@media (max-width: 900px) {
  :where(#juego-native) .ui-right { left: 10px; right: 10px; top: auto; bottom: 10px; }
  :where(#juego-native) .ui-right-stack { left: 10px; right: 10px; top: auto; bottom: 10px; max-width: none; }
  :where(#juego-native) .ui-actions { flex-direction: row; justify-content: flex-end; }
}
:where(#juego-native) .ui-right-stack{
  max-width: none;
}
:where(#juego-native) #ui-dims{
  min-width: 0;
  width: clamp(260px, 34vw, 300px);
}
:where(#juego-native) #ui-dims .dims-row{
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: end;
  column-gap: 8px;
}
:where(#juego-native) #ui-dims input[type="number"]{
  width: 7.5ch;
  min-width: 7.5ch;
  font-variant-numeric: tabular-nums;
  padding-inline: 10px;
}
:where(#juego-native) #ui-view label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
}
:where(#juego-native) #ui-view label select {
  text-align: center;
  margin:0px!important;
}
@media (max-width: 1500px){
  :where(#juego-native) .wpa-viewer .ui-right-stack{ position: static !important; }
  :where(#juego-native) .wpa-viewer .ui-panel{
    padding: 6px 8px;
    border-radius: 10px;
    min-width: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
  }
  :where(#juego-native) .ui-title{ font-size: 11px; margin-bottom: 2px; }
  :where(#juego-native) .wpa-switch{ --track: 42px; --knob: 18px; --pad: 2px; }
  :where(#juego-native) .wpa-switch-label{ font-size: 12px; }
  :where(#juego-native) .wpa-switch-wrap{ margin-bottom: 6px; }
  :where(#juego-native) .ui-left input[type="range"]{
    width: 140px !important;
    height: 18px;
  }

  :where(#juego-native) .wpa-viewer #ui-dims{
    position: absolute !important;
    inset: auto auto 84px 50% !important;
    transform: translate(-50%) !important;
    z-index: 1003 !important;
    max-width: 380px !important;
    padding: 5px;
    box-shadow: none !important;
  }
  :where(#juego-native) #ui-dims .dims-row{ column-gap: 4px; }
  :where(#juego-native) #ui-dims .dims-x{ margin: 0 2px 2px; font-size: 12px; }
  :where(#juego-native) #ui-dims input[type="number"]{
    height: 32px;
    padding-inline: 6px;
    font-size: 13px;
  }
  :where(#juego-native) .wpa-viewer #ui-actions{
    position: absolute !important;
    left: 50% !important; transform: translateX(-50%) !important;
    bottom: 10px !important;
    top: auto !important; right: auto !important;
    z-index: 1002 !important;
    display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap;
    justify-content: center; align-items: center; pointer-events: auto;
  }
  :where(#juego-native) .wpa-viewer #ui-actions .wpa-action{
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.05;
    margin:0!important
  }
}


/* BLOQUE DE PANEL DE VISTA CON MINIATURA */

/* Contenedor de miniaturas debajo del switch 3D/2D */
:where(#juego-native) #wpa-view-thumbs {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-start;
  margin-top: 0;
}

:where(#juego-native) #wpa-view-face-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 0 8px;
}

:where(#juego-native) #wpa-view-face-controls[hidden],
:where(#juego-native) #wpa-view-face-controls > [hidden] {
  display: none !important;
}

/* Recuadros de miniatura (3D y 2D) */
:where(#juego-native) #wpa-thumb-3d,
:where(#juego-native) #wpa-thumb-2d {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 6px;
  background: #f8f8f8;
  overflow: hidden;
  box-shadow: 0 0 0 1px #ddd;
  aspect-ratio: 4 / 3;
}

/* Mini slider de apertura sobre la miniatura 3D */
:where(#juego-native) #wpa-thumb-3d {
  position: relative;
}

:where(#juego-native) #wpa-thumb-3d canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

:where(#juego-native) .wpa-thumb-open-ui {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 0px 10px;
    background: #ffffffe6;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
    box-shadow: 0 0 0 1px #0000000a;
    color: #333;
}

:where(#juego-native) .wpa-thumb-open-label {
  white-space: nowrap;
  opacity: 0.8;
  flex: 0 0 auto;
}

:where(#juego-native) .wpa-thumb-open-range {
  flex: 0 1 55%;
  min-width: 60px;
  margin-right: 5px !important;
}

/* Canvases dentro de las miniaturas: default (para no romper otros casos) */
:where(#juego-native) #wpa-view-thumbs canvas {
  position: static !important;
  inset: auto !important;
  display: block;
  width: 100%;
  height: auto;
  background-color: #d0d0d0;
}

/* Miniatura 3D: el canvas debe llenar el recuadro 4:3 */
:where(#juego-native) #wpa-view-thumbs #wpa-thumb-3d canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* Miniatura 2D: el canvas debe llenar el recuadro (sin “zona vacía”) */
:where(#juego-native) #wpa-thumb-2d{
  position: relative; /* referencia para overlay */
}

:where(#juego-native) #wpa-thumb-2d canvas{
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}



/* --- Botón NUEVO (solo ícono) superpuesto dentro de la miniatura 2D --- */
:where(#juego-native) #wpa-thumb-2d { position: relative; }

:where(#juego-native) #wpa-thumb-2d #wpa-thumb-export-uv{
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 20;

  width: 40px;
  height: 40px;
  padding: 0;

  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 10px;

  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  background-color: #007BFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);

  background-image: url("images/icono-plantilla-60x60.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 32px;

  /* blindaje “sin texto” */
  font-size: 0;
  color: transparent;
  overflow: hidden;
  margin:0px;
}

:where(#juego-native) #wpa-thumb-2d #wpa-thumb-export-uv:hover{
  filter: brightness(0.95);
}



/* === Layout del panel VISTA dentro del visor === */

/* Panel izquierdo: ocupa ~25% del ancho del visor */
:where(#juego-native) .wpa-viewer .ui-panel.ui-left {
  width: 25%;
  min-width: 220px;
  max-width: 360px;
}

:where(#juego-native) .wpa-tapa-doble-americano-micro .wpa-micro-controls-toggle {
  display: none;
}

@media (max-width: 640px) {
  :where(#juego-native) .wpa-viewer.wpa-tapa-doble-americano-micro .ui-panel.ui-left {
    min-width: 0;
    max-width: min(92vw, 320px);
  }
  :where(#juego-native) .wpa-tapa-doble-americano-micro .wpa-micro-controls-toggle {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 6px;
    padding: 5px 9px;
    background: #fff;
    color: #333;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  :where(#juego-native) .wpa-tapa-doble-americano-micro .ui-panel.ui-left.wpa-micro-mobile-collapsed {
    padding: 5px;
    box-sizing: border-box;
    width: 108px;
  }
  :where(#juego-native) .wpa-tapa-doble-americano-micro .ui-panel.ui-left.wpa-micro-mobile-collapsed > :not(.wpa-micro-controls-toggle) {
    display: none !important;
  }
}


@media (max-width: 640px) {
    :where(#juego-native) .wpa-viewer #ui-dims {

        inset: auto auto 67px 50% !important;

    }
}
/* En pantallas chicas, el panel de vista se adapta al ancho */
@media (max-width: 900px) {
  :where(#juego-native) .wpa-viewer .ui-panel.ui-left {
    width: auto;
    min-width: auto;
    max-width: min(92vw, 320px);
    left: 10px;
    right: auto;
  }
  :where(#juego-native) #wpa-view-thumbs {
    justify-content: center;
    gap: 6px;
  }
  :where(#juego-native) #wpa-thumb-3d,
  :where(#juego-native) #wpa-thumb-2d {
    flex: 0 0 auto;
    width: min(42vw, 150px);
  }
}



:where(#juego-native) #panel-measures {
  --wpa-exterior-hint-gap: 10px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80%;                         /* ajustás acá lo larga/corta que es la barra */
  max-width: min(92vw, 520px);
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  box-sizing: border-box;
  z-index: 30;
}

:where(#juego-native) #wpa-view-face-controls .wpa-3d-face-selector {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
  white-space: nowrap;
  pointer-events: auto;
}

:where(#juego-native) #wpa-view-face-controls .wpa-3d-face-selector[hidden],
:where(#juego-native) #panel-measures .wpa-3d-exterior-hint[hidden] {
  display: none !important;
}

:where(#juego-native) #wpa-view-face-controls .wpa-3d-face-selector button {
  min-width: 76px;
  height: 30px;
  margin: 0 !important;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

:where(#juego-native) #wpa-view-face-controls .wpa-3d-face-selector button:hover:not(:disabled):not(.is-active) {
  background: rgba(0, 159, 227, .09);
}

:where(#juego-native) #wpa-view-face-controls .wpa-3d-face-selector button.is-active,
:where(#juego-native) #wpa-view-face-controls .wpa-3d-face-selector button[aria-pressed="true"] {
  background: #009fe3;
  color: #fff;
}

:where(#juego-native) #wpa-view-face-controls .wpa-3d-face-selector button:disabled {
  cursor: wait;
  opacity: .64;
}

:where(#juego-native) #wpa-view-face-controls .wpa-3d-face-selector button:focus-visible,
:where(#juego-native) #panel-measures .wpa-3d-exterior-hint button:focus-visible {
  outline: 3px solid rgba(0, 79, 158, .3);
  outline-offset: 2px;
}

:where(#juego-native) #panel-measures .wpa-3d-exterior-hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + var(--wpa-exterior-hint-gap));
  transform: translateX(-50%);
  z-index: 32;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(92vw, 560px);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  background: rgba(31, 41, 55, .96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .24);
  color: #fff;
  box-sizing: border-box;
  pointer-events: auto;
}

:where(#juego-native) #panel-measures .wpa-3d-exterior-hint > span {
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}

:where(#juego-native) #panel-measures .wpa-3d-exterior-hint__actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

:where(#juego-native) #panel-measures .wpa-3d-exterior-hint button {
  min-height: 32px;
  margin: 0 !important;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
}

:where(#juego-native) #panel-measures .wpa-3d-exterior-hint button[data-presentation-return] {
  border-color: #009fe3;
  background: #009fe3;
}

:where(#juego-native) #panel-measures .wpa-3d-exterior-hint button:hover {
  filter: brightness(.94);
}
@media (max-width: 640px) {
  :where(#juego-native) #panel-measures {
    --wpa-exterior-hint-gap: 8px;
  }

  :where(#juego-native) #wpa-view-face-controls .wpa-3d-face-selector button {
    min-width: 74px;
    padding-inline: 10px;
  }

  :where(#juego-native) #panel-measures .wpa-3d-exterior-hint {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: calc(100vw - 20px);
    padding: 10px;
  }

  :where(#juego-native) #panel-measures .wpa-3d-exterior-hint > span {
    text-align: center;
  }

  :where(#juego-native) #panel-measures .wpa-3d-exterior-hint__actions {
    width: 100%;
  }

  :where(#juego-native) #panel-measures .wpa-3d-exterior-hint button {
    flex: 1 1 50%;
    padding-inline: 8px;
    white-space: normal;
  }
}

:where(#juego-native) .is-hidden { display:none !important; }
:where(#juego-native) .viewport-host { position:relative; }

:where(#juego-native) #wpa-messages-overlay {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 2005;
}

:where(#juego-native) .wpa-message-box,
:where(#juego-native) .wpa-url-warning,
:where(#juego-native) .wpa-dims-warning {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-block;
  width: max-content;
  max-width: min(90vw, 520px);
  margin: 0;
  padding: 10px;
  border: 1px solid #f0c36d;
  background: #fff8e5;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  color: #3e2f12;
  pointer-events: auto;
  box-sizing: border-box;
  z-index: 2006;
}

:where(#juego-native) #panel-dieline-legend {
  position: absolute;
  z-index: 1000;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 80px;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

:where(#juego-native) #panel-dieline-legend.is-3d-logo {
  background-image: url("images/logo-3d-60x60.webp");
}

:where(#juego-native) #panel-dieline-legend.is-2d-legend {
  width: 160px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  background-image: none;
  margin-left:5px;
  margin-top:5px;
}

:where(#juego-native) #panel-dieline-legend .dieline-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

:where(#juego-native) #panel-dieline-legend .dieline-legend-label {
  font-size: 14px;
  line-height: 1.2;
  color: #333;
  white-space: nowrap;
}

:where(#juego-native) #panel-dieline-legend .dieline-legend-line {
  flex: 0 0 72px;
  width: 72px;
  height: 0;
  display: block;
}

:where(#juego-native) #panel-dieline-legend .dieline-legend-line.bleed {
  border-top: 3px solid #46BA00;
  border-radius: 999px;
}

:where(#juego-native) #panel-dieline-legend .dieline-legend-line.cut {
  border-top: 3px solid #2028B0;
}

:where(#juego-native) #panel-dieline-legend .dieline-legend-line.inner {
  border-top: 2px dashed #ff0000;
}

:where(#juego-native) #panel-dieline-legend .dieline-legend-line.perforation {
  height: 4px;
  overflow: visible;
}

/* Panel 2D */
:where(#juego-native) #panel-2d {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(1.05) blur(6px);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  z-index: 30;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  box-sizing: border-box;
  width: max-content;
  max-width: min(92vw, 760px);
}

:where(#juego-native) #wpa-view-face-controls .wpa-2d-face-selector {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  box-shadow: none;
  white-space: nowrap;
}

:where(#juego-native) #wpa-view-face-controls .wpa-2d-face-selector label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  cursor: pointer;
}

:where(#juego-native) #wpa-view-face-controls .wpa-2d-face-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

:where(#juego-native) #wpa-view-face-controls .wpa-2d-face-selector span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  background: transparent;
}

:where(#juego-native) #wpa-view-face-controls .wpa-2d-face-selector input:checked + span {
  background: #4caf50;
  color: #fff;
}

:where(#juego-native) #panel-2d .row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

:where(#juego-native) #panel-2d .state-pre {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}

:where(#juego-native) #panel-2d .state-pre .row {
  width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

:where(#juego-native) #panel-2d .state-pre .row .title {
  margin-right: auto;
  color: #333;
}

:where(#juego-native) #panel-2d .state-post {
  display: none;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}

:where(#juego-native) body.has-2d-art #panel-2d .state-pre {
  display: none;
}

:where(#juego-native) body.has-2d-art #panel-2d .state-post {
  display: flex;
}

:where(#juego-native) #panel-2d #wpa-thumb-export-uv {
  position: static;
  right: auto;
  bottom: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 10px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: #009fe3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  background-image: url("images/icono-plantilla-60x60.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 32px;
  font-size: 0;
  color: transparent;
  overflow: hidden;
  margin: 0;
}

:where(#juego-native) #panel-2d #wpa-thumb-export-uv:hover {
  filter: brightness(0.95);
}

/* Estado edición de arte subido */
:where(#juego-native) #panel-2d .panel-2d-edit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

:where(#juego-native) #panel-2d .panel-2d-edit__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

:where(#juego-native) #panel-2d .panel-2d-edit__zoom-group {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: #f4f6f8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

:where(#juego-native) #panel-2d .panel-2d-edit__zoom-btn {
  width: 42px;
  height: 42px;
  padding: 5px;
  margin:0px;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

:where(#juego-native) #panel-2d .panel-2d-edit__zoom-btn + .panel-2d-edit__zoom-btn {
  border-left: 1px solid rgba(0,0,0,0.10);
}

:where(#juego-native) #panel-2d .panel-2d-edit__zoom-btn:hover {
  background: rgba(0,159,227,0.08);
}

:where(#juego-native) #panel-2d .panel-2d-edit__zoom-btn:active {
  background: rgba(0,159,227,0.14);
}

:where(#juego-native) #panel-2d .panel-2d-edit__action-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 0 auto;
  min-width: 132px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

:where(#juego-native) #panel-2d .panel-2d-edit__action-btn:hover {
  background: #004f9e;
}

:where(#juego-native) #panel-2d .panel-2d-edit__action-btn--primary {
  background: #009fe3;
  border-color: #009fe3;
  color: #fff;
  margin:0px;
}


:where(#juego-native) #panel-2d .panel-2d-edit__action-btn--icon {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 0;
  color: transparent;
  overflow: hidden;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px;
  margin:0px;
}

:where(#juego-native) #panel-2d .panel-2d-edit__action-btn--clear {
  background-image: url("images/icono-borrar-60x60.webp");
}

:where(#juego-native) #panel-2d .panel-2d-edit__action-btn--clear:hover {
  background-color: #f7f9fb;
}

:where(#juego-native) #panel-2d .panel-2d-edit__hint {
  font-size: 13px;
  line-height: 1.2;
  color: #5b6470;
  text-align: center;
  padding: 0 4px;
}



@media (max-width: 640px) {
  :where(#juego-native) #panel-2d {
    width: max-content;
    max-width: min(96vw, 760px);
    padding: 8px 10px;
    gap: 8px;
    bottom:5px!important;
  }

  :where(#juego-native) #panel-2d .state-pre .row {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 8px;
  }

  :where(#juego-native) #panel-2d .state-pre .row .title {
    width: auto;
    margin-right: 0;
    text-align: left;
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
    flex: 0 1 auto;
  }

  :where(#juego-native) #panel-2d #wpa-thumb-export-uv {
    width: 34px;
    height: 34px;
    background-size: 26px;
    border-radius: 8px;
  }

  :where(#juego-native) #panel-2d .panel-2d-edit__row {
    gap: 8px;
  }

  :where(#juego-native) #panel-2d .panel-2d-edit__action-btn {
    min-width: 120px;
  }

  :where(#juego-native) #panel-measures {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    bottom:10px;
  }

  :where(#juego-native) #panel-measures .wpa-open-zoom-row {
    gap: 5px;
    border-radius: 5px;
    padding: 5px;
    margin: 0px;
  }

  :where(#juego-native) #panel-measures .wpa-open-slider {
    min-width: 0;
    gap: 4px;
    padding: 4px 10px;
    border-radius:20px;
  }

  :where(#juego-native) #panel-measures .wpa-open-slider span {
    font-size: 0.82rem;
  }

  :where(#juego-native) #panel-measures .wpa-open-slider input[type=range] {
    width: 50px!important;
    min-width:auto;
  }

  :where(#juego-native) #panel-measures .wpa-open-actions {
    gap: 6px;
    flex: 0 0 auto;
  }

  :where(#juego-native) #panel-measures .wpa-open-action {
    width: 32px;
    height: 32px;
    background-size: 22px 22px;
  }

  :where(#juego-native) #panel-measures #wpa-open-play {
    width: 26px;
    height: 26px;
    background-size: 16px;
    margin-left: 0;
  }

  :where(#juego-native) #panel-measures #wpa-open-snap {
    width: 32px;
    height: 32px;
    background-size: 24px;
    margin: 0;
  }
}

/* Panel de medidas 3D */
:where(#juego-native) #panel-measures .dims-row { flex-wrap:nowrap; }
:where(#juego-native) #panel-measures .dims-row label { white-space:nowrap; }
:where(#juego-native) #panel-measures.is-hidden { display:none !important; }


:where(#juego-native) .wpa-open-zoom-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #f5f5f5;
  box-sizing: border-box;
  margin: 0 auto;
  flex-wrap: nowrap;                  /* todo en una única línea */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Bloque + y - */
:where(#juego-native) .wpa-zoom-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  border-right: 1px solid rgba(0,0,0,0.16);
}

:where(#juego-native) #wpa-zoom-vertical{
  position: absolute;
  right: 16px;
  z-index: 30;
  background: #f5f5f5;
  padding: 10px;
  border-radius: 10px;
  box-sizing: border-box;
}

:where(#juego-native) #wpa-zoom-vertical .wpa-zoom-buttons{
  flex-direction: column;
  padding-right: 0;
  border-right: none;
  gap: 6px;
}

:where(#juego-native) #wpa-zoom-vertical .wpa-zoom-btn{
  margin: 0;
}

:where(#juego-native) .wpa-zoom-btn {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  padding: 0;
  margin: 0px 5px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background-repeat: no-repeat;
  background-position: center;
  background-size: 25px 25px; /* ajustable */
}

/* Hover: NO agranda/zoom (blindado contra reglas globales) */
:where(#juego-native) .wpa-zoom-btn:hover{
  background-color: #e9e9e9;

  /* anti “zoom” */
  background-size: 25px 25px !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;

  /* anti transiciones globales tipo button{transition:all...} */
  transition: background-color .12s ease, border-color .12s ease !important;
}

/* Click (pressed): tampoco agranda/zoom */
:where(#juego-native) .wpa-zoom-btn:active{
  background-color: #e6e6e6;

  background-size: 32px 32px !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  transition: background-color .12s ease, border-color .12s ease !important;
}

/* Iconos extra: centrar / rotar / pan */
:where(#juego-native) .wpa-zoom-btn.center,
:where(#juego-native) .wpa-zoom-btn.mode-rotate,
:where(#juego-native) .wpa-zoom-btn.mode-pan {
  font-size: 12px;
}

/* Modo activo: SOLO fondo/borde (sin afectar background-image/repeat) */
:where(#juego-native) .wpa-zoom-btn.is-active{
  background-color:#008fe63b;
  border-color: #008fe6;
  color: #fff;

  background-size: 25px 25px !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  transition: background-color .12s ease, border-color .12s ease !important;
}

/* Si está activo y pasás el mouse, NO cambia nada del ícono */
:where(#juego-native) .wpa-zoom-btn.is-active:hover{
  background-color: #008fe63b;
  border-color: #008fe6;

  background-size: 32px 32px !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  transition: background-color .12s ease, border-color .12s ease !important;
}

/* Bloque Abierta [slider] Cerrada */
:where(#juego-native) .wpa-open-slider {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1 1 auto;
    border-radius: 35px;
    border: 1px solid #c1c1c1;
    box-sizing: border-box;
    padding:5px 15px;
}

:where(#juego-native) .wpa-open-slider span {
    font-size: 0.9rem;
    white-space: nowrap;
    color: #333;
}

/* Track del slider: ocupa TODO el espacio libre entre las etiquetas */
:where(#juego-native) .wpa-open-slider input[type=range] {
    flex: 1 1 auto;
    min-width: 80px;
    width: auto !important;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0px !important;
}

:where(#juego-native) .solo-visor-3d {
    position: relative;
    display: block;
    width: 100%;
    min-height: 420px!important;
    background: #f6f7f8;
    border-radius: 10px;
    overflow: hidden;
}

@media (max-width: 640px) {
    :where(#juego-native) .solo-visor-3d {
        width: calc(100% - 40px);
        max-width: calc(100% - 40px);
        margin-left: auto;
        margin-right: auto;
    }
      :where(#juego-native) #panel-dieline-legend {
    transform: scale(0.7);
  }
  :where(#juego-native) #wpa-zoom-vertical {
    top: 80px!important;
  }


}

:where(#juego-native) .solo-visor-3d canvas, :where(#juego-native) .solo-visor-3d .wpa-overlay, :where(#juego-native) .solo-visor-3d .wpa-ui {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* El contenedor de cada medida sirve de referencia */
:where(#juego-native) #ui-dims .dim {
  position: relative;
}

/* Deja espacio para el texto "cm" */
:where(#juego-native) #ui-dims .dim input[type="number"] {
    text-align: left;
    padding: 0px;
    padding-left: 12px;
    font-weight: 600;
    border: 1px solid #009fe3;;
    background-color: white;
    border-radius: 7px;
}

/* La unidad de medida, dentro del input a la derecha */
:where(#juego-native) #ui-dims .dim .dim-unit {
  position: absolute;
  right: 10px;             /* separacion del borde derecho */
  bottom: 9px;             /* ajustá a ojo según la altura de tu input */
  font-size: 0.85em;
  color: #555;
  pointer-events: none;    /* para que no moleste al hacer click */
}

:where(#juego-native) .dim-label {
  margin-left:5px;
}

/* --- WPA: acciones (Play/Replay + PNG) junto al slider --- */
:where(#juego-native) .wpa-open-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0px;
}

:where(#juego-native) .wpa-open-action {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    border: 1px solid #ccc;
    padding: 0;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 !important;
}

:where(#juego-native) .wpa-open-action:hover{
  background-color: #e9e9e9;
}
:where(#juego-native) .wpa-open-action:disabled,
:where(#juego-native) .wpa-open-action.is-disabled {
  cursor: not-allowed;
  opacity: .5;
}

:where(#juego-native) .wpa-open-action:active{
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* Íconos play/replay: mostrar solo uno según data-state */
:where(#juego-native) #wpa-open-play .wpa-ico-play,
:where(#juego-native) #wpa-open-play .wpa-ico-replay{
  font-size: 16px;
}

:where(#juego-native) #wpa-open-play{
  width: 30px;
  height: 30px;
  background-size: 20px;
  background-position: center;
  background-repeat: no-repeat;
  margin-left:5px;
}

:where(#juego-native) #wpa-open-play[data-state="play"] .wpa-ico-replay{ display:none; }
:where(#juego-native) #wpa-open-play[data-state="replay"] .wpa-ico-play{ display:none; }

/* Botón PNG: tipografía más chica y ancha automática */
:where(#juego-native) #wpa-open-snap {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    padding: 0;
    margin: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px;
}

/* -------------------------------------------------
   Tooltips PRO (data-tip) para botones cuadrados
-------------------------------------------------- */
:where(#juego-native) .wpa-btn-icon {
  position: relative;
  overflow: visible !important;
}

:where(#juego-native) .wpa-btn-icon:focus-visible,
:where(#juego-native) .wpa-btn-icon[data-show-touch-tip="true"]{
  z-index: 10001;
}

:where(#juego-native) .wpa-btn-icon::after{
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(2px);
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  background: rgba(0,0,0,.85);
  color: #fff;
  z-index: 9999;
}

/* Storefront oculta los ::after de los botones; sólo habilitar los que tienen ayuda. */
:where(#juego-native) .wpa-btn-icon[data-tip]::after{
  display: block;
}

:where(#juego-native) .wpa-btn-icon:focus-visible::after,
:where(#juego-native) .wpa-btn-icon[data-show-touch-tip="true"]::after{
  opacity: 1;
  transform: translateX(-50%) translateY(0px);
}

/* La barra vertical muestra las ayudas hacia el interior del visor. */
:where(#juego-native) #wpa-zoom-vertical .wpa-btn-icon::after{
  left: auto;
  right: calc(100% + 9px);
  bottom: 50%;
  transform: translateX(2px) translateY(50%);
}
:where(#juego-native) #wpa-zoom-vertical .wpa-btn-icon:focus-visible::after,
:where(#juego-native) #wpa-zoom-vertical .wpa-btn-icon[data-show-touch-tip="true"]::after{
  transform: translateX(0) translateY(50%);
}

@media (hover: hover) {
  :where(#juego-native) .wpa-btn-icon:hover { z-index: 10001; }
  :where(#juego-native) .wpa-btn-icon:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  :where(#juego-native) #wpa-zoom-vertical .wpa-btn-icon:hover::after {
    transform: translateX(0) translateY(50%);
  }
}

/* -------------------------------------------------
   Iconos (desde src/assets/images)
-------------------------------------------------- */
:where(#juego-native) .wpa-zoom-btn.plus{
  background-image: url("images/icono-zoom-in-60x60.webp");
}
:where(#juego-native) .wpa-zoom-btn.minus{
  background-image: url("images/icono-zoom-out-60x60.webp");
}
:where(#juego-native) .wpa-zoom-btn.center{
  background-image: url("images/icono-centrar-60x60.webp");
}

/* Rotación: usar flecha */
:where(#juego-native) .wpa-zoom-btn.mode-rotate{
  background-image: url("images/icono-flecha-60x60.webp");
}

/* Pan: mano */
:where(#juego-native) .wpa-zoom-btn.mode-pan{
  background-image: url("images/icono-mano-60x60.webp");
}

:where(#juego-native) .wpa-zoom-btn:disabled{
  opacity: .5;
  cursor: not-allowed;
}

/* Play / Retro según data-state */
:where(#juego-native) #wpa-open-play[data-state="play"]{
  background-image: url("images/icono-play-60x60.webp");
}
:where(#juego-native) #wpa-open-play[data-state="replay"]{
  background-image: url("images/icono-retro-60x60.webp");
}
:where(#juego-native) #wpa-open-play[data-state="pause"]{
  background-image:
    linear-gradient(#303030, #303030),
    linear-gradient(#303030, #303030);
  background-size: 5px 17px, 5px 17px;
  background-position: calc(50% - 4px) center, calc(50% + 4px) center;
}

/* Piso: icono piso */
:where(#juego-native) #wpa-open-floor{
  background-image: url("images/icono-piso-60x60.webp");
}

:where(#juego-native) #wpa-open-floor[aria-pressed="false"]{
  opacity: .55;
}

/* PNG: icono foto */
:where(#juego-native) #wpa-open-snap{
  background-image: url("images/icono-foto-60x60.webp");
}

/* Subir arte: icono subir */
:where(#juego-native) #wpa-open-upload-art{
  background-image: url("images/icono-subir-arte-60x60.webp");
}

/* PNG: único botón rectangular (60x45) */
:where(#juego-native) .wpa-open-action.wpa-open-snap-wide{
  background-size: 32px; /* ajustá si lo querés más grande */
}
