html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #111;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#viewer {
  position: fixed;
  inset: 0;
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  background: #111;
  z-index: 30;
  transition: opacity .3s ease;
}
#loading.hidden {
  opacity: 0;
  pointer-events: none;
}

#panel {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  padding: 6px;
}

#textureInput {
  display: none;
}

.sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.icon-btn.toggle.active {
  background: #fff;
  color: #111;
}
.icon-btn.toggle.active:hover {
  background: #fff;
  color: #111;
}

/* Tooltips propios: aparecen al instante (sin el delay del title nativo del navegador) */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: rgba(15, 15, 15, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .08s linear, transform .08s linear;
  z-index: 50;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  #panel { bottom: 16px; }
}