/* The globe (web/js/globe). Classes are prefixed g-; colours come from core's custom properties.
   The canvas is drawn by WebGL with its own palette, so only the surrounding chrome is styled here. */

.g-root {
  position: absolute;
  inset: 0;
}

.g-globe {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font);
  border-radius: inherit;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.g-globe:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.g-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.g-canvas:active {
  cursor: grabbing;
}

.g-canvas.g-over {
  cursor: pointer;
}

.g-controls {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--target);
  height: var(--target);
  padding: 0;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.g-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.g-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.g-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  max-width: min(20rem, 80%);
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  pointer-events: none;
  will-change: transform;
}

.g-tooltip[hidden] {
  display: none;
}

/* Visually hidden, still read by screen readers (the text alternative of the canvas). */
.g-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .g-btn {
    transition: none;
  }
}
