:root {
  --ink: #1f2933;
  --muted: #657987;
  --teal: #008b93;
  --line: rgba(0, 139, 147, 0.18);
}

* {
  box-sizing: border-box;
}

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

body[data-mode="compare"] {
  background: #eef6ff;
}

body[data-mode="overlay"] {
  color: #effefe;
  background: #081a1d;
}

#renderCanvas {
  width: 100vw;
  height: 100vh;
  display: block;
  outline: none;
  touch-action: none;
}

.mode-topbar {
  position: fixed;
  z-index: 10;
  top: 18px;
  left: 18px;
  right: 18px;
  min-height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(21, 70, 80, 0.14);
}

body[data-mode="compare"] .mode-topbar,
body[data-mode="compare"] .mode-hud,
body[data-mode="compare"] .xr-actions {
  border-color: rgba(0, 98, 170, 0.18);
  background: rgba(247, 252, 255, 0.88);
  box-shadow: 0 18px 54px rgba(18, 72, 120, 0.16);
}

body[data-mode="overlay"] .mode-topbar,
body[data-mode="overlay"] .mode-hud,
body[data-mode="overlay"] .xr-actions {
  border-color: rgba(0, 226, 232, 0.34);
  background: rgba(5, 28, 31, 0.78);
  box-shadow: 0 18px 54px rgba(0, 225, 232, 0.12);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-link img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.mode-title p,
.mode-hud p {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.mode-title h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
}

.mode-tabs {
  display: flex;
  gap: 7px;
}

.mode-tabs a {
  height: 36px;
  min-width: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #536977;
  background: rgba(0, 139, 147, 0.08);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.mode-tabs a.is-active,
.mode-tabs a:hover {
  color: #fff;
  background: var(--teal);
}

body[data-mode="compare"] .mode-tabs a.is-active,
body[data-mode="compare"] .mode-tabs a:hover {
  color: #fff;
  background: #176aa6;
}

body[data-mode="overlay"] .mode-tabs a {
  color: #b6d9dc;
  background: rgba(0, 226, 232, 0.1);
}

body[data-mode="overlay"] .mode-tabs a.is-active,
body[data-mode="overlay"] .mode-tabs a:hover {
  color: #061719;
  background: #00e2e8;
}

.mode-hud {
  position: fixed;
  z-index: 10;
  left: 18px;
  bottom: 18px;
  width: min(405px, calc(100vw - 36px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(21, 70, 80, 0.14);
}

.mode-hud h2 {
  margin: 0 0 8px;
  font-size: 25px;
  line-height: 1.05;
}

.mode-hud span {
  color: #4a5f6d;
  font-size: 14px;
  line-height: 1.45;
}

body[data-mode="overlay"] .mode-title p,
body[data-mode="overlay"] .mode-hud p,
body[data-mode="overlay"] .brand-link {
  color: #00e2e8;
}

body[data-mode="overlay"] .mode-hud span {
  color: #bbd9dc;
}

body[data-mode="compare"] .mode-title p,
body[data-mode="compare"] .mode-hud p,
body[data-mode="compare"] .brand-link {
  color: #176aa6;
}

.xr-actions {
  position: fixed;
  z-index: 12;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(21, 70, 80, 0.14);
}

.xr-actions button {
  height: 38px;
  min-width: 52px;
  border: 0;
  border-radius: 7px;
  color: #536977;
  background: rgba(0, 139, 147, 0.08);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.xr-actions button:hover {
  color: #fff;
  background: var(--teal);
}

body[data-mode="compare"] .xr-actions button:hover {
  background: #176aa6;
}

body[data-mode="overlay"] .xr-actions button {
  color: #b6d9dc;
  background: rgba(0, 226, 232, 0.1);
}

body[data-mode="overlay"] .xr-actions button:hover {
  color: #061719;
  background: #00e2e8;
}

@media (max-width: 820px) {
  .mode-topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .mode-tabs {
    overflow-x: auto;
  }
}
