/* styles.css - Estilos centralizados */

/* Reset e Base */
body {
  margin: 0;
  overflow: hidden;
  background: #111;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial;
  display: flex;
}

/* Container Principal */
#main-container {
  flex: 1;
  position: relative;
  background: #111;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Painel de Controle GUI */
#gui {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 280px;
  max-height: calc(100vh - 20px);
  color: white;
  font-family: inherit;
  font-size: 14px;
  background: rgba(0, 0, 0, .45);
  padding: 10px 12px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Scrollbar customizada */
#gui::-webkit-scrollbar {
  width: 8px;
}

#gui::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

#gui::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

#gui::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Elementos do GUI */
#gui input,
#gui label,
#gui select,
#gui button {
  margin: 5px 0;
  font-family: inherit;
}

#gui .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

#gui .pill {
  background: #191919;
  border: 1px solid #2a2a2a;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12px;
}

#gui .hint {
  font-size: 12px;
  opacity: .8;
}

#gui hr {
  border-color: #333;
  opacity: .5;
  margin: 15px 0;
}

/* Aviso HTTP */
#httpWarn {
  display: none;
  background: #221b00;
  color: #ffde85;
  border: 1px solid #6a5400;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  margin-top: 6px;
}

/* Títulos de Seção */
#gui .section-title {
  font-weight: bold;
  font-size: 13px;
  color: #fff;
  margin: 15px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #333;
}

/* Inputs */
#gui input[type="range"] {
  width: 100px;
}

#gui input[type="color"] {
  width: 50px;
  height: 30px;
  padding: 2px;
  border: 1px solid #555;
  border-radius: 4px;
}

/* ===== Custom Color Picker (S3D UX) ===== */
.s3d-color-wrapper {
  display: inline-flex;
  flex-direction: column;
  position: relative;
}

.s3d-color-btn {
  width: 42px;
  height: 26px;
  border: 1px solid #444;
  border-radius: 6px;
  cursor: pointer;
  background: #666;
  padding: 0;
  box-shadow: 0 0 0 1px #111, 0 0 4px rgba(0, 0, 0, .6) inset;
}

.s3d-color-wrapper input[type=color] {
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 26px;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}

.s3d-color-btn:focus {
  outline: 2px solid #0af;
}

.s3d-color-panel {
  position: fixed;
  top: 34px;
  left: 0;
  z-index: 100900;
  background: #101214;
  padding: 10px;
  border-radius: 10px;
  width: 220px;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .6), 0 0 0 1px #1e1e1e;
  display: none;
  gap: 10px;
  flex-direction: column;
  font-size: 12px;
}

.s3d-color-panel.s3d-color-open {
  display: flex;
}

.s3d-color-sv {
  position: relative;
  height: 140px;
  border-radius: 6px;
  cursor: crosshair;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 0 0 1px #222;
}

.s3d-color-sv::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, black, transparent);
}

.s3d-color-sv-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5);
  border-radius: 50%;
  transform: translate(-7px, -7px);
  pointer-events: none;
}

.s3d-color-hue {
  position: relative;
  height: 16px;
  border-radius: 999px;
  cursor: ew-resize;
  background: linear-gradient(to right, red, #ff0, #0f0, #0ff, #00f, #f0f, red);
  box-shadow: 0 0 0 1px #222;
}

.s3d-color-hue-cursor {
  position: absolute;
  top: 0;
  width: 14px;
  height: 100%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
  border-radius: 4px;
  transform: translateX(-7px);
  pointer-events: none;
}

.s3d-color-hex {
  background: #181818;
  border: 1px solid #333;
  color: #ddd;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: monospace;
}

@media (max-width:600px) {
  .s3d-color-panel {
    width: 180px;
    padding: 8px;
  }

  .s3d-color-sv {
    height: 110px;
  }

  .s3d-color-btn {
    width: 38px;
    height: 24px;
  }
}

#gui select {
  padding: 4px;
  background: #333;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
}

/* Botões */
#gui button {
  background: #333;
  color: white;
  border: 1px solid #555;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  min-width: 96px;
}

#gui button:hover {
  background: #444;
}

#gui button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Info Box */
.method-info {
  background: rgba(255, 255, 100, 0.1);
  border: 1px solid rgba(255, 255, 100, 0.3);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  margin-top: 6px;
}

/* Status de Exportação */
#exportStatus {
  padding: 5px;
  border-radius: 4px;
  text-align: center;
  transition: all 0.3s ease;
}

#exportStatus:not(:empty) {
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid rgba(0, 255, 0, 0.3);
  margin-top: 10px;
}

/* Animação de Loading */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ================================================ */
/* ===== ESTILOS MOVIDOS DO ARQUIVO s3d.html ====== */
/* ================================================ */

/* Loaders para miniaturas de GIFs na janela de Modelos */
:root {
  --accent: #0084ff;
  --loaderSize: 19px;
}

.loader {
  --s: var(--loaderSize);
  width: var(--s);
  height: var(--s);
  color: var(--accent);
  display: inline-block;
}

/* Spinner */
.spin {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  overflow: hidden;
}

/* Container Principal */
#main-container {
  position: fixed;
  top: 0;
  left: 320px;
  /* Espaço do painel esquerdo */
  width: calc(100vw - 600px);
  /* Largura total menos os dois painéis (320px + 280px) */
  height: 100vh;
  background: #111;
}

/* Quando o Boss estiver escondido, ocupar toda a viewport e centralizar o canvas
   (sobrescreve o left/width usados para o layout com painéis). */
body.boss-hidden #main-container {
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: inherit !important;
}

/* Painel Esquerdo - Controles */
#gui-left {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  overflow-y: auto;
  background: #1a1a1a;
  padding: 15px;
  border-right: 1px solid #333;
}

/* Painel Direito - Camadas */
#gui-right {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #161616;
  border-left: 1px solid #333;
  display: flex;
  flex-direction: column;
}

/* Estilo do Painel de Camadas */
.layers-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.layers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #222;
  border-bottom: 2px solid #444;
}

.layers-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.model-counter {
  background: #4a9eff;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
}

.layers-toolbar {
  display: flex;
  gap: 5px;
  padding: 10px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}

/* Top shading controls inside layers panel */
.layers-shading {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #161616, #151515);
  border-bottom: 1px solid #2a2a2a;
}

.layers-shading .shading-btn {
  flex: 1;
  padding: 8px 10px;
  background: #2b2b2b;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layers-shading .shading-btn.active {
  background: #2b6bff;
  border-color: #1f5fe6;
}

.layers-toolbar button {
  flex: 0 0 auto;
  padding: 8px 10px;
  background: #2a2a2a;
  color: white;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  min-width: 64px;
}

.layers-toolbar button:hover {
  background: #3a3a3a;
  transform: translateY(-1px);
}

.layers-toolbar button:active {
  transform: translateY(0);
}

#addLayerBtn {
  background: #2a5a2a;
}

#addLayerBtn:hover {
  background: #3a6a3a;
}

#deleteLayerBtn {
  background: #5a2a2a;
}

#deleteLayerBtn:hover {
  background: #6a3a3a;
}

#clearAllModels {
  background: #5a2a2a;
}

#clearAllModels:hover {
  background: #7a3a3a;
}

.layers-list {
  flex: 1;
  overflow-y: auto;
  background: #0a0a0a;
  cursor: default;
  min-height: 200px;
  /* Altura mínima para ter área clicável */
}

/* Adicionar padding interno para criar área clicável */
#layersList {
  padding: 10px 0;
  min-height: 100%;
}

/* Hover na área vazia */
#layersList:hover:empty::after,
#layersList:hover:not(:empty) {
  background: rgba(255, 255, 255, 0.02);
}

/* Estilo dos Itens de Camada */
.layer-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #222;
  transition: all 0.2s;
  cursor: pointer;
  user-select: none;
}

.layer-item:hover {
  background: #1a1a1a;
}

.layer-item.selected {
  background: #2a3a4a;
  border-left: 3px solid #4a9eff;
  padding-left: 9px;
}

.layer-visibility {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.layer-visibility:hover {
  background: #2a2a2a;
}

.layer-visibility.visible::before {
  content: "👁";
  color: white;
}

/* ========================= */
/* POSIÇÃO D-Pad (s3dux)     */
/* ========================= */
/* Scoped styles for the floating POSIÇÃO panel to look like a modern D-pad */
#s3dux-pos-panel {
  background: rgba(10, 10, 10, 0.9);
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  color: #eaeaea;
  min-width: 180px;
  /* reduced overall width */
  max-width: calc(100vw - 24px);
  /* never exceed viewport on narrow screens */
  box-sizing: border-box;
}

.s3dux-dpad-container {
  display: grid;
  grid-template-areas:
    ".    up    ."
    "left center right"
    ".    down  .";
  /* smaller cells for a compact popup */
  grid-template-columns: 48px 60px 48px;
  grid-template-rows: 48px 60px 48px;
  gap: 6px;
  align-items: center;
  justify-items: center;
}

