:root {
  --bg-primary: #0a0a0f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #00d4ff;
  --danger: #ff4466;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

#three-canvas {
  display: block;
  width: 600px;
  height: 600px;
  background: var(--bg-primary);
}

/* --- Top overlay: current model name --- */
.overlay-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-md);
  pointer-events: none;
}
#model-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overlay-meta {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* --- Bottom-left hint --- */
.overlay-hint {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  pointer-events: none;
}
.hint-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--text-primary);
  font-weight: 600;
}
.hint-label { margin-left: 4px; }

/* --- FPS counter --- */
.overlay-fps {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 10px;
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* --- Centered status overlays (loading / error) --- */
.overlay-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  background: rgba(10, 10, 15, 0.7);
  text-align: center;
}
.overlay-center.hidden { display: none; }

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 15px;
  color: var(--text-secondary);
}

.error-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 68, 102, 0.15);
  color: var(--danger);
  font-size: 32px;
  font-weight: 700;
}
.error-message {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 480px;
}

.hidden { display: none !important; }
