/* notation.css — the Notation page. Builds on rubiks.css; colours are tokens only. */

.nt-tabs { margin-bottom: 20px; }
.nt-tabs button { min-inline-size: 120px; }

/* the small checkbox label used under the demo cube */
.nt-check {
  display: inline-flex; align-items: center; gap: 8px;
  min-block-size: 40px; color: var(--ink); cursor: pointer;
}
.nt-check input { width: 18px; height: 18px; min-block-size: 0; accent-color: var(--accent); margin: 0; }

/* ── the terms ───────────────────────────────────────────────────────────── */

.nt-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) {
  .nt-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
  .nt-demo-slot { position: sticky; top: calc(var(--bar-h) + 12px); }
}
@media (max-width: 899px) {
  /* on a phone the demo lives in a dialog that opens when you press Watch */
  .nt-demo-slot { display: none; }
}
.nt-main { min-width: 0; }
.nt-start { margin-bottom: 24px; }
.nt-start p { margin: 0; max-width: 70ch; }

.nt-group { margin: 0 0 32px; }
.nt-group h2 { margin-bottom: 6px; }
.nt-intro { max-width: 70ch; margin-bottom: 14px; }
.nt-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

.nt-card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-1);
}
.nt-card-top { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.nt-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.nt-say { margin: 0; color: var(--ink); font-weight: 600; font-size: 0.93rem; }
.nt-desc { margin: 0; color: var(--ink-dim); font-size: 0.93rem; }
.nt-expand { margin: 0; color: var(--ink-dim); }
.nt-thumb { flex: none; width: 88px; line-height: 0; }
.nt-thumb svg { width: 88px; height: auto; }
.nt-card-foot { margin-top: auto; justify-content: space-between; align-items: center; }
.nt-term { font-size: 1.05rem; }
.nt-watch { margin-left: auto; min-inline-size: 84px; }

.nt-layers { display: block; max-width: 100%; height: auto; }
.nt-layers rect.on { fill: var(--accent); }
.nt-layers rect.off { fill: var(--surface-sunken); stroke: var(--line-strong); stroke-width: 1; }
.nt-layers text { fill: var(--ink-dim); font: 600 10px var(--font-mono); }
.nt-layers text.face { fill: var(--ink); font-size: 13px; }

.nt-demo { padding: 14px; }
.nt-demo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.nt-demo-head .panel-title { margin: 0; }
.nt-demo-stage { max-height: 52vh; }
.nt-demo-move {
  margin: 12px 0 4px; min-height: 2.2rem; text-align: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}
.nt-demo-move span { display: inline-block; padding: 0 4px; color: var(--ink-faint); }
.nt-demo-move span.now { color: var(--accent-text); }
.nt-demo-move span.done { color: var(--ink-dim); }
.nt-demo-say { margin: 0 0 8px; text-align: center; min-height: 1.4em; }
.nt-demo-ctl { justify-content: space-between; }
.nt-speed { display: inline-flex; align-items: center; gap: 8px; }
.nt-speed input { width: 90px; }
#demoDialogBody .nt-demo { border: 0; box-shadow: none; padding: 0; background: transparent; }
#demoDialogBody .nt-demo-stage { max-height: 50vh; }

.nt-playground { display: flex; flex-direction: column; gap: 12px; }
.nt-playground input[type="text"] { font-family: var(--font-mono); width: 100%; }
.nt-playground select { min-inline-size: 90px; }
.nt-pg-out { margin: 0; min-height: 2.6rem; overflow-wrap: anywhere; }
.nt-pg-out.bad { color: var(--danger); }
.nt-pg-out code.alg { display: inline-block; margin-top: 4px; }

/* ── the trainer ─────────────────────────────────────────────────────────── */

.tr-setup { margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.tr-setup-row { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.tr-setup .seg button { min-inline-size: 44px; }
#trLevels button { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; }
.tr-lvnum { font-weight: 800; }
.tr-lvname { display: none; font-size: 0.82rem; }
@media (min-width: 1100px) { .tr-lvname { display: inline; } }
#trLevels button[aria-pressed="true"] .tr-lvname { display: inline; }
#trLevelBlurb { margin: 0; min-height: 1.4em; }

.tr-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 900px) { .tr-grid { grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); } }
.tr-left, .tr-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tr-left > .panel + .panel, .tr-right > .panel + .panel { margin-top: 0; }

.tr-prompt { text-align: center; padding: 16px; transition: border-color 0.2s, background 0.2s; }
.tr-prompt[data-state="ok"] { border-color: var(--safe); background: color-mix(in srgb, var(--safe) 9%, var(--surface)); }
.tr-prompt[data-state="bad"] { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.tr-prompt[data-state="half"], .tr-prompt[data-state="hint"] { border-color: var(--accent-line); }
.tr-kicker { margin: 0; color: var(--ink-dim); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.tr-term {
  margin: 4px 0 6px; font-family: var(--font-mono); font-weight: 800; line-height: 1.1;
  font-size: clamp(2.6rem, 2rem + 4vw, 4.2rem); letter-spacing: 0; overflow-wrap: anywhere;
}
.tr-term.is-small { font-size: clamp(1.4rem, 1.2rem + 1.4vw, 2rem); color: var(--ink-dim); }
.tr-feedback { margin: 0; min-height: 3em; font-size: 0.97rem; color: var(--ink-dim); text-align: left; }
.tr-feedback.ok { color: var(--safe-text); }
.tr-feedback.bad { color: var(--ink); }
.tr-feedback.bad strong { color: var(--danger); }
.tr-feedback.half, .tr-feedback.hint { color: var(--ink); }
.tr-feedback code.alg { vertical-align: baseline; }

.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 10px; }
.tr-chip {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
  padding: 4px 11px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface-sunken); color: var(--ink-dim);
}
.tr-chip.is-now { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tr-chip.is-done { color: var(--safe-text); border-color: color-mix(in srgb, var(--safe) 55%, transparent); }
.tr-chip.is-missed { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }

.tr-stage { width: min(100%, 52vh); margin-inline: auto; max-height: none; }
@media (min-width: 900px) { .tr-stage { width: min(100%, 62vh); } }

.tr-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tr-choice { min-block-size: 56px; font-size: 1.2rem; justify-content: flex-start; gap: 12px; }
.tr-choice code { font-weight: 800; font-size: 1.3rem; }
.tr-choice.is-right { border-color: var(--safe); background: color-mix(in srgb, var(--safe) 18%, var(--surface-hi)); opacity: 1; }
.tr-choice.is-wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--surface-hi)); }
.tr-choice[disabled]:not(.is-right):not(.is-wrong) { opacity: 0.5; }

