#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, #092057 0%, #090f23 100%);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.3s ease;
}
#loadingOverlay::before {
  /* 3D Ground Grid */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(123, 147, 232, 0.2) 0.5px, transparent 0.5px),
    linear-gradient(90deg, rgba(123, 147, 232, 0.2) 0.5px, transparent 0.5px);
  background-size: 50px 50px;
  background-position: center center;
  transform: perspective(500px) rotateX(60deg) scale(2.5);
  transform-origin: center center;
  opacity: 0.8;
  pointer-events: none;
  animation: grid-drift 60s linear infinite;
}
@keyframes grid-drift {
  0% {
    background-position: center 0;
  }
  100% {
    background-position: center 1000px;
  }
}
.loading-container {
  color: #fff;
  font-size: 24px;
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  text-align: center;
}
.loading-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.wireframe-cage {
  position: absolute;
  width: 320px;
  height: 320px;
  transform-origin: center center;
  animation: spin-cage 25s linear infinite;
  opacity: 0.65;
  z-index: 0;
  pointer-events: none;
}
@keyframes spin-cage {
  0% {
    transform: rotate(0deg) scale(0.9);
  }
  50% {
    transform: rotate(180deg) scale(1.04);
  }
  100% {
    transform: rotate(360deg) scale(0.9);
  }
}
.logo-container-svg {
  position: relative;
  width: 300px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.brand-logo-svg {
  width: 100%;
  height: auto;
}
.loading-title {
  font-size: 26px;
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  font-weight: 700;
  margin-top: 120px; /* Push down below the bottom vertices of the rotating cube. */
  color: rgba(255, 255, 255, 0.75);
}
.loading-download {
  display: none;
  margin-top: 16px;
  opacity: 0.6;
}
.loading-download-label {
  font-size: 16px;
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  font-weight: 400;
}
.loading-download-file {
  font-size: 16px;
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  font-weight: 400;
}
#dropOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
  pointer-events: none;
  align-items: center;
  justify-content: center;
}
.drop-message {
  color: #fff;
  font-size: 24px;
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  padding: 32px 48px;
  border: 3px dashed #fff;
  border-radius: 16px;
}
#commitHash {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 1;
  font-family: monospace;
  font-size: 7pt;
  color: #fff;
  mix-blend-mode: difference;
  user-select: all;
}
#canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}

/* --- Floating model selector toolbar (top-left) --- */
#modelBar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(10, 16, 32, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(123, 147, 232, 0.25);
  border-radius: 10px;
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  color: #e8ecff;
  user-select: none;
}
#modelBar label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.7;
  letter-spacing: 0.02em;
}
.modelBar-arrow {
  font-size: 16px;
  opacity: 0.5;
  line-height: 1;
}
#modelBar select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(20, 28, 48, 0.9);
  color: #e8ecff;
  border: 1px solid rgba(123, 147, 232, 0.4);
  border-radius: 6px;
  padding: 5px 28px 5px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23e8ecff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#modelBar select:hover {
  border-color: rgba(0, 245, 212, 0.6);
}
#modelBar select:focus {
  border-color: #00f5d4;
  box-shadow: 0 0 0 2px rgba(0, 245, 212, 0.2);
}
#modelBar select option {
  background: #141c30;
  color: #e8ecff;
}
#categorySelect {
  min-width: 130px;
}
#modelSelect {
  min-width: 150px;
}
