/* Chalk Talk — a dark chalkboard that fills the screen; everything else
   gets out of its way. */

:root {
  --bg: #121a17;
  --board: #1d2a26;
  --board-edge: #2a3a35;
  --ink: #f4f1e8;
  --ink-dim: rgba(244, 241, 232, 0.62);
  --ink-faint: rgba(244, 241, 232, 0.14);
  --yellow: #ffd866;
  --pink: #ff8fb1;
  --blue: #7cc7ff;
  --green: #8ee59b;
  --top: 52px;
  --dock: 108px;
  --gap: 12px;
  --radius: 18px;
  --chalk: "Patrick Hand", "Comic Neue", "Segoe Print", system-ui, sans-serif;
  --ui: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mic: 0;
  --out: 0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar {
  /* the status bar's inset is added to the bar, never taken out of it (an iPad home-screen app has one) */
  height: calc(var(--top) + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 14px; min-width: 0;
  padding: env(safe-area-inset-top, 0px) calc(var(--gap) + 4px + env(safe-area-inset-right, 0px)) 0 calc(var(--gap) + 4px + env(safe-area-inset-left, 0px));
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--chalk); font-size: 23px; letter-spacing: .3px; white-space: nowrap; flex: 0 0 auto; }
.brand svg { width: 28px; height: 28px; }
.mode {
  flex: 0 1 auto;
  font-size: 12.5px; color: var(--ink-dim); border: 1px solid var(--ink-faint);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.tools { margin-left: auto; display: flex; gap: 4px; flex: 0 0 auto; }
.tools button {
  width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--ink-dim);
}
.tools button:hover, .tools button:focus-visible { background: rgba(255,255,255,.07); color: var(--ink); outline: none; }
.tools svg { width: 21px; height: 21px; }

/* ---------- board and cards ---------- */
#board {
  height: calc(100vh - var(--top) - var(--dock) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  height: calc(100dvh - var(--top) - var(--dock) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex; gap: var(--gap);
  padding: 0 var(--gap);
}
.board-main { flex: 1 1 64%; display: flex; min-width: 0; min-height: 0; }
.board-side { flex: 0 0 34%; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; min-height: 0; overflow: auto; scrollbar-width: thin; }
#board[data-side="0"] .board-side { display: none; }
#board[data-side="1"] .board-side { flex-basis: 30%; }
.board-side .card-steps { flex: 1 1 auto; max-height: none; }

.card {
  position: relative; flex: 1 1 0; min-height: 0; min-width: 0;
  border-radius: var(--radius); overflow: hidden;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(255,255,255,.035), transparent 60%),
    radial-gradient(900px 500px at 90% 100%, rgba(0,0,0,.18), transparent 60%),
    var(--board);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset 0 0 60px rgba(0,0,0,.28), 0 10px 30px rgba(0,0,0,.25);
}
.board-side .card { min-height: 190px; }
.card canvas { display: block; width: 100%; height: 100%; }
.card-body { position: absolute; inset: 34px 0 0 0; }
.card-tag {
  position: absolute; top: 9px; left: 14px; z-index: 2;
  font-family: var(--chalk); font-size: 17px; color: var(--ink-dim); pointer-events: none;
}
.card.pulse { animation: cardPulse 1.6s ease-out; }
@keyframes cardPulse {
  0% { box-shadow: inset 0 0 0 2px rgba(255,216,102,.9), 0 0 0 0 rgba(255,216,102,.45); }
  100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 0 0 22px rgba(255,216,102,0); }
}

/* the stage: one canvas, its tabs above, its sliders below */
.board-main { flex-direction: column; gap: 8px; }
.stage { position: relative; flex: 1 1 auto; display: flex; min-height: 0; min-width: 0; }
.stage-tabs {
  display: flex; gap: 6px; align-items: center; overflow-x: auto; flex: 0 0 auto; min-height: 34px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.stage-tabs-head { flex: 0 0 auto; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); padding-right: 2px; }