#s3dux-camisa-pos-panel,
#s3dux-camisa-back-pos-panel {
  min-width: 0 !important;
  width: fit-content !important;
  max-width: calc(100vw - 16px);
  padding: 8px !important;
  border-radius: 28px !important;
}

.s3dux-dpad-button {
  background-color: #1b1b1b;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.12s ease-out;
  width: 48px;
  height: 48px;
  user-select: none;
}

/* Responsive adjustments to keep the D-pad compact on small/mobile viewports */
@media (max-width: 480px) {
  #s3dux-pos-panel {
    min-width: 0;
    padding: 6px;
  }

  .s3dux-dpad-container {
    grid-template-columns: 40px 48px 40px;
    grid-template-rows: 40px 48px 40px;
    gap: 4px;
  }

  .s3dux-dpad-button {
    width: 40px;
    height: 40px;
  }

  #s3dux-pos-center {
    width: 48px;
    height: 48px;
  }

  .s3dux-size-panel {
    min-width: 160px;
  }
}

.s3dux-dpad-button svg {
  stroke: #ffffff;
  stroke-width: 2.0;
  width: 20px;
  height: 20px;
}

.s3dux-dpad-button:hover {
  background-color: #404040;
}

.s3dux-dpad-button:active {
  background-color: #555555;
  transform: scale(0.97);
}

/* Stronger, circular dark style specifically for the size popup buttons */
#s3dux-size-panel .s3dux-dpad-button {
  background-color: #2b2b2b;
  /* slightly lighter for contrast on dark panel */
  width: 52px;
  height: 52px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

#s3dux-size-panel .s3dux-dpad-button svg {
  width: 28px;
  height: 28px;
}

#s3dux-pos-up {
  grid-area: up;
}

#s3dux-camisa-pos-up {
  grid-area: up;
}

#s3dux-pos-left {
  grid-area: left;
}

#s3dux-camisa-pos-left {
  grid-area: left;
}

#s3dux-pos-right {
  grid-area: right;
}

#s3dux-camisa-pos-right {
  grid-area: right;
}

#s3dux-pos-down {
  grid-area: down;
}

#s3dux-camisa-pos-down {
  grid-area: down;
}

#s3dux-pos-center {
  grid-area: center;
  background-color: #151515;
  border-radius: 50%;
  width: 56px;
  /* smaller center circle */
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #ddd;
  font-family: monospace;
  font-size: 11px;
}

#s3dux-camisa-pos-center {
  grid-area: center;
  background-color: #151515;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #ddd;
  font-family: monospace;
  font-size: 11px;
}

#s3dux-pos-center #s3dux-pos-x-val,
#s3dux-pos-center #s3dux-pos-y-val {
  /* Hidden by request: keep values out of the center circle UI */
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

#s3dux-camisa-pos-center #s3dux-camisa-pos-x-val,
#s3dux-camisa-pos-center #s3dux-camisa-pos-y-val {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Small adjustments for the value text when center placed outside */
#s3dux-pos-panel .s3dux-pos-values {
  text-align: center;
  margin-top: 6px;
  font-family: monospace;
  font-size: 11px;
  color: #ddd;
}

/* Small center used in the Tamanho popup to match the POSIÇÃO style */
#s3dux-size-center {
  background-color: #151515;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ddd;
  font-family: monospace;
  font-size: 12px;
}

#s3dux-camisa-size-center {
  background-color: #151515;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ddd;
  font-family: monospace;
  font-size: 12px;
}

#s3dux-camisa-size-panel .s3dux-dpad-button,
#s3dux-camisa-back-size-panel .s3dux-dpad-button {
  background-color: #2b2b2b;
  width: 52px;
  height: 52px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

#s3dux-camisa-size-panel .s3dux-dpad-button svg,
#s3dux-camisa-back-size-panel .s3dux-dpad-button svg {
  width: 28px;
  height: 28px;
}

/* ATRÁS pos panel: grid-area assignments for buttons */
#s3dux-camisa-back-pos-up    { grid-area: up; }
#s3dux-camisa-back-pos-left  { grid-area: left; }
#s3dux-camisa-back-pos-right { grid-area: right; }
#s3dux-camisa-back-pos-down  { grid-area: down; }

#s3dux-camisa-back-pos-center {
  grid-area: center;
  background-color: #151515;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #ddd;
  font-family: monospace;
  font-size: 11px;
}

#s3dux-camisa-back-pos-center #s3dux-camisa-back-pos-x-val,
#s3dux-camisa-back-pos-center #s3dux-camisa-back-pos-y-val {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

#s3dux-camisa-back-size-center {
  background-color: #151515;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ddd;
  font-family: monospace;
  font-size: 12px;
}


/* ============================= */
/* S3D UX toolbar (bottom center) */
/* ============================= */
.s3dux-toolbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: stretch;
  padding: 10px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 20, 22, 0.98), rgba(12, 12, 14, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  z-index: 100001;
}

/* Apenas alteração solicitada: cor do box do LOGO */
#s3dux-button-container {
  background: #121212 !important;
}

/* Edge glow on icon and text when popup button is pressed (reduced spread) */
/* Container highlight for active buttons (Premium Glassy Look - Refined) */
.s3dux-item.s3dux-active,
.s3dux-item.s3dux-glow {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)) !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(4px);
  transform: translateY(-1px) !important;
  border-radius: 14px !important;
}

.s3dux-item.s3dux-active .s3dux-label,
.s3dux-item.s3dux-glow .s3dux-label {
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 0 0 10px rgba(74, 158, 255, 0.4) !important;
  transition: text-shadow 120ms ease;
  font-weight: 600;
  opacity: 1 !important;
  color: #ffffffff !important;
}

.s3dux-item.s3dux-glow .s3dux-icon,
.s3dux-item.s3dux-active .s3dux-icon,
.s3dux-item.s3dux-glow .s3dux-color-icon,
.s3dux-item.s3dux-active .s3dux-color-icon,
.s3dux-item.s3dux-glow .s3dux-icon-wrap img,
.s3dux-item.s3dux-active .s3dux-icon-wrap img,
.s3dux-item.s3dux-glow .s3dux-icon-wrap svg,
.s3dux-item.s3dux-active .s3dux-icon-wrap svg {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 8px rgba(74, 158, 255, 0.3)) !important;
  transition: all 120ms ease;
  transform: scale(1.04) !important;
}

/* Reapply glow specifically for the POSIÇÃO icon when its button is glowing.
   This overrides the earlier rule that prevents inversion but preserves the glow. */
/* Reapply glow specifically for the POSIÇÃO icon when its button is glowing.
   This overrides the earlier rule that prevents inversion but preserves the glow. */
.s3dux-item.s3dux-glow #s3dux-pos-icon,
.s3dux-item.s3dux-active #s3dux-pos-icon,
.s3dux-item.s3dux-glow.s3dux-pos-btn .s3dux-icon-wrap img,
.s3dux-item.s3dux-active.s3dux-pos-btn .s3dux-icon-wrap img,
.s3dux-item.s3dux-glow.s3dux-pos-btn .s3dux-color-icon,
.s3dux-item.s3dux-active.s3dux-pos-btn .s3dux-color-icon {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 12px rgba(74, 158, 255, 0.5)) !important;
  transition: all 120ms ease;
}

.s3dux-item {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid transparent;
  box-sizing: border-box;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  min-width: 80px;
  /* make toolbar items uniform and closer together */
}

/* Blue-dot badge to signal new features (top-right of a button)
   Use by adding the `s3dux-has-badge` class to any `.s3dux-item` */
.s3dux-item.s3dux-has-badge {
  position: relative;
}

.s3dux-item.s3dux-has-badge::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #39a9ff, #0077cc);
  box-shadow: 0 6px 18px rgba(3, 120, 255, 0.28);
  top: 8px;
  right: 8px;
  left: auto;
  border: 2px solid rgba(255, 255, 255, 0.08);
  z-index: 10020;
  pointer-events: none;
  transition: transform .18s cubic-bezier(.2, .9, .2, 1), opacity .18s ease;
  opacity: 1;
}

@media (max-width: 900px) {
  .s3dux-item.s3dux-has-badge::after {
    width: 8px;
    height: 8px;
    top: 6px;
    right: 6px;
    left: auto;
    border-width: 1px;
  }
}

/* Specific badges for non-.s3dux-item controls inside the Play popup */
#s3dux-inverted.s3dux-has-badge {
  position: relative;
}

#s3dux-inverted.s3dux-has-badge::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #39a9ff, #0077cc);
  box-shadow: 0 6px 18px rgba(3, 120, 255, 0.28);
  top: 6px;
  right: 6px;
  left: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10020;
  pointer-events: none;
  transition: transform .18s cubic-bezier(.2, .9, .2, 1), opacity .18s ease;
  opacity: 1;
}

#s3dux-animationSpeedValue.s3dux-has-badge {
  position: relative;
  display: inline-block;
}

/* ensure models panel buttons can show badges */
#s3dux-models.s3dux-has-badge,
.s3dux-models-side-btn.s3dux-has-badge {
  position: relative;
}

