:root {
  --glass: rgba(12, 10, 9, 0.74);
  --glass-strong: rgba(12, 10, 9, 0.9);
  --line: rgba(255, 255, 255, 0.16);
  --text: #fff9ef;
  --muted: #d7cabb;
  --gold: #c7a45d;
  --green: #58c783;
  --orange: #f19b4a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050505;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#ar-root {
  position: fixed;
  inset: 0;
  touch-action: none;
}

.hud,
.info-panel,
.hotspot-bar,
.mini-dock,
.loading-screen {
  position: fixed;
  z-index: 10;
}

.top-hud {
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 11;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  pointer-events: none;
}

.icon-link,
.tracking-badge,
.title-block,
.info-panel,
.mini-dock,
.hotspot-bar {
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(14px);
}

.icon-link {
  pointer-events: auto;
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  font-size: 13px;
}

.title-block {
  justify-self: start;
  min-width: 160px;
  padding: 9px 12px;
}

.title-block span {
  display: block;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.title-block strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
}

.tracking-badge {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tracking-badge.searching {
  color: #140d07;
  background: var(--orange);
}

.tracking-badge.locked {
  color: #06150b;
  background: var(--green);
}

.info-panel {
  top: 82px;
  left: 16px;
  width: min(220px, calc(100vw - 32px));
  max-height: 118px;
  overflow: auto;
  padding: 8px 9px;
  background: rgba(12, 10, 9, 0.42);
  opacity: 0.72;
  transform: translateY(0);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.info-panel:focus-within,
.info-panel:hover {
  opacity: 0.96;
}

.info-panel.collapsed {
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
}

.close-button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.panel-kicker {
  margin: 0 28px 5px 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.info-panel h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
}

.info-panel p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  line-height: 1.28;
}

.hotspot-bar {
  left: 50%;
  bottom: 18px;
  width: min(860px, calc(100vw - 24px));
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.hotspot-bar button {
  flex: 0 0 auto;
  min-width: 104px;
  min-height: 32px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.hotspot-bar button.active {
  color: #1b1309;
  background: var(--gold);
}

.mini-dock {
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 6px;
  padding: 6px;
}

.mini-dock button,
.mini-dock a {
  min-height: 32px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 8px;
  text-decoration: none;
}

.model-variant-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-right: 4px;
  border-right: 1px solid rgba(255, 250, 241, 0.28);
}

.mini-dock button.active,
.mini-dock a.active {
  background: var(--gold);
  color: #1b1309;
}

.loading-screen {
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, rgba(90, 72, 48, 0.75), rgba(5, 5, 5, 0.96) 58%);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-screen div {
  max-width: 420px;
  text-align: center;
}

.loading-screen h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 8vw, 68px);
  font-weight: 500;
}

.loading-screen p {
  color: var(--muted);
  line-height: 1.5;
}

.start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  margin: 8px auto 18px;
  padding: 11px 18px;
  border: 1px solid var(--gold);
  color: #1b1309;
  background: var(--gold);
  font-weight: 800;
  cursor: pointer;
}

.camera-glyph {
  position: relative;
  width: 24px;
  height: 18px;
  display: inline-block;
  border: 2px solid #1b1309;
  border-radius: 3px;
}

.camera-glyph::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 4px;
  width: 8px;
  height: 5px;
  border: 2px solid #1b1309;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.camera-glyph::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 8px;
  width: 6px;
  height: 6px;
  border: 2px solid #1b1309;
  border-radius: 50%;
}

.start-button[disabled] {
  cursor: wait;
  opacity: 0.7;
}

.version-note {
  display: block;
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.error-details {
  max-width: min(680px, calc(100vw - 32px));
  max-height: 170px;
  margin: 8px auto 16px;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(255, 120, 120, 0.38);
  color: #ffd8d8;
  background: rgba(90, 10, 10, 0.34);
  white-space: pre-wrap;
  text-align: left;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.loading-screen a {
  display: block;
  margin-top: 8px;
  color: var(--gold);
}

@media (max-width: 700px) {
  .top-hud {
    grid-template-columns: auto 1fr;
  }

  .tracking-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .hotspot-bar {
    bottom: 64px;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  .mini-dock {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    overflow-x: hidden;
    overflow-y: auto;
    flex-wrap: wrap;
  }

  .mini-dock > button,
  .mini-dock > a {
    flex: 0 0 auto;
  }

  .mini-dock .model-variant-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1 0 100%;
    width: 100%;
    padding: 0 0 6px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 250, 241, 0.28);
  }

  .mini-dock .model-variant {
    min-width: 0;
    white-space: normal;
  }
}