.stage-tab-wrap { display: inline-flex; align-items: center; flex: 0 0 auto; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.stage-tab-wrap:has([aria-current="true"]) { background: var(--yellow); border-color: var(--yellow); }
.stage-tab {
  font-family: var(--chalk); font-size: 16px; color: var(--ink-dim); white-space: nowrap;
  background: transparent; border: 0; min-height: 30px;
  padding: 3px 10px 3px 12px; border-radius: 999px; cursor: pointer;
}
.stage-tab-x { border: 0; background: transparent; color: var(--ink-dim); font-size: 18px; line-height: 1; width: 28px; height: 30px; border-radius: 999px; cursor: pointer; padding: 0; }
.stage-tab-wrap:has([aria-current="true"]) .stage-tab-x { color: #1b1a12; }
.stage-tab-x:hover, .stage-tab-x:focus-visible { background: rgba(0,0,0,.18); outline: none; }
.stage-tab:hover, .stage-tab:focus-visible { color: var(--ink); outline: none; border-color: rgba(255,216,102,.4); }
.stage-tab[aria-current="true"] { color: #1b1a12; }

.controls {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px 34px;
  padding: 8px 14px; border-radius: 14px;
  background: rgba(18,26,23,.72); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  animation: chipIn .35s ease-out;
}
.ctl { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; font-family: var(--chalk); }
.ctl-n { font-size: 18px; color: var(--ink-dim); white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* a long label shortens; the value never overlaps */
.ctl output { flex: 0 0 auto; font-size: 20px; color: var(--yellow); min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.ctl input[type=range] {
  flex: 1 1 60px; min-width: 60px; height: 28px; margin: 0; background: transparent;   /* the track gives way before the label */
  -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: none;
}
.ctl input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,216,102,.55), rgba(255,143,177,.55)); }
.ctl input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,216,102,.55), rgba(255,143,177,.55)); }
.ctl input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 0 4px rgba(255,216,102,.22), 0 0 14px rgba(255,216,102,.6);
}
.ctl input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 0 4px rgba(255,216,102,.22), 0 0 14px rgba(255,216,102,.6);
}
.ctl input[type=range]:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 8px; }
/* play a number through its range; pause and play a moving card */
.ctl-play, .ctl-motion {
  flex: 0 0 auto; height: 30px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(255,216,102,.4); background: rgba(255,216,102,.08); color: var(--yellow);
  font: 14px var(--ui); line-height: 1;
}
.ctl-play { width: 30px; padding: 0; }
.ctl-play[aria-pressed="true"], .ctl-motion[aria-pressed="true"] { background: var(--yellow); color: var(--board); }
.ctl-motion { padding: 0 14px; font-weight: 700; letter-spacing: .02em; align-self: center; }
.ctl-play:focus-visible, .ctl-motion:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
/* named options: a list to pick from, in the slider row */
.ctl-choice select {
  flex: 1 1 120px; min-width: 0; max-width: 100%; height: 34px; padding: 0 30px 0 12px;
  font: 19px var(--chalk); color: var(--yellow); cursor: pointer;
  background: rgba(255,216,102,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ffd866' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 11px center;
  border: 1px solid rgba(255,216,102,.4); border-radius: 10px;
  -webkit-appearance: none; appearance: none; text-overflow: ellipsis;
}
.ctl-choice select:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.ctl-choice select option { color: var(--ink); background: var(--board); font-family: var(--ui); }
@keyframes chipIn { from { opacity: 0; transform: translateY(-6px); } }

/* steps rail */
.card-steps { flex: 0 1 auto; max-height: 48%; overflow: auto; padding: 38px 16px 10px 8px; }
.board-side .card-steps { min-height: 120px; }
.steps-list { margin: 0; padding-left: 34px; font-family: var(--chalk); }
.steps-list li { margin: 0 0 10px; font-size: 22px; color: var(--ink); }
.steps-list li::marker { color: var(--yellow); }
.steps-list .step-note { font-size: 17px; color: var(--ink-dim); }
.steps-list li.fresh { animation: stepIn .5s ease-out; }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } }

/* typeset maths (math/typeset.js): fractions stacked, roots barred, scripts raised */
.step-math { line-height: 1.5; overflow-x: auto; overflow-y: hidden; white-space: nowrap; padding-bottom: 2px; }
.step-math.live { border-left: 2px solid var(--green, #8ee59b); padding-left: 8px; }
.step-math .m-v { font-style: italic; }
.step-math .m-f, .step-math .m-el { font-style: normal; }
.step-math .m-state { font-size: .72em; color: var(--ink-dim); }
.step-math .m-op { white-space: pre; }
.step-math .m-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .12em; font-size: .9em; line-height: 1.15; }
.step-math .m-fn { padding: 0 .2em .08em; }
.step-math .m-fd { padding: .08em .2em 0; border-top: 2px solid currentColor; }
.step-math .m-sqrt { display: inline-flex; align-items: flex-start; }
.step-math .m-rad { font-size: 1.1em; line-height: 1; }
.step-math .m-rc { border-top: 2px solid currentColor; padding: .05em .15em 0; margin-top: .08em; }
.step-math sup, .step-math sub { font-size: .66em; line-height: 0; }
.step-math sup { vertical-align: .6em; }
.step-math sub { vertical-align: -.25em; }

/* artifact cards */
.artifact-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--board); }
.artifact-badge { position: absolute; top: 40px; right: 12px; margin: 0; padding: 4px 10px; border-radius: 999px; background: rgba(29, 42, 38, 0.85); color: var(--yellow, #ffd866); font-size: 13px; pointer-events: none; z-index: 2; }
/* the checker's note: checking, correcting, checked */
.artifact-check { position: absolute; bottom: 10px; right: 12px; margin: 0; padding: 3px 10px; border-radius: 999px; background: rgba(29, 42, 38, 0.85); color: var(--ink-dim, #c8c4b8); font-size: 12.5px; pointer-events: auto; z-index: 2; transition: opacity .3s; }
.artifact-check[data-kind="ok"] { color: #8ee59b; }
.artifact-check[data-kind="checking"] { color: #ffd866; }
.artifact-loading { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; padding: 18px; }
.artifact-status { margin: 0; font-family: var(--chalk); font-size: 19px; color: var(--ink-dim); }
.shimmer {
  width: min(70%, 260px); height: 92px; border-radius: 14px;
  background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,216,102,.16) 50%, rgba(255,255,255,.04) 70%);
  background-size: 300% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* ---------- dock: orb + captions ---------- */
.dock {
  height: calc(var(--dock) + env(safe-area-inset-bottom));
  padding: 10px calc(var(--gap) + 6px) calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 18px;
}
.orb {
  position: relative; flex: 0 0 auto; width: 76px; height: 76px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer; background: transparent;
}
.orb .core {
  position: absolute; inset: 8px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffe9a3, var(--yellow) 45%, #d9a93a);
  color: #1d2a26; box-shadow: 0 6px 22px rgba(255,216,102,.28);
  transition: transform .15s ease;
}
.orb:active .core { transform: scale(.95); }
.orb svg { width: 28px; height: 28px; stroke-width: 2.4; }
.orb .i-stop { display: none; }
body:not([data-orb="idle"]) .orb .i-mic { display: none; }
body:not([data-orb="idle"]) .orb .i-stop { display: block; }
.orb .ring { position: absolute; inset: 8px; border-radius: 50%; border: 2px solid var(--yellow); opacity: 0; pointer-events: none; }
body[data-orb="listening"] .orb .r1 { opacity: calc(.25 + var(--mic) * .75); transform: scale(calc(1 + var(--mic) * .45)); }
body[data-orb="speaking"] .orb .r1,
body[data-orb="speaking"] .orb .r2 { border-color: var(--blue); }
body[data-orb="speaking"] .orb .r1 { opacity: .8; transform: scale(calc(1.05 + var(--out) * .5)); }
body[data-orb="speaking"] .orb .r2 { opacity: .4; transform: scale(calc(1.15 + var(--out) * .8)); }
body[data-orb="speaking"] .orb .core { background: radial-gradient(circle at 35% 30%, #d6efff, var(--blue) 50%, #4b98d0); }
body[data-orb="thinking"] .orb .r1 { opacity: .9; border-style: dashed; animation: spin 1.4s linear infinite; }
body[data-orb="connecting"] .orb .r1 { opacity: .6; animation: breathe 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg) scale(1.08); } }
@keyframes breathe { 50% { transform: scale(1.18); opacity: .2; } }

.talk { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.captions { display: flex; flex-direction: column; gap: 3px; min-height: 52px; }
.cap { margin: 0; display: flex; gap: 10px; align-items: baseline; font-size: 18px; line-height: 1.3; min-width: 0; }
.cap .who { flex: 0 0 auto; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); width: 46px; }
.cap .txt { flex: 1 1 auto; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cap-you .txt { color: var(--ink-dim); }
.cap-tutor .txt { color: var(--ink); font-weight: 700; }
.cap-tutor .who { color: var(--yellow); }
.cap:has(.txt:empty) { visibility: hidden; }
.status { margin: 0; font-size: 13px; color: var(--ink-dim); display: flex; gap: 10px; align-items: center; min-width: 0; }
.status > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latency { color: var(--green); font-variant-numeric: tabular-nums; white-space: nowrap; }

.typed { display: flex; gap: 8px; margin-top: 2px; }
.typed input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--ink);
  background: rgba(255,255,255,.06); border: 1px solid var(--ink-faint); border-radius: 11px; padding: 8px 12px;
}
.typed input:focus { outline: 2px solid rgba(255,216,102,.5); border-color: transparent; }
.typed button { border: 0; border-radius: 11px; padding: 0 16px; background: var(--yellow); color: #1d2a26; font-weight: 800; cursor: pointer; }
body.typing { --dock: 146px; }

/* ---------- transcript drawer ---------- */
.log {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 20;
  background: #18221f; box-shadow: -20px 0 40px rgba(0,0,0,.4);
  display: flex; flex-direction: column; animation: drawerIn .22s ease-out;
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } }
.log header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--ink-faint); }
.log h2 { margin: 0; font-size: 16px; }
.log header button { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink-dim); }
.log ol { list-style: none; margin: 0; padding: 12px 16px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.log li { font-size: 15px; line-height: 1.4; }
.log li b { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.log li.tutor b { color: var(--yellow); }
.log footer { padding: 10px 16px 16px; font-size: 12.5px; color: var(--ink-dim); border-top: 1px solid var(--ink-faint); }

/* ---------- welcome ---------- */
.welcome {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
  background: rgba(10,15,13,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.welcome[hidden] { display: none; }
.welcome-card {
  width: min(560px, 100%); padding: 30px 30px 22px; border-radius: 24px; text-align: center;
  background: var(--board); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 30px 80px rgba(0,0,0,.5);
}
.welcome h1 { margin: 0 0 8px; font-family: var(--chalk); font-weight: 400; font-size: 44px; color: var(--yellow); }
.lede { margin: 0 auto 18px; max-width: 42ch; color: var(--ink-dim); font-size: 16.5px; line-height: 1.5; }
.try-head { margin: 0 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.try { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 7px; font-family: var(--chalk); font-size: 20px; }
.access input {
  width: min(260px, 100%); font: inherit; text-align: center; margin-bottom: 14px; color: var(--ink);
  background: rgba(255,255,255,.06); border: 1px solid var(--ink-faint); border-radius: 12px; padding: 10px 12px;
}
.start {
  display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer;
  background: var(--yellow); color: #1d2a26; font-weight: 800; font-size: 18px; padding: 14px 28px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(255,216,102,.25);
}
.start svg { width: 22px; height: 22px; stroke-width: 2.4; }
.fine { margin: 14px 0 0; font-size: 13px; color: var(--ink-dim); }
.link { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* ---------- small and portrait screens ---------- */
@media (max-width: 820px), (max-aspect-ratio: 4/5) {
  #board { flex-direction: column; }
  .board-main { flex: 1 1 60%; }
  #board[data-side="1"] .board-side { flex: 0 0 30%; }
  .board-side .card { min-height: 0; }
  .ctl { flex-basis: 100%; }
}
@media (max-width: 900px) {
  .mode { max-width: 34vw; }
  .brand span { display: none; }
}
@media (max-width: 560px) {
  :root { --dock: 116px; --gap: 8px; --top: 48px; }
  .mode { display: none; }
  .orb { width: 66px; height: 66px; }
  .cap { font-size: 16px; }
  .cap .who { width: 38px; }
  .welcome h1 { font-size: 36px; }
  .try { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
::view-transition-group(*) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }

/* ---------- topics drawer ---------- */
.topics input[type=search] {
  margin: 12px 16px 4px; font: inherit; color: var(--ink); background: rgba(255,255,255,.06);
  border: 1px solid var(--ink-faint); border-radius: 10px; padding: 9px 12px;
}
.topics-jump { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 6px; }
.topics-jump button { font: inherit; font-size: 13px; text-transform: capitalize; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: transparent; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.topics-jump button:hover, .topics-jump button:focus-visible { border-color: rgba(255,216,102,.6); outline: none; }
.topics-list { overflow: auto; flex: 1; padding: 6px 16px 16px; position: relative; }
.topics-list h3 { margin: 14px 0 6px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.topics-list button {
  display: block; width: 100%; text-align: left; margin: 0 0 6px; padding: 9px 12px; cursor: pointer;
  font: inherit; color: var(--ink); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 10px;
}
.topics-list button:hover, .topics-list button:focus-visible { border-color: rgba(255,216,102,.5); outline: none; }
.topics-list button b { display: block; font-family: var(--chalk); font-weight: 400; font-size: 19px; color: var(--yellow); }
.topics-list button span { font-size: 13px; color: var(--ink-dim); }
.topics-list h4 { margin: 10px 0 6px; font-size: 14px; font-weight: 700; color: var(--green); }

/* ---------- busy light: red while this answer is still being drawn, green once it is all on the board ---------- */
.busy { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; }
.busy i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(142,229,155,.7); transition: background .2s, box-shadow .2s; }
body[data-busy="1"] .busy i { background: #ff7a7a; box-shadow: 0 0 10px rgba(255,122,122,.85); animation: busyPulse 1s ease-in-out infinite; }
body[data-busy="1"] .busy b { color: #ffb0b0; }
.busy b { font-weight: 700; }
@keyframes busyPulse { 50% { opacity: .45; } }
@media (max-width: 560px) { .busy b { display: none; } }

/* a tip in the corner of the stage: practical, short, easy to put away */
.tip-note { position: absolute; right: 14px; top: 42px; z-index: 6; max-width: min(360px, calc(100% - 28px)); display: flex; gap: 8px; align-items: baseline; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255, 216, 102, 0.55); background: rgba(29, 42, 38, 0.92); color: #f4f1e8; font: inherit; font-size: 15px; line-height: 1.35; cursor: pointer; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35); animation: tip-in 0.35s ease-out; }
.tip-note b { color: #ffd866; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; flex: none; }
.tip-note.instant { animation: none; }
@keyframes tip-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tip-note { animation: none; } }

/* every canvas has a number: "show 2" */
.card-letter, .stage-tab-letter {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; margin-right: 7px;
  border-radius: 7px; font-family: var(--ui); font-size: 13px; font-weight: 800;
  background: rgba(255,216,102,.16); color: var(--yellow); vertical-align: 1px;
}
.stage-tab[aria-current="true"] .stage-tab-letter { background: rgba(0,0,0,.18); color: #1b1a12; }
