@johnoscott/isometric-engine 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +3 -1
  2. package/iso-editor.js +230 -193
  3. package/iso-remotion.js +353 -0
  4. package/iso-render.js +184 -147
  5. package/iso-systems.js +183 -146
  6. package/isometric-diagram.js +389 -0
  7. package/js/iso-core/arimo.js +5 -0
  8. package/js/iso-core/arimo.json +1 -0
  9. package/js/iso-core/index.js +8 -2
  10. package/js/iso-core/kernel.js +13 -2
  11. package/js/iso-core/mono.js +242 -0
  12. package/js/iso-editor/ui/canvas.js +23 -1
  13. package/js/iso-objects/ants.js +1 -1
  14. package/js/iso-objects/index.js +10 -2
  15. package/js/iso-objects/mono-paint.js +96 -0
  16. package/js/iso-objects/motion-doc.js +0 -79
  17. package/js/iso-objects/motion-entry.js +4 -2
  18. package/js/iso-objects/motion-schema.js +83 -0
  19. package/js/iso-objects/motion.js +9 -4
  20. package/js/iso-objects/timeline.js +60 -16
  21. package/js/iso-systems/compile.js +34 -3
  22. package/js/iso-systems/render.js +1 -1
  23. package/js/iso-systems/schema.json +1 -0
  24. package/js/iso-viewer/index.js +6 -0
  25. package/js/iso-viewer/page.js +40 -17
  26. package/js/iso-viewer/play.js +340 -0
  27. package/js/iso-viewer/player.js +147 -162
  28. package/js/iso-viewer/transport.js +289 -0
  29. package/package.json +61 -2
  30. package/src/iso-core/arimo.json +1 -0
  31. package/src/iso-core/arimo.ts +6 -0
  32. package/src/iso-core/index.ts +2 -1
  33. package/src/iso-core/kernel.ts +11 -1
  34. package/src/iso-core/mono.ts +306 -0
  35. package/src/iso-core/theme.ts +2 -1
  36. package/src/iso-editor/ui/canvas.ts +14 -1
  37. package/src/iso-objects/ants.ts +2 -2
  38. package/src/iso-objects/index.ts +5 -3
  39. package/src/iso-objects/mono-paint.ts +97 -0
  40. package/src/iso-objects/motion-doc.ts +0 -52
  41. package/src/iso-objects/motion-entry.ts +4 -3
  42. package/src/iso-objects/motion-schema.ts +55 -0
  43. package/src/iso-objects/motion.ts +6 -5
  44. package/src/iso-objects/scene.ts +3 -0
  45. package/src/iso-objects/timeline.ts +71 -15
  46. package/src/iso-objects/types.ts +2 -0
  47. package/src/iso-systems/compile.ts +37 -4
  48. package/src/iso-systems/render.ts +5 -1
  49. package/src/iso-systems/schema.json +1 -0
  50. package/src/iso-viewer/index.ts +4 -0
  51. package/src/iso-viewer/page.ts +28 -12
  52. package/src/iso-viewer/play.ts +280 -0
  53. package/src/iso-viewer/player.ts +133 -134
  54. package/src/iso-viewer/transport.ts +272 -0
  55. package/types/iso-core/arimo.d.ts +2 -0
  56. package/types/iso-core/index.d.ts +2 -1
  57. package/types/iso-core/kernel.d.ts +9 -0
  58. package/types/iso-core/mono.d.ts +61 -0
  59. package/types/iso-core/theme.d.ts +2 -0
  60. package/types/iso-objects/ants.d.ts +1 -0
  61. package/types/iso-objects/index.d.ts +5 -3
  62. package/types/iso-objects/mono-paint.d.ts +20 -0
  63. package/types/iso-objects/motion-doc.d.ts +0 -594
  64. package/types/iso-objects/motion-entry.d.ts +4 -3
  65. package/types/iso-objects/motion-schema.d.ts +594 -0
  66. package/types/iso-objects/motion.d.ts +4 -2
  67. package/types/iso-objects/scene.d.ts +3 -0
  68. package/types/iso-objects/timeline.d.ts +26 -3
  69. package/types/iso-objects/types.d.ts +2 -0
  70. package/types/iso-systems/compile.d.ts +8 -0
  71. package/types/iso-systems/render.d.ts +4 -0
  72. package/types/iso-viewer/index.d.ts +4 -0
  73. package/types/iso-viewer/play.d.ts +37 -0
  74. package/types/iso-viewer/transport.d.ts +73 -0
  75. package/types/player/isometric-diagram.d.ts +24 -0
  76. package/types/remotion/entry.d.ts +2 -0
  77. package/types/remotion/frames.d.ts +70 -0
  78. package/types/remotion/index.d.ts +39 -0