#s3dux-models.s3dux-has-badge::after,
.s3dux-models-side-btn.s3dux-has-badge::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #39a9ff, #0077cc);
  box-shadow: 0 6px 18px rgba(3, 120, 255, 0.28);
  top: 6px;
  right: 6px;
  left: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10020;
  pointer-events: none;
  transition: transform .18s cubic-bezier(.2, .9, .2, 1), opacity .18s ease;
  opacity: 1;
}

#s3dux-animationSpeedValue.s3dux-has-badge::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #39a9ff, #0077cc);
  box-shadow: 0 6px 18px rgba(3, 120, 255, 0.28);
  top: -6px;
  right: -10px;
  left: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10020;
  pointer-events: none;
  transition: transform .18s cubic-bezier(.2, .9, .2, 1), opacity .18s ease;
  opacity: 1;
}

.s3dux-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.s3dux-item:active {
  background: rgba(255, 255, 255, 0.12);
}

/* Camisa > FRENTE submenu buttons (IMPORTAR/TAMANHO/POSIÇÃO) */
.s3dux-camisa-sub-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: #fff;
  min-width: 80px;
  height: 60px;
}

.s3dux-camisa-sub-btn:hover,
.s3dux-camisa-sub-btn:active,
.s3dux-camisa-sub-btn.s3dux-active,
#s3dux-camisa-front-btn:hover,
#s3dux-camisa-front-btn:active,
#s3dux-camisa-front-btn.s3dux-active,
#s3dux-camisa-back-btn:hover,
#s3dux-camisa-back-btn:active,
#s3dux-camisa-back-btn.s3dux-active {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  transform: none !important;
  backdrop-filter: none !important;
}

.s3dux-camisa-sub-btn .s3dux-icon-wrap {
  position: relative;
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.s3dux-camisa-sub-btn .s3dux-color-icon,
.s3dux-camisa-sub-btn .s3dux-icon {
  width: 30px;
  height: 30px;
  display: block;
}

.s3dux-camisa-sub-btn .s3dux-label {
  white-space: normal;
  line-height: 1.05;
}

#s3dux-camisa-front-submenu-pill {
  position: fixed;
  display: none;
  z-index: 100002;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  pointer-events: none;
  box-sizing: border-box;
}

#s3dux-camisa-back-submenu-pill {
  position: fixed;
  display: none;
  z-index: 100002;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  pointer-events: none;
  box-sizing: border-box;
}

/* Make `Modelos` visually centered by adding extra spacing around it. */
/* remove toolbar margin for these since they'll be positioned outside the toolbar */
#s3dux-install {
  margin: 0;
}

#s3dux-duvidas {
  margin: 0;
}

#s3dux-models {
  margin-left: 6px;
  margin-right: 6px;
}

/* Make `Instalar` and `DÚVIDAS` icons and labels gray */
#s3dux-install,
#s3dux-duvidas {
  color: #9ca3af;
  /* neutral gray */
}

#s3dux-install .s3dux-label,
#s3dux-duvidas .s3dux-label {
  color: #9ca3af;
}

/* Keep them gray when hovered */
#s3dux-install:hover,
#s3dux-duvidas:hover {
  color: #9ca3af;
}

/* Force inline SVG icons inside those buttons to use the gray color
   (override inline `fill="white"` / `stroke="white"` attributes). */
#s3dux-install svg *,
#s3dux-duvidas svg * {
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Position `Instalar` and `DÚVIDAS` as circular fixed buttons at top-right */
/* Floating install/duvidas buttons: default hidden; JS controls visibility. */
#s3dux-install,
#s3dux-duvidas,
#s3dux-afiliado {
  position: fixed !important;
  width: 39px !important;
  height: 39px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  align-items: center;
  justify-content: center;
  background: #1c1c1c !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important;
  z-index: 100005 !important;
  display: none;
  /* hidden by default; scripts will set inline style to 'flex' when needed */
}

#s3dux-afiliado {
  display: none !important;
}

#s3dux-install,
#s3dux-duvidas {
  right: 12px !important;
}

#s3dux-afiliado {
  left: 12px !important;
}

/* Stack them vertically with `DÚVIDAS` above `Instalar`, both moved lower */
#s3dux-duvidas {
  top: 40px !important;
}

#s3dux-afiliado {
  top: 40px !important;
}

#s3dux-install {
  top: 96px !important;
}

/* Hide textual labels when buttons are shown floating */
#s3dux-install .s3dux-label,
#s3dux-duvidas .s3dux-label,
#s3dux-afiliado .s3dux-label {
  display: none !important;
}

/* Ensure SVG fits nicely and is centered inside the circular button */
#s3dux-install svg,
#s3dux-duvidas svg,
#s3dux-afiliado svg {
  width: 27px !important;
  height: 27px !important;
  display: block !important;
}

#s3dux-afiliado .s3dux-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Slight hover brighten for affordance */
#s3dux-install:hover svg *,
#s3dux-duvidas:hover svg *,
#s3dux-afiliado:hover svg * {
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

#s3dux-afiliado:hover {
  color: #ffffff;
}

/* default (non-hover) color for affiliate icon */
#s3dux-afiliado svg * {
  fill: #73FF7F !important;
}

/* On narrow screens shift slightly inward so they don't overlap edge buttons */
@media (max-width: 420px) {

  #s3dux-install,
  #s3dux-duvidas {
    right: 8px !important;
  }

  #s3dux-afiliado {
    left: 8px !important;
  }
}

/* Desktop-specific positioning: ensure fixed top-right placement looks correct on larger screens */
@media (min-width: 901px) {

  /* bring them a bit inward from the very top-right corner */
  #s3dux-install,
  #s3dux-duvidas {
    right: 18px !important;
  }

  #s3dux-afiliado {
    left: 18px !important;
  }

  /* place DÚVIDAS above INSTALAR with comfortable spacing from the boss-banner */
  #s3dux-duvidas {
    top: 28px !important;
  }

  #s3dux-afiliado {
    top: 28px !important;
  }

  #s3dux-install {
    top: 88px !important;
  }
}

/* FU2 lock state: dim and overlay padlock on specific toolbar buttons */
.fu2-lock-target {
  position: relative;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

body.fu2-active .fu2-lock-target {
  opacity: 0.45;
  filter: grayscale(0.6);
  /* keep pointer events so click listener can show toast */
  pointer-events: auto;
}

body.fu2-active .fu2-lock-target::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  background-image: url("assets/icons/locker.svg");
  background-size: contain;
  background-repeat: no-repeat;
  /* make icon white and retain drop-shadow */
  filter: brightness(0) invert(1) drop-shadow(0 1px 4px rgba(0, 0, 0, 0.55));
  opacity: 0.95;
  pointer-events: none;
}

/* FU2 watermark overlay */
.fu2-watermark {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: clamp(18px, 4vw, 72px);
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: none;
  color: rgba(233, 236, 245, 0.32);
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  mix-blend-mode: screen;
  text-align: center;
}

.fu2-watermark .fu2-wm-line1 {
  display: block;
  font-size: 1em;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.fu2-watermark .fu2-wm-line2 {
  display: block;
  font-size: 0.62em;
  opacity: 0.95;
  margin-top: 6px;
  font-weight: 700;
  text-transform: none;
}

/* FU2 CTA button (top center) */
.fu2-cta {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200005;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 28px;
  border-radius: 18px;
  border: 0;
  appearance: none;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  color: #ffffff;
  font-family: inherit;
  font-weight: 900;
  letter-spacing: .6px;
  font-size: 18px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #00e676, #00c853);
  box-shadow: 0 14px 34px rgba(0, 200, 83, .32), 0 0 0 0 rgba(0, 255, 149, .35);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  pointer-events: auto;
  position: fixed;
}

.fu2-cta::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 255, 149, .6), rgba(0, 200, 83, .45));
  filter: blur(14px);
  opacity: .55;
  z-index: -1;
}

.fu2-cta::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -60%;
  width: 55%;
  height: 180%;
  transform: rotate(18deg);
  background: linear-gradient(to right,
      transparent 0%,
      rgba(255, 255, 255, .7) 35%,
      rgba(255, 255, 255, .15) 55%,
      transparent 75%);
  animation: fu2-shine 2.8s ease-in-out infinite;
}

.fu2-cta:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.02);
  box-shadow: 0 18px 44px rgba(0, 200, 83, .45), 0 0 0 10px rgba(0, 255, 149, .15);
}

.fu2-cta:active {
  transform: translateX(-50%) scale(.98);
}

.pulse {
  animation: fu2-glow 1.9s ease-in-out infinite;
}

@keyframes fu2-glow {

  0%,
  100% {
    box-shadow: 0 14px 34px rgba(0, 200, 83, .32), 0 0 0 0 rgba(0, 255, 149, .25);
  }

  50% {
    box-shadow: 0 18px 46px rgba(0, 200, 83, .45), 0 0 0 14px rgba(0, 255, 149, .12);
  }
}

