/* Page shell: canvas, world, connector lines, title, hint bar */
* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Occasional shooting stars, behind everything - a night-sky touch that
   only suits the dark theme, so it stays hidden in light mode. */
#stars-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
html[data-theme="dark"] #stars-bg {
  opacity: 1;
}

#canvas-wrap {
  position: absolute; inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

/* #world has no intrinsic size of its own - every node inside it is
   position:absolute, so its own box is always 0x0/indeterminate. Its
   left/top:50% (percentages of canvas-wrap, always well-defined) place its
   origin at the canvas center; the camera then only ever applies a plain
   pixel translate + scale from there (see camera.js) - never a percentage
   of #world's own size (including the default 50% 50% transform-origin),
   since that can't reliably resolve against an indeterminate size. */
#world {
  position: absolute;
  left: 50%; top: 50%;
  transform-origin: 0 0;
  transition: transform 0.5s cubic-bezier(.22,1,.36,1);
  will-change: transform;
}

svg#lines {
  position: absolute;
  left: -20000px; top: -20000px;
  width: 40000px; height: 40000px;
  pointer-events: none;
  overflow: visible;
}
svg#lines path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
  transition: stroke 0.3s ease;
}

#hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#hint b { color: #555; font-weight: 600; }

#title {
  position: fixed;
  z-index: 10;
  top: 18px;
  left: 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--muted);
  pointer-events: none;
}

#credit {
  position: fixed;
  z-index: 10;
  bottom: 18px;
  left: 22px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
#credit a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
#credit a:hover {
  color: var(--text);
}
.credit-divider {
  margin: 0 2px;
  opacity: 0.6;
}
.coffee-link {
  text-decoration: none !important;
}
.coffee-link:hover {
  color: var(--gold-3) !important;
}
