/* The Fourth Dimension, part 2 — the six-polytope gallery (wonders9.js).
   Prefix .p4- (verified unused). Never restyles a .wx-* or .f4-* rule; those
   belong to screens.css and fourth.css respectively. */

/* ------------------------------------------------------------ the split */
.p4-half { flex: 2; min-width: 0; min-height: 0; position: relative; }
.p4-card {
  flex: 1; min-width: 260px; max-width: 380px; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 2px 4px 2px 0; font-size: 13.5px; line-height: 1.5; color: var(--tx1);
}
@media (max-width: 1120px) {
  .p4-card { max-width: none; max-height: 34%; }
}

/* ------------------------------------------------------------ info card */
.p4-name { font-size: 17px; font-weight: 600; color: var(--tx0); }
.p4-sch {
  font: 600 15px/1 Consolas, monospace; color: var(--gold); margin-left: 8px;
}
.p4-also { color: var(--tx2); font-size: 12.5px; margin: 3px 0 12px; }
.p4-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 5px 0; border-top: 1px solid var(--line);
}
.p4-row:first-of-type { border-top: 0; }
.p4-k { color: var(--tx2); }
.p4-v { color: var(--tx0); font-variant-numeric: tabular-nums; text-align: right; }
.p4-v b { color: var(--gold); }
/* the live V − E + F − C = 0, which is the 4D twin of the app's beloved
   V − E + F = 2 and is recomputed from the geometry every time */
.p4-euler {
  margin: 12px 0; padding: 9px 11px; border-radius: 9px;
  background: #12161f; border: 1px solid var(--line);
  font: 600 14px/1.4 Consolas, monospace; color: var(--tx1); text-align: center;
}
.p4-euler b { color: var(--tx0); }
.p4-euler .p4-ok { color: var(--good); }
.p4-note { color: var(--tx1); margin: 12px 0 0; }
.p4-note em { color: var(--tx0); font-style: normal; border-bottom: 1px dotted var(--tx2); }
.p4-madeof { margin-top: 10px; }

/* ------------------------------------------------------- the rotation pad
   Absolutely positioned INSIDE the stage. touch-action:none plus pointer
   capture plus stopPropagation means OrbitControls never sees these pointers
   at all — no arbitration, no enable/disable state machine, nothing to get
   stuck. Gesture contention is the exact class of bug that only shows up in a
   browser, and browser testing is what we have least of. */
.p4-pad {
  position: absolute; left: 12px; bottom: 12px;
  width: 132px; height: 132px;
  touch-action: none; cursor: grab;
  border-radius: 12px; background: rgba(13, 16, 25, 0.82);
  border: 1px solid var(--line);
}
.p4-pad:active { cursor: grabbing; }
.p4-pad.p4-live { border-color: var(--acc); }
@media (pointer: coarse) { .p4-pad { width: 116px; height: 116px; } }

/* the stage's own caption — what you are looking at, said plainly */
.p4-stamp {
  position: absolute; right: 12px; top: 12px; pointer-events: none;
  font: 600 10.5px/1 Consolas, monospace; letter-spacing: .1em; text-transform: uppercase;
  color: var(--acc2); background: #f0a35e18; border: 1px solid #f0a35e55;
  border-radius: 20px; padding: 5px 10px;
}

/* ------------------------------------------------------------ controls */
.p4-pick button { font-size: 12.5px; padding: 6px 9px; }
.p4-pick button.on { background: #24406030; border-color: var(--acc); color: #cfe8ff; }
.p4-ang {
  font: 600 12.5px/1 Consolas, monospace; color: var(--tx2);
  font-variant-numeric: tabular-nums; min-width: 12em;
}
.p4-ang b { color: var(--gold); }
.p4-build { color: var(--acc2); font-size: 12.5px; }

/* ------------------------------------------ the machines (stage 3) */
/* Full-width stage: the section and the fold are both the whole point, so
   nothing competes with them for width. The readout gets reserved height so
   text appearing can never re-squash the picture. */
.p4-stage-full { flex: 1; min-height: 0; position: relative; }
.p4-read {
  flex-shrink: 0; min-height: 3.2em; max-height: 26%;
  overflow-y: auto; overflow-x: hidden;
  padding: 9px 2px 0; font-size: 13.5px; line-height: 1.55; color: var(--tx1);
}
.p4-read b { color: var(--tx0); }
.p4-read em { color: var(--tx0); font-style: normal; border-bottom: 1px dotted var(--tx2); }
.p4-read .p4-ok { color: var(--good); }
.p4-read .p4-dim { color: var(--tx2); }
.p4-read p { margin: 0 0 6px; }
@media (pointer: coarse) { .p4-read { max-height: 30%; } }