@keyframes fu2-shine {
  0% {
    left: -70%;
    opacity: 0;
  }

  15% {
    opacity: .7;
  }

  45% {
    left: 120%;
    opacity: 0;
  }

  100% {
    left: 120%;
    opacity: 0;
  }
}

/* When boss banner is visible, place CTA below it */
body.boss-hidden .fu2-cta {
  top: 37px;
}

/* Prevent the CTA text from wrapping and improve mobile sizing */
.fu2-cta>span {
  white-space: nowrap;
  display: inline-block;
  word-break: keep-all;
}

.fu2-checkout-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 7, 5, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2147483646;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.fu2-checkout-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.fu2-checkout-dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 30px 24px 24px;
  border-radius: 28px;
  border: 1px solid rgba(24, 72, 49, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.98));
  box-shadow: 0 24px 70px rgba(12, 27, 20, 0.16), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
  transform: translateY(12px) scale(0.98);
  transition: transform .18s ease;
}

.fu2-checkout-modal.is-visible .fu2-checkout-dialog {
  transform: translateY(0) scale(1);
}

.fu2-checkout-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 52, 35, 0.06);
  color: #204330;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.fu2-checkout-close:hover {
  background: rgba(18, 52, 35, 0.12);
  transform: scale(1.03);
}

.fu2-checkout-kicker {
  margin-bottom: 10px;
  color: #2b8f61;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.fu2-checkout-title {
  margin: 0 0 10px;
  color: #163021;
  font-size: 30px;
  line-height: 1.08;
}

.fu2-checkout-copy {
  margin: 0 0 20px;
  color: rgba(22, 48, 33, 0.70);
  font-size: 14px;
  line-height: 1.5;
}

.fu2-checkout-options {
  display: grid;
  gap: 14px;
}

.fu2-checkout-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px 18px;
  border: 1px solid rgba(24, 72, 49, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f7fbf8);
  box-shadow: 0 8px 22px rgba(18, 45, 31, 0.06);
  color: #163021;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.fu2-checkout-option:hover {
  transform: translateY(-2px);
  border-color: rgba(43, 143, 97, 0.30);
  background: linear-gradient(180deg, #ffffff, #f2faf5);
  box-shadow: 0 16px 30px rgba(18, 45, 31, 0.10);
}

.fu2-checkout-option:active {
  transform: scale(0.985);
}

.fu2-checkout-option-text {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.fu2-checkout-option-price {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 128px;
  padding: 10px 14px;
  gap: 0;
  border: 1px solid rgba(72, 126, 218, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(78, 132, 224, 0.98), rgba(57, 109, 201, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px rgba(48, 86, 155, 0.18);
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.fu2-checkout-option-price-currency {
  display: inline-block;
  align-self: flex-start;
  margin-right: 1px;
  font-size: 0.43em;
  font-weight: 700;
  line-height: 1;
  transform: translateY(0.1em);
}

.fu2-checkout-option-price-main {
  display: inline-block;
  line-height: 1;
}

.fu2-checkout-option-price-decimal {
  display: inline-block;
  align-self: flex-end;
  margin-left: -2px;
  font-size: 0.46em;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-0.02em);
}

@media (max-width: 520px) {
  .fu2-cta {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 14px;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
  }

  .fu2-cta>span {
    white-space: nowrap;
  }

  .fu2-checkout-modal {
    padding: 16px;
  }

  .fu2-checkout-dialog {
    padding: 24px 16px 18px;
    border-radius: 24px;
  }

  .fu2-checkout-title {
    font-size: 24px;
  }

  .fu2-checkout-option {
    padding: 16px 14px;
  }

  .fu2-checkout-option-price {
    min-width: 116px;
    padding: 9px 12px;
    font-size: 22px;
  }

  .fu2-checkout-option-price-currency {
    font-size: 0.41em;
  }

  .fu2-checkout-option-price-decimal {
    font-size: 0.44em;
  }

  .fu2-checkout-option-text {
    font-size: 15px;
  }
}

/* Modelos button: entrada suave ao carregar; glow movido para pseudo-elemento */
#s3dux-models {
  /* estado inicial para a animação de entrada */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  /* apenas animação de entrada no elemento; o glow roda no ::before */
  animation: entradaSuave 0.5s ease-out forwards;
  /* faster entrance */
  transition: transform 0.25s ease, opacity 0.25s ease;
  /* quicker revert on hover */
  position: relative;
  z-index: 0;
}

/* Glow via pseudo-element para permitir fade-out por opacidade */
/* Glow removed from the Modelos button */
#s3dux-models::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  /* glow disabled */
  box-shadow: none !important;
  animation: none !important;
  opacity: 0 !important;
  display: none !important;
  z-index: 0;
}

/* ensure button content sits above the glow */
#s3dux-models>* {
  position: relative;
  z-index: 1;
}

/* Classe aplicada via JS para desligar apenas o glow, preservando o ícone */
#s3dux-models.no-glow::before {
  opacity: 0;
  animation-play-state: paused !important;
}

#s3dux-models:hover {
  transform: translateY(-2px) scale(1.02);
}

/* @keyframes glow removed — glow disabled for `#s3dux-models` */

@keyframes entradaSuave {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* When preloader is active, hide the bottom toolbar to avoid flicker beneath the preloader */
body.s3d-loading-hide-ux .s3dux-toolbar,
body.s3d-loading-hide-ux .s3dux-toolbar * {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Prevent text selection on S3D UX elements (keep inputs selectable) */
.s3dux-toolbar,
.s3dux-toolbar .s3dux-item,
.s3dux-toolbar .s3dux-label,
.s3dux-size-panel,
.s3dux-models-panel,
.s3dux-dpad-button,
#s3dux-pos-center,
#s3dux-size-center,
.mobile-toggle,
.s3dux-models-item {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Re-enable selection/cursor behavior inside form controls */
.s3dux-size-panel input,
.s3dux-size-panel textarea,
.s3dux-size-panel select,
.s3dux-models-panel input,
.s3dux-models-panel textarea,
.s3dux-models-panel select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.s3dux-icon {
  color: #f5f7fb;
  opacity: 0.96;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure external SVG icons in the toolbar match inline SVGs: size and white color */
.s3dux-item .s3dux-icon img {
  width: 28px;
  height: 28px;
  display: block;
  /* Convert typical dark SVGs to white while preserving transparency */
  filter: invert(1) grayscale(1) brightness(1.2);
}

/* Do not invert the POSIÇÃO icon (it is already white or authored specifically) */
.s3dux-pos-btn .s3dux-icon img,
#s3dux-pos-icon {
  filter: none !important;
}

.s3dux-label {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0.95;
  font-weight: 700;
}

/* COR button (color pill) */
.s3dux-color-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 6px;
  border-radius: 12px;
  background: transparent;
  border: none;
  min-width: 80px;
  /* match other buttons for uniform spacing */
  height: 60px;
}

.s3dux-size-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  background: transparent;
  border: none;
  min-width: 80px;
  height: 60px;
}

/* POSIÇÃO secondary button (may be used alongside the others) */
.s3dux-pos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: #fff;
  height: 60px;
}

.s3dux-color-btn:hover,
.s3dux-size-btn:hover,
.s3dux-pos-btn:hover {
  background: transparent;
}

.s3dux-color-btn:active,
.s3dux-size-btn:active,
.s3dux-pos-btn:active {
  background: transparent;
  transform: none;
}

.s3dux-size-panel {
  position: fixed;
  z-index: 100004;
  display: none;
  padding: 8px 10px;
  background: rgba(16, 18, 20, 0.95);
  border-radius: 100px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 12px;
}

/* Remove outer background for export panel (inner .panel provides the visual) */
#s3dux-export-panel {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* Make the Especial popup visually match the LOGO button container (rounded pill) */
#s3dux-special-panel {
  background: #121212 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 100px !important;
  padding: 0 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45) !important;
  z-index: 100005 !important;
  align-items: center !important;
  height: 76px !important;
  /* match toolbar button group height (60px buttons + padding) */
  overflow: hidden !important;
  overflow-y: hidden !important;
  white-space: normal !important;
  -webkit-overflow-scrolling: auto;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

#s3dux-special-panel>.s3dux-button-scroll {
  height: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  border-radius: 100px;
  clip-path: inset(0 round 100px);
  touch-action: pan-x;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#s3dux-special-panel>.s3dux-button-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#s3dux-special-panel .s3dux-scroll-indicator {
  position: absolute;
  left: 25%;
  right: 25%;
  bottom: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  pointer-events: none;
  z-index: 3;
  width: auto;
  max-width: none;
  align-self: stretch;
  opacity: 0;
  transition: opacity 120ms ease;
}

#s3dux-special-panel .s3dux-scroll-indicator.is-visible {
  opacity: 1;
}

#s3dux-special-panel .s3dux-scroll-thumb {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 24px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
}

/* Inner mini tools: make them visually integrated with the pill (no heavy borders) */
/* make mini tools match the main toolbar item sizing and layout */
#s3dux-special-panel .s3dux-mini-tool {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 6px 8px !important;
  min-width: 80px !important;
  height: 60px !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

