/* The Fourth Dimension, part 1 — styles for the wonders8.js exhibits (the
   Flatland On-Ramp and the Analogy Ladder). Prefix .f4- so it can never collide
   with the other wing files (.nt-, .nz-, .nc- and .nb2- are taken).
   Reuses the .wx-* vocabulary from screens.css; only adds what is new, and
   never restyles a .wx-* rule — those belong to screens.css and reshaping them
   from here would silently move every other wing. */

/* ---------------------------------------------------------- the split stage
   #wx-body is a fixed-height flex column with NO scroll container, so this row
   must claim the middle and the prose below must scroll inside itself. Without
   min-height:0 a tall canvas refuses to shrink and pushes the readout off the
   bottom of the screen. */
.f4-split { flex: 1; display: flex; gap: 12px; min-height: 0; min-width: 0; position: relative; }
.f4-flat, .f4-stage {
  flex: 1; min-width: 0; min-height: 0;
  border-radius: 12px; border: 1px solid var(--line); background: #0d1019;
}
.f4-stage { position: relative; overflow: hidden; }
.f4-gone { display: none !important; }
@media (max-width: 1120px) { .f4-split { flex-direction: column; } }

/* the w-axis inset: a fixed object sliding past our slice, drawn over the 3D
   stage. Without it a hypersphere passing through is indistinguishable from a
   sphere being scaled, and chapter 4 — the hinge of the whole wing — lands flat */
.f4-inset {
  position: absolute; right: 10px; bottom: 10px;
  width: 210px; height: 66px; pointer-events: none;
  border-radius: 8px; background: rgba(13, 16, 25, 0.82); border: 1px solid var(--line);
}

/* ---------------------------------------------------------- the narration
   Reserved height so text appearing never re-squashes the stage, and its own
   scroller so a long chapter can never evict the picture. */
.f4-say {
  flex-shrink: 0; min-height: 4.8em; max-height: 30%;
  overflow-y: auto; overflow-x: hidden;
  padding: 10px 2px 0; font-size: 14px; line-height: 1.58; color: var(--tx1);
}
.f4-say b { color: var(--tx0); }
.f4-say em { color: var(--tx0); font-style: normal; border-bottom: 1px dotted var(--tx2); }
.f4-say .f4-num { color: var(--gold); font: 600 15px/1 Consolas, monospace; }
.f4-say .f4-good { color: var(--good); }
.f4-say p { margin: 0 0 7px; }
.f4-say p:last-child { margin-bottom: 0; }

/* the standing honesty note. A class in the layout survives a rewrite in a way
   a sentence in the prose does not — which is the point of putting it here. */
.f4-honest {
  display: inline-block; margin-left: 2px; padding: 3px 9px; border-radius: 20px;
  font: 600 10.5px/1 Consolas, monospace; letter-spacing: .1em; text-transform: uppercase;
  color: var(--acc2); background: #f0a35e18; border: 1px solid #f0a35e55;
}

/* ---------------------------------------------------------- chapter rail */
.f4-chap { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.f4-chap button { min-width: 38px; padding: 6px 9px; font-size: 13px; }
.f4-chap button.on { background: #24406030; border-color: var(--acc); color: #cfe8ff; }
.f4-chap .f4-done { color: var(--good); }
.f4-title { color: var(--tx0); font-size: 14px; font-weight: 600; }

/* ---------------------------------------------------------- counts table */
.f4-tab {
  flex-shrink: 0; overflow-x: auto; padding: 8px 0 2px;
}
.f4-tab table { border-collapse: collapse; font-size: 13px; min-width: 400px; }
.f4-tab th, .f4-tab td {
  padding: 4px 12px 4px 0; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--tx1);
}
.f4-tab th {
  font: 600 10.5px/1 Consolas, monospace; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tx2); border-bottom: 1px solid var(--line); padding-bottom: 7px;
}
.f4-tab td.f4-name { text-align: left; color: var(--tx1); padding-right: 20px; }
.f4-tab tr.on td { color: var(--tx0); font-weight: 600; }
.f4-tab tr.on td.f4-name { color: var(--gold); }
.f4-tab td.f4-lit { color: var(--gold); }
.f4-tab td.f4-zero { color: #3a4260; }

/* ---------------------------------------------------------- touch sizing */
@media (pointer: coarse) {
  .f4-chap button { min-height: 44px; }
  .f4-say { max-height: 34%; }
}
