/* atlas.css -- the viewer: stage on the left, readout on the right. */

html, body { height: 100%; }

body.atlas {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

main.atlas {
  flex: 1;
  min-height: 0;
  display: flex;
}

#stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#port {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  cursor: grab;
  touch-action: none;
}

#port.grabbing { cursor: grabbing; }

#paper {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

#view {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  user-select: none;
  -webkit-user-drag: none;
}

.stage-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: var(--faint);
  font: 14px/1.6 var(--mono);
  background: var(--bg);
  pointer-events: none;
}

.stage-note[hidden] { display: none; }

.zoom {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.zoom button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--rule);
  background: rgba(12, 13, 18, 0.9);
  color: var(--ink);
  font: 16px/1 var(--mono);
  cursor: pointer;
}

.zoom button:hover { border-color: var(--gold); }
.zoom button.wide { width: auto; padding: 0 10px; font-size: 12px; }

#minimap {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  border: 1px solid var(--rule);
  background: #000;
  cursor: crosshair;
  line-height: 0;
}

#minimap canvas { display: block; }

#profile {
  position: relative;
  height: 72px;
  flex: 0 0 auto;
  border-top: 1px solid var(--rule);
  background: var(--panel);
}

#profile canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

#profile-tip {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border: 1px solid var(--rule);
  background: rgba(7, 7, 10, 0.94);
  color: var(--body);
  font: 12px/1.5 var(--mono);
  white-space: nowrap;
  pointer-events: none;
}

#profile-tip[hidden] { display: none; }

#panel {
  flex: 0 0 308px;
  overflow-y: auto;
  border-left: 1px solid var(--rule);
  background: var(--panel);
  padding: 18px 20px 28px;
}

#panel h3 {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 26px 0 10px;
  font-weight: 600;
}

.views { display: flex; gap: 6px; }

.views button {
  flex: 1;
  border: 1px solid var(--rule);
  background: var(--panel-2);
  color: var(--body);
  padding: 8px 0;
  font: 13px/1 var(--font);
  cursor: pointer;
}

.views button[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--ink);
  background: #191a22;
}

.views button:disabled { opacity: 0.35; cursor: default; }

dl.readout { margin: 18px 0 0; font-size: 13px; }
dl.readout > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
dl.readout dt { color: var(--faint); white-space: nowrap; }
dl.readout dd { margin: 0; text-align: right; color: var(--ink); font-family: var(--mono); font-size: 12px; }

.swatches {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.swatches span {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  font: 17px/1 "Noto Naskh Arabic", "Segoe UI", serif;
  color: #fff;
  border-radius: 1px;
}

.fine { font-size: 12px; line-height: 1.5; color: var(--faint); margin: 18px 0 0; max-width: none; }

@media (max-width: 820px) {
  body.atlas { overflow: auto; }
  main.atlas { flex-direction: column; }
  #stage { flex: none; }
  #port { height: 62vh; flex: none; }
  #panel { flex: none; border-left: 0; border-top: 1px solid var(--rule); }
}