/* inner label sizing to match other toolbar labels */
#s3dux-special-panel .s3dux-mini-tool .s3dux-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  color: #ffffff !important;
}

/* ensure inner wrapper uses full height so buttons center vertically */
#s3dux-special-panel>.s3dux-button-scroll {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

/* Box de fundo para COR/IMPORTAR (similar ao painel especial mas com altura menor) */
#s3dux-watermark-controls {
  background: #121212 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 100px !important;
  padding: 4px 8px !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45) !important;
  height: 50px !important;
  z-index: 100006 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Garantir que SVGs dos botões especiais sejam brancos (apenas Reflexo e Marca D'água) */
#s3dux-rfx-btn .s3dux-icon img,
#s3dux-watermark-run .s3dux-icon img,
#s3dux-watermark-import .s3dux-icon img {
  filter: none !important;
}

#s3dux-watermark-import .s3dux-icon img {
  filter: invert(1) brightness(2) !important;
}

/* Adicionar glow mantendo ícones brancos */
#s3dux-rfx-btn.s3dux-glow .s3dux-icon img,
#s3dux-watermark-run.s3dux-glow .s3dux-icon img {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 8px rgba(74, 158, 255, 0.35)) !important;
}

.s3dux-size-panel input[type="range"] {
  width: 160px;
}

.s3dux-size-panel .val {
  display: inline-block;
  width: 48px;
  text-align: right;
  margin-left: 8px;
  font-family: monospace;
}

/* Ensure panels have a sensible minimum width and layout so they don't collapse into a tiny dot */
.s3dux-size-panel {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Arrow button styling inside panels (POSIÇÃO) */
.s3dux-size-panel .s3dux-arrow-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.s3dux-size-panel .s3dux-arrow-btn:active {
  transform: translateY(1px);
}

.s3dux-size-panel label {
  margin: 0;
  color: #e6e6e6;
}

.s3dux-size-panel span {
  color: #e6e6e6;
  font-family: monospace;
}

/* Ensure special panel mini-tools receive same glow and sizing as LOGO popup */
#s3dux-special-panel .s3dux-mini-tool.s3dux-glow .s3dux-label {
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.95), 0 0 8px rgba(74, 158, 255, 0.35) !important;
  transition: text-shadow 120ms ease !important;
}

#s3dux-special-panel .s3dux-mini-tool.s3dux-glow .s3dux-icon,
#s3dux-special-panel .s3dux-mini-tool.s3dux-glow .s3dux-color-icon,
#s3dux-special-panel .s3dux-mini-tool.s3dux-glow .s3dux-icon img,
#s3dux-special-panel .s3dux-mini-tool.s3dux-glow .s3dux-icon svg {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 8px rgba(74, 158, 255, 0.35)) !important;
  transition: filter 120ms ease !important;
}

/* Match label size/weight and icon sizing to main toolbar */
#s3dux-special-panel .s3dux-mini-tool .s3dux-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  color: #ffffff !important;
}

#s3dux-special-panel .s3dux-icon img {
  width: 28px !important;
  height: 28px !important;
  display: block !important;
  filter: invert(1) grayscale(1) brightness(1.2) !important;
}

#s3dux-special-panel .s3dux-pos-btn .s3dux-icon img,
#s3dux-special-panel #s3dux-pos-icon {
  filter: none !important;
}

.s3dux-models-panel {
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 16px); /* keep at least 8px padding each side on narrow screens */
  /* fixed size so the panel never shrinks regardless of content */
  height: 360px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.98), rgba(15, 15, 15, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  z-index: 100200;
  color: #f5f5f5;
}

.s3dux-models-body-wrap {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: stretch;
  height: 100%;
}

.s3dux-models-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.s3dux-models-side-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
  padding-top: 2px;
  border-left: 1px solid rgba(255,255,255,0.07);
  padding-left: 10px;
}

.s3dux-models-side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 48px;
  padding: 8px 4px;
  background: rgba(40, 43, 53, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 9px;
  color: #f0f2f8;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  font-size: 0px;
  line-height: 1;
}

.s3dux-models-side-btn span {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c8ccd8;
  line-height: 1;
}

.s3dux-models-side-btn svg {
  display: block;
  flex-shrink: 0;
}

.s3dux-models-side-btn:hover {
  background: rgba(75, 80, 100, 0.85);
  border-color: rgba(255, 255, 255, 0.22);
}

.s3dux-models-side-btn:active {
  transform: translateY(1px);
}

.s3dux-models-side-btn.active {
  background: rgba(147, 147, 147, 0.308);
  border-color: rgba(144, 144, 144, 0.45);
}

.s3dux-models-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.s3dux-models-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.s3dux-models-title {
  text-transform: uppercase;
  color: #f8fafc;
}

.s3dux-models-subtitle {
  display: none;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: rgba(209, 213, 219, 0.86);
  text-transform: none;
}

.s3dux-models-subtitle:not(:empty) {
  display: block;
  margin-top: 3px;
}

.s3dux-models-subtitle.s3dux-models-subtitle--quick {
  color: #f97316;
}

.s3dux-models-refresh {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(40, 43, 53, 0.8);
  color: #f8fafc;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.s3dux-models-refresh:hover {
  background: rgba(75, 78, 88, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
}

.s3dux-models-refresh:active {
  transform: translateY(1px);
}

.s3dux-models-status {
  font-size: 0.74rem;
  color: #d1d5db;
  margin-bottom: 10px;
  line-height: 1.4;
}

.s3dux-models-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.s3dux-models-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(33, 37, 47, 0.7);
  color: #e2e8f0;
  font-size: 0.8rem;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.s3dux-models-item:hover {
  border-color: rgba(248, 250, 252, 0.5);
  background: rgba(45, 49, 60, 0.9);
}

.s3dux-models-item:active {
  transform: translateY(1px);
}

.s3dux-models-item--quick {
  border-color: rgba(251, 146, 60, 0.34);
  background: linear-gradient(180deg, rgba(74, 40, 18, 0.82) 0%, rgba(52, 31, 18, 0.88) 100%);
  color: #ffedd5;
}

.s3dux-models-item--quick:hover {
  border-color: rgba(251, 146, 60, 0.65);
  background: linear-gradient(180deg, rgba(98, 52, 22, 0.92) 0%, rgba(66, 37, 18, 0.96) 100%);
}

.s3dux-models-item--quick .s3dux-models-filename {
  color: #fff2e2;
}

.s3dux-models-item--quick .s3dux-models-thumb {
  background: rgba(58, 31, 15, 0.72);
}

/* lock appearance when FU2 is active */
body.fu2-active .s3dux-models-item.fu2-lock-target {
  opacity: 0.45;
  filter: grayscale(0.6);
  /* keep clickable so we can intercept and show a toast */
  pointer-events: auto;
}

body.fu2-active .s3dux-models-item.fu2-lock-target::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background-image: url("assets/icons/locker.svg");
  filter: brightness(0) invert(1);
}

/* basic toast used by FU2 plugin */
.s3dux-fu2-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* allow wider toasts on narrow screens */
  width: 90vw;
  max-width: 360px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2147483647;
  pointer-events: none;
}

.s3dux-models-list::-webkit-scrollbar {
  width: 6px;
}

.s3dux-models-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.s3dux-models-thumbwrap {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.s3dux-models-thumbwrap .loader {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: calc(var(--loaderSize) / -2);
  margin-top: calc(var(--loaderSize) / -2);
  pointer-events: none;
  z-index: 2;
}

.s3dux-models-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: rgba(15, 17, 23, 0.6);
  border: 0;
}

.s3dux-models-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.s3dux-models-filename {
  font-size: 0.82rem;
  color: #f8fafc;
  word-break: normal;
  overflow-wrap: break-word;
  font-weight: bold;
}

.s3dux-models-no-thumb {
  padding-left: 12px;
}

.s3dux-color-preview {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: conic-gradient(from 180deg at 50% 50%, #FF0000 0deg, #FF9900 60deg, #FFFF00 120deg, #00FF00 180deg, #00FFFF 240deg, #0000FF 300deg, #FF00FF 360deg);
  border: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55), inset 0 0 8px rgba(255, 255, 255, 0.02);
}

