/* A risograph puzzle card: warm paper, black ink, four spot inks.
   The four inks started from a random seed string (d86, c2d, 4c2, 8ede e6)
   and were then moved to the nearest real Riso drum colours: Orange,
   Fluorescent Pink, Aqua, Green. Hard edges; the only texture is grain. */

:root {
  --paper: #EDE6D8;
  --paper-2: #E3DBCB;
  --ink: #15130F;
  --ink-soft: #5E574C;
  --thing: #FF6C2F;
  --how: #FF48B0;
  --idea: #5EC8E5;
  --wild: #00A95C;
  --alert: #D7261E;
  --rule: 3px;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --ink-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='1' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .22 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --paper-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --display: "Archivo", "Arial Narrow", sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14120E; --paper-2: #1F1C17; --ink: #EDE6D8; --ink-soft: #A39A8B;
    --alert: #FF5A4F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14120E; --paper-2: #1F1C17; --ink: #EDE6D8; --ink-soft: #A39A8B;
  --alert: #FF5A4F;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* The grain is part of the page background, so it scrolls with the paper
   and never leaves a seam. */
html { background: var(--paper-grain), var(--paper); }
body {
  margin: 0;
  min-height: 100dvh;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-variation-settings: "wdth" 100;
  font-size: 16px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  align-items: center;
}

button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---- top bar ---------------------------------------------------------- */
.bar {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  border-bottom: var(--rule) solid var(--ink);
}
.wordmark {
  font-weight: 800;
  font-variation-settings: "wdth" 70;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: 15px;
}
.issue {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .02em;
}
.bar-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px;
  border: 2px solid var(--ink);
  background: transparent;
  font-weight: 800;
  font-size: 17px;
  display: grid; place-items: center;
  padding: 0;
}
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }
.icon-btn:active { background: var(--ink); color: var(--paper); }

main {
  width: 100%;
  max-width: 560px;
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
}

/* ---- the square --------------------------------------------------------- */
.stage { padding: 18px 0 22px; display: flex; justify-content: center; }
.board-wrap {
  --size: min(calc(100vw - 32px), 380px, 46dvh);
  width: var(--size);
  height: var(--size);
  position: relative;
}
.board {
  --turn: 0deg;
  position: absolute; inset: 0;
  display: grid;
  grid-template: repeat(4, 1fr) / repeat(4, 1fr);
  gap: calc(var(--size) * .014);
  transform: rotate(var(--turn));
  transition: transform .8s cubic-bezier(.68, -0.25, .27, 1.25);
}
/* Every cell starts as bare paper with a dotted keyline. Ink is printed on
   top with no outline, so a finished side reads as one block of colour.
   The keyline is drawn with gradients rather than a dotted border: iOS
   drops or doubles the edges of thin dotted borders while the board turns. */
.cell {
  --c: var(--ink);
  --kl: color-mix(in srgb, var(--ink) 38%, transparent);
  position: relative;
  background: transparent;
  transition: border-color .25s, background-color .25s;
}
.cell::before {
  --across: repeating-linear-gradient(90deg, var(--kl) 0 1.5px, transparent 1.5px 4px);
  --down: repeating-linear-gradient(180deg, var(--kl) 0 1.5px, transparent 1.5px 4px);
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    var(--across) top / 100% 1.5px no-repeat,
    var(--across) bottom / 100% 1.5px no-repeat,
    var(--down) left / 1.5px 100% no-repeat,
    var(--down) right / 1.5px 100% no-repeat;
  transition: opacity .25s;
}
.cell.pending { --kl: color-mix(in srgb, var(--ink) 20%, transparent); }
.cell.current { border: 3.5px solid var(--c); }
.cell.current::before, .cell.spent::before, .cell.inked::before { opacity: 0; }
/* a miss is hatched in its own side's ink, so a side stays identifiable
   even when every cell of it was missed */
