*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0a0a0f;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
}

canvas {
  cursor: grab;
  display: block;
}
canvas.dragging { cursor: grabbing; }

#nav-controls {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: 48px 48px 48px;
  grid-template-rows: 48px 48px 48px;
  grid-template-areas:
    ". top ."
    "lft mid rgt"
    ". bot .";
  gap: 6px;
  user-select: none;
}

#zoom-level {
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
}


.zoom-btn {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.55);
  color: rgba(255,255,255,1);
  font-family: inherit;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  width: 48px;
  height: 48px;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 6px;
}
.zoom-btn:hover {
  background: rgba(255,255,255,0.38);
  border-color: rgba(255,255,255,0.9);
}
.zoom-btn:active {
  background: rgba(255,255,255,0.55);
}

#hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.25);
  font-size: 11px;
  letter-spacing: 0.08em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

#loading {
  position: fixed;
  inset: 0;
  background: #0a0a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  letter-spacing: 0.1em;
  transition: opacity 0.8s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
#loading-bar {
  width: 200px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  position: relative;
}
#loading-bar::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(255,255,255,0.5);
  width: var(--p, 0%);
  transition: width 0.3s;
}

#reset-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.95);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 4px;
}
#reset-btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.9);
}