@@ -0,0 +1,280 @@
1
+ // The player (docs/design/MOTION.md, 6.2): a skin over a transport. The drawing, play and pause, back and next, the beats as dots by
2
+ // chapter, a scrubber, the commentary with its facts, the ambient switch, a text list of the beats. It owns no clock (transport.ts does)
3
+ // and draws nothing of its own: what shows is paint(svg, timeline.at(…)). Built as DOM (no HTML text but the commentary's own small
4
+ // Markdown, escaped), no style attributes, no storage, nothing fetched, so it runs under a strict CSP; its stylesheet is the host's to add
5
+ // (PLAY_CSS, in a page or a shadow root). The drawing is a self-contained one (compile's resolveVars), so no theme's CSS is needed.
6
+
7
+ import { paint, type SceneState } from '../iso-objects/motion.ts';
8
+ import type { CompiledScene } from '../iso-objects/compile.ts';
9
+ import type { BeatInfo, Timeline } from '../iso-objects/timeline.ts';
10
+ import { h } from './dom.ts';
11
+ import { md } from './page.ts';
12
+ import { transport, type Transport, type TransportClock } from './transport.ts';
13
+
14
+ export interface PlayerOptions {
15
+ scene: Pick<CompiledScene, 'rendered' | 'id'>;
16
+ /** none: the drawing alone, with nothing to play */
17
+ timeline?: Timeline;
18
+ /** what a screen reader calls it */
19
+ label?: string;
20
+ /** the controls and the commentary (default true): without them, the drawing alone */
21
+ controls?: boolean;
22
+ /** start at once, or each time most of it is in view (default: neither) */
23
+ autoplay?: boolean | 'visible';
24
+ loop?: boolean;
25
+ rate?: number;
26
+ ambient?: 'on' | 'off';
27
+ /** a reader who asked for less motion (default 'ignore': motion plays). 'respect': the last state, everything lit, the ambient off, until they press Play */
28
+ reducedMotion?: 'ignore' | 'respect';
29
+ mode?: 'light' | 'dark';
30
+ /** the timeline is the drawing's own steps (motionOfSteps): its callouts and marks show at their step, and the other steps' numbers dim */
31
+ steps?: boolean;
32
+ clock?: TransportClock;
33
+ }
34
+ export interface Player {
35
+ readonly root: HTMLElement;
36
+ readonly transport: Transport;
37
+ /** another drawing, or another document: the place is kept (transport's rebind). Faults are refused, and what plays goes on */
38
+ set(scene: Pick<CompiledScene, 'rendered' | 'id'>, timeline?: Timeline, mode?: 'light' | 'dark'): boolean;
39
+ /** show one moment, still: no clock, no controls (a screenshot, a link) */
40
+ freeze(ms: number): void;
41
+ /** to a beat and through it, stopping before the next */
42
+ step(beat: number): void;
43
+ dispose(): void;
44
+ }
45
+
46
+ /** which of the page's players plays: the one most in view (an autoplaying one that is not stops) */
47
+ const mounted = new Map<HTMLElement, { seen: number; auto(on: boolean): void; wants: boolean }>();
48
+ function pick() {
49
+ let best: HTMLElement | undefined, most = 0.35;
50
+ for (const [el, m] of mounted) if (m.wants && m.seen >= most && (m.seen > most || !best)) { best = el; most = m.seen; }
51
+ for (const [el, m] of mounted) if (m.wants) m.auto(el === best);
52
+ }
53
+
54
+ const svgOf = (text: string): SVGSVGElement => {
55
+ const doc = new DOMParser().parseFromString(text, 'image/svg+xml');
56
+ if (doc.documentElement.localName !== 'svg') throw new Error('the drawing is not SVG');
57
+ return document.importNode(doc.documentElement, true) as unknown as SVGSVGElement;
58
+ };
59
+ const clockText = (ms: number) => { const s = Math.round(ms / 1000); return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')}`; };
60
+ /** a drawing with nothing to play */
61
+ const NOTHING: Timeline = { ok: true, diags: [], duration: 0, beats: [], markers: {}, ambient: 'on', loops: false, at: () => ({}), cues: () => undefined, beatAt: () => undefined, startOf: () => undefined };
62
+ /** everything still hidden stays hidden; what is only dimmed is lit */
63
+ function lit(S: SceneState): SceneState {
64
+ const out: SceneState = { ...(S.camera ? { camera: S.camera } : {}), ...(S.variants ? { variants: S.variants } : {}) };
65
+ for (const k of ['items', 'labels', 'routes'] as const) {
66
+ const gone = Object.entries(S[k] ?? {}).filter(([, v]) => v.opacity === 0).map(([id]) => [id, { opacity: 0 }]);
67
+ if (gone.length) out[k] = Object.fromEntries(gone);
68
+ }
69
+ return out;
70
+ }
71
+
72
+ export function mountPlayer(host: HTMLElement | ShadowRoot, o: PlayerOptions): Player {
73
+ if (o.timeline && !o.timeline.ok) throw new Error(`the motion has faults: ${o.timeline.diags.map(d => `${d.path}: ${d.message}`).join('; ')}`);
74
+ let scene = o.scene, svg = svgOf(scene.rendered.svg), frozen: number | undefined, stepTo: number | undefined, userPaused = false, gone = false;
75
+ const tr = transport(o.timeline ?? NOTHING, { loop: o.loop, rate: o.rate, ambient: o.ambient, clock: o.clock });
76
+ const controls = o.controls ?? true;
77
+ const calm = o.reducedMotion === 'respect' && typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
78
+ let resting = calm;
79
+
80
+ // ---- the parts ----
81
+ const btn = (cls: string, label: string, text: string, f: () => void) => h('button', { type: 'button', class: `iso-play-btn ${cls}`, 'aria-label': label, title: label, on: { click: f as EventListener } }, text);
82
+ const stage = h('div', { class: 'iso-play-stage' }, svg as unknown as Node);
83
+ const back = btn('back', 'Back', '‹', () => byHand(() => step(Math.max(0, at() - 1))));
84
+ const play = btn('play', 'Play', '▶', () => toggle());
85
+ const next = btn('next', 'Next', '›', () => byHand(() => step(Math.min(tr.timeline.beats.length - 1, at() + 1))));
86
+ const again = btn('again', 'Reset', '↺', () => byHand(() => { stop(); tr.restart(); }));
87
+ const amb = btn('ambient', 'Ambient motion', '∿', () => { wake(); tr.ambient = !tr.ambient; show(); });
88
+ const bar = h('input', { type: 'range', class: 'iso-play-bar', min: 0, step: 1, 'aria-label': 'Time', on: { input: (() => byHand(() => { stop(); tr.seek(Number(bar.value)); })) as EventListener } });
89
+ const time = h('span', { class: 'iso-play-time' });
90
+ const dots = h('div', { class: 'iso-play-dots' });
91
+ const num = h('span', { class: 'iso-play-num' }), title = h('span', { class: 'iso-play-title' }), chapter = h('span', { class: 'iso-play-chapter' }), count = h('span', { class: 'iso-play-count' });
92
+ const text = h('div', { class: 'iso-play-text' }), code = h('pre', { class: 'iso-play-code' }), facts = h('dl', { class: 'iso-play-facts' });
93
+ const say = h('div', { class: 'iso-play-say', 'aria-live': 'polite' }, h('div', { class: 'iso-play-head' }, num, title, chapter, count), text, code, facts);
94
+ const list = h('details', { class: 'iso-play-list' });
95
+ const row = h('div', { class: 'iso-play-row' }, back, play, next, again, amb, bar, time);
96
+ const root = h('div', { class: 'iso-play', role: 'group', 'aria-roledescription': 'animated diagram', 'aria-label': o.label ?? 'Diagram', tabindex: controls ? 0 : undefined, 'data-mode': o.mode ?? 'light' },
97
+ stage, controls && row, controls && dots, controls && say, controls && list);
98
+ host.append(root);
99
+
100
+ // ---- what there is to show: the beats ----
101
+ let dotOf: HTMLButtonElement[] = [];
102
+ function beats() {
103
+ const all = tr.timeline.beats, some = all.length > 0, said = all.some(b => b.say);
104
+ dotOf = [];
105
+ dots.replaceChildren();
106
+ let group: HTMLElement | undefined, last: string | undefined;
107
+ for (const b of all) {
108
+ if (!group || b.say?.chapter !== last) { group = h('span', { class: 'iso-play-group', role: 'group', 'aria-label': b.say?.chapter, title: b.say?.chapter }); dots.append(group); last = b.say?.chapter; }
109
+ const d = h('button', { type: 'button', class: 'iso-play-dot', 'aria-label': `Step ${b.index + 1}: ${b.say?.title ?? b.name}`, title: b.say?.title ?? b.name, on: { click: (() => byHand(() => step(b.index))) as EventListener } });
110
+ group.append(d); dotOf.push(d);
111
+ }
112
+ list.replaceChildren(h('summary', null, `All ${all.length} steps as text`), h('ol', null, ...all.map(b => h('li', null, ...words(b)))));
113
+ for (const el of [back, next, dots]) el.hidden = !some;
114
+ say.hidden = !said; list.hidden = !said;
115
+ amb.hidden = !tr.timeline.loops;
116
+ bar.max = String(Math.round(tr.duration));
117
+ for (const el of [play, again, bar, time]) el.hidden = tr.duration <= 0;
118
+ told = undefined;
119
+ }
120
+ function words(b: BeatInfo): Node[] {
121
+ const s = b.say, out: Node[] = [h('b', null, s?.title ?? b.name)];
122
+ if (s?.text) { const p = h('div', null); p.innerHTML = md(s.text); out.push(p); }
123
+ if (s?.code) out.push(h('code', null, s.code));
124
+ if (s?.facts?.length) out.push(h('span', null, s.facts.map(([k, v]) => `${k}: ${v}`).join(' · ')));
125
+ return out;
126
+ }
127
+ let told: BeatInfo | undefined;
128
+ /** what is drawn for one step alone: the rest of it is the Timeline's */
129
+ function marks(b: BeatInfo | undefined) {
130
+ const n = String((b?.index ?? -1) + 1);
131
+ for (const e of svg.querySelectorAll('[data-badge]')) {
132
+ e.classList.toggle('on', e.getAttribute('data-badge') === n);
133
+ if (o.steps) { if (e.getAttribute('data-badge') === n || resting) e.removeAttribute('opacity'); else e.setAttribute('opacity', '0.14'); }
134
+ }
135
+ if (o.steps) for (const e of svg.querySelectorAll('[data-step]')) e.setAttribute('visibility', e.getAttribute('data-step') === n && !resting ? 'visible' : 'hidden');
136
+ }
137
+ function caption() {
138
+ const b = tr.beat;
139
+ if (b === told) return;
140
+ told = b;
141
+ marks(b);
142
+ if (!controls) return;
143
+ const s = b?.say;
144
+ num.textContent = b ? String(b.index + 1) : '';
145
+ num.style.backgroundColor = s?.color ?? '';
146
+ title.textContent = s?.title ?? b?.name ?? '';
147
+ chapter.textContent = s?.chapter ?? '';
148
+ count.textContent = b ? `${b.index + 1} / ${tr.timeline.beats.length}` : '';
149
+ text.innerHTML = md(s?.text);
150
+ code.textContent = s?.code ?? '';
151
+ facts.replaceChildren(...(s?.facts ?? []).flatMap(([k, v]) => [h('dt', null, k), h('dd', null, v)]));
152
+ code.hidden = !s?.code; facts.hidden = !s?.facts?.length;
153
+ dotOf.forEach((d, i) => { d.classList.toggle('on', i === b?.index); d.classList.toggle('done', b !== undefined && i < b.index); if (i === b?.index) d.setAttribute('aria-current', 'step'); else d.removeAttribute('aria-current'); });
154
+ }
155
+ function show() {
156
+ const S = frozen !== undefined ? tr.timeline.at(frozen, { ambient: frozen }) : resting ? lit(tr.timeline.at(tr.duration, { ambient: 'off' })) : tr.state();
157
+ paint(svg, S, scene.rendered, { styles: 'cssom' });
158
+ root.dataset.time = String(Math.round(frozen ?? tr.time));
159
+ if (frozen !== undefined) marks(tr.timeline.beatAt(frozen)); else caption();
160
+ if (!controls) return;
161
+ bar.value = String(Math.round(tr.time));
162
+ bar.setAttribute('aria-valuetext', `${clockText(tr.time)} of ${clockText(tr.duration)}${tr.beat ? `, ${tr.beat.say?.title ?? tr.beat.name}` : ''}`);
163
+ time.textContent = `${clockText(tr.time)} / ${clockText(tr.duration)}`;
164
+ }
165
+ function buttons() {
166
+ const on = going();
167
+ play.textContent = on ? '❚❚' : '▶';
168
+ play.setAttribute('aria-label', on ? 'Pause' : 'Play'); play.title = on ? 'Pause' : 'Play';
169
+ amb.setAttribute('aria-pressed', String(tr.ambient));
170
+ say.setAttribute('aria-live', on ? 'off' : 'polite');
171
+ root.dataset.playing = String(on);
172
+ }
173
+
174
+ // ---- playing ----
175
+ /** playing on and on, not only through one step */
176
+ const going = () => tr.playing && stepTo === undefined;
177
+ const at = () => tr.beat?.index ?? 0;
178
+ /** a reader who asked for less motion has asked for some */
179
+ function wake() { if (resting) { resting = false; told = undefined; } }
180
+ /** the reader did it: an autoplay doesn't start again by itself */
181
+ function byHand(f: () => void) { wake(); userPaused = true; f(); buttons(); show(); }
182
+ function stop() { stepTo = undefined; tr.pause(); }
183
+ function step(i: number) {
184
+ const b = tr.timeline.beats[i];
185
+ if (!b || gone) return;
186
+ tr.pause();
187
+ tr.seek(b.start, { join: true });
188
+ const nextStart = tr.timeline.beats[i + 1]?.start ?? Infinity;
189
+ // through the beat, and to a stop within it (its end is the next one's start)
190
+ stepTo = Math.max(b.start, Math.min(b.end, nextStart, tr.duration) - 1);
191
+ tr.play({ until: stepTo });
192
+ }
193
+ function toggle() {
194
+ wake();
195
+ if (going()) { userPaused = true; stop(); } else { userPaused = false; stepTo = undefined; tr.pause(); tr.play(); }
196
+ buttons(); show();
197
+ }
198
+ tr.on('time', show);
199
+ tr.on('play', buttons); tr.on('ambient', buttons);
200
+ tr.on('pause', () => { stepTo = undefined; buttons(); });
201
+ root.addEventListener('keydown', e => {
202
+ const k = e.key, t = e.target as Element;
203
+ if (e.altKey || e.ctrlKey || e.metaKey || t === bar) return;
204
+ if (k === 'ArrowRight' || k === 'ArrowLeft') { e.preventDefault(); (k === 'ArrowRight' ? next : back).click(); }
205
+ else if (k === 'Home') { e.preventDefault(); again.click(); }
206
+ else if ((k === ' ' || k === 'k') && t === root) { e.preventDefault(); toggle(); }
207
+ });
208
+ const onBadge = (e: Event) => {
209
+ const b = (e.target as Element).closest?.('[data-go]'), key = (e as KeyboardEvent).key;
210
+ if (!b || (e.type === 'keydown' && key !== 'Enter' && key !== ' ')) return;
211
+ e.preventDefault(); e.stopPropagation();
212
+ byHand(() => step(Number(b.getAttribute('data-go')) - 1));
213
+ };
214
+ stage.addEventListener('click', onBadge); stage.addEventListener('keydown', onBadge);
215
+
216
+ // ---- in view: neither clock moves for a player nobody can see; one that autoplays in view is one at a time ----
217
+ const me = {
218
+ seen: 0, wants: o.autoplay === 'visible' && !calm,
219
+ auto(on: boolean) { if (on) { if (!userPaused && !going()) { stepTo = undefined; tr.play(); } } else if (going()) { stepTo = undefined; tr.pause(); } },
220
+ };
221
+ mounted.set(root, me);
222
+ const io = typeof IntersectionObserver === 'function' ? new IntersectionObserver(es => { for (const e of es) { me.seen = e.isIntersecting ? e.intersectionRatio : 0; if (frozen === undefined) tr.active = e.isIntersecting; } pick(); }, { threshold: [0, 0.2, 0.35, 0.5, 0.7, 0.9, 1] }) : undefined;
223
+ io?.observe(root);
224
+
225
+ beats(); buttons(); show();
226
+ if (o.autoplay === true && !calm) tr.play();
227
+ return {
228
+ root, transport: tr, step: i => byHand(() => step(i)),
229
+ set(s, tl = NOTHING, mode) {
230
+ if (gone || !tl.ok) return false;
231
+ const fresh = svgOf(s.rendered.svg);
232
+ scene = s; svg.replaceWith(fresh); svg = fresh;
233
+ if (mode) root.dataset.mode = mode;
234
+ if (stepTo !== undefined) stop();
235
+ tr.rebind(tl);
236
+ beats(); buttons(); show();
237
+ return true;
238
+ },
239
+ freeze(ms) { frozen = ms; tr.pause(); tr.active = false; root.classList.add('frozen'); show(); },
240
+ dispose() { gone = true; io?.disconnect(); mounted.delete(root); tr.dispose(); root.remove(); pick(); },
241
+ };
242
+ }
243
+
244
+ /** The player's stylesheet: its own, under one class; the colours are custom properties a host may set. */
245
+ export const PLAY_CSS = `
246
+ .iso-play{--ip-ink:#1c2026;--ip-muted:#68707c;--ip-line:#dfe3e8;--ip-bg:#fff;--ip-code:#f2f4f7;--ip-focus:#2a64d6;container:iso-play/inline-size;display:block;color:var(--ip-ink);background:var(--ip-bg);font:14px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;border-radius:10px}
247
+ .iso-play[data-mode="dark"]{--ip-ink:#e6e9ee;--ip-muted:#98a1ae;--ip-line:#333a44;--ip-bg:#15181d;--ip-code:#1f242b;--ip-focus:#7aa7ff;color-scheme:dark}
248
+ .iso-play:focus-visible,.iso-play button:focus-visible,.iso-play input:focus-visible,.iso-play summary:focus-visible{outline:2px solid var(--ip-focus);outline-offset:2px}
249
+ .iso-play [hidden]{display:none}
250
+ .iso-play-stage svg{display:block;width:100%;height:auto}
251
+ .iso-play-stage [data-go]{cursor:pointer}
252
+ .iso-play-row{display:flex;align-items:center;gap:6px;padding:8px 12px 4px}
253
+ .iso-play-btn{font:inherit;min-width:32px;height:32px;padding:0 8px;border:1px solid var(--ip-line);border-radius:8px;background:none;color:inherit;cursor:pointer}
254
+ .iso-play-btn:hover{border-color:var(--ip-muted)}
255
+ .iso-play-btn.play{background:var(--ip-ink);color:var(--ip-bg);border-color:var(--ip-ink);min-width:44px}
256
+ .iso-play-btn.ambient[aria-pressed="false"]{color:var(--ip-muted);text-decoration:line-through}
257
+ .iso-play-bar{flex:1 1 60px;min-width:0;accent-color:var(--ip-ink)}
258
+ .iso-play-time{color:var(--ip-muted);font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
259
+ .iso-play-dots{display:flex;flex-wrap:wrap;gap:4px 12px;padding:2px 12px}
260
+ .iso-play-group{display:inline-flex;gap:0}
261
+ .iso-play-dot{width:24px;height:24px;padding:0;border:0;background:none;cursor:pointer;display:grid;place-items:center}
262
+ .iso-play-dot::before{content:"";width:9px;height:9px;border-radius:50%;background:var(--ip-line)}
263
+ .iso-play-dot.done::before{background:var(--ip-muted)}
264
+ .iso-play-dot.on::before{background:var(--ip-ink);width:11px;height:11px}
265
+ .iso-play-say{padding:4px 12px 10px;min-height:5.2em}
266
+ .iso-play-head{display:flex;align-items:baseline;gap:8px;font-weight:700}
267
+ .iso-play-num{flex:none;display:inline-grid;place-items:center;min-width:22px;height:22px;border-radius:11px;background:var(--ip-ink);color:var(--ip-bg);font-size:11px;align-self:center}
268
+ .iso-play-chapter,.iso-play-count{color:var(--ip-muted);font-size:12px;font-weight:500}
269
+ .iso-play-count{margin-left:auto;white-space:nowrap}
270
+ .iso-play-text{max-width:80ch}
271
+ .iso-play-text a{color:inherit}
272
+ .iso-play-code{margin:6px 0 0;padding:6px 10px;border-radius:8px;background:var(--ip-code);font:12px/1.5 ui-monospace,Menlo,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
273
+ .iso-play-facts{display:flex;flex-wrap:wrap;gap:2px 16px;margin:6px 0 0;font-size:12px}
274
+ .iso-play-facts dt{color:var(--ip-muted)}
275
+ .iso-play-facts dd{margin:0 8px 0 -10px;font-weight:600}
276
+ .iso-play-list{padding:0 12px 10px;font-size:13px}
277
+ .iso-play-list summary{color:var(--ip-muted);cursor:pointer}
278
+ .iso-play.frozen>:not(.iso-play-stage){display:none}
279
+ @container iso-play (max-width:420px){.iso-play-time{display:none}.iso-play-row{flex-wrap:wrap}.iso-play-bar{flex-basis:100%;order:9}}
280
+ `;