.s3dux-color-btn .s3dux-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* New icon + swatch layout for using assets/colorpick.svg */
.s3dux-icon-wrap {
  position: relative;
  width: 100%;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.s3dux-color-icon {
  width: 30px;
  height: 30px;
  display: block;
}

/* Ensure POSIÇÃO toolbar icon appears white and matches size of neighbors */
.s3dux-pos-btn .s3dux-color-icon {
  filter: invert(1) brightness(1.2);
}

.s3dux-color-swatch {
  display: none !important;
  /* hide the small color dot per request */
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layer-visibility.hidden::before {
  content: "—";
  color: #666;
}

.layer-name {
  flex: 1;
  padding: 4px 8px;
  background: transparent;
  color: white;
  font-size: 13px;
  outline: none;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Viewport shading buttons (small segmented look) */
.shading-btn {
  background: #2a2a2a;
  color: #e6e6e6;
  border: 1px solid #3b3b3b;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.shading-btn:hover {
  background: #3a3a3a;
}

.shading-btn.active {
  background: linear-gradient(180deg, #4a9eff, #2a7bff);
  color: white;
  border-color: rgba(74, 158, 255, 0.9);
  box-shadow: 0 4px 12px rgba(42, 123, 255, 0.12);
}

.layer-name:hover {
  background: rgba(255, 255, 255, 0.05);
}

.layer-item.selected .layer-name {
  font-weight: bold;
}

/* Estilo para o input de edição (quando aparece) */
.layer-name-edit {
  flex: 1;
  padding: 4px 8px;
  background: #1a1a1a;
  border: 1px solid #444;
  color: white;
  font-size: 13px;
  outline: none;
  border-radius: 3px;
}

.layer-name-edit:focus {
  border-color: #4a9eff;
  background: #222;
}

.layer-type {
  padding: 3px 8px;
  background: #333;
  border-radius: 4px;
  font-size: 10px;
  color: #aaa;
  text-transform: uppercase;
  font-weight: 600;
  margin-right: 5px;
}

.layer-type.png {
  background: #2a5a3a;
  color: #8fef8f;
}

.layer-type.obj {
  background: #3a4a6a;
  color: #8f8fef;
}

.layer-type.glb {
  background: #5a3a5a;
  color: #ef8fef;
}

.layer-type.shape {
  background: #4a5a2a;
  color: #efef8f;
}

.layer-type.group {
  background: #5a4a2a;
  color: #ffdf8f;
}

/* Estilos para grupos */
.layer-item.group {
  background: linear-gradient(90deg, #2a2a2a 0%, #1e1e1e 100%);
  font-weight: bold;
  border: 1px solid #444;
  border-radius: 4px;
  margin-bottom: 2px;
}

.layer-item.group:hover {
  background: linear-gradient(90deg, #3a3a3a 0%, #2e2e2e 100%);
}

.layer-item.group.selected {
  background: linear-gradient(90deg, #3a4a5a 0%, #2e3e4e 100%);
  border-color: #4a9eff;
}

/* Ícone do tipo de camada */
.layer-type-icon {
  margin-right: 8px;
  font-size: 14px;
  width: 16px;
  text-align: center;
}

/* Estados de drag e drop */
.layer-item.drag-over {
  background: linear-gradient(90deg, #3a4a3a 0%, #2e3e2e 100%) !important;
  border-color: #4a9eff !important;
  transform: scale(1.02);
}

.layer-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

/* Indentação para filhos de grupos */
.layer-item.child {
  margin-left: 20px;
  border-left: 2px solid #333;
  padding-left: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.layer-item.child::before {
  content: "└─";
  color: #666;
  margin-right: 4px;
  font-family: monospace;
}

/* Botão de expandir/recolher grupos */

/* Melhorar o botão de criar grupo */
#addLayerBtn {
  background: #5a4a2a;
  color: #ffdf8f;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 6px;
}

#addLayerBtn:hover {
  background: #6a5a3a;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 223, 143, 0.2);
}

.layer-lock {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  padding: 0;
}

.layer-lock:hover {
  opacity: 1;
}

.layer-lock.locked::before {
  content: "🔒";
}

.layer-lock.unlocked::before {
  content: "🔓";
}

.layer-info {
  padding: 12px;
  background: #1a1a1a;
  border-top: 1px solid #333;
  font-size: 12px;
  line-height: 1.6;
}

.layer-info div {
  margin-bottom: 4px;
}

.layer-tips {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #333;
  color: #888;
}

/* Seções Colapsáveis */
.collapsible-section {
  margin-bottom: 8px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #222;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  background: #2a2a2a;
  border-radius: 5px 5px 0 0;
  transition: background 0.2s;
  user-select: none;
}

.section-header:hover {
  background: #333;
}

.section-title {
  font-weight: bold;
  font-size: 14px;
  flex: 1;
}

.toggle-icon {
  font-size: 14px;
  color: #888;
  transition: transform 0.2s;
}

.toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.section-content {
  padding: 12px 15px 15px 15px;
  border-top: 1px solid #333;
}

/* Ajustes específicos para Controles → Luzes (evita cortes nos sliders) */
#lights-content .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

#lights-content .row>div,
#lights-content .row label {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
}

#lights-content .row label {
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

#lights-content .row label input[type="range"] {
  flex: 1 1 auto;
  min-width: 160px;
  margin: 0;
}

#lights-content .row label input[type="number"],
#lights-content .row label input[type="color"],
#lights-content .row label select {
  width: 100%;
  box-sizing: border-box;
}

#lights-content [style*="flex:0 0 120px"] {
  flex: 0 0 auto !important;
  min-width: 0 !important;
}

@media (max-width: 420px) {
  #lights-content .row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Estilos gerais - Layout fixo para sliders */
.row {
  margin-bottom: 10px;
}

.control-group {
  margin-bottom: 15px;
}

.control-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.control-group small {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.control-group input[type="range"] {
  width: 100%;
}


.row label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  cursor: pointer;
  gap: 10px;
  /* Espaçamento consistente */
}

.row label input[type="range"] {
  flex: 1;
  /* Ocupa todo espaço disponível */
  min-width: 0;
  /* Permite encolher se necessário */
  margin: 0 10px;
}

.row button {
  width: 100%;
  padding: 10px;
  background: #333;
  color: white;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.row button:hover {
  background: #444;
}

.row button:active {
  transform: scale(0.98);
}

.row input[type="checkbox"] {
  margin-right: 8px;
}

.row select {
  width: 100%;
  padding: 8px;
  background: #333;
  color: white;
  border: 1px solid #444;
  border-radius: 4px;
}

.row input[type="color"] {
  width: 50px;
  height: 30px;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #333;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  margin-right: 8px;
  margin-bottom: 8px;
}

.hint {
  font-size: 12px;
  line-height: 1.4;
  color: #888;
}

#httpWarn {
  display: none;
  padding: 10px;
  background: #4a4a2a;
  border: 1px solid #6a6a3a;
  border-radius: 4px;
  margin-top: 10px;
  font-size: 11px;
}

/* Scrollbar customizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Mobile helpers hidden by default (desktop view) */
.mobile-toggle {
  display: none;
}

#mobileBackdrop {
  display: none;
}

/* ================================ */
/* Mobile layout (keep desktop same)*/
/* ================================ */
@media (max-width: 900px) {

  /* Canvas occupies full screen on mobile */
  #main-container {
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    /* raise canvas slightly on mobile */
    transform: translateY(-40px);
    transition: transform 180ms ease;
  }

  /* Off-canvas drawers for side panels */
  #gui-left,
  #gui-right {
    width: 86vw;
    max-width: 86vw;
    height: 100vh;
    top: 0;
    bottom: 0;
    position: fixed;
    z-index: 100500;
    transition: transform 0.25s ease;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
  }

  /* Start hidden off screen */
  #gui-left {
    left: 0;
    transform: translateX(-100%);
  }

  #gui-right {
    right: 0;
    transform: translateX(100%);
  }

  /* When opened */
  #gui-left.open {
    transform: translateX(0);
  }

  #gui-right.open {
    transform: translateX(0);
  }

  /* Backdrop behind panels */
  #mobileBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100400;
  }

  #mobileBackdrop.shown {
    display: block;
  }

  /* Toggle buttons (only on mobile) */
  .mobile-toggle {
    position: fixed;
    top: 10px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(24, 24, 28, 0.9);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 100600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-toggle-left {
    left: 10px;
  }

  .mobile-toggle-right {
    right: 10px;
  }

  /* Make lists and content scroll nicely on small screens */
  #gui-left,
  #gui-right,
  .layers-list {
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile toolbar: center when it fits; scroll when overflowing */
  .s3dux-toolbar {
    gap: 6px;
    padding: 8px 10px;
    /* default: centered and sized to content when it fits */
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: fit-content;
    max-width: calc(100% - 16px);
    justify-content: center;
    /* center when content fits */
    overflow-x: auto;
    /* scroll when doesn't fit */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    touch-action: pan-x;
  }

  /* When overflowing, switch to edge-to-edge scrollable layout and left-align */
  .s3dux-toolbar.s3dux-overflow {
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
    justify-content: flex-start;
  }

  .s3dux-toolbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .s3dux-toolbar::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  #s3dux-toolbar-scroll-indicator {
    position: fixed;
    height: 2px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    pointer-events: none;
    z-index: 100003;
    opacity: 0;
    transition: opacity 120ms ease;
  }

  #s3dux-toolbar-scroll-indicator.is-visible {
    opacity: 1;
  }

  #s3dux-toolbar-scroll-indicator .s3dux-scroll-thumb {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 24px;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 999px;
  }

  /* Floating logo controls row (COR/TAMANHO/POSIÇÃO/ESPESSURA/REFLEXO) */
  #s3dux-button-container .s3dux-button-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #s3dux-button-container .s3dux-button-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  #s3dux-button-container .s3dux-scroll-indicator {
    position: absolute;
    left: 25%;
    right: 25%;
    bottom: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 120ms ease;
  }

  #s3dux-button-container .s3dux-scroll-indicator.is-visible {
    opacity: 1;
  }

  #s3dux-button-container .s3dux-scroll-thumb {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 24px;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 999px;
  }

  .s3dux-item {
    min-width: 56px;
    gap: 4px;
    padding: 6px 8px;
    flex: 0 0 auto;
  }

  .s3dux-label {
    font-size: 10px;
  }

  /* Inputs expand */
  #gui-left .row label,
  #gui-left .row>div,
  #gui-left .section-content .row label,
  #gui-left .section-content .row>div {
    width: 100%;
    min-width: 0;
  }

  #gui-left input[type="range"] {
    width: 100%;
  }

  #gui-left select {
    width: 100%;
  }
}

