/* One block per app. Sizes are in viewport units so each app fills the screen, and so
   its miniature tile is the same layout scaled down. */

/* ---- forms that turn any text into something else ---- */

/* nametag */
.nametag .badge { position: absolute; left: 50%; top: 44vh; width: min(88vw, 124vh); height: 76vh; transform: translate(-50%, -50%) rotate(-2deg); display: flex; flex-direction: column; overflow: hidden; border-radius: 4vh; background: #e02929; box-shadow: 0 2vh 6vh #0005; }
.nametag .top { display: grid; gap: .4vh; padding: 3vh 0 2.4vh; text-align: center; color: #fff; }
.nametag .top b { font: 800 clamp(26px, 10vh, 96px) / 1 var(--sans); letter-spacing: .12em; }
.nametag .top span { font: 600 clamp(12px, 3.2vh, 30px) var(--sans); letter-spacing: .08em; }
.nametag .field { flex: 1; min-height: 0; margin: 0 2.2vh 2.2vh; padding: 1vh 3vw; display: grid; place-content: center; overflow: hidden; border-radius: 2.2vh; background: #fff; color: #16233f; text-align: center; font-family: Caveat, 'Segoe Script', cursive; }
.nametag .name { font-weight: 700; line-height: 1; overflow-wrap: anywhere; }

/* keys */
.keys .figs, .letters .facts { position: absolute; left: 4vw; right: 4vw; display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6vh 4vw; }
.keys .figs { top: 6vh; }
.keys .figs div { display: grid; gap: .3vh; text-align: center; font-size: clamp(10px, 1.7vh, 14px); }
.keys .figs b { font: 650 clamp(15px, 3.4vh, 32px) var(--sans); font-variant-numeric: tabular-nums; }
.keys .board { position: absolute; left: 50%; top: 53vh; transform: translate(-50%, -50%); --k: calc(min(92vw, 122vh) / 11.4); width: calc(var(--k) * 11.4); display: grid; gap: calc(var(--k) * .1); }
.keys .row { display: flex; gap: calc(var(--k) * .1); padding-left: calc(var(--k) * var(--in, 0)); }
.keys .row i { flex: none; width: calc(var(--k) * .9); height: calc(var(--k) * .9); display: grid; place-items: center; border-radius: calc(var(--k) * .16); border: 1px solid var(--line);
  font: 500 calc(var(--k) * .3) var(--mono); text-transform: uppercase; color: var(--dim); background: color-mix(in srgb, var(--accent) calc(var(--h, 0) * 100%), var(--soft)); }
.keys .row i.hot { color: var(--bg); }
.keys .row .space { width: calc(var(--k) * 5.4); margin-left: calc(var(--k) * 2.7); }
.keys .path { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.keys polyline { fill: none; stroke: var(--fg); stroke-width: 1.5; stroke-linejoin: round; opacity: .32; }

/* small counts under a form */
.skyline .cap, .mosaic .cap, .emoji .cap, .mandala .cap { position: absolute; left: 4vw; right: 4vw; top: 82vh; text-align: center; font: clamp(11px, 2vh, 18px) var(--mono); }

/* skyline */
.skyline .town { position: absolute; left: 3vw; top: 15vh; width: 94vw; height: 65vh; }
.skyline .b { fill: var(--fg); }
.skyline .w { fill: color-mix(in srgb, var(--bg) 22%, var(--fg)); }
.skyline .w.on { fill: var(--accent); }

/* mosaic */
.mosaic .quilt { position: absolute; left: 50%; top: 43vh; transform: translate(-50%, -50%); display: grid; grid-template-columns: repeat(var(--cols, 1), var(--cell, 20px)); gap: calc(var(--cell, 20px) * .07); }
.mosaic .quilt i { width: var(--cell); height: var(--cell); border-radius: 16%; background: var(--c, transparent); }
.mosaic .quilt .gap { border: 1px dashed var(--line); }
.mosaic .quilt .dot { background: radial-gradient(circle, var(--fg) 0 22%, transparent 24%); }
.mosaic .quilt i:last-child { animation: pop .28s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes pop { from { transform: scale(.2); } }

/* stats */
.stats .grid { position: absolute; left: 50%; top: 50vh; transform: translate(-50%, -50%); width: min(92vw, 1240px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6vh; }
.stats .grid div { min-width: 0; padding: 2.2vh 2vh; display: grid; gap: .5vh; border: 1px solid var(--line); border-radius: 2vh; background: var(--soft); }
.stats .grid .wide { grid-column: 1 / -1; }
.stats b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 clamp(20px, 7.4vh, 72px) / 1.05 var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats span { font-size: clamp(10px, 2vh, 17px); color: var(--dim); }

/* reading */
.reading .hero { position: absolute; left: 6vw; top: 7vh; display: flex; gap: 5vw; }
.reading .hero div { display: grid; gap: .6vh; }
.reading .hero b { font: 700 min(19vh, 13vw) / .92 var(--sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--accent); }
.reading .hero span { font-size: clamp(11px, 2.2vh, 19px); color: var(--dim); }
.reading .src { position: absolute; left: 6vw; top: 33.5vh; font: clamp(10px, 1.8vh, 15px) var(--mono); }
.reading .radar { position: absolute; left: 25vw; top: 61vh; width: min(40vw, 62vh); height: 44vh; transform: translate(-50%, -50%); overflow: visible; }
.reading .web { fill: none; stroke: var(--line); stroke-width: .3; }
.reading .shape { fill: color-mix(in srgb, var(--accent) 34%, transparent); stroke: var(--accent); stroke-width: .9; stroke-linejoin: round; }
.reading text { fill: var(--dim); font: 4px var(--sans); text-anchor: middle; }
.reading .lean { position: absolute; left: 54vw; right: 5vw; top: 9vh; display: grid; gap: 2.4vh; }
.reading h4 { margin: 0 0 .2vh; font: 500 clamp(11px, 2.2vh, 19px) var(--sans); }
.reading .lean div { display: grid; grid-template-columns: minmax(5em, 8.4em) 1fr 3em; align-items: center; gap: .7em; font: 650 clamp(15px, 3.8vh, 36px) var(--sans); }
.reading .lean span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading .lean i, .reading .meters i { display: block; height: 1.8vh; min-height: 6px; border-radius: 0 99px 99px 0; overflow: hidden; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.reading .lean b, .reading .meters b { display: block; height: 100%; border-radius: 0 99px 99px 0; background: var(--accent); transition: width .18s ease-out; }
.reading em { text-align: right; font-style: normal; font-variant-numeric: tabular-nums; }
.reading .lean em { font-size: .78em; font-weight: 500; }
.reading .meters { position: absolute; left: 54vw; right: 5vw; top: 60vh; display: grid; grid-template-columns: 1fr 1fr; gap: 2vh 3vw; }
.reading .meters div { display: grid; grid-template-columns: 4.4em 1fr 2.8em; align-items: center; gap: .7em; font-size: clamp(11px, 2.1vh, 18px); }
.reading .meters span { color: var(--dim); }
.reading .meters i { height: .8vh; min-height: 4px; }
@media (orientation: portrait) {
  .reading .hero { top: 5vh; gap: 8vw; }
  .reading .hero b { font-size: 9.5vh; }
  .reading .src { top: 19.5vh; }
  .reading .radar { left: 50%; top: 35vh; width: 76vw; height: 24vh; }
  .reading .lean { left: 6vw; right: 6vw; top: 47.5vh; gap: .6vh; }
  .reading .lean div { font-size: clamp(13px, 2.3vh, 21px); }
  .reading .meters { left: 6vw; right: 6vw; top: 73.5vh; gap: 1vh 5vw; }
}

/* emoji */
.emoji .row { position: absolute; left: 5vw; right: 5vw; top: 46vh; transform: translateY(-50%); max-height: 62vh; overflow: hidden; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .05em .22em; line-height: 1.18; }
.emoji .row i { font-size: .36em; color: var(--dim); opacity: .6; }

/* mandala */
.mandala .rose { position: absolute; left: 50%; top: 43vh; width: min(80vh, 92vw); height: min(80vh, 92vw); transform: translate(-50%, -50%); overflow: visible; }
.mandala g { animation: turn 90s linear infinite; }
.mandala g:nth-child(even) { animation-direction: reverse; }
.mandala path { fill: none; stroke: var(--fg); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mandala g:nth-child(3n + 1) path { stroke: var(--accent); }
@keyframes turn { to { transform: rotate(360deg); } }

/* morse */
.morse .lamp { position: absolute; left: 50%; top: 5vh; width: 7vh; height: 7vh; margin-left: -3.5vh; border-radius: 50%; border: 1px solid var(--line); background: var(--soft); }
.morse .lamp.on { background: var(--accent); box-shadow: 0 0 6vh var(--accent); }
.morse .tape { position: absolute; left: 5vw; right: 5vw; top: 15vh; height: 61vh; overflow: hidden; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: .9em .8em; }
.morse .tape span { display: grid; justify-items: center; gap: .25em; }
.morse .tape b { display: flex; align-items: center; gap: .16em; height: .36em; }
.morse .dot, .morse .dash { display: block; height: .32em; border-radius: 99px; background: var(--fg); }
.morse .dot { width: .32em; }
.morse .dash { width: .96em; }
.morse em { font: .42em var(--mono); color: var(--dim); text-transform: uppercase; }
.morse .gap { width: 1.1em; }
.morse .now .dot, .morse .now .dash { background: var(--accent); }
.morse .now em { color: var(--accent); }
.morse .ctl, .melody .ctl { position: absolute; left: 4vw; right: 4vw; top: 78vh; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1vh 2vh; font-size: clamp(12px, 2vh, 18px); }

/* melody */
.melody .roll { position: absolute; left: 3vw; right: 3vw; top: 7vh; height: 66vh; }
.melody svg { display: block; width: 100%; height: 100%; }
.melody .row { stroke: var(--line); stroke-width: 1; }
.melody rect { fill: var(--accent); }
.melody .hit rect { fill: var(--fg); }
.melody text { fill: var(--bg); font: 600 12px var(--mono); text-anchor: middle; }
.melody .head { display: none; stroke: var(--fg); stroke-width: 2; }
.melody .ctl label { display: flex; align-items: center; gap: .6em; cursor: pointer; }

/* stars: a night sky whatever the mood */
.stars .screen { background: linear-gradient(#070b1f, #121a3a 70%, #1c2148); }
.stars .sky, .stars .map { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.stars .map { top: 11vh; height: 72vh; }
.stars .sky circle { fill: #fff; opacity: .5; }
.stars .map path { fill: none; stroke: #9fb4ff; stroke-width: 1; opacity: .5; vector-effect: non-scaling-stroke; }
.stars .map circle { fill: #fff; }
.stars .map .halo { fill: #9fb4ff; opacity: .16; }
.stars .map g { animation: twinkle 3s ease-in-out infinite alternate; }
.stars .map text { fill: #c9d4ff; font: 2.1px var(--sans); text-anchor: middle; opacity: .85; }
@keyframes twinkle { to { opacity: .55; } }
.stars .cap { position: absolute; left: 0; right: 0; top: 84vh; text-align: center; font: clamp(11px, 2vh, 18px) var(--mono); color: #c9d4ffaa; }

/* letters */
.letters .plot { position: absolute; left: 4vw; right: 4vw; top: 6vh; height: 58vh; }
.letters svg { display: block; width: 100%; height: 100%; overflow: visible; }
.letters .bar { fill: var(--accent); transition: opacity .12s; }
.letters .bar.off { opacity: .35; }
.letters .zero { stroke: var(--dim); stroke-width: 1; }
.letters text { fill: var(--dim); font: 12px var(--sans); text-anchor: middle; }
.letters .val { fill: var(--fg); font-weight: 600; font-size: 13px; }
.letters .lab.none { opacity: .4; }
.letters .hit { fill: transparent; }
.letters .tip { position: absolute; z-index: 2; transform: translate(12px, -130%); pointer-events: none; opacity: 0; padding: 5px 10px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 13px; white-space: nowrap; }
.letters .facts { position: absolute; left: 4vw; right: 4vw; top: 68vh; display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6vh 4vw; }
.letters .facts div { display: grid; gap: .3vh; text-align: center; font-size: clamp(10px, 1.7vh, 14px); }
.letters .facts b { font: 650 clamp(14px, 3.2vh, 30px) var(--sans); }

/* ---- forms that act on something in the text ---- */

/* todo */
.todo .col { top: calc(12vh + 50px); --w: 820px; }
.todo .prog { display: flex; align-items: center; gap: 2vh; margin-bottom: 1.6vh; font-size: clamp(13px, 2vh, 18px); color: var(--dim); white-space: nowrap; }
.todo .track { flex: 1; height: .8vh; min-height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; display: block; }
.todo .track b { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.todo .items { display: grid; gap: var(--gap); }
.todo label { display: flex; gap: 2vh; align-items: center; padding: 1.1vh 2.2vh; border: 1px solid var(--line); border-radius: 1.8vh; background: var(--soft); font-size: clamp(16px, 2.7vh, 30px); cursor: pointer; }
.todo input { accent-color: var(--accent); width: 2.8vh; height: 2.8vh; min-width: 16px; min-height: 16px; flex: none; }
.todo input:checked + span { text-decoration: line-through; color: var(--dim); }

/* calc */
.calc .res { position: absolute; left: 4vw; right: 4vw; top: 20vh; height: 30vh; display: grid; place-items: center; white-space: nowrap;
  font: 600 min(28vh, calc(138vw / var(--n, 4))) / 1 var(--mono); letter-spacing: -.04em; color: var(--accent); }
.calc .detail { position: absolute; left: 4vw; right: 4vw; top: 51.5vh; text-align: center; font: clamp(13px, 2.2vh, 20px) var(--mono); }
.calc .keys { position: absolute; left: 50%; bottom: 5vh; transform: translateX(-50%); width: min(92vw, 720px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2vh; }
.calc .keys button { height: 7.4vh; font: clamp(15px, 3vh, 28px) var(--mono); color: var(--fg); background: var(--soft); cursor: pointer; border: 1px solid var(--line); border-radius: 1.6vh; }
.calc .keys button:hover { background: var(--line); }

/* timer */
.timer svg { position: absolute; left: 50%; top: 45vh; width: min(80vh, 92vw); transform: translate(-50%, -50%); overflow: visible; }
.timer circle { fill: none; stroke-width: 2.4; }
.timer .track { stroke: var(--line); }
.timer .arc { stroke: var(--accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.timer text { fill: var(--fg); font: 600 21px var(--mono); text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; }
.timer text.sub { font: 4px var(--sans); fill: var(--dim); letter-spacing: .06em; }
.timer .ctl { position: absolute; left: 50%; top: calc(45vh + min(80vh, 92vw) * .22); transform: translateX(-50%); display: flex; align-items: center; gap: 1.4vh; }
.timer.done .track { stroke: var(--accent); animation: pulse .7s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .25; } }

/* clock */
.clock .face { position: absolute; left: 50%; top: 40vh; width: min(62vh, 86vw); transform: translate(-50%, -50%); overflow: visible; }
.clock .face line { stroke: var(--fg); stroke-linecap: round; }
.clock .face .min { stroke-width: .3; opacity: .5; }
.clock .face .hr { stroke-width: .9; }
.clock .hand.h { stroke-width: 2.6; }
.clock .hand.m { stroke-width: 1.7; }
.clock .hand.s { stroke: var(--accent); stroke-width: .7; }
.clock .face circle { fill: var(--accent); }
.clock .read { position: absolute; left: 4vw; right: 4vw; top: calc(40vh + min(62vh, 86vw) / 2 + 2.5vh); text-align: center; }
.clock .time { font: 650 clamp(24px, 6vh, 58px) var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock .where { margin-top: .6vh; font-size: clamp(12px, 2.2vh, 20px); color: var(--dim); }

/* date */
.date .col { top: calc(10vh + 44px); --w: 1100px; }
.date .head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.date h3 { margin: 0; font-size: clamp(18px, min(4.4vh, 4.6vw), 42px); font-weight: 650; }
.date .rel { color: var(--accent); font-size: clamp(13px, 2.6vh, 24px); font-weight: 600; white-space: nowrap; }
.date .sub { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 1vh 0 1.4vh; font-size: clamp(12px, 1.9vh, 16px); }
.date .nav { display: flex; align-items: center; gap: 1vh; }
.date .mo { min-width: 9.5em; text-align: center; }
.date .grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: auto; grid-auto-rows: 1fr; gap: .8vh; height: 56vh; }
.date .grid span { min-height: 0; padding: .9vh 1.1vh; border-radius: 1.2vh; background: var(--soft); font-size: clamp(12px, 2.2vh, 20px); }
.date .grid .h { background: none; color: var(--dim); font-size: clamp(10px, 1.6vh, 14px); padding: 0 1.1vh; }
.date .grid .e { background: none; }
.date .grid .today { outline: 2px solid var(--fg); outline-offset: -2px; }
.date .grid .pick { background: var(--accent); color: var(--bg); font-weight: 650; }

/* color: the screen is the colour; --ink is black or white, whichever reads on it */
.color .screen { color: var(--ink, #fff); }
.color .fill { position: absolute; inset: 0; background: var(--c, #2f7f6b); }
.color .hue { position: absolute; top: 0; left: 0; right: 0; height: 5vh; cursor: crosshair;
  background: linear-gradient(to right, hsl(0 85% 55%), hsl(60 85% 55%), hsl(120 85% 55%), hsl(180 85% 55%), hsl(240 85% 55%), hsl(300 85% 55%), hsl(360 85% 55%)); }
.color .hex { position: absolute; left: 0; right: 0; top: 9vh; height: 30vh; display: grid; place-items: center; background: none; border: 0; color: inherit; cursor: copy;
  font: 700 min(19vw, 26vh) / 1 var(--mono); letter-spacing: -.05em; }
.color .vals { position: absolute; left: 4vw; right: 4vw; top: 41vh; display: flex; justify-content: center; flex-wrap: wrap; gap: 1.4vh; }
.color .vals .btn { font-family: var(--mono); color: var(--ink); border-color: color-mix(in srgb, var(--ink) 35%, transparent); background: color-mix(in srgb, var(--ink) 10%, transparent); cursor: copy; }
.color .strip { position: absolute; left: 4vw; right: 4vw; height: 13vh; display: flex; border-radius: 1.6vh; overflow: hidden; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent); }
.color .shades { top: 52vh; }
.color .harm { top: 68vh; }
.color .strip button { flex: 1; min-width: 0; border: 0; padding: 1vh .3vw; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; text-align: center; font: clamp(8px, 1.5vh, 13px) var(--mono); }
.color .strip span { overflow: hidden; }

/* draw: white paper whatever the mood, so the inks and the saved PNG look the same */
.draw .screen { --fg: #111; --bg: #fff; --dim: #1119; --line: #1113; --soft: #1111; color: var(--fg); }
.draw canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; background-color: #fff;
  background-image: radial-gradient(#1112 1.5px, transparent 1.5px); background-size: 28px 28px; }
.draw .hint { position: absolute; top: 44vh; left: 0; right: 0; text-align: center; font-size: clamp(18px, 4vh, 40px); pointer-events: none; }
.draw .tools { position: absolute; top: 3vh; left: 50%; transform: translateX(-50%); width: max-content; max-width: 94vw; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1vh;
  padding: 1vh 1.6vh; border-radius: 3.4vh; background: #fffd; border: 1px solid var(--line); }
.draw .tools > i { width: 1px; height: 3vh; background: var(--line); }
.draw .ink, .draw .w { width: 3.4vh; height: 3.4vh; min-width: 24px; min-height: 24px; padding: 0; border-radius: 50%; cursor: pointer; }
.draw .ink { border: 2px solid #fff; background: var(--c); }
.draw .ink.sel { box-shadow: 0 0 0 2px #111; }
.draw .w { border: 1px solid var(--line); background: none; display: grid; place-items: center; }
.draw .w b { width: var(--w); height: var(--w); border-radius: 50%; background: #111; }
.draw .w.sel { background: var(--line); }

/* dice */
.dice .out { position: absolute; left: 4vw; right: 4vw; top: 7vh; height: 58vh; display: grid; place-content: center; justify-items: center; gap: 2vh; text-align: center; }
.dice .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.4vh; --size: min(20vh, calc(84vw / var(--n, 1) - 2.4vh)); }
.dice .die { width: var(--size); aspect-ratio: 1; padding: calc(var(--size) * .13); border-radius: 16%; background: #fff; color: #111; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); box-shadow: 0 1vh 3vh #0003; }
.dice .pip { margin: 14%; border-radius: 50%; background: #111; }
.dice .die.num { display: grid; grid-template: none; place-items: center; padding: 0; font: 700 calc(var(--size) * .42) var(--mono); }
.dice .coin { width: calc(var(--size) * 1.4); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--bg);
  font: 700 calc(var(--size) * .24) var(--sans); letter-spacing: .08em; text-transform: uppercase; box-shadow: inset 0 0 0 .8vh color-mix(in srgb, var(--bg) 30%, transparent), 0 1vh 3vh #0003; }
.dice .big { font: 700 min(34vh, 30vw) / 1 var(--mono); letter-spacing: -.04em; color: var(--accent); }
.dice .big.word { font: 700 min(15vh, 11vw) / 1.05 var(--sans); letter-spacing: -.02em; overflow-wrap: anywhere; }
.dice .rest { font-size: clamp(14px, 2.6vh, 24px); }
.dice .pw { max-width: 92vw; padding: 2vh 3vh; border: 1px solid var(--line); border-radius: 2vh; background: var(--soft); color: var(--fg); font: 600 min(6vh, 4.4vw) var(--mono); overflow-wrap: anywhere; cursor: copy; }
.dice .cap { position: absolute; left: 4vw; right: 4vw; top: 68vh; text-align: center; font-size: clamp(12px, 2.2vh, 20px); }
.dice .again { position: absolute; left: 50%; top: 75vh; transform: translateX(-50%); }
.dice .rolling > * { animation: roll .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes roll { from { transform: rotate(-14deg) scale(.6); opacity: 0; } }

/* chart */
.chart .ttl { position: absolute; left: calc(4vw + 64px); top: calc(10vh + 40px); font: 650 clamp(14px, 2.6vh, 22px) var(--sans); }
.chart .plot { position: absolute; left: 4vw; right: 4vw; top: calc(10vh + 62px); bottom: 17vh; overflow: auto; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .bar { fill: var(--accent); transition: opacity .12s; }
.chart .bar.off { opacity: .35; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--dim); stroke-width: 1; }
.chart text { fill: var(--dim); font: 12px var(--sans); }
.chart .tick { text-anchor: end; font-variant-numeric: tabular-nums; }
.chart .lab { text-anchor: middle; }
.chart .val { text-anchor: middle; fill: var(--fg); font-weight: 600; font-size: 13px; }
.chart .hit { fill: transparent; }
.chart .tip { position: absolute; z-index: 2; transform: translate(12px, -130%); pointer-events: none; opacity: 0; padding: 5px 10px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 13px; white-space: nowrap; }
.chart .foot { position: absolute; left: 4vw; right: 4vw; bottom: 4.5vh; display: flex; justify-content: center; align-items: center; gap: 4vw; }
.chart .figs { display: flex; gap: 4vw; }
.chart .figs div { display: grid; gap: .3vh; text-align: center; font-size: clamp(10px, 1.7vh, 14px); }
.chart .figs b { font: 650 clamp(16px, 3.6vh, 34px) var(--sans); font-variant-numeric: tabular-nums; }
.chart table { margin: 0 auto; border-collapse: collapse; font-size: clamp(13px, 2.2vh, 18px); }
.chart th, .chart td { padding: .7vh 3vw; border-bottom: 1px solid var(--line); text-align: left; }
.chart th { color: var(--dim); font-weight: 500; }
.chart th:last-child, .chart td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.chart .empty { position: absolute; left: 4vw; right: 4vw; top: 40vh; text-align: center; font-size: clamp(15px, 3vh, 26px); line-height: 1.6; }

/* code */
.code .pane { position: absolute; right: 2vw; top: 11.5vh; bottom: 15.5vh; width: 45vw; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--fg) 6%, transparent); }
.code .bar { display: flex; justify-content: space-between; padding: 1vh 14px; border-bottom: 1px solid var(--line); font: 12px var(--mono); }
.code .lines { flex: 1; overflow: auto; padding: 1.2vh 14px; font: clamp(13px, 2vh, 17px) / 1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.code .ln.err { color: #e5484d; }
.code .ln.warn { color: #c2820a; }
.code .ln.val { color: var(--accent); font-weight: 600; }
.code .ln.wait { color: var(--dim); }
@media (orientation: portrait) { .code .pane { left: 3vw; right: 3vw; width: auto; top: 54vh; bottom: 4vh; } }

/* breathe */
.breathe .orb { position: absolute; left: 50%; top: 44vh; width: min(70vh, 88vw); aspect-ratio: 1; transform: translate(-50%, -50%); --k: .62; }
.breathe .orb i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line); }
.breathe .orb i:nth-child(2) { inset: 29%; }
.breathe .orb .core { border: 0; opacity: .92; transform: scale(var(--k)); background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 55%, var(--bg)), var(--accent)); box-shadow: 0 0 12vh color-mix(in srgb, var(--accent) 45%, transparent); }
.breathe .say { position: absolute; left: 0; right: 0; top: 44vh; transform: translateY(-50%); display: grid; gap: .5vh; text-align: center; color: var(--bg); pointer-events: none; }
.breathe .say b { font: 650 clamp(17px, 4.2vh, 42px) var(--sans); }
.breathe .say span { min-height: 1.2em; font: clamp(15px, 3.2vh, 32px) var(--mono); opacity: .85; }
.breathe .meta { position: absolute; left: 0; right: 0; top: calc(44vh + min(70vh, 88vw) / 2 + 2vh); text-align: center; font-size: clamp(12px, 2.2vh, 20px); }

/* qr: always black on white, with its quiet margin, so phones can read it */
.qr .card { position: absolute; left: 50%; top: 50vh; width: min(60vh, 84vw); aspect-ratio: 1; transform: translate(-50%, -50%); overflow: hidden; border-radius: 2vh; background: #fff; box-shadow: 0 2vh 6vh #0003; }
.qr .card:empty { display: none; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr .cap { position: absolute; left: 4vw; right: 4vw; top: calc(50vh + min(60vh, 84vw) / 2 + 2vh); display: flex; flex-direction: column; align-items: center; gap: 1vh; }
.qr .what { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: clamp(12px, 2vh, 18px) var(--mono); }

/* beat */
.beat .top { position: absolute; top: 7vh; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 3vh; }
.beat .tempo { display: flex; align-items: center; gap: 1.2vh; font: 600 clamp(15px, 3vh, 28px) var(--mono); }
.beat .tempo b { min-width: 5.4em; text-align: center; }
.beat .steps { position: absolute; left: 50%; top: 21vh; transform: translateX(-50%); width: min(94vw, 1200px); height: 58vh; display: grid;
  grid-template-columns: minmax(2.6em, auto) repeat(16, 1fr); grid-template-rows: repeat(4, 1fr); gap: 1vh .45vw; }
.beat .name { align-self: center; padding-right: .6vw; font: clamp(10px, 1.9vh, 16px) var(--mono); color: var(--dim); }
.beat .steps button { min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 1.2vh; background: var(--soft); cursor: pointer; }
.beat .steps .q { background: color-mix(in srgb, var(--fg) 14%, transparent); }
.beat .steps .on { background: var(--accent); border-color: var(--accent); }
.beat .steps .now { box-shadow: 0 0 0 2px var(--fg); }

/* game */
.game .status { position: absolute; left: 0; right: 0; top: 6vh; text-align: center; font: 650 clamp(20px, 4.4vh, 42px) var(--sans); }
.game .board { position: absolute; left: 50%; top: 47vh; width: min(60vh, 86vw); aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 1.4vh; }
.game .board button { padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 2.4vh; background: var(--soft); color: var(--fg); font: 500 min(15vh, 20vw) / 1 var(--sans); cursor: pointer; }
.game .board .win { background: var(--accent); color: var(--bg); }
.game .tally { position: absolute; left: 0; right: 0; top: calc(47vh + min(60vh, 86vw) / 2 + 2.5vh); display: flex; justify-content: center; align-items: center; gap: 2vh; font-size: clamp(12px, 2.2vh, 20px); }

@media (max-width: 640px) {
  .stats .grid { grid-template-columns: repeat(2, 1fr); }
  .stats b { font-size: 5vh; }
  .color .shades span { display: none; }
  .date .head { flex-direction: column; gap: 2px; }
  .date .facts { display: none; }
  .date .sub { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .dice .rolling > *, .timer.done .track, .stars .map g, .mandala g, .mosaic .quilt i:last-child { animation: none; }
}
