/* Classboard, on top of kit/kit.css.
   A projector screen: a 12 by 8 grid of widget cards that fills the window under a slim dock. Everything inside a widget
   is sized from the widget itself (container query units), so a big timer gets big digits and a small one stays tidy.
   Presenting hides the header, the dock and the widgets' top bars. */

/* ---------- backgrounds ---------- */
.cb-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s, background .4s; }
body:not([data-bg="sky"]) .cb-bg { opacity: 1; }
body[data-bg="paper"] .cb-bg { background: radial-gradient(circle at 20% 10%, #FFFFFF 0%, transparent 50%), #F3ECDA; }
body[data-bg="candy"] .cb-bg { background: linear-gradient(135deg, #FFD6E0 0%, #FFEFB5 45%, #C8E1FF 100%); }
body[data-bg="ocean"] .cb-bg { background: radial-gradient(circle at 80% 0%, rgba(94,208,224,.55), transparent 55%), linear-gradient(160deg, #0E7C9B 0%, #2F5DA8 100%); }
body[data-bg="forest"] .cb-bg { background: radial-gradient(circle at 15% 0%, rgba(155,203,106,.45), transparent 55%), linear-gradient(170deg, #2E7D4F 0%, #173F2C 100%); }
body[data-bg="chalk"] .cb-bg { background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,.08), transparent 70%), repeating-linear-gradient(20deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px), #24453A; }
body[data-bg="sunset"] .cb-bg { background: linear-gradient(140deg, #FF8C42 0%, #F0508A 55%, #665191 100%); }
body[data-bg="night"] .cb-bg { background: radial-gradient(circle at 75% 15%, rgba(108,123,234,.35), transparent 55%), linear-gradient(180deg, #0D1726 0%, #1B2D4A 100%); }
/* light ink for the page's own text on the dark backgrounds (menus that open keep the normal colours) */
body:is([data-bg="ocean"], [data-bg="forest"], [data-bg="chalk"], [data-bg="sunset"], [data-bg="night"]) {
  --on-dark: #F4FBF8; --on-dark-2: rgba(244,251,248,.78); --on-dark-line: rgba(244,251,248,.45);
}
body:is([data-bg="ocean"], [data-bg="forest"], [data-bg="chalk"], [data-bg="sunset"], [data-bg="night"]) :is(.brand, .brand svg, .cb-empty, .cb-empty .sticker) { color: var(--on-dark); }
body:is([data-bg="ocean"], [data-bg="forest"], [data-bg="chalk"], [data-bg="sunset"], [data-bg="night"]) :is(.brand-text small, .cb-dock-hint, .cb-empty p) { color: var(--on-dark-2); }
body:is([data-bg="ocean"], [data-bg="forest"], [data-bg="chalk"], [data-bg="sunset"], [data-bg="night"]) .brand b { color: #FFD27A; }
body:is([data-bg="ocean"], [data-bg="forest"], [data-bg="chalk"], [data-bg="sunset"], [data-bg="night"]) :is(.top, .cb-dock) :is(.dd-btn, .tools-btn, #addBtn, #tplBtn) { background: rgba(255,255,255,.12); color: var(--on-dark); border-color: var(--on-dark-line); }
body:is([data-bg="ocean"], [data-bg="forest"], [data-bg="chalk"], [data-bg="sunset"], [data-bg="night"]) .cb-empty .sticker { --sticker-fill: #F4FBF8; --sticker-edge: #143E38; }

/* ---------- the dock ---------- */
.cb-dock { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; max-width: 1600px; margin: 0 auto; padding-block: 4px 12px; position: relative; z-index: 25; }
.cb-dock .btn svg { width: 18px; height: 18px; }
.cb-dock-hint { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 700; }
.cb-add { position: relative; }
.cb-add-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; width: min(520px, calc(100vw - 32px)); padding: 8px; border-radius: 22px; background: var(--surface); color: var(--fg); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: ddIn .16s ease-out; }
.cb-add-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 16px; background: none; color: var(--fg); text-align: left; cursor: pointer; }
.cb-add-item:hover, .cb-add-item:focus-visible { background: var(--hover); }
.cb-add-item b { display: block; font-size: 15px; font-weight: 900; }
.cb-add-item small { display: block; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.3; }
.cb-add-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--surface-2); }
.cb-add-ico svg { width: 22px; height: 22px; }

/* ---------- the board ---------- */
.cb-main { position: relative; max-width: 1600px; margin: 0 auto; padding-bottom: 14px; }
.board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); gap: clamp(8px, 1vw, 16px); height: max(540px, calc(100vh - 150px)); height: max(540px, calc(100dvh - 150px)); }
.cb-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; pointer-events: none; }
.cb-empty .sticker { font-size: clamp(34px, 4vw, 54px); }
.cb-empty p:last-child { margin: 0; color: var(--muted); font-size: 18px; font-weight: 800; }
.widget { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 26px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow); transition: opacity .2s; }
.widget:focus-within { z-index: 5; }
.widget.is-new { animation: pop .5s cubic-bezier(.2,1.3,.4,1) both; }
.widget.is-leaving { animation: leave .22s ease-in both; }
@keyframes leave { to { opacity: 0; transform: scale(.85); } }
.widget.is-back { animation: nope .4s; }
@keyframes nope { 25% { translate: -8px 0; } 75% { translate: 8px 0; } }
.widget.is-dragging, .widget.is-resizing { z-index: 20; opacity: .9; box-shadow: var(--shadow-pop); }
.widget.is-resizing { align-self: start; justify-self: start; }
.w-head { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 6px 0 14px; border-radius: 26px 26px 0 0; cursor: grab; touch-action: none; user-select: none; }
.is-dragging .w-head { cursor: grabbing; }
.w-head:focus-visible { outline-offset: -3px; }
.w-ico { display: grid; place-items: center; color: var(--muted); }
.w-ico svg { width: 18px; height: 18px; }
.w-head h2 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.w-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.w-close svg { width: 15px; height: 15px; }
.widget:hover .w-close, .widget:focus-within .w-close { opacity: 1; }
.w-close:hover { background: var(--hover); color: var(--fg); }
.w-body { position: relative; flex: 1; min-height: 0; padding: 4px 16px 16px; container-type: size; }
.w-resize { position: absolute; right: 7px; bottom: 7px; width: 16px; height: 16px; border-radius: 0 0 12px 0; cursor: nwse-resize; touch-action: none; opacity: .0; transition: opacity .15s;
  background: linear-gradient(135deg, transparent 0 46%, var(--border-strong) 46% 54%, transparent 54% 66%, var(--border-strong) 66% 74%, transparent 74%); }
.widget:hover .w-resize { opacity: 1; }
.w-ghost { border: 3px dashed var(--teal); border-radius: 26px; background: rgba(31,168,155,.1); pointer-events: none; z-index: 1; }
.w-ghost.is-bad { border-color: var(--danger); background: rgba(179,38,30,.08); }

/* presenting */
body.presenting { padding: 0; overflow: hidden; }
body.presenting :is(.top, .cb-dock) { display: none; }
body.presenting .cb-main { max-width: none; padding: clamp(10px, 1.4vw, 22px); }
body.presenting .board { height: calc(100vh - 2 * clamp(10px, 1.4vw, 22px)); height: calc(100dvh - 2 * clamp(10px, 1.4vw, 22px)); }
body.presenting .w-head { min-height: 14px; padding: 0; cursor: default; }
body.presenting .w-head > * , body.presenting .w-resize { display: none; }
body.presenting .is-chrome { opacity: .3; transition: opacity .25s; }
body.presenting .widget:hover .is-chrome, body.presenting .widget:focus-within .is-chrome { opacity: 1; }
.cb-exit { position: fixed; top: 14px; right: 14px; z-index: 80; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: var(--r-pill); background: var(--forest); color: var(--paper); font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: var(--shadow); opacity: 0; transition: opacity .3s; }
.cb-exit svg { width: 18px; height: 18px; }
.cb-exit.is-awake, .cb-exit:focus-visible { opacity: 1; }

/* small controls shared by the widgets */
.w-body .segc button { padding: 5px 11px; font-size: 13px; }

/* ---------- timer ---------- */
.tm { --ring: min(100cqw - 8px, 100cqh - 120px); display: grid; grid-template-rows: minmax(0, 1fr) auto auto auto; justify-items: center; gap: 8px; height: 100%; }
.tm-face { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; }
.tm-ring { position: absolute; width: var(--ring); height: var(--ring); }
.tm-track { fill: none; stroke: var(--track); stroke-width: 6; }
.tm-arc { fill: none; stroke: var(--teal); stroke-width: 6; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke .4s; }
.tm.is-low .tm-arc { stroke: var(--gold); }
.tm.is-last .tm-arc { stroke: var(--fox); }
.tm-read { position: relative; display: flex; flex-direction: column; align-items: center; }
.tm-time { font-size: clamp(24px, calc(var(--ring) * .25), 300px); font-weight: 900; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tm-time.is-long { font-size: clamp(22px, calc(var(--ring) * .18), 240px); }
.tm-up { min-height: 0; color: var(--accent-text); font-size: clamp(13px, calc(var(--ring) * .07), 54px); font-weight: 900; }
.tm-up:empty { display: none; }
.tm.is-up .tm-time { animation: blink 1s steps(2, start) 4; color: var(--accent-text); }
@keyframes blink { to { opacity: .25; } }
.tm-ctrl { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tm-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; height: 40px; padding: 0 12px; border: 2px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface-3); color: var(--fg); font-weight: 900; font-size: 15px; cursor: pointer; justify-content: center; }
.tm-btn:hover { background: var(--hover); }
.tm-btn svg { width: 18px; height: 18px; }
.tm-go { min-width: 108px; border-color: transparent; background: var(--fox); color: var(--on-fox); box-shadow: 0 3px 0 var(--press); }
.tm-go:hover { background: var(--fox); filter: brightness(1.05); }
.tm-go:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--press); }
.tm-presets { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; }
.tm-chip { min-width: 34px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); font-weight: 900; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.tm-chip:hover { background: var(--hover); }
.tm-chip[aria-pressed="true"] { background: var(--fg); color: var(--bg-2); }
.tm-unit { margin-left: 2px; color: var(--muted); font-size: 12px; font-weight: 800; }
@container (max-height: 330px) { .tm { --ring: min(100cqw - 8px, 100cqh - 56px); } .tm-presets, .tm-mode { display: none; } }
@container (max-height: 230px) { .tm-ring { display: none; } .tm-time { font-size: clamp(24px, min(19cqw, 42cqh), 200px); } .tm-time.is-long { font-size: clamp(20px, min(14cqw, 34cqh), 160px); } .tm-up { font-size: clamp(13px, min(5cqw, 10cqh), 40px); } }

/* ---------- clock ---------- */
.ck { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; text-align: center; }
.ck-digital { display: flex; align-items: baseline; gap: 6px; }
.ck-time { font-size: clamp(28px, min(24cqw, 40cqh), 260px); font-weight: 900; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ck-sec { color: var(--muted); font-size: clamp(14px, min(7cqw, 12cqh), 80px); font-weight: 900; font-variant-numeric: tabular-nums; }
.ck-date { margin: 0; color: var(--muted); font-size: clamp(13px, min(5.5cqw, 9cqh), 44px); font-weight: 800; }
.ck-face { display: none; width: min(100cqw, 100cqh - 70px); height: min(100cqw, 100cqh - 70px); }
[data-style="analog"] .ck-digital { display: none; }
[data-style="analog"] .ck-face { display: block; }
.ck-rim { fill: var(--surface-2); stroke: var(--fg); stroke-width: 2.5; }
.ck-hour { stroke: var(--fg); stroke-width: 2.4; stroke-linecap: round; }
.ck-min { stroke: var(--muted); stroke-width: .8; }
.ck-h { stroke: var(--fg); stroke-width: 5; stroke-linecap: round; }
.ck-m { stroke: var(--fg); stroke-width: 3.4; stroke-linecap: round; }
.ck-s { stroke: var(--fox); stroke-width: 1.4; stroke-linecap: round; }
.ck-pin { fill: var(--fox); }
.ck-style { margin-top: 4px; }
@container (max-height: 200px) { .ck-style { display: none; } [data-style="analog"] .ck-face { width: min(100cqw, 100cqh - 30px); height: min(100cqw, 100cqh - 30px); } }

/* ---------- traffic light ---------- */
.tl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; }
.tl-box { display: flex; flex-direction: column; gap: min(4cqw, 3cqh); padding: min(4cqw, 3cqh); border-radius: 999px; background: #1A2926; box-shadow: inset 0 0 0 3px rgba(255,255,255,.08); }
.tl-light { position: relative; width: min(30cqw, 21cqh); height: min(30cqw, 21cqh); padding: 0; border: 0; border-radius: 50%; background: #2C3B38; cursor: pointer; }
.tl-light i { position: absolute; inset: 0; border-radius: 50%; opacity: 0; transition: opacity .3s; }
.tl-red i { background: radial-gradient(circle at 35% 30%, #FFB3A8, #E5383B 55%, #A4161A); box-shadow: 0 0 22px 4px rgba(229,56,59,.55); }
.tl-amber i { background: radial-gradient(circle at 35% 30%, #FFE7A3, #F5B700 55%, #C47F00); box-shadow: 0 0 22px 4px rgba(245,183,0,.55); }
.tl-green i { background: radial-gradient(circle at 35% 30%, #B8F5C8, #2DC653 55%, #12813A); box-shadow: 0 0 22px 4px rgba(45,198,83,.5); }
.tl-light[aria-pressed="true"] i { opacity: 1; }
.tl-light:not([aria-pressed="true"]):hover { background: #34474A; }
.tl-cap { margin: 0; font-size: clamp(14px, min(9cqw, 9cqh), 64px); font-weight: 900; line-height: 1.1; text-align: center; }
.tl-cap[data-c="red"] { color: #D62828; } .tl-cap[data-c="amber"] { color: #C47F00; } .tl-cap[data-c="green"] { color: #1B8A3E; }
:root[data-theme="dark"] .tl-cap[data-c="red"] { color: #FF8A80; } :root[data-theme="dark"] .tl-cap[data-c="amber"] { color: #FFD166; } :root[data-theme="dark"] .tl-cap[data-c="green"] { color: #7BE495; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-cap[data-c="red"] { color: #FF8A80; } :root:not([data-theme="light"]) .tl-cap[data-c="amber"] { color: #FFD166; } :root:not([data-theme="light"]) .tl-cap[data-c="green"] { color: #7BE495; } }
@container (min-aspect-ratio: 1.45) {
  .tl { flex-direction: row; gap: 4cqw; }
  .tl-box { flex-direction: row; gap: min(3cqw, 5cqh); padding: min(3cqw, 5cqh); }
  .tl-light { width: min(19cqw, 34cqh); height: min(19cqw, 34cqh); }
  .tl-cap { max-width: 30cqw; font-size: clamp(14px, min(6cqw, 12cqh), 64px); text-align: left; }
}

/* ---------- work mode ---------- */
.wm { display: flex; flex-direction: column; height: 100%; gap: 8px; }
.wm-now { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: min(3cqh, 14px); text-align: center; }
.wm-now.is-in { animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.wm-badge { display: grid; place-items: center; width: min(42cqw, 46cqh); height: min(42cqw, 46cqh); border-radius: 30%; background: var(--wm); box-shadow: 0 6px 0 rgba(0,0,0,.14); }
.wm-badge svg { width: 74%; height: 74%; }
.wm-label { font-size: clamp(16px, min(9cqw, 11cqh), 80px); font-weight: 900; line-height: 1.08; text-wrap: balance; }
.wm-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.wm-opt { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 3px solid transparent; border-radius: 12px; background: var(--wm); cursor: pointer; opacity: .55; transition: opacity .15s, transform .15s; }
.wm-opt svg { width: 24px; height: 24px; }
.wm-opt:hover { opacity: 1; transform: translateY(-2px); }
.wm-opt[aria-pressed="true"] { opacity: 1; border-color: var(--fg); }
@container (min-aspect-ratio: 1.7) { .wm-now { flex-direction: row; gap: 5cqw; } .wm-badge { width: min(30cqw, 62cqh); height: min(30cqw, 62cqh); } .wm-label { text-align: left; font-size: clamp(16px, min(7cqw, 14cqh), 80px); } }
@container (max-height: 190px) { .wm-pick { display: none; } }

/* ---------- noise meter ---------- */
.nz { height: 100%; }
.nz-idle, .nz-live { height: 100%; }
.nz-idle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.nz[data-state="live"] .nz-idle, .nz:not([data-state="live"]) .nz-live { display: none; }
.nz-mic { display: grid; place-items: center; width: min(28cqw, 30cqh); height: min(28cqw, 30cqh); border-radius: 50%; background: var(--surface-2); color: var(--link); }
.nz-mic svg { width: 55%; height: 55%; }
.nz-note { margin: 0; max-width: 34ch; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.4; }
.nz[data-state="error"] .nz-note { color: var(--accent-text); }
.nz-live { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: stretch; }
.nz-meter { position: relative; width: clamp(34px, 14cqw, 90px); border-radius: 18px; background: var(--track); overflow: hidden; }
.nz-fill { position: absolute; inset: 0; transform-origin: bottom; transform: scaleY(0); background: linear-gradient(0deg, #2DC653 0%, #A6D94A 45%, #F5B700 70%, #E5383B 100%); background-size: 100% 100cqh; }
.nz-limit { position: absolute; left: -2px; right: -2px; height: 4px; margin-bottom: -2px; background: var(--fg); border-radius: 2px; }
.nz-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; text-align: center; }
.nz-face { width: min(46cqw, 38cqh); height: min(46cqw, 38cqh); }
.nz-head { fill: #2DC653; transition: fill .3s; }
.nz[data-mood="meh"] .nz-head { fill: #F5B700; }
.nz[data-mood="loud"] .nz-head { fill: #E5383B; }
.nz[data-mood="loud"] .nz-face { animation: nope .5s infinite; }
.nz-eye { fill: #143E38; }
.nz-mouth { fill: none; stroke: #143E38; stroke-width: 4; stroke-linecap: round; }
.nz-loud { min-height: 1.2em; margin: 0; color: #D62828; font-size: clamp(16px, min(8cqw, 9cqh), 60px); font-weight: 900; line-height: 1.1; }
.nz-range { display: flex; flex-direction: column; gap: 2px; width: min(100%, 260px); font-size: 13px; font-weight: 800; color: var(--muted); }
.nz-range input { width: 100%; accent-color: var(--fox); }
.nz-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; }
.nz-row .sw { font-size: 13px; }
@container (max-height: 300px) { .nz-range, .nz-row .sw { display: none; } }

/* ---------- text ---------- */
.tx { position: relative; height: 100%; }
.tx-area { width: 100%; height: 100%; padding: 4px 6px 30px; border: 0; border-radius: 14px; background: transparent; color: var(--fg); resize: none; font-weight: 800; line-height: 1.3; font-size: calc(clamp(14px, min(7cqw, 13cqh), 70px) * var(--tx, 1)); }
.tx-area:focus-visible { outline: 3px dashed var(--border-strong); outline-offset: 0; }
.tx-area::placeholder { color: var(--muted); opacity: .7; }
.tx[data-size="1"] { --tx: .55; } .tx[data-size="2"] { --tx: .75; } .tx[data-size="3"] { --tx: 1; } .tx[data-size="4"] { --tx: 1.3; } .tx[data-size="5"] { --tx: 1.7; } .tx[data-size="6"] { --tx: 2.2; }
.tx-tools { position: absolute; right: 0; bottom: 0; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.widget:hover .tx-tools, .tx:focus-within .tx-tools { opacity: 1; }
.tx-btn { min-width: 38px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); font-weight: 900; font-size: 13px; cursor: pointer; }
.tx-btn:hover { background: var(--hover); }

/* ---------- pick a name ---------- */
.nm { display: flex; flex-direction: column; height: 100%; gap: 8px; }
.nm-class .dd-btn { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.nm-show { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; text-align: center; }
.nm-show[data-left]::after { content: attr(data-left); position: absolute; right: 0; top: 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.nm-name { font-size: clamp(22px, min(14cqw, 26cqh), 160px); font-weight: 900; line-height: 1.05; letter-spacing: -.01em; overflow-wrap: anywhere; }
.nm-name.is-wait { color: var(--muted); font-size: clamp(16px, min(7cqw, 12cqh), 60px); }
.nm-name.is-picked { animation: pop .55s cubic-bezier(.2,1.5,.4,1); color: var(--accent-text); }
.nm-ctrl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; }
.nm-ctrl .sw { font-size: 13px; }
.nm-none { align-items: center; justify-content: center; text-align: center; }
.nm-none p { margin: 0; max-width: 30ch; color: var(--muted); font-weight: 800; }
@container (max-height: 200px) { .nm-ctrl .sw, .nm-show[data-left]::after { display: none; } }

/* ---------- dice ---------- */
.dc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; }
.dc-row { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 4cqw; }
.die { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: min(24cqw, 52cqh); height: min(24cqw, 52cqh); padding: 13%; border: 0; border-radius: 20%; background: #FFFCF4; box-shadow: inset 0 -6px 0 rgba(0,0,0,.1), 0 6px 14px rgba(20,48,44,.22); cursor: pointer; }
.die i { width: 72%; height: 72%; margin: auto; border-radius: 50%; background: #143E38; }
.die.is-rolling { animation: tumble .34s linear infinite; animation-delay: calc(var(--k) * -.11s); }
@keyframes tumble { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(180deg) translateY(-8%); } 100% { transform: rotate(360deg) translateY(0); } }
.dc-sum { min-height: 1.2em; margin: 0; font-size: clamp(14px, min(7cqw, 10cqh), 48px); font-weight: 900; }
.dc-ctrl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
@container (max-height: 210px) { .dc-n { display: none; } }

/* star jar (kit/jar.js draws the jar) */
.jw { position: relative; display: flex; flex-direction: column; height: 100%; gap: 6px; }
.jw-top { display: flex; align-items: center; gap: 4px; min-width: 0; }
.jw-dd { flex: 1; min-width: 0; }
.jw-dd .dd-btn { min-height: 34px; padding: 5px 12px; font-size: 13px; width: 100%; }
.jw-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.jw-icon:hover { background: var(--hover); color: var(--fg); }
.jw-icon svg { width: 18px; height: 18px; }
.jw-stage { position: relative; flex: 1; min-height: 0; padding-top: 6px; cursor: pointer; border-radius: 18px; outline-offset: 2px; -webkit-tap-highlight-color: transparent; }
.jw-stage.is-full { cursor: default; }
.jw-ctrl { display: flex; align-items: center; justify-content: center; gap: 8px; }
.jw-add { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px 6px 8px; border: 0; border-radius: var(--r-pill); background: var(--fox); color: var(--on-fox); box-shadow: 0 4px 0 var(--press); font-size: 20px; font-weight: 1000; cursor: pointer; transition: transform .08s; }
.jw-add:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--press); }
.jw-add:disabled { opacity: .5; cursor: default; transform: none; }
.jw-ico { width: 30px; height: 30px; flex: none; }
.jw-take { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--fg); cursor: pointer; }
.jw-take:disabled { opacity: .4; cursor: default; }
.jw-take svg { width: 18px; height: 18px; }
.jw-rules-wrap { position: relative; }
.jw-rules-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 8px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--fg); font-size: 13px; font-weight: 900; cursor: pointer; }
.jw-rules-btn .sj-ico { width: 20px; height: 20px; }
.jw-rules-btn[aria-expanded="true"] { background: var(--fg); color: var(--bg-2); }
.jw-rules { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column; gap: 4px; width: max-content; max-width: min(320px, 80vw); padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: ddIn .16s ease-out; }
.jw-rules button { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border: 0; border-radius: 12px; background: none; color: var(--fg); font-size: 14px; font-weight: 800; text-align: left; cursor: pointer; }
.jw-rules button:hover:not(:disabled) { background: var(--hover); }
.jw-rules button:disabled { opacity: .45; }
.jw-rules button span { flex: 1; }
.jw-rules button b { padding: 1px 9px; border-radius: var(--r-pill); background: var(--gold); color: var(--forest); font-weight: 1000; }
.jw-done { position: absolute; left: 50%; bottom: 52px; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(94%, 360px); padding: 12px 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-pop); text-align: center; translate: -50% 0; animation: jwIn .5s cubic-bezier(.2,1.4,.4,1) .9s both; }
@keyframes jwIn { from { opacity: 0; transform: translateY(18px) scale(.92); } }
.jw-done-t { font-size: clamp(16px, 7cqmin, 30px); font-weight: 1000; color: var(--accent-text); }
.jw-done-r { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: clamp(14px, 5cqmin, 22px); line-height: 1.2; }
.jw-none { align-items: center; justify-content: center; text-align: center; gap: 10px; }
.jw-none p { margin: 0; max-width: 28ch; color: var(--muted); font-weight: 800; }
.jw-ghost { width: clamp(50px, 26cqmin, 110px); color: var(--muted); opacity: .6; }
.jw-ghost svg { display: block; width: 100%; height: auto; }
@container (max-height: 300px) { .jw-top { display: none; } .jw-done { bottom: 46px; } }
@container (max-height: 220px) { .jw-rules-wrap, .jw-take { display: none; } }
@container (max-width: 240px) { .jw-rules-btn span { display: none; } .jw-rules-btn { padding: 0 9px; } }

/* ---------- narrow screens: the widgets stack ---------- */
@media (max-width: 760px) {
  .cb-dock-hint { display: none; }
  .cb-dock #presentBtn { margin-left: auto; }
  .cb-add-pop { grid-template-columns: minmax(0, 1fr); }
  .board { display: flex; flex-direction: column; height: auto; }
  .widget { grid-area: auto !important; height: 300px; flex: none; }
  .w-timer, .w-noise { height: 400px; } .w-clock { height: 230px; } .w-text { height: 260px; } .w-work { height: 340px; }
  .w-resize { display: none; }
  .w-head { cursor: default; }
}
