/* The board page and the board itself. */
.board-root { width: 100%; max-width: 580px; margin: 0 auto; }
.grid { container-type: inline-size; display: grid; grid-template: repeat(9, 1fr) / repeat(9, 1fr); aspect-ratio: 1; width: 100%; background: var(--paper); border: 3px solid var(--paper-ink); border-radius: 14px; box-shadow: var(--board-shadow); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.cell { --pc: var(--paper-ink); position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; margin: 0; font: inherit; background: var(--paper); color: var(--paper-ink); border: 0; border-right: 1px solid var(--paper-thin); border-bottom: 1px solid var(--paper-thin); border-radius: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cell:nth-child(9n) { border-right: 0; }
.cell:nth-child(n+73) { border-bottom: 0; }
.cell.bl { border-left: 2px solid var(--paper-ink); }
.cell.bt { border-top: 2px solid var(--paper-ink); }
.cell:nth-child(9n+1) { border-left: 0; }
.cell:nth-child(-n+9) { border-top: 0; }
/* --me is the viewer's own color (board.js): the selection ring and a light tint of it across
   the selected square's row, column and box */
.cell.peer, .cell.sel { background: var(--peer); background: color-mix(in srgb, var(--me, var(--paper-line)) 10%, var(--paper)); }
.cell.sel { z-index: 1; }
/* tiles under the digit, like game pieces on the paper: the selected square is a raised tile
   ringed in the viewer's color, and every copy of the highlighted digit sits on a tile tinted
   in the color of whoever placed it (warm yellow for the printed ones). The digit stays above
   its tile; every digit color keeps at least 3:1 on every tile at this size. */
.cell.sel::before, .cell.same::before { content: ""; position: absolute; inset: 7%; border-radius: 26%; pointer-events: none; }
.cell.same:not(.sel)::before { background: color-mix(in srgb, var(--pc) 13%, var(--paper)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pc) 55%, var(--paper)); }
.cell.same:is(.given, .filled):not(.sel)::before { background: var(--same); box-shadow: inset 0 0 0 2px #d9a23c; }
.cell.sel::before { inset: 5%; background: var(--sel); box-shadow: inset 0 0 0 3px var(--me, var(--paper-ink)), 0 3px 0 color-mix(in srgb, var(--me, var(--paper-ink)) 30%, transparent), 0 8px 14px -6px rgba(40, 26, 6, .45); }
.cell.sel.mine::before, .cell.sel.theirs::before { background: color-mix(in srgb, var(--pc) 10%, var(--paper)); }
/* a clash, a hint mark or a hint's next step rings the square's edge: the tile steps inside it */
.cell:is(.clash, .marked)::before { inset: 13%; }
.cell.step::before { inset: 22%; }
@media (hover: hover) {
  .board-root:not(.finished) .cell:not(.sel):not(.same):hover::before { content: ""; position: absolute; inset: 7%; border-radius: 26%; pointer-events: none; background: color-mix(in srgb, var(--me, var(--paper-line)) 8%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--me, var(--paper-line)) 35%, transparent); }
}
.cell:focus-visible { outline: 3px solid #1b5fd1; outline-offset: -3px; z-index: 2; }
.cell .d { position: relative; font-size: calc(100cqw / 9 * .62); font-weight: 600; line-height: 1; color: var(--paper-ink); }
.cell.given .d { font-weight: 800; color: #2c2822; }
.cell.mine .d, .cell.theirs .d { color: var(--pc); font-weight: 700; }
.cell.filled .d { color: #7a7368; font-weight: 600; }
/* a guess (the Guess tool): a smaller digit in the player's color inside a dashed ring, or a
   dashed rounded square for the second guess. Only on this device. */
.cell .d.guess { display: grid; place-items: center; width: calc(100cqw / 9 * .74); aspect-ratio: 1; font-size: calc(100cqw / 9 * .42); font-weight: 700; color: var(--pc); border: 2px dashed var(--pc); border-radius: 50%; }
.cell .d.guess.l2 { border-radius: 24%; }
/* a layer's first two guesses, the guess itself: heavier, underlined, the ring breathing faintly */
.cell .d.guess.start { font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; border-width: 2.5px; }
@media (prefers-reduced-motion: no-preference) {
  .cell .d.guess.start { animation: guess-breathe 2.6s ease-in-out infinite; }
}
@keyframes guess-breathe { 50% { border-color: color-mix(in srgb, var(--pc) 45%, transparent); } }
.cell.clash { background-image: repeating-linear-gradient(135deg, rgba(190, 30, 30, .0) 0 6px, rgba(190, 30, 30, .13) 6px 8px); box-shadow: inset 0 0 0 3px #b3261e; }
.cell.marked { background-image: repeating-linear-gradient(45deg, rgba(31, 27, 22, 0) 0 5px, rgba(31, 27, 22, .16) 5px 7px); box-shadow: inset 0 0 0 3px #1f1b16; }
.cell.step { animation: pulse 1.2s ease-in-out infinite; box-shadow: inset 0 0 0 4px #1b5fd1; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 8px #1b5fd1; } }
@media (prefers-reduced-motion: reduce) { .cell.step { animation: none; } }
.cell .q { position: absolute; top: 1px; right: 3px; font-style: normal; font-weight: 900; font-size: calc(100cqw / 9 * .3); color: var(--qc, #333); line-height: 1; background: var(--paper); border-radius: 50%; padding: 0 2px; border: 1.5px solid var(--qc, #333); min-width: 1.1em; text-align: center; }
.cell .notes { position: absolute; inset: 2px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center; }
/* notes in the selected square sit inside its tile, clear of the ring */
.cell.sel .notes { inset: 15%; }
.cell.sel .notes b { font-size: calc(100cqw / 9 * .245); }
.cell .notes b { font-size: calc(100cqw / 9 * .27); font-weight: 800; line-height: 1; }
/* the lit digit inside notes sits on a small round chip, like the tiles under its copies */
.cell .notes b.hl { display: grid; place-items: center; width: 92%; aspect-ratio: 1; border-radius: 50%; background: var(--same); box-shadow: inset 0 0 0 1.5px #d9a23c; }
/* a finished board becomes the picture of who solved what, like the mosaic beside it: the
   selection and the lit tiles step away, and each placed square takes a wash of its player's
   color (grey where Fill the rest put the answer) */
.board-root.finished .cell { background: var(--paper); }
.board-root.finished .cell::before { content: none; }
.board-root.finished .cell:is(.mine, .theirs) { background: color-mix(in srgb, var(--pc) 15%, var(--paper)); }
.board-root.finished .cell.filled { background: color-mix(in srgb, #a7a095 20%, var(--paper)); }

.status { min-height: 1.6em; text-align: center; color: var(--muted); font-size: 16px; margin: 8px 0; }
/* while guessing: the layer, how many guesses it holds, and what to do with them */
.guessbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1.5px dashed var(--me, var(--line)); }
.guessbar[hidden] { display: none; }
.guessbar .gb-text { flex: 1 1 100%; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.guessbar .btn { flex: 1 1 0; min-height: 44px; padding: 0 10px; font-size: 15px; white-space: nowrap; }
.guessbar .btn[hidden] { display: none; }
.pad { display: grid; gap: 12px; margin-top: 4px; }
.pad-digits { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
/* keys are raised tiles that press down; the digits are in the viewer's color (--mine) */
.key { position: relative; font: inherit; min-height: 62px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--mine, var(--ink)); cursor: pointer; padding: 0; display: grid; place-items: center; touch-action: manipulation; box-shadow: 0 3px 0 var(--key-edge); }
.key .kd { font-size: 30px; font-weight: 800; line-height: 1; }
.key .kc { position: absolute; bottom: 4px; right: 0; left: 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1; }
/* the key of the digit lit on the board (a selected square's digit, or a key tapped with no
   square selected) lights up in the viewer's color */
.key.lit:not([disabled]) { border-color: var(--mine, var(--ink)); background: color-mix(in srgb, var(--mine, var(--ink)) 13%, var(--surface)); box-shadow: 0 3px 0 color-mix(in srgb, var(--mine, var(--ink)) 50%, var(--key-edge)); }
.key.done { background: var(--surface-2); box-shadow: none; }
.key.done .kd { opacity: .4; }
.key.done .kc::before { content: ""; display: inline-block; width: 9px; height: 4.5px; margin-bottom: 2px; border: solid var(--ok); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg); }
/* a locked digit (held key): its key is filled in the viewer's color with a small padlock, and
   every square tapped takes it. White on every palette color is at least 4.5:1 (--me). */
.key .lk { display: none; position: absolute; top: 5px; right: 5px; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.key.locked:not([disabled]) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 55%, #000); }
.has-me .key.locked:not([disabled]) { background: var(--me); border-color: var(--me); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--me) 55%, #000); }
.key.locked:not([disabled]) .kc { color: inherit; opacity: .85; }
.key.locked:not([disabled]) .lk { display: block; }
.locking .key:not(.locked):not([disabled]) .kd { opacity: .7; }
/* notes mode: pencil weight digits on dashed keys */
.notes-on .key:not([disabled]) { border-style: dashed; box-shadow: none; }
.notes-on .key .kd { font-size: 21px; font-weight: 700; }
.pad-tools { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.tool { font: inherit; font-weight: 800; font-size: 14px; line-height: 1.1; min-height: 60px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 3px 0 var(--key-edge); }
.tool svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool.on, .tool[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* Notes on, or my own doubt on this digit, lights the button in my color (white on every
   palette color is at least 4.5:1) */
.has-me .tool.on { background: var(--me); border-color: var(--me); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--me) 55%, #000); }
.key:active:not([disabled]), .tool:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-edge); }
.tool[disabled], .key[disabled] { opacity: .45; cursor: default; box-shadow: none; }
@media (hover: hover) {
  .key:hover:not([disabled]):not(.done):not(.locked), .tool:hover:not([disabled]):not(.on) { background: var(--surface-2); }
}
.notes-view { display: flex; gap: 12px; align-items: center; font-size: 16px; color: var(--muted); min-height: 48px; cursor: pointer; }
/* under the tools: the notes view on the left, the lightning switch (number first) on the right */
.pad-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.bolt { font: inherit; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; margin-left: auto; padding: 0 13px 0 5px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 800; white-space: nowrap; cursor: pointer; touch-action: manipulation; box-shadow: 0 3px 0 var(--key-edge); }
.bolt .track { position: relative; flex: none; width: 46px; height: 30px; border-radius: 999px; background: var(--switch-off); }
.bolt .knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); display: grid; place-items: center; }
.bolt .knob svg { width: 15px; height: 15px; fill: var(--switch-off); }
.bolt[aria-checked="true"] { border-color: var(--me, var(--accent)); background: color-mix(in srgb, var(--me, var(--accent)) 12%, var(--surface)); }
.bolt[aria-checked="true"] .track { background: var(--me, var(--accent)); }
.bolt[aria-checked="true"] .knob { transform: translateX(16px); background: #fff; }
.bolt[aria-checked="true"] .knob svg { fill: var(--me, var(--accent)); }
.bolt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-edge); }
.board-root.finished .bolt { display: none; }
.board-root.finished .pad { display: none; }
@media (max-width: 420px) {
  .pad-digits { gap: 5px; }
  .key { min-height: 58px; border-radius: 10px; }
  .key .kd { font-size: 26px; }
  .notes-on .key .kd { font-size: 19px; }
  .key .lk { top: 3px; right: 3px; width: 10px; height: 10px; }
  .tool { font-size: 13.5px; border-radius: 12px; }
}
@media (max-width: 350px) {
  .pad-digits { gap: 4px; }
  .pad-tools { gap: 5px; }
  .tool { font-size: 12.5px; }
}

/* the play page */
.play { display: grid; gap: 20px; }
@media (min-width: 940px) { .play { grid-template-columns: minmax(0, 580px) minmax(300px, 1fr); gap: 40px; align-items: start; } }
.main-col { width: 100%; max-width: 580px; margin: 0 auto; }
/* the head: difficulty squares, the title, and the team's progress in everyone's colors */
.play-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; margin: 4px 0 16px; }
.play-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.play-head h1 { font-size: 32px; margin: 0; }
.level { display: inline-grid; grid-template-columns: repeat(2, 10px); gap: 3px; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.level i { width: 10px; height: 10px; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.level i.on { background: var(--ink); box-shadow: none; }
.progress-text { margin: 0; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-text b { color: var(--ink); font-weight: 800; }
.progress { grid-column: 1 / -1; display: flex; height: 12px; padding: 2px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; min-width: 4px; background: var(--pc); border-radius: 999px; }
.progress i + i { margin-left: 2px; }
.progress i.grey { background: #a7a095; }
.progress:empty { display: none; }

.side { display: grid; gap: 16px; }
.side .card + .card { margin-top: 0; }
.side h2 { font-size: 22px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-head .caption { font-size: 14px; font-weight: 700; color: var(--muted); }
.players { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.players li { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 10px; border-radius: 12px; }
.players li.me { background: var(--surface-2); }
.players .who { flex: 1; min-width: 0; display: grid; gap: 6px; }
.players .name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.players .name { font-weight: 700; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .share { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.players li.me .share { background: var(--surface); }
.players .share i { display: block; height: 100%; border-radius: inherit; background: var(--pc); }
.players .count { font-family: var(--display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: right; }
.players .more { min-width: 44px; min-height: 44px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.solo-note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 16px; line-height: 1.45; }
.solo-note svg { flex: none; width: 22px; height: 22px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.settings-sub { font: 800 15px/1.3 var(--font); letter-spacing: .02em; text-transform: uppercase; color: var(--muted); margin: 22px 0 4px; }
.keys-help { margin: 14px 0 0; font-size: 15px; line-height: 2; color: var(--muted); }
@media (hover: none) and (pointer: coarse) { .keys-help { display: none; } }
.hintbox { border-left: 6px solid #1b5fd1; background: var(--surface-2); padding: 12px 14px; border-radius: 8px; }
/* the next step's strategy: its lesson (learn.js) */
.step-learn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 8px; padding: 0 4px; font-weight: 800; color: var(--ink); text-underline-offset: 4px; }
.step-learn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ladder { display: grid; gap: 8px; }
.ladder button { text-align: left; }

/* finish: a rosette in the eight colors, the team's line, the board's picture on a little
   table of dotted paper, and who did what. It leads the side column, so on a computer it sits
   beside the finished board, and on a phone it follows it. */
#finish:empty { display: none; }
.finish { position: relative; overflow: hidden; isolation: isolate; text-align: center; margin: 0; padding: 26px 22px 22px; box-shadow: var(--lift); }
.finish::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--p0) 0 12.5%, var(--p1) 0 25%, var(--p2) 0 37.5%, var(--p3) 0 50%, var(--p4) 0 62.5%, var(--p5) 0 75%, var(--p6) 0 87.5%, var(--p7) 0); }
/* a soft glow in the player colors behind the rosette */
.finish::after { content: ""; position: absolute; z-index: -1; top: -20px; left: 50%; width: 360px; height: 250px; margin-left: -180px; pointer-events: none;
  background:
    radial-gradient(30% 36% at 34% 46%, color-mix(in srgb, var(--p0) 24%, transparent), transparent),
    radial-gradient(28% 34% at 66% 44%, color-mix(in srgb, var(--p5) 22%, transparent), transparent),
    radial-gradient(24% 26% at 50% 68%, color-mix(in srgb, var(--p4) 20%, transparent), transparent); }
.rosette { display: block; width: 100px; height: auto; margin: 4px auto 10px; overflow: visible; filter: drop-shadow(0 10px 12px rgba(40, 26, 6, .24)); }
.finish .finish-big { font-family: var(--display); font-size: clamp(44px, 11vw, 60px); font-weight: 700; line-height: 1; letter-spacing: -.01em; margin: 0 0 10px; color: var(--ink); }
.finish h2 { font-size: clamp(22px, 4.6vw, 28px); line-height: 1.18; letter-spacing: -.005em; margin: 0 0 8px; text-wrap: balance; }
.finish .cheer { margin: 0 auto 18px; max-width: 24em; font-size: 17px; color: var(--muted); text-wrap: balance; }
.finish .open { color: var(--muted); margin: 18px 0 18px; }
/* the way on, before anything else: Next puzzle big, the other two under it */
.next-up { display: grid; gap: 10px; max-width: 420px; margin: 0 auto; }
.btn.next { position: relative; min-height: 68px; width: 100%; padding: 8px 54px 8px 22px; display: grid; justify-items: center; gap: 2px; border-radius: 18px; font-size: 21px; line-height: 1.15; box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 55%, #000); }
.btn.next .next-note { font-size: 14.5px; font-weight: 700; opacity: .85; }
.btn.next svg { position: absolute; right: 20px; top: 50%; width: 22px; height: 22px; margin-top: -11px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.btn.next:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 55%, #000); }
.next-more { display: grid; gap: 10px; }
.next-more .btn { min-height: 50px; padding: 0 14px; font-size: 16.5px; }
.next-more .pill { margin-left: 2px; background: var(--surface-2); color: var(--ink); font-size: 13px; white-space: nowrap; }
.finish .btn.busy { opacity: .7; cursor: progress; }
.finish .share-row { margin-top: 16px; gap: 8px; }
.finish .share-row .btn { min-height: 46px; padding: 0 13px; font-size: 14.5px; }
.finish-art { margin: 0 -22px; padding: 22px 22px 14px; background:
    radial-gradient(color-mix(in srgb, var(--ink) 12%, transparent) 1px, transparent 1.6px) 0 0 / 18px 18px,
    var(--surface-2); border-block: 1px solid var(--line); }
.finish-art figcaption { margin: 14px auto 0; max-width: 22em; font-size: 14px; line-height: 1.45; color: var(--muted); text-wrap: balance; }
.mosaic { display: grid; grid-template-columns: repeat(9, 1fr); width: min(100%, 280px); aspect-ratio: 1; margin: 0 auto; gap: 3px; padding: 6px; background: var(--paper); border: 3px solid var(--paper-ink); border-radius: 14px; box-shadow: var(--board-shadow); rotate: -2deg; }
.mosaic i { background: var(--pc, #cfc7b8); display: block; border-radius: 4px; }
.mosaic i.given { background: #e4dccb; }
.mosaic i.filled { background: #a7a095; }
/* each player: their tile and name, and what they earned on a pill edged in their color */
.credits { list-style: none; padding: 0; margin: 18px auto 6px; max-width: 360px; display: grid; gap: 8px; font-size: 16px; }
.credits li { display: flex; gap: 10px; align-items: center; justify-content: space-between; min-height: 52px; padding: 6px 8px 6px 6px; border-radius: 14px; background: var(--surface-2); }
.credits .who { display: inline-flex; gap: 10px; align-items: center; min-width: 0; color: var(--ink); font-weight: 800; }
.credits .avatar { width: 38px; height: 38px; border-radius: 11px; font-size: 14px; }
.credits .cname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credits .pts { flex: none; padding: 3px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pc) 55%, var(--surface)); color: var(--ink); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.finish .hints-used { margin: 8px 0 0; font-size: 15px; }
.share-row { justify-content: center; margin-top: 12px; }
/* the moment a board is solved (play.js): tiles that burst from the last square and tumble */
.confetti { position: fixed; inset: 0; z-index: 40; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; width: 12px; height: 12px; border-radius: 3.5px; background: var(--c); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }
.confetti i.long { width: 9px; height: 17px; border-radius: 3px; }
/* a nice find (board.js): a small burst over the square and a word that floats up */
.confetti.nice { z-index: 45; }
.confetti i.small { width: 8px; height: 8px; border-radius: 2.5px; }
.nice-word { position: absolute; padding: 4px 14px; border-radius: 999px; background: var(--paper); color: var(--me, var(--paper-ink)); border: 2.5px solid var(--me, var(--paper-ink)); font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.2; white-space: nowrap; box-shadow: 0 6px 14px -6px rgba(40, 26, 6, .5); }

@media (prefers-reduced-motion: no-preference) {
  .cell { transition: background-color .12s; }
  .cell .d.pop { animation: place .4s cubic-bezier(.3, 1.6, .5, 1) both; }
  /* a digit that lands in a clash shakes its head once */
  .cell.clash .d.pop { animation: nope .45s ease-in-out both; }
  /* the selected tile settles into place; copies of the lit digit flip up their tiles */
  .cell.sel::before { animation: lift .26s cubic-bezier(.3, 1.5, .5, 1) both; }
  .cell.same:not(.sel)::before { animation: chip .3s cubic-bezier(.3, 1.4, .5, 1) both; }
  .key.done .kc::before { animation: tick .45s cubic-bezier(.3, 1.8, .5, 1) both; }
  .board-root.finished .cell .d { animation: finish-wave .7s calc(150ms + var(--w) * 50ms) ease-in-out both; }
  .key, .tool { transition: transform .08s, box-shadow .08s, background-color .15s; }
  .bolt .knob { transition: transform .18s cubic-bezier(.3, 1.4, .5, 1), background-color .15s; }
  .progress i, .players .share i { transition: width .4s ease; }
  /* the finish: the rosette spins in, its tiles pop round it and the check draws itself; the
     picture fills in from the top left corner; the players arrive */
  .rosette { animation: rosette .7s cubic-bezier(.3, 1.5, .5, 1) both; }
  .rosette .rp { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(260ms + var(--k) * 55ms); transform-box: fill-box; transform-origin: center; }
  .rosette .rt { animation: arrive .5s .5s ease-out both; }
  .rosette .rc { animation: draw .45s .85s ease-out both; }
  .mosaic i { animation: tile .45s calc(500ms + var(--k) * 40ms) cubic-bezier(.3, 1.5, .5, 1) both; }
  .credits li { animation: arrive .45s 1.1s ease-out both; }
  .credits li + li { animation-delay: 1.2s; }
}
@keyframes place { from { opacity: 0; transform: scale(.3); } }
@keyframes nope { 0% { opacity: 0; transform: scale(.5); } 25% { opacity: 1; transform: none; } 45% { transform: translateX(-11%); } 65% { transform: translateX(9%); } 85% { transform: translateX(-4%); } }
@keyframes lift { from { transform: scale(.72); opacity: .4; } }
@keyframes chip { from { transform: scale(.5); opacity: 0; } }
@keyframes tick { from { transform: rotate(-45deg) scale(0); } }
@keyframes finish-wave { 35% { transform: translateY(-12%) scale(1.22); } }
@keyframes tile { from { opacity: 0; transform: scale(.2); } }
@keyframes rosette { from { opacity: 0; transform: scale(.3) rotate(-40deg); } }
@keyframes draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
