/* Towers of Hanoi — lacquer, brass and stone. Colours that depend on the
   chosen material arrive as custom properties from themes.js. */

:root {
  --bg-a: #f1e8da;
  --bg-b: #d6c8b4;
  --paper: #f8f3ea;
  --paper-2: #eee6d8;
  --ink: #2b241d;
  --ink-soft: #6d6052;
  --base-a: #4a403a;
  --base-b: #241e1a;
  --peg-a: #f3d78a; --peg-b: #c8933c; --peg-c: #6e4a16;
  --d1: #e0a93f; --d2: #d2672c; --d3: #be3a2b; --d4: #8e1f2f; --d5: #5f2a52; --d6: #2f3f70; --d7: #24594c; --d8: #262324;
  --glow: #f0b24a;
  --accent: #d04b35;
  --accent-2: #8e1f2f;
  --accent-ink: #fff6ee;
  --disc-opacity: 100%;
  --gloss: 0.42;
  --line: rgba(60, 45, 30, 0.12);
  --ease: cubic-bezier(0.4, 0.1, 0.2, 1);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(165deg, var(--bg-a), var(--bg-b));
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  transition: background 0.8s, color 0.8s;
}

/* ---------------------------------------------------------- background */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.bg .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
  transition: background 0.8s;
}
.bg .b1 { width: 60vmax; height: 60vmax; left: -20vmax; top: -25vmax; background: rgba(255, 252, 245, 0.9); animation: drift 52s ease-in-out infinite alternate; }
.bg .b2 { width: 50vmax; height: 50vmax; right: -20vmax; bottom: -20vmax; background: color-mix(in oklab, var(--glow) 32%, transparent); animation: drift 64s ease-in-out infinite alternate-reverse; }
.bg .b3 { width: 44vmax; height: 44vmax; left: 28vw; bottom: -28vmax; background: color-mix(in oklab, var(--accent) 22%, transparent); animation: drift 76s ease-in-out infinite alternate; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(8vmax, 6vmax) scale(1.12); }
}

/* -------------------------------------------------------------- layout */
.app {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-width: 820px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: 0.02em; }
.brand small { font-size: 11.5px; color: var(--ink-soft); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }
.menu { display: flex; gap: 4px; }

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.icon-btn:hover { background: rgba(60, 45, 30, 0.08); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg, .btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 4px 16px 6px;
}
.stat {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 2px rgba(60, 45, 30, 0.06);
  border-radius: 12px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.stat span { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.stat b { font-family: var(--serif); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat b.over { color: var(--accent); }

.stage {
  flex: 1;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
  padding: 8px 16px 4px;
}

.actions, .demo-bar {
  display: flex;
  gap: 10px;
  padding: 6px 16px 14px;
}
.btn {
  appearance: none;
  flex: 1;
  border: 1px solid rgba(60, 45, 30, 0.14);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: 500 15px var(--sans);
  padding: 11px 12px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(60, 45, 30, 0.08);
  transition: transform 0.15s, background 0.2s, opacity 0.2s, box-shadow 0.2s;
}
.btn svg { width: 19px; height: 19px; }
.btn:hover { background: rgba(255, 255, 255, 0.8); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 85%, white), var(--accent-2));
  color: var(--accent-ink);
  border-color: color-mix(in oklab, var(--accent-2) 80%, black);
  box-shadow: 0 4px 12px -4px color-mix(in oklab, var(--accent-2) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.subtle { flex: 0 0 auto; background: transparent; box-shadow: none; color: var(--ink-soft); font-size: 13.5px; margin: 18px auto 0; display: flex; }

/* ------------------------------------------------------------ demo bar */
.demo-bar { align-items: center; }
.demo-bar .btn { flex: 0 0 auto; }
.demo-title { display: none; }
.speed { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); letter-spacing: 0.04em; }
.speed b { font-family: var(--serif); font-size: 17px; color: var(--ink); min-width: 2.6em; text-align: right; font-variant-numeric: tabular-nums; }
.speed input { flex: 1; min-width: 60px; accent-color: var(--accent); height: 28px; margin: 0; }
@media (min-width: 560px) { .demo-title { display: inline; font-size: 13px; color: var(--ink-soft); } }

/* --------------------------------------------------------------- board */
.board {
  --ratio: 1.45;
  width: min(100cqw, calc(100cqh * var(--ratio)));
  aspect-ratio: var(--ratio);
  position: relative;
  touch-action: none;
  cursor: pointer;
}

/* stone base: a top face seen from slightly above, and a front face */
.base {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 15%;
  border-radius: 10px 10px 8px 8px;
  background: linear-gradient(180deg, var(--base-a), var(--base-b));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    0 18px 36px -14px rgba(20, 12, 6, 0.65),
    0 4px 10px -3px rgba(20, 12, 6, 0.4);
  transition: background 0.6s;
}
.base::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 38%;
  border-radius: 10px 10px 50% 50% / 10px 10px 100% 100%;
  background: linear-gradient(180deg, color-mix(in oklab, var(--base-a) 72%, white), var(--base-a));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.base::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 20% 100%, rgba(255, 255, 255, 0.07), transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(255, 255, 255, 0.08), transparent 55%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.02) 0 3px, rgba(0, 0, 0, 0.025) 3px 7px);
  pointer-events: none;
}