/* When a loading screen is active, hide the S3D UX elements to avoid overlap/interaction */
body.s3d-loading-hide-ux .s3dux-toolbar,
body.s3d-loading-hide-ux [id^="s3dux-"],
body.s3d-loading-hide-ux .s3dux-item,
body.s3d-loading-hide-ux .s3dux-label,
body.s3d-loading-hide-ux #s3dux-status,
body.s3d-loading-hide-ux .sv7-model-monitor,
body.s3d-loading-hide-ux .vertex-counter {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* When Fit Size is enabled on desktop, move the main canvas close to the top */
@media (min-width: 900px) {
  body.fit-size-enabled #main-container {
    transform: translateY(-56px);
    transition: transform 180ms ease;
  }
}

/* ========================================
   Estilos movidos do index.html
   ======================================== */

/* Oculta tarja e botões IMEDIATAMENTE para evitar flash no refresh */
.boss-banner,
.mobile-toggle,
#s3dux-toolbar {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

body.s3d-loaded .boss-banner,
body.s3d-loaded .mobile-toggle,
body.s3d-loaded #s3dux-toolbar {
  opacity: 1 !important;
  visibility: visible !important;
  transition: opacity 400ms ease !important;
}

/* Remove tap highlight on mobile browsers */
html,
body,
button,
a,
input,
select,
textarea,
.s3dux-item,
.mobile-toggle,
#s3dux-toolbar,
#s3dux-toolbar * {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  outline: none;
}

@media (max-width: 900px) {

  #s3dux-toolbar,
  #s3dux-toolbar *,
  .s3dux-toolbar,
  .s3dux-toolbar .s3dux-item,
  .s3dux-toolbar .s3dux-label {
    touch-action: pan-x !important;
  }
}

/* For anchors or elements that might still show native focus ring on some browsers */
:focus {
  outline: none !important;
}

/* Center-bottom monitor (SV7-style) */
.sv7-model-monitor {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  background: rgba(17, 24, 39, 0.92);
  color: #e5e7eb;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  z-index: 99999;
  min-width: 220px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  display: none;
  /* shown only when SV7 method enabled */
  /* debug helpers: remove or reduce after verifying visibility */
  border: 2px solid rgba(255, 100, 50, 0.9);
  background: rgba(20, 30, 50, 0.98);
}

.sv7-model-monitor h4 {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  color: #fff;
}

.sv7-model-monitor .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0;
}

.sv7-model-monitor .label {
  color: #9ca3af;
}

.sv7-model-monitor .value {
  color: #e5e7eb;
  font-weight: 600;
}

/* Responsive fixes for Controls layout to avoid horizontal scrolling */
/* Make control rows wrap instead of forcing horizontal scroll */
#gui-left .section-content .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Ensure children respect box-sizing and don't overflow */
#gui-left .section-content .row>* {
  box-sizing: border-box;
  min-width: 0;
  /* allow flex children to shrink */
}

/* Helpers for fixed-width blocks inside rows (keeps them compact but allows wrap) */
#gui-left .section-content .row [style*="flex:0 0"] {
  flex: 0 0 auto;
  min-width: 60px;
}

/* Ensure the Inflate control in Modelo 3D is wide and interactive */
#model3d-content .row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

#model3d-content .row label input[type="range"] {
  flex: 1 1 auto;
  min-width: 120px;
}

#model3d-content .row label span {
  width: 72px;
  text-align: right;
  font-family: monospace;
}

/* Inputs and buttons should not exceed their container */
#gui-left input[type="number"],
#gui-left input[type="range"],
#gui-left select,
#gui-left input[type="color"],
#gui-left input[type="file"] {
  max-width: 100%;
}

#gui-left button {
  max-width: 100%;
}

/* Make labels + inputs stack nicely on narrow widths */
#gui-left .section-content .row>div,
#gui-left .section-content .row label {
  flex: 1 1 auto;
  min-width: 120px;
}

/* Tighter spacing for the Controls panel to fit more vertically */
#controls-content {
  gap: 6px;
}

/* Ensure joystick group stays visually grouped but can wrap under small widths */
#controls-content .row>div[style*="flex:0 0 120px"] {
  flex: 0 0 120px;
  /* prefer to keep width but allow wrap */
}

/* Vertex counter (bottom-right) */
.vertex-counter {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: rgba(17, 24, 39, 0.9);
  color: #e5e7eb;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.95rem;
  z-index: 100000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  display: block;
  min-width: 140px;
  text-align: right;
}

.vertex-counter .label {
  color: #9ca3af;
  font-size: 0.78rem;
  display: block;
}

.vertex-counter .value {
  color: #e5e7eb;
  font-weight: 600;
  font-family: monospace;
}

/* FPS counter (top-right) */
.fps-counter {
  position: fixed;
  right: 14px;
  top: 14px;
  background: rgba(17, 24, 39, 0.9);
  color: #e5e7eb;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  z-index: 100001;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  min-width: 100px;
  text-align: right;
}

.fps-counter span {
  font-family: monospace;
  font-weight: 600;
}

/* Boss hidden mode */
body.boss-hidden {
  background: #111;
}

/* Hide most UI when boss-hidden; also hide FPS monitor when auto-hide is enabled */
body.boss-hidden>*:not(#main-container):not(#s3d-preloader):not(#s3d-scene-cover):not([id^="s3dux"]):not([class*="s3dux"]):not(.boss-banner) {
  display: none !important;
}

body.boss-hidden #main-container {
  background: inherit;
}

/* Ensure FPS monitor is hidden when boss is auto-hidden */
body.boss-hidden #fps-counter,
body.boss-hidden .fps-counter {
  display: none !important;
}

/* Boss banner - tarja preta no topo com logo */
.boss-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 25px;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100002;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

body.boss-hidden .boss-banner {
  display: flex;
}

.boss-banner svg {
  height: 15px;
  width: auto;
  max-width: 100%;
}

/* Ensure external image logo matches previous inline-SVG size */
.boss-banner img {
  height: 15px;
  width: auto;
  max-width: 100%;
  display: block;
}

/* Ensure we can forcibly hide the import button even if other scripts toggle inline styles */
.s3dux-hidden {
  display: none !important;
}

/* Collapse toggle icons: render via CSS so orientation can change with `.collapsed` */
.toggle-icon {
  display: inline-block;
  width: 20px;
  text-align: center;
  margin-left: 8px;
  color: #bdbdbd;
  font-size: 0;
  /* hide any inline text fallback so only ::before shows */
  line-height: 1;
}

.toggle-icon::before {
  content: '▶';
  display: inline-block;
  transition: transform 180ms ease, color 120ms ease;
  font-size: 12px;
}

.toggle-icon:not(.collapsed)::before {
  content: '▼';
  transform: translateY(0);
}

.toggle-icon.collapsed::before {
  transform: translateY(-1px);
}

/* Override legacy rotation rule in styles.css that rotates the .toggle-icon element
  (that produced an upward pointing triangle). We want no transform on the element
  itself — only the pseudo-element controls the glyph. */
.toggle-icon,
.toggle-icon.collapsed {
  transform: none !important;
}

/* Hide import button by default until app signals it's allowed (prevents flash) */
body:not(.s3dux-allow-import) #s3dux-import {
  display: none !important;
}

/* Hide other S3D UX buttons by default to prevent flash; JS will add body classes to allow them */
body:not(.s3dux-allow-borders) #s3dux-borders {
  display: none !important;
}

body:not(.s3dux-allow-circle) #s3dux-circle {
  display: none !important;
}

body:not(.s3dux-allow-square) #s3dux-square2 {
  display: none !important;
}

body:not(.s3dux-allow-square1) #s3dux-square1 {
  display: none !important;
}

body:not(.s3dux-allow-led) #s3dux-led-main {
  display: none !important;
}

body:not(.s3dux-allow-led) #s3dux-led-btn {
  display: none !important;
}

body:not(.s3dux-allow-play) #s3dux-play {
  display: none !important;
}

body:not(.s3dux-allow-special) #s3dux-special {
  display: none !important;
}

body:not(.s3dux-allow-texto) #s3dux-texto {
  display: none !important;
}

