/* Realistic weapon renders (weapon-models.js) and the 3D inspect view (weapon-viewer.js). */

.weapon-render {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.result-art .weapon-render,
.inspect-main-art .weapon-render {
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
}

/* 3D inspect: the art box grows into a stage you can drag around in. The inspect box otherwise
   shrinks to fit its contents, so give it a real width while the stage is showing. */
#inspect-modal-content:has(.inspect-main-art.has-3d) {
  width: min(650px, calc(100vw - 32px));
}

.inspect-main-art.has-3d {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 8px 0 16px;
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 55%, rgba(148, 163, 184, 0.12), transparent 70%);
  cursor: grab;
}

.inspect-main-art.has-3d:active {
  cursor: grabbing;
}

.inspect-main-art.has-3d .weapon-render {
  display: none;
}

.inspect-main-art.has-3d.is-loading .weapon-render {
  display: block;
  width: 320px;
  opacity: 0.55;
}

.inspect-main-art.is-loading::after {
  content: 'Loading 3D…';
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(226, 232, 240, 0.75);
}

.weapon-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

.weapon-3d-hint {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: rgba(226, 232, 240, 0.8);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.weapon-3d-hint.gone {
  opacity: 0;
}

@media (max-width: 600px) {
  .inspect-main-art.has-3d {
    height: 220px;
  }
  .weapon-3d-hint {
    font-size: 10px;
  }
}
