/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Chance Machine. The shared look lives in /core/static/core.css. */

/* ------------------------------------------------------------ Galton board (stage + live panel) */
#view-galton.active { display: grid; grid-template-columns: 1fr 300px; gap: 14px; overflow: hidden; }
#gStage canvas { cursor: crosshair; }
.hud-top {
  position: absolute; top: 14px; left: 18px; text-align: left; pointer-events: none;
  font: 600 12px var(--mono); color: var(--yellow); letter-spacing: .05em;
}
.hud-caption {
  position: absolute; top: 40%; left: 0; right: 0; text-align: center; pointer-events: none;
  font-size: 22px; font-weight: 800; opacity: 0; transition: opacity .4s; text-shadow: 0 2px 12px #000;
}
.hud-caption.on { opacity: 1; }
.hud-caption em { font-style: normal; color: var(--yellow); }
.hint kbd { font-size: 9px; padding: 0 4px; color: var(--muted); }
.hint { max-width: min(360px, 40%); }
.stage-ctrl button { white-space: nowrap; }
@media (max-width: 1500px) {
  #gStage .stage-credit { display: none; }
  #gStage .hint { top: 36px; }
}

.live {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; overflow-y: auto; scrollbar-width: thin;
}
.live h3 { font-size: 13px; margin: 4px 0 6px; }
.live h3:not(:first-child) { margin-top: 16px; }
.live h3 + .sub { margin-top: 2px; }

table.stats { border-collapse: collapse; width: 100%; font: 12px var(--mono); }
table.stats th { color: var(--muted); font-weight: 600; text-align: right; padding: 3px 6px; font-family: var(--sans); }
table.stats th:first-child, table.stats td:first-child { text-align: left; font-family: var(--sans); color: var(--muted); }
table.stats td { text-align: right; padding: 4px 6px; border-top: 1px solid var(--line); }
table.stats td.y { color: var(--yellow); font-weight: 700; }
table.stats td.b { color: var(--blue); }
table.stats td.g { color: var(--green); font-weight: 700; }
table.stats td.p { color: var(--pink); font-weight: 700; }
.path-box { font: 12px var(--mono); color: var(--muted); line-height: 1.6; min-height: 60px; }
.path-box .steps { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 6px; }
.path-box .steps span {
  width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 700; background: var(--panel2); color: var(--dim);
}
.path-box .steps span.r { background: rgba(255, 201, 60, .18); color: var(--yellow); }
.path-box b { color: var(--yellow); }
canvas.resid { width: 100%; height: 150px; display: block; }

/* the "key idea" cards in the sidebar */
.card[data-for]:not(.on), .card[hidden] { display: none; }
.card.idea .formula { font-size: 16px; text-align: center; padding: 6px 0 10px; overflow-x: auto; }
.card.idea .sub { margin-bottom: 0; }
.formula math { color: var(--text); }
.lesson .formula { text-align: center; padding: 8px 0; overflow-x: auto; }
.seed-row { margin-top: 4px; gap: 6px; }
.seed-row input {
  flex: 1; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 8px; font-family: var(--mono); color: var(--yellow);
}
.drop-quick { margin-top: 12px; }

/* ------------------------------------------------------------ shared bits of the other tabs */
.lesson-wide p { color: #c3cbe0; max-width: 900px; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col .panel { margin: 0; }
canvas.tall { height: 420px; }
.lab-big.small { font-size: 28px; }
.lab-readout .sub { margin-bottom: 0; }
#mPiSub { white-space: nowrap; font-family: var(--mono); }
.lab-sliders .quick { margin-top: 6px; }

/* central limit theorem */
.src-seg { flex-wrap: wrap; }
.src-seg button { flex: 1 0 auto; }
canvas.src { width: 100%; height: 150px; display: block; touch-action: none; }
canvas.src.editable { cursor: crosshair; }
canvas.shape { width: 100%; height: 120px; display: block; margin-top: 8px; }
.shape-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shape-grid > div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.ms-lab { font-size: 12px; color: var(--muted); }
.ms-val { font: 800 24px var(--mono); color: var(--yellow); }
.ms-alt { font-size: 11px; color: var(--blue); }

/* Monty Hall */
canvas.doors { cursor: pointer; }
.mh-actions { justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.mh-actions .btn:disabled { opacity: .35; cursor: default; filter: none; box-shadow: none; }
canvas.mh-chart { width: 100%; height: 190px; display: block; }
table.score td, table.score th { padding: 6px 8px; }

/* random walk */
canvas.wchart { width: 100%; height: 150px; display: block; }

/* streaks */
.coin-btns { margin-top: 10px; flex-wrap: wrap; }
.coin-btn { min-width: 92px; font-weight: 600; }
canvas.seq { width: 100%; height: 120px; display: block; }

@media (max-width: 1200px) {
  #view-galton.active { grid-template-columns: 1fr; grid-template-rows: minmax(480px, 1fr) auto; overflow-y: auto; }
  .live { overflow: visible; }
}
@media (max-width: 860px) {
  #view-galton.active { grid-template-rows: 70vh auto; }
  canvas.tall { height: 340px; }
}
#cvClt { height: 520px; }
