/* view.css -- the shareable, read-only page.
 *
 * The board's three-column grid pins 250px side panels either side of the
 * map, so browser zoom shrinks the CSS viewport, the panels hold their width
 * and the map absorbs the whole loss: zooming in makes the map smaller. This
 * page has no side columns. The map takes the viewport, so zoom does what it
 * says, and a pan/zoom of its own sits on top for reading it on a phone. */

.view {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viewbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.viewbar h1 { font-size: 16px; white-space: nowrap; }

.viewtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.viewtab {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.viewtab:hover { border-color: var(--faint); }
.viewtab[aria-selected="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: #eef6f9;
}

/* The map gets everything that is left, and the pan/zoom transform rides on
   the inner wrapper so the plan itself never has to be re-laid-out. */
.viewer {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #e4e9ef;
  touch-action: none;
  cursor: grab;
}
.viewer.is-panning { cursor: grabbing; }

.viewer__inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-origin: 0 0;
  padding: 10px;
}

.view .plan {
  aspect-ratio: 1088 / 788;
  height: 100%;
  width: auto;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.zoomer {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px;
  box-shadow: var(--shadow);
}
.zoomer button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  min-width: 32px;
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.zoomer button:hover { background: #eef1f5; color: var(--ink); }
#zoom-reset { font-size: 12.5px; }

.viewfoot {
  margin: 0;
  padding: 7px 16px;
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border-top: 1px solid var(--line);
}

/* Nothing here is editable, so nothing should invite a click. */
.view .cell__head,
.view .chip { cursor: default; pointer-events: none; }
.view .room-shape { cursor: default; }
.view .room-shape:hover { fill: var(--room); }
.view .room-shape.is-filled:hover { fill: #f3f8fa; }

@media (max-width: 620px) {
  .viewbar { gap: 10px; padding: 9px 12px; }
  .viewbar h1 { font-size: 15px; }
  .viewtab { padding: 5px 10px; font-size: 12.5px; }
}

@media print {
  .view { height: auto; display: block; }
  .viewbar, .zoomer, .viewfoot { display: none; }
  .viewer { overflow: visible; height: auto; }
  .viewer__inner { position: static; transform: none !important; }
}