/* --- Floating Popup Buttons Highlight Customization --- */
/* Remove background button glow for floating popup buttons, keep only icon/text glow */
#s3dux-size-btn.s3dux-active,
#s3dux-pos-btn.s3dux-active,
#s3dux-thick-btn.s3dux-active,
#s3dux-led-btn.s3dux-active,
#s3dux-text-edit-btn.s3dux-active,
#s3dux-borders-color-btn.s3dux-active,
#s3dux-borders-color-btn-2.s3dux-active,
#s3dux-rfx-btn.s3dux-active,
#s3dux-watermark-run.s3dux-active,
#s3dux-watermark-color-btn.s3dux-active,
#s3dux-watermark-import.s3dux-active,
#s3dux-importestampa-btn.s3dux-active,
#s3dux-scene-bg-run.s3dux-active,
#s3dux-size-group.s3dux-active,
#s3dux-pos-group.s3dux-active,
#s3dux-text-fonts-btn.s3dux-active,
#s3dux-text-edit-btn.s3dux-active,
#s3dux-size-btn.s3dux-active,
#s3dux-pos-btn.s3dux-active,
#s3dux-thick-btn.s3dux-active,
#s3dux-led-btn.s3dux-active,
#s3dux-rfx-btn.s3dux-active {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  transform: none !important;
  /* prevent lift effect since no box */
}

/* Group 1: Icons that need NO INVERSION (already correct color) -> Just apply glow */
#s3dux-size-btn.s3dux-active .s3dux-icon-wrap img,
#s3dux-pos-btn.s3dux-active .s3dux-icon-wrap img,
#s3dux-led-btn.s3dux-active .s3dux-icon-wrap img,
#s3dux-text-edit-btn.s3dux-active .s3dux-icon-wrap img,
#s3dux-borders-color-btn.s3dux-active .s3dux-icon-wrap img,
#s3dux-borders-color-btn-2.s3dux-active .s3dux-icon-wrap img,
#s3dux-size-btn.s3dux-active .s3dux-icon svg,
#s3dux-pos-btn.s3dux-active .s3dux-icon svg,
#s3dux-led-btn.s3dux-active .s3dux-icon svg,
#s3dux-text-edit-btn.s3dux-active .s3dux-icon svg,
#s3dux-borders-color-btn.s3dux-active .s3dux-color-swatch,
#s3dux-borders-color-btn-2.s3dux-active .s3dux-color-swatch,
#s3dux-watermark-color-btn.s3dux-active .s3dux-icon-wrap img,
#s3dux-watermark-color-btn.s3dux-active .s3dux-color-icon {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 1)) drop-shadow(0 0 10px rgba(255, 255, 255, 0.6)) !important;
  transform: scale(1.08) !important;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Ensure Reflexo icon is inverted by default (before activation) */
#s3dux-rfx-btn .s3dux-icon img,
#s3dux-rfx-btn .s3dux-icon-wrap img {
  filter: invert(1) brightness(1.2) !important;
  transition: filter 0.18s ease, transform 0.18s ease;
}

/* Group 2: Icons that usage INLINE INVERT (need to preserve it) -> Apply invert + glow */
#s3dux-size-btn.s3dux-size-btn--borders.s3dux-active .s3dux-icon-wrap img,
#s3dux-size-btn.s3dux-size-btn--borders.s3dux-active .s3dux-color-icon,
#s3dux-rfx-btn.s3dux-active .s3dux-icon img,
#s3dux-rfx-btn.s3dux-active .s3dux-icon-wrap img,
#s3dux-thick-btn.s3dux-active .s3dux-icon img,
#s3dux-thick-btn.s3dux-active .s3dux-icon-wrap img,
#s3dux-thick-btn.s3dux-active .s3dux-color-icon,
#s3dux-watermark-run.s3dux-active .s3dux-icon img,
#s3dux-watermark-import.s3dux-active .s3dux-icon img,
#s3dux-scene-bg-run.s3dux-active .s3dux-icon img,
#s3dux-size-group.s3dux-active .s3dux-icon img,
#s3dux-pos-group.s3dux-active .s3dux-icon img,
#s3dux-text-fonts-btn.s3dux-active .s3dux-icon img,
#s3dux-text-fonts-btn.s3dux-active .s3dux-color-icon {
  filter: invert(1) brightness(1.5) drop-shadow(0 0 5px rgba(255, 255, 255, 1)) drop-shadow(0 0 10px rgba(255, 255, 255, 0.6)) !important;
  transform: scale(1.08) !important;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

#s3dux-size-btn.s3dux-active .s3dux-label,
#s3dux-pos-btn.s3dux-active .s3dux-label,
#s3dux-thick-btn.s3dux-active .s3dux-label,
#s3dux-led-btn.s3dux-active .s3dux-label,
#s3dux-text-edit-btn.s3dux-active .s3dux-label,
#s3dux-borders-color-btn.s3dux-active .s3dux-label,
#s3dux-borders-color-btn-2.s3dux-active .s3dux-label,
#s3dux-rfx-btn.s3dux-active .s3dux-label,
#s3dux-watermark-run.s3dux-active .s3dux-label,
#s3dux-watermark-color-btn.s3dux-active .s3dux-label,
#s3dux-watermark-import.s3dux-active .s3dux-label,
#s3dux-scene-bg-run.s3dux-active .s3dux-label,
#s3dux-size-group.s3dux-active .s3dux-label,
#s3dux-pos-group.s3dux-active .s3dux-label,
#s3dux-text-fonts-btn.s3dux-active .s3dux-label {
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.95), 0 0 12px rgba(255, 255, 255, 0.5) !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Custom Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .4s;
  border-radius: 20px;
  border: 1px solid #555;
}

.slider:before {
  position: absolute;
  content: '';
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 2px;
  background-color: #ddd;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #2b6bff;
  border-color: #1f5fe6;
}

input:checked+.slider:before {
  transform: translateX(16px);
  background-color: #fff;
}

input:focus+.slider {
  box-shadow: 0 0 1px #2b6bff;
}

/* AR Mode Overrides - Fix camera occlusion */
body.ar-mode-active,
body.ar-mode-active #main-container,
body.ar-mode-active canvas {
  background: transparent !important;
}

/* Ensure UI elements that shouldn't block view are handled via existing visibility controls */

/* Force visibility for AR elements even in BOSS HIDDEN mode */
body.boss-hidden #ar-error-popup,
body.boss-hidden #ar-popup,
body.boss-hidden #ar-hint {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* AR Mode: Move Boss Banner content to Left, keep banner full width */
body.ar-mode-active .boss-banner {
  width: calc(100% + 20px) !important;
  max-width: none !important;
  left: -10px !important;
  right: 0 !important;
  top: 0 !important;
  height: 29px !important;
  transform: none !important;

  /* Align content (logo) to left */
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding-left: 20px !important;
  box-sizing: border-box !important;

  margin: 0 !important;
  transition: all 0.3s ease !important;
}

/* AR Instruction Overlay */
#ar-instruction-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  pointer-events: none;
  transition: opacity 0.5s;
}

.ar-instruction-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  animation: ar-phone-move 2.5s infinite ease-in-out;
  opacity: 0.9;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.ar-instruction-visual {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ar-instruction-ground {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: auto;
  height: 52px;
  max-width: 72px;
  object-fit: contain;
  display: block;
  transform: translateX(-50%);
  opacity: 0.95;
  filter: brightness(0) invert(1) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
}

.ar-instruction-phone {
  position: absolute;
  top: 2px;
  left: 50%;
  width: auto;
  height: 36px;
  max-width: 54px;
  object-fit: contain;
  display: block;
  transform: translateX(-50%);
  opacity: 0.98;
  filter: brightness(0) invert(1) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
  animation: ar-phone-surface-move 3.2s infinite ease-in-out;
}

.ar-instruction-text {
  color: white;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  text-align: center;
  max-width: 80%;
}

@keyframes ar-phone-move {
  0% {
    transform: translateX(-20px) rotate(-8deg);
  }

  50% {
    transform: translateX(20px) rotate(8deg);
  }

  100% {
    transform: translateX(-20px) rotate(-8deg);
  }
}

/* Ensure Instruction Overlay is visible in Hide Boss mode */
body.boss-hidden #ar-instruction-overlay {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none;
}

#ar-experimental-label {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 0, 0, 0.6);
  color: white;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  z-index: 999999 !important;
  pointer-events: none;
  font-family: sans-serif;
  letter-spacing: 1px;
}

/* Super Force Overlay */
html body.boss-hidden div#ar-instruction-overlay {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 999999 !important;
}

/* Ensure AR Error Popup is visible and interactive in Hide Boss mode */
html body.boss-hidden #ar-error-popup {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 9999999 !important;
  pointer-events: auto !important;
}

@keyframes ar-phone-surface-move {
  0% {
    transform: translateX(calc(-50% - 8px)) rotate(-4deg);
  }

  50% {
    transform: translateX(calc(-50% + 8px)) rotate(4deg);
  }

  100% {
    transform: translateX(calc(-50% - 8px)) rotate(-4deg);
  }
}