/* TrimPreview.css — preview 3D armor trim ala minetrim.com (CSS 3D, tanpa WebGL) */

.trim-preview {
  margin-top: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.trim-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.trim-preview__viewport {
  position: relative;
  height: 300px;
  background: radial-gradient(ellipse at 50% 18%, rgba(45,212,191,0.14), transparent 55%),
              radial-gradient(ellipse at 80% 82%, rgba(180,140,242,0.10), transparent 50%),
              var(--canvas-bg, #0a0e16);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
  perspective: 760px;
  perspective-origin: 50% 42%;
}

.trim-preview__viewport:active { cursor: grabbing; }

.trim-preview__scene {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.trim-preview__hint {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: rgba(236,231,219,0.55);
  background: rgba(0,0,0,0.35);
  padding: 3px 6px;
  border-radius: 999px;
  pointer-events: none;
}

/* ── Model pemain (CSS cubes) ── */
.player {
  position: absolute;
  left: 0; top: 0;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%);
}

.part {
  position: absolute;
  transform-style: preserve-3d;
}

.face {
  position: absolute;
  transform-style: preserve-3d;
  box-sizing: border-box;
}

.face-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-sizing: border-box;
  backface-visibility: hidden;
}

.armor-layer { opacity: 1; }
.trim-layer { opacity: 0.96; mix-blend-mode: normal; }

/* ── Controls ── */
.trim-preview__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  align-items: center;
}

.trim-preview__btn,
.trim-preview__file-label {
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
}

.trim-preview__btn--active {
  background: color-mix(in srgb, var(--accent-teal) 22%, var(--bg-surface-2));
  border-color: var(--accent-teal);
  color: var(--text-primary);
}

.trim-preview__file-input { display: none; }

.trim-preview__meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: auto;
}
