:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #d8e5ee;
  color: #132026;
}

* {
  box-sizing: border-box;
}

html,
body,
#scene-wrap {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  touch-action: none;
}

#taj-scene {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hud {
  position: fixed;
  left: clamp(12px, 2.6vw, 30px);
  right: clamp(12px, 2.6vw, 30px);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.hud.top {
  top: max(14px, env(safe-area-inset-top));
}

.hud.bottom {
  bottom: max(14px, env(safe-area-inset-bottom));
  justify-content: center;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4.2vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 2px 18px rgba(255, 255, 255, 0.72);
}

p {
  max-width: min(620px, 76vw);
  margin: 9px 0 0;
  color: rgba(19, 32, 38, 0.78);
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.4;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.86);
}

.mode,
#recenter,
.hud.bottom span {
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(245, 249, 248, 0.66);
  box-shadow: 0 10px 32px rgba(26, 37, 43, 0.16);
  backdrop-filter: blur(14px);
}

.mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 158px;
  padding: 4px;
  border-radius: 8px;
  pointer-events: auto;
}

button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  color: #132026;
  background: transparent;
  font: 700 13px/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

button.active {
  color: #f7fbfb;
  background: #255466;
}

#recenter {
  position: fixed;
  right: clamp(12px, 2.6vw, 30px);
  bottom: calc(max(60px, env(safe-area-inset-bottom)) + 28px);
  z-index: 4;
  padding: 0 14px;
}

.hud.bottom span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  color: rgba(19, 32, 38, 0.82);
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  color: #132026;
  background: #d8e5ee;
  font-weight: 800;
  transition: opacity 260ms ease;
}

#loading.done {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 720px) {
  .hud.top {
    align-items: flex-start;
  }

  p {
    max-width: 58vw;
  }

  .mode {
    min-width: 126px;
  }

  .hud.bottom {
    display: none;
  }

  #recenter {
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}
