/* Number Theatre — styles for the wonders4/wonders5 exhibits.
   Reuses the .wx-* vocabulary from screens.css; only adds what's new.
   Everything here is prefixed .nt- so the two halves of the wing can be built
   side by side without stepping on each other. */

/* ---------- shared control-strip bits ---------- */
/* a group of controls belonging to one sub-mode; toggled with .hidden */
.nt-grp { display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.nt-dim { color: var(--tx2); font-size: 12.5px; }
.nt-num { width: 78px; }
.nt-num.wide { width: 118px; }
/* touch-first: these canvases handle their own gestures, so the browser must
   not steal them for scroll/pinch-zoom */
.nt-zoomable { touch-action: none; }
.nt-grab { cursor: grab; }
.nt-grab:active { cursor: grabbing; }

/* ---------- Prime Machine: factor-pair chips + the big verdict ---------- */
.nt-strip {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 0 2px; max-width: 100%; overflow-x: auto;
}
.nt-chip {
  padding: 5px 12px; font-size: 13.5px; font-family: Consolas, monospace;
  border-radius: 999px; white-space: nowrap;
}
.nt-chip.on { background: var(--gold); color: #0b0e14; border-color: var(--gold); font-weight: 700; }
.nt-verdict {
  margin-top: 8px; padding: 10px 14px; min-height: 58px;
  background: var(--bg1); border: 1px solid var(--line); border-radius: 12px;
  color: var(--tx0); font-size: 15px; line-height: 1.5;
}
.nt-big { font-size: 26px; color: var(--gold); font-family: Consolas, monospace; }
.nt-prime { color: var(--good); font-weight: 700; letter-spacing: 2px; }
.nt-comp { color: var(--tx2); }
.nt-sub { font-size: 12.5px; color: var(--tx2); margin-top: 5px; line-height: 1.6; }
.nt-twin {
  padding: 3px 10px; font-size: 12.5px; border-color: var(--gold); color: var(--gold);
  border-radius: 999px; margin-left: 4px;
}
.nt-twin:hover { background: #2a2410; border-color: var(--gold); }

/* ---------- Factor Trees: canvas + divisor side panel ---------- */
.nt-split { flex: 1; display: flex; gap: 12px; min-height: 0; min-width: 0; }
.nt-treestage { position: relative; flex: 1; min-width: 0; display: flex; }
.nt-side {
  width: 250px; min-width: 250px; overflow-y: auto; padding: 12px 14px;
  background: var(--bg1); border: 1px solid var(--line); border-radius: 12px;
  font-size: 13px; color: var(--tx1); line-height: 1.5;
}
.nt-side h4 {
  margin: 0 0 8px; font-size: 20px; color: var(--tx0);
  font-family: Consolas, monospace; letter-spacing: 1px;
}
.nt-stat { margin: 7px 0; }
.nt-stat b { color: var(--tx0); }
.nt-flag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); color: var(--tx2); margin-left: 4px;
}
.nt-flag.good { color: var(--good); border-color: var(--good); }
.nt-divs {
  margin-top: 8px; font-family: Consolas, monospace; font-size: 11.5px;
  color: var(--tx2); line-height: 1.7; word-break: break-word;
  max-height: 220px; overflow-y: auto;
}
/* the "you choose the split" popup — lives inside the stage so it can never
   push the page sideways */
.nt-menu {
  position: absolute; z-index: 6; display: grid; gap: 4px;
  min-width: 130px; max-width: 240px; max-height: 244px; overflow-y: auto;
  padding: 6px; background: var(--bg2); border: 1px solid var(--acc);
  border-radius: 12px; box-shadow: 0 12px 30px #000a;
}
.nt-menu button {
  width: 100%; text-align: left; padding: 6px 10px;
  font-family: Consolas, monospace; font-size: 13.5px;
}
.nt-menuhd {
  color: var(--tx2); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
  padding: 2px 4px 4px;
}

/* ---------- the printed equation, colour-keyed to the 3D pieces ---------- */
.nt-eq {
  margin-top: 8px; padding: 9px 14px; border-radius: 12px;
  background: var(--bg1); border: 1px solid var(--line);
  color: var(--tx0); font-size: 14.5px; line-height: 1.6;
  max-width: 100%; overflow-x: auto;
}
.nt-eq.nt-eqbig { font-size: 17px; font-family: Consolas, monospace; min-height: 54px; }
.nt-eq b { color: var(--tx0); }
/* these four MUST stay in step with T1..T4 in wonders4.js exFigurate */
.nt-t1 { color: #62b6f0; font-weight: 700; }
.nt-t2 { color: #8fd18a; font-weight: 700; }
.nt-t3 { color: #e8d477; font-weight: 700; }
.nt-t4 { color: #f0a35e; font-weight: 700; }

/* ---------- narrow / portrait: stack instead of overflowing sideways ---------- */
@media (max-width: 900px) {
  .nt-split { flex-direction: column; }
  .nt-side { width: auto; min-width: 0; max-height: 190px; }
  .nt-treestage { min-height: 240px; }
  .nt-big { font-size: 22px; }
  .nt-eq.nt-eqbig { font-size: 15px; }
}