.pegs { position: absolute; inset: 0; display: flex; z-index: 1; }
.peg { flex: 1; position: relative; }
.peg .rod {
  position: absolute;
  left: 50%;
  bottom: 12%;
  width: 9.4%;
  top: 7%;
  transform: translateX(-50%);
  border-radius: 999px 999px 2px 2px;
  background: linear-gradient(90deg, var(--peg-c), var(--peg-b) 30%, var(--peg-a) 52%, var(--peg-b) 72%, var(--peg-c));
  box-shadow: 0 0 0 0 transparent, 2px 0 4px rgba(0, 0, 0, 0.3), inset 0 -8px 10px -6px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s, background 0.6s;
}
.peg .cap {
  position: absolute;
  left: 50%;
  top: 7%;
  width: 9.4%;
  aspect-ratio: 1;
  transform: translate(-50%, -45%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--peg-a), var(--peg-b) 55%, var(--peg-c));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: background 0.6s;
}
.peg::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14.5%;
  width: 86%;
  height: 4%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, color-mix(in oklab, var(--glow) 70%, white), color-mix(in oklab, var(--glow) 40%, transparent) 45%, transparent 72%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.peg.target::after { opacity: 0.7; animation: ring 1.5s ease-in-out infinite; }
.peg.target .rod { box-shadow: 0 0 10px 1px color-mix(in oklab, var(--glow) 60%, transparent), 2px 0 4px rgba(0, 0, 0, 0.3), inset 0 -8px 10px -6px rgba(0, 0, 0, 0.5); }
.peg.hint-target::after { opacity: 1; animation: ring 0.9s ease-in-out infinite; }
.peg.hint-target .rod { box-shadow: 0 0 14px 3px color-mix(in oklab, var(--glow) 80%, transparent), 2px 0 4px rgba(0, 0, 0, 0.3), inset 0 -8px 10px -6px rgba(0, 0, 0, 0.5); }
@keyframes ring { 50% { opacity: 0.35; transform: translateX(-50%) scale(0.92); } }

