/* ============================================================
   conway.css - layout for the simulation page.
   Mirrors topo.css: canvas left, docked sidebar right.
   All controls come from ui.css so the two pages match.
   ============================================================ */

body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.work {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
}

/* Collapsing the panel hands the whole viewport to the board. */
.work.is-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.work.is-collapsed .side {
  display: none;
}

.stage {
  position: relative;
  min-width: 0;
  background: var(--canvas-void);
}

#c {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
}

.tip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 5;
  padding: 4px 9px;
  border: 1px solid var(--rule-2);
  background: var(--surface);
  box-shadow: var(--bevel);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-mid);
  text-transform: uppercase;
  user-select: none;
}

/* ---------- sidebar --------------------------------------- */

.side {
  min-height: 0;
  border-left: 1px solid var(--rule-2);
  background: var(--surface);
  overflow-y: auto;
}

/* ---------- key legend ------------------------------------ */

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 9px;
  align-items: center;
}

.keys dd {
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  color: var(--dim);
}

/* ---------- narrow ---------------------------------------- */

@media (max-width: 860px) {
  .work {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(220px, 1fr) auto;
    overflow-y: auto;
  }

  .work.is-collapsed {
    grid-template-rows: minmax(0, 1fr);
  }

  .side {
    border-left: 0;
    border-top: 1px solid var(--rule-2);
    overflow: visible;
  }

  .bar__seg--hide {
    display: none;
  }

  .tip {
    display: none;
  }
}