.cell.spent {
  background: repeating-linear-gradient(-45deg, var(--c) 0 2.5px, transparent 2.5px 8px);
}
.cell.inked {
  /* white speckle: ink that didn't quite take, as on a real drum */
  background: var(--ink-grain), var(--c);
  animation: stamp .42s cubic-bezier(.2, 1.6, .4, 1) both;
  animation-delay: var(--delay, 0s);
}
@keyframes stamp {
  0% { transform: scale(1.35); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* In the dark, the square stays a paper card so the inks still read as print. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .board-wrap {
    --paper: #EDE6D8; --ink: #15130F; --ink-soft: #5E574C;
    --size: min(calc(100vw - 60px), 380px, 44dvh);
    margin: 6px 0 14px;
    background: var(--paper);
    box-shadow: 0 0 0 12px var(--paper);
    color: var(--ink);
  }
}
:root[data-theme="dark"] .board-wrap {
  --paper: #EDE6D8; --ink: #15130F; --ink-soft: #5E574C;
  --size: min(calc(100vw - 60px), 380px, 44dvh);
  margin: 6px 0 14px;
  background: var(--paper);
  box-shadow: 0 0 0 12px var(--paper);
  color: var(--ink);
}

.centre {
  position: absolute;
  left: 25%; top: 25%; width: 50%; height: 50%;
  padding: calc(var(--size) * .03);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.centre .side-tag {
  font-size: 11px;
  font-weight: 800;
  font-variation-settings: "wdth" 80;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 7px 2px;
  background: var(--c);
  color: #15130F;
}
.centre .blurb {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--ink-soft);
}
.target {
  margin: 8px 0 2px;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  text-transform: uppercase;
  line-height: .86;
  letter-spacing: -.005em;
  width: 100%;
  overflow-wrap: normal;
}
.centre.swap > * { animation: rise .45s cubic-bezier(.2, .9, .3, 1) both; }
.centre.swap > *:nth-child(2) { animation-delay: .05s; }
.centre.swap > *:nth-child(3) { animation-delay: .1s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.centre .score-big {
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-size: calc(var(--size) * .24);
  line-height: .8;
  letter-spacing: -.02em;
}
.centre .score-big small { font-size: .42em; color: var(--ink-soft); letter-spacing: 0; }

.burst {
  position: absolute; left: 50%; top: 50%;
  pointer-events: none;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-size: 44px;
  transform: translate(-50%, -50%);
}
.burst.go { animation: burst 1s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); }
  25% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(1); }
}

/* ---- pass or miss ------------------------------------------------------- */
.bit {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--size) * .055); height: calc(var(--size) * .055);
  pointer-events: none;
  z-index: 2;
}
/* The kicker over the centre: today's word for a full square, hatched like a
   missed cell otherwise. */
.centre .centre-k {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 7px 2px;
  color: #15130F;
}
.centre .centre-k { margin-bottom: 8px; }
.centre.passed .centre-k { background: var(--wild); }
.centre.missed .centre-k {
  --c: var(--ink-soft);
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 45%, transparent) 0 2px, transparent 2px 6px);
  color: var(--ink);
  outline: 1.5px solid var(--c); outline-offset: -1.5px;
}
.centre.missed-word .centre-k {
  background: repeating-linear-gradient(-45deg, var(--c) 0 2px, transparent 2px 6px);
  color: var(--ink);
  outline: 1.5px solid var(--c); outline-offset: -1.5px;
}
.result-head.passed .verdict-head em { background: var(--wild); }
/* Text in the page's own ink and a faint hatch, so the number reads in the
   dark theme too, where the bright highlights' dark text would vanish. */
.result-head.missed .verdict-head em {
  color: var(--ink);
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--ink) 14%, transparent) 0 3px, transparent 3px 9px);
  outline: 2px solid var(--ink); outline-offset: -2px;
}

