body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 16%, rgba(242, 238, 229, 0.2), transparent 30%),
    linear-gradient(180deg, #b6beb7 0%, #97a09a 42%, #787f79 100%);
  font-family: "Arial", "Helvetica Neue", Helvetica, sans-serif;
}

#webcam,
#overlay,
#three-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#webcam {
  z-index: 0;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0.82;
  filter: grayscale(10%) contrast(1.03) brightness(1.04);
}

#overlay {
  z-index: 1;
  pointer-events: none;
}

#three-container {
  z-index: 2;
  cursor: crosshair;
}

#instructions,
#searchPanel,
#statusBox,
#infoBox {
  position: absolute;
  z-index: 3;
  color: #1f241f;
  background: rgba(245, 243, 236, 0.84);
  border: 2px solid #1f241f;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(4px);
}

#instructions {
  top: 12px;
  left: 12px;
  max-width: 260px;
}

#instructions .header {
  padding: 8px 10px;
  border-bottom: 2px solid #1f241f;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
}

#instructions .content {
  padding: 10px;
  font-size: 13px;
  line-height: 1.5;
}

#searchPanel {
  top: 172px;
  left: 12px;
  width: 260px;
  padding: 10px;
}

#searchPanel label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

#boneSearch {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 9px;
  color: #1f241f;
  background: rgba(255, 253, 246, 0.92);
  border: 2px solid #1f241f;
  border-radius: 0;
  font: inherit;
  font-size: 13px;
  outline: none;
}

#boneSearch:focus {
  box-shadow: 0 0 0 2px rgba(129, 233, 144, 0.75);
}

#searchResults {
  margin-top: 8px;
  max-height: 190px;
  overflow-y: auto;
  font-size: 12px;
}

#searchResults.empty {
  opacity: 0.72;
  line-height: 1.4;
}

.search-result {
  width: 100%;
  margin: 0 0 6px;
  padding: 7px 8px;
  color: #1f241f;
  background: rgba(255, 253, 246, 0.72);
  border: 1px solid rgba(31, 36, 31, 0.42);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.search-result:hover,
.search-result:focus {
  background: #f3e29c;
  outline: none;
}

.search-title {
  display: block;
  font-weight: bold;
}

.search-meta {
  display: block;
  margin-top: 2px;
  opacity: 0.7;
  font-size: 11px;
}

#statusBox {
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  font-size: 13px;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#statusBox.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(31, 36, 31, 0.25);
  border-top-color: #1f241f;
  border-radius: 50%;
  flex: 0 0 auto;
  animation: status-spin 0.8s linear infinite;
}

@keyframes status-spin {
  to {
    transform: rotate(360deg);
  }
}

#infoBox {
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  min-width: 240px;
  max-width: 320px;
  padding: 12px;
  text-align: left;
  transition: opacity 0.2s ease;
}

.info-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.info-pinned {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 7px;
  color: #1f241f;
  background: #f3e29c;
  border: 1px solid #1f241f;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.info-region {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 7px;
  color: #f7f3e8;
  background: #1f241f;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.info-description {
  font-size: 13px;
  line-height: 1.45;
}

.info-model-name {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(31, 36, 31, 0.3);
  font-size: 11px;
  opacity: 0.72;
}

#infoBox.hidden {
  opacity: 0;
  pointer-events: none;
}