.tr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-actions .btn { flex: 1 1 auto; min-inline-size: 0; }
.tr-actions .btn.primary { flex-grow: 1.4; }

.tr-score dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; }
.tr-score dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); font-weight: 700; }
.tr-score dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.tr-padpanel .panel-title, .tr-stats .panel-title { margin-bottom: 10px; }
.tr-mods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tr-mod { min-inline-size: 44px; gap: 6px; min-block-size: 44px; font-family: var(--font-mono); font-size: 1.1rem; font-weight: 800; }
.tr-mod[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tr-pad { display: flex; flex-direction: column; gap: 6px; }
.tr-facegrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tr-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tr-key {
  min-inline-size: 0; min-block-size: 52px; padding: 0 4px;
  font-family: var(--font-mono); font-size: 1.15rem; font-weight: 800;
}
.tr-key.is-rot { color: var(--ink-dim); border-style: dashed; }

.tr-statchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tr-stat code { font-weight: 800; color: var(--ink); }
.tr-stat small { font-variant-numeric: tabular-nums; }
.tr-weak-title { font-size: 0.95rem; margin: 10px 0 6px; }
.tr-weak { margin: 0 0 10px; padding-left: 1.3em; }
.tr-weak li { margin: 2px 0; }

.tr-timerbar {
  position: relative; margin-top: 10px; height: 26px; border-radius: var(--radius-pill);
  background: var(--surface-sunken); border: 1px solid var(--line); overflow: hidden;
}
.tr-timerbar span { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: 0.55; transition: width 0.2s linear; }
.tr-timerbar b { position: relative; display: block; text-align: center; line-height: 24px; font-variant-numeric: tabular-nums; }

.tr-summary { text-align: center; border-color: var(--accent-line); }
.tr-summary h2 { margin-bottom: 4px; }
.tr-summary-big { font-size: 2.2rem; font-weight: 800; margin: 0 0 4px; }
.tr-summary .row { justify-content: center; }

.nt-keys { margin: 0; display: grid; gap: 10px; }
.nt-keys > div { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 10px; align-items: baseline; }
.nt-keys dt { font-weight: 600; }
.nt-keys dd { margin: 0; color: var(--ink-dim); }
.nt-keys .kbd { margin-right: 3px; }

@media (max-width: 480px) {
  .tr-score dd { font-size: 1.15rem; }
  .tr-choice { min-block-size: 52px; }
  .nt-keys > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .tr-prompt, .tr-timerbar span { transition: none; }
}

.tr-mod small { font-family: var(--font-sans); font-weight: 600; font-size: 0.75rem; opacity: 0.85; }
@media (max-width: 899px) {
  /* on a phone the turn buttons sit right under the cube, the score below them */
  .tr-right .tr-padpanel { order: 1; }
  .tr-right .tr-score { order: 2; }
  .tr-right .tr-stats { order: 3; }
}
