html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #111;
  color: #eee;
  height: 100%;
  overflow: hidden;
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
}

/* Main */
.wrap {
  display: flex;
  width: 100vw;
  flex-grow: 1;
  position: relative;
}

.dropzone {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.dropzone.viewer-active {
  justify-content: flex-start;
}

.dropzone.drag-over::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(68, 170, 255, 0.08);
  border: 2px dashed rgba(68, 170, 255, 0.4);
  z-index: 50;
  pointer-events: none;
}

/* Placeholder */
.placeholder {
  text-align: center;
  padding: 3em;
}

.placeholder-icon {
  color: #444;
  margin-bottom: 1.5em;
}

.placeholder-title {
  font-size: 1.2rem;
  color: #888;
  margin: 0 0 0.3em;
}

.placeholder-formats {
  font-size: 0.85rem;
  color: #555;
  font-family: monospace;
  margin: 0;
}

/* Upload */
.upload-btn {
  margin-top: 1.5em;
}

.upload-btn input {
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

.upload-btn label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: #aaa;
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0.5em 1.2em;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.upload-btn label:hover {
  background: #2a2a2a;
  border-color: #4af;
  color: #ddd;
}

/* Viewer container */
.viewer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

/* GUI overrides */
.gui-wrap {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 20;
}

.gui-wrap > div {
  pointer-events: all;
  max-height: 100%;
  overflow-y: auto;
}

/* Info bar */
#info-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: #1a1a1a;
  border-top: 1px solid #252525;
  display: flex;
  align-items: center;
  padding: 0 1em;
  font-size: 0.75rem;
  color: #666;
  z-index: 100;
}

#info-bar:empty { display: none; }

/* UV Preview panel */
.uv-preview {
  position: absolute;
  bottom: 40px;
  left: 12px;
  z-index: 30;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
  display: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.uv-preview.visible {
  display: block;
}

.uv-preview canvas {
  display: block;
  width: 256px;
  height: 256px;
}

.uv-preview-label {
  text-align: center;
  font-size: 0.7rem;
  color: #666;
  padding: 4px 0;
  background: #151515;
}

/* GUI info hint */
.gui-info {
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
}

.texture-drop-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: #888;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -20px;
  background-color: #4af;
  border-radius: 100%;
  animation: sk-scaleout 1.0s infinite ease-in-out;
  z-index: 200;
}

@keyframes sk-scaleout {
  0% { transform: scale(0); }
  100% { transform: scale(1.0); opacity: 0; }
}

/* Axes helper */
.axes {
  width: 100px;
  height: 100px;
  position: absolute;
  left: 12px;
  bottom: 40px;
  z-index: 10;
  pointer-events: none;
}