.fork { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.fork[hidden] { display: none; }
.fork-line { margin: 0; text-align: center; font-size: 15px; color: var(--ink-soft); }
.fork-actions { display: flex; gap: 10px; }
.fork-actions button { flex: 1; }
.fork-actions button[hidden] { display: none; }

/* ---- playing ------------------------------------------------------------ */
.play { display: flex; flex-direction: column; gap: 14px; }
.dont { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dont-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font-weight: 700;
  font-variation-settings: "wdth" 80;
  font-size: 15px;
  padding: 1px 7px 0;
  border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent);
  transition: background-color .15s;
}
.chips li.hot { background: var(--alert); color: #fff; border-color: var(--alert); }

.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.log li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 2px 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid color-mix(in srgb, var(--ink) 18%, transparent);
  animation: rise .35s ease-out both;
}
.log .n { font-family: var(--mono); font-size: 11px; padding-top: 3px; color: var(--ink-soft); }
.log .you { font-size: 15px; overflow-wrap: anywhere; }
.log .said {
  grid-column: 2;
  font-family: var(--mono);
  font-variation-settings: "wdth" 100;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.log .said::before { content: "→"; font-weight: 400; color: var(--ink-soft); }
.log .said .mark { font-size: 12px; font-weight: 700; padding: 1px 6px; border: 2px solid currentColor; }
.log .said.hit .mark { background: var(--c); border-color: var(--c); color: #15130F; }
.log .said.thinking { color: var(--ink-soft); }
.log .said.thinking .dots::after { content: "…"; animation: dots 1s steps(4) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } }

.composer {
  position: sticky;
  bottom: 0;
  background: var(--paper-grain), var(--paper);
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field { display: flex; border: var(--rule) solid var(--ink); background: var(--paper); }

textarea {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 18px/1.3 var(--display);
  padding: 12px 12px;
  resize: none;
  min-height: 50px;
  max-height: 120px;
  outline: none;
}
textarea::placeholder { color: color-mix(in srgb, var(--ink) 40%, transparent); }
.ask {
  border: 0;
  border-left: var(--rule) solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 0 16px;
  font-weight: 800;
  font-variation-settings: "wdth" 75;
  text-transform: uppercase;
  letter-spacing: .06em;
  display: flex; align-items: center; gap: 6px;
}
.ask svg { width: 18px; height: 18px; }
/* "Blurt" is wider than a verb needs to be; on narrow phones the arrow goes so
   the placeholder keeps one line. */
@media (max-width: 389px) { .ask svg { display: none; } }
.ask:disabled { background: transparent; color: color-mix(in srgb, var(--ink) 35%, transparent); cursor: default; }
.ask:not(:disabled):active { background: var(--c); color: #15130F; }
/* In the empty box from the second try, in the place of the greyed-out Blurt:
   puts the last prompt back to edit. Typing brings Blurt back. */
.again {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 16px;
  display: flex; align-items: center;
  cursor: pointer;
}
.again svg { width: 22px; height: 22px; }
.again:active { color: var(--c); }
.count.over { color: var(--alert); font-weight: 700; }
.under { display: flex; justify-content: space-between; gap: 12px; min-height: 20px; }
.verdict { margin: 0; font-size: 14px; font-weight: 600; }
.verdict.bad { color: var(--alert); }
.verdict.ok { color: var(--ink-soft); font-weight: 500; }
.count { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); padding-top: 2px; }
.skip {
  align-self: flex-start;
  border: 0; background: none; padding: 4px 0;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- results ------------------------------------------------------------ */
.results { display: flex; flex-direction: column; gap: 22px; padding-top: 6px; }
.verdict-head {
  margin: 0;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-size: clamp(38px, 11vw, 54px);
  line-height: .9;
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.verdict-head em { font-style: normal; background: var(--thing); color: #15130F; padding: 0 .08em; }
.crowd-line { margin: 8px 0 0; font-size: 15px; color: var(--ink-soft); }
.crowd-line b { color: var(--ink); font-family: var(--mono); font-size: 13px; }

.hist { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; align-items: end; height: 132px; }
.hist .col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.hist .b {
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  min-height: 2px;
  transform-origin: bottom;
  animation: grow .7s cubic-bezier(.2, .9, .3, 1) both;
  animation-delay: calc(var(--i) * 35ms);
}
.hist .col.me .b { background: var(--ink); }
.hist .col.me::before {
  content: "you";
  position: absolute;
  top: -2px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}
@keyframes grow { from { transform: scaleY(0); } }
.hist-axis { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; margin-top: 4px; }
.hist-axis span { font-family: var(--mono); font-size: 10px; text-align: center; color: var(--ink-soft); }
.hist-axis span.me { color: var(--ink); font-weight: 700; }

.sides { list-style: none; margin: 0; padding: 0; border-top: var(--rule) solid var(--ink); }
.sides li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 4px 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 2px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.sides .sw { width: 12px; height: 34px; background: var(--c); grid-row: span 2; }
.sides .t { font-weight: 800; font-variation-settings: "wdth" 70; text-transform: uppercase; font-size: 19px; line-height: 1; }
.sides .meta { font-size: 13px; color: var(--ink-soft); grid-column: 2; }

.primary {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-weight: 900;
  font-variation-settings: "wdth" 70;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 18px;
  padding: 17px 16px;
}
.primary:active, .secondary:active { transform: translate(1px, 1px); }
.secondary {
  border: var(--rule) solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  font-variation-settings: "wdth" 70;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 18px;
  padding: 15px 16px;
}
.wide { width: 100%; }

.tally { display: grid; grid-template-columns: repeat(5, 1fr); border-top: var(--rule) solid var(--ink); border-bottom: var(--rule) solid var(--ink); }
.tally div { padding: 10px 4px 8px; text-align: center; }
.tally div + div { border-left: 2px solid color-mix(in srgb, var(--ink) 18%, transparent); }
.tally b { display: block; font-weight: 900; font-variation-settings: "wdth" 62; font-size: 32px; line-height: 1; }
.tally span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }

.next { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 0; }
.next b { font-family: var(--mono); color: var(--ink); font-size: 15px; margin-left: 4px; }
.section-k { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 10px; }

/* ---- start card ------------------------------------------------------------ */
/* Covers the page until the player taps Play, so the streak is the first
   thing they see. Shown from the first paint and dropped once the day loads
   if the square is already finished. */
.start {
  position: fixed; inset: 0;
  z-index: 50;
  background: var(--paper-grain), var(--paper);
  display: grid;
  place-items: center;
  padding: 24px 16px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.start.leaving { animation: leave .28s ease-in forwards; }
@keyframes leave { to { opacity: 0; transform: translateY(-12px); } }
.start-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.start-mark {
  width: 76px; height: 76px;
  display: grid;
  grid-template: repeat(4, 1fr) / repeat(4, 1fr);
  gap: 3px;
}
.start-mark span { background: var(--c); }
.start-name {
  margin: 18px 0 0;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-size: 64px;
  line-height: .85;
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.start-line { margin: 16px 0 0; min-height: 2.6em; font-size: 21px; line-height: 1.25; }
.start-line em { font-style: normal; font-weight: 900; background: var(--thing); color: #15130F; padding: 0 .12em; }
.start-line .sub { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.start-go { width: min(240px, 100%); margin-top: 26px; }
.start-meta { margin: 22px 0 0; font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--ink-soft); }
.start-meta b { color: var(--ink); }

/* ---- sheets & toast ------------------------------------------------------ */
.sheet {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px);
  border: var(--rule) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 22px 20px 20px;
}
.sheet::backdrop { background: color-mix(in srgb, var(--paper) 70%, transparent); backdrop-filter: blur(2px); }
.sheet[open] { animation: rise .3s ease-out; }
.sheet h2 {
  margin: 0 0 10px;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-size: 40px;
  line-height: .9;
  text-transform: uppercase;
}
.sheet .lede { font-size: 17px; margin: 0 0 14px; }
.rules { padding-left: 20px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.rules li::marker { font-family: var(--mono); font-size: 12px; }
.tag { font-style: normal; font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 5px; color: #15130F; }
.tag.thing { background: var(--thing); } .tag.how { background: var(--how); } .tag.idea { background: var(--idea); } .tag.wild { background: var(--wild); }
.fine { font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; }
.close { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 28px; line-height: 1; padding: 4px 8px; }

.toast {
  position: fixed;
  left: 50%; top: 70px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 15px;
  z-index: 60;
  max-width: calc(100vw - 32px);
  animation: rise .25s ease-out;
}

.side-thing { --c: var(--thing); }
.side-how { --c: var(--how); }
.side-idea { --c: var(--idea); }
.side-wild { --c: var(--wild); }

.loading { text-align: center; padding: 40px 0; font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }

@media (min-width: 700px) {
  .stage { padding-top: 28px; }
  .board-wrap { --size: min(400px, 48dvh); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- keyboard open (phones) ---------------------------------------------- */
/* app.js sets .kb and --vvh, the height left above the keyboard. The page fits
   that height exactly: the banned words stand beside a smaller square, past
   tries scroll in the middle, and the prompt sits on the keyboard. */
:root.kb body { height: var(--vvh); min-height: 0; overflow: hidden; }
:root.kb .bar, :root.kb .skip { display: none; }
:root.kb main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  column-gap: 16px;
  padding-bottom: 0;
}
:root.kb .play { display: contents; }
:root.kb .stage { grid-column: 1; grid-row: 1; padding: max(10px, env(safe-area-inset-top)) 0 10px; }
:root.kb .board-wrap { --size: clamp(120px, min(56vw, var(--vvh) - 150px), 240px); margin: 0; }
@media (prefers-color-scheme: dark) {
  :root.kb:not([data-theme="light"]) .board-wrap { --size: clamp(110px, min(52vw, var(--vvh) - 170px), 230px); margin: 12px; }
}
:root.kb[data-theme="dark"] .board-wrap { --size: clamp(110px, min(52vw, var(--vvh) - 170px), 230px); margin: 12px; }
:root.kb .dont {
  grid-column: 2; grid-row: 1;
  align-self: center;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
:root.kb .chips { flex-direction: column; align-items: flex-start; }
/* Short phones get smaller chips, so five still fit beside the square. */
:root.kb .chips li { font-size: clamp(12px, calc((var(--vvh) - 200px) / 14), 15px); }
:root.kb .log { grid-column: 1 / -1; grid-row: 2; overflow-y: auto; }
:root.kb .composer { grid-column: 1 / -1; grid-row: 3; padding-bottom: 8px; }