#discs { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.disc {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w);
  height: var(--h);
  transform: translate(var(--x), var(--y));
  will-change: transform;
  z-index: 2;
}
.disc.lifted { z-index: 5; }
.disc.dragging { z-index: 7; }
.face {
  --c: color-mix(in oklab, var(--d) var(--disc-opacity), transparent);
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, var(--gloss)) 0%, rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0) 52%, rgba(0, 0, 0, 0.14) 100%),
    linear-gradient(90deg, color-mix(in oklab, var(--c) 68%, black), var(--c) 16%, color-mix(in oklab, var(--c) 82%, white) 48%, var(--c) 82%, color-mix(in oklab, var(--c) 68%, black));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3),
    inset 1px 0 2px rgba(255, 255, 255, 0.15),
    0 2px 3px rgba(0, 0, 0, 0.35),
    0 7px 12px -5px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.3s, transform 0.3s var(--ease), background 0.6s;
}
.face::after {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 14%;
  height: 24%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, calc(var(--gloss) * 0.9)) 30%, rgba(255, 255, 255, calc(var(--gloss) * 1.1)) 50%, rgba(255, 255, 255, calc(var(--gloss) * 0.9)) 70%, transparent);
  filter: blur(0.5px);
  pointer-events: none;
}
:root[data-theme="glass"] .face { backdrop-filter: blur(6px) saturate(1.2); -webkit-backdrop-filter: blur(6px) saturate(1.2); }
:root[data-theme="glass"] .face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -2px 4px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 2px 3px rgba(0, 0, 0, 0.18), 0 8px 14px -6px rgba(40, 60, 80, 0.35); }

.disc.lifted .face, .disc.dragging .face {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3),
    0 10px 12px rgba(0, 0, 0, 0.3),
    0 18px 30px -8px rgba(0, 0, 0, 0.35),
    0 0 16px 2px color-mix(in oklab, var(--glow) 45%, transparent);
}
.disc.dragging .face { transform: scale(1.04); }
.disc.hint .face { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -2px 3px rgba(0,0,0,.3), 0 10px 12px rgba(0,0,0,.3), 0 0 26px 6px color-mix(in oklab, var(--glow) 75%, transparent); } }
.disc.shake .face { animation: shake 0.38s ease-in-out; }
@keyframes shake {
  20% { transform: translateX(-7%) rotate(-1.5deg); }
  45% { transform: translateX(6%) rotate(1.2deg); }
  70% { transform: translateX(-4%); }
  100% { transform: translateX(0); }
}
.disc.settle .face { animation: settle 0.28s var(--ease); }
@keyframes settle {
  0% { transform: scale(1.03, 0.92) translateY(2%); }
  55% { transform: scale(0.99, 1.03); }
  100% { transform: scale(1, 1); }
}

/* -------------------------------------------------------- sheets, dialogs */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(40, 28, 16, 0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade 0.25s;
}
@keyframes fade { from { opacity: 0; } }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  z-index: 21;
  max-width: 560px;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(40, 28, 16, 0.25);
  padding-bottom: env(safe-area-inset-bottom);
  animation: rise 0.32s var(--ease);
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 6px 22px;
  flex: 0 0 auto;
}
.sheet h2, .dialog h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0; letter-spacing: 0.01em; }
.sheet-body {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2px 22px 26px;
  font-size: 15px;
  line-height: 1.55;
}
.sheet-body h3 { font-family: var(--serif); font-weight: 600; font-size: 17px; margin: 20px 0 8px; color: var(--ink); }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { margin: 4px 0; }
.muted { color: var(--ink-soft); }
.about { font-size: 13px; margin-top: 22px; text-align: center; }

@media (min-width: 700px) and (min-height: 560px) {
  .sheet {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 24px;
    max-height: 80dvh;
    animation: pop 0.28s var(--ease);
  }
}
@keyframes pop { from { opacity: 0; transform: translateY(-50%) scale(0.96); } }

.dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 22;
  width: min(92vw, 400px);
  max-height: 92dvh;
  overflow: auto;
  background: var(--paper);
  border-radius: 24px;
  padding: 26px 24px 22px;
  box-shadow: 0 20px 60px rgba(40, 28, 16, 0.35);
  text-align: center;
  animation: popc 0.3s var(--ease);
}
@keyframes popc { from { opacity: 0; transform: translate(-50%, -50%) scale(0.94); } }
.dialog p { margin: 8px 0 18px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.5; }
.dialog .row { display: flex; gap: 10px; }
.result { overflow: hidden; }
.result .glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(ellipse at 50% 40%, color-mix(in oklab, var(--glow) 45%, transparent), transparent 65%);
  pointer-events: none;
  opacity: 0.8;
}
.result h2 { position: relative; font-size: 30px; }
.result[data-outcome="perfect"] h2 { animation: shimmer 2.4s ease-in-out infinite; }
@keyframes shimmer { 50% { text-shadow: 0 0 18px color-mix(in oklab, var(--glow) 80%, white); } }
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.result-stats div, .summary div { display: flex; flex-direction: column; align-items: center; background: var(--paper-2); border-radius: 12px; padding: 8px 4px; line-height: 1.2; }
.result-stats span, .summary span { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.result-stats b, .summary b { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.score { display: flex; flex-direction: column; align-items: center; margin: 4px 0 18px; }
.score span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.score b { font-family: var(--serif); font-size: 44px; font-weight: 600; line-height: 1.05; }
.newgame .opts { justify-content: center; margin-bottom: 22px; }
.newgame p { min-height: 1.5em; }

/* ------------------------------------------------------------- results */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; vertical-align: bottom; font-weight: 500; color: var(--ink-soft); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 4px; border-bottom: 1px solid var(--line); }
td { padding: 7px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th.num, td.num { text-align: right; }
td.score { font-family: var(--serif); font-weight: 600; font-size: 15px; }
td.discs b { font-family: var(--serif); font-size: 15px; }
tr[data-perfect="true"] td.moves { color: #a06b1a; font-weight: 600; }
@media (max-width: 420px) { th.hints, td.hints { display: none; } td { padding: 7px 3px; } }

/* ------------------------------------------------------------- settings */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  appearance: none;
  border: 1.5px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font: 500 14px var(--sans);
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.opt:active { transform: scale(0.97); }
.opt[aria-checked="true"] { border-color: var(--accent-2); background: #fff; box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent); }
.opts.lang .opt, .opts.counts .opt { padding-left: 14px; min-width: 88px; justify-content: center; }
.opts.counts .opt { min-width: 64px; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.swatch { display: inline-block; width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; position: relative; overflow: hidden; background: linear-gradient(180deg, var(--s1), var(--s2)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.swatch::before, .swatch::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); border-radius: 999px; }
.swatch::before { top: 5px; width: 3px; height: 16px; background: var(--s3); }
.swatch::after { bottom: 5px; width: 18px; height: 6px; background: var(--s4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.toggle { display: flex; align-items: center; gap: 12px; margin-top: 22px; cursor: pointer; font-size: 15px; line-height: 1.35; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { flex: 0 0 auto; width: 46px; height: 28px; border-radius: 999px; background: #cfc6b8; position: relative; transition: background 0.25s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.25s var(--ease); }
.toggle input:checked + .track { background: var(--accent-2); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  z-index: 15;
  background: rgba(43, 36, 29, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  max-width: min(88vw, 420px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------- small screens */
@media (max-height: 640px) {
  .top { padding-top: 6px; }
  .brand small { display: none; }
  .brand b { font-size: 19px; }
  .stat b { font-size: 17px; }
  .actions, .demo-bar { padding-bottom: 10px; }
  .btn { padding: 9px 10px; }
}
@media (max-width: 520px) {
  .brand b { font-size: 19px; white-space: nowrap; }
  .brand img { width: 36px; height: 36px; }
  .actions .btn { flex-direction: column; gap: 3px; padding: 8px 4px 7px; font-size: 12px; }
  .btn span { white-space: nowrap; }
  .btn svg { width: 21px; height: 21px; }
  .board { --ratio: 1; }
}
@media (min-width: 900px) and (min-height: 700px) {
  .brand b { font-size: 26px; }
  .stage { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg .blob { animation: none; }
  .face, .sheet, .dialog, .backdrop, .peg::after { animation: none; transition-duration: 0.01s; }
}
