:root {
  color-scheme: light;
  font-family: ui-rounded, "Avenir Next", system-ui, sans-serif;
  background: #C9C4B8;
  color: #1E2023;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  min-width: 320px;
  background: #C9C4B8;
}

button, a { font: inherit; }

button {
  min-height: 44px;
  border: 1px solid #c7c1b3;
  border-radius: 14px;
  padding: 9px 14px;
  color: inherit;
  background: #fffdf8;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible, a:focus-visible { outline: 3px solid #176e83; outline-offset: 3px; }
button:disabled { opacity: .42; cursor: not-allowed; }

.shell {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px calc(22px + env(safe-area-inset-bottom));
}

.topbar, .top-actions, .level-row, .map-heading, .controls, .result-actions {
  display: flex;
  align-items: center;
}

.topbar { min-height: 44px; justify-content: space-between; gap: 8px; }
.top-actions { gap: 5px; }

.lab-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #1E2023;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.brand-mark { width: 22px; height: 22px; margin-right: 6px; flex: 0 0 auto; }

.quiet-button, .icon-button {
  min-height: 44px;
  border-color: transparent;
  padding: 7px 9px;
  background: transparent;
  color: #1E2023;
  font-size: 13px;
  font-weight: 750;
}

.icon-button { width: 44px; padding: 0; font-size: 21px; }

.title-screen { padding: clamp(148px, 23vh, 210px) 14px 32px; text-align: center; }
.eyebrow { margin: 0 0 7px; color: #757a70; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-family: ui-rounded, system-ui, sans-serif; font-size: clamp(32px, 10vw, 45px); line-height: 1.05; letter-spacing: -.045em; }
.subtitle { max-width: 32ch; margin: 17px auto 25px; color: #5c6159; font-size: 16px; line-height: 1.45; }
.instruction { min-height: 1.4em; margin: 11px 2px; color: #62685d; font-size: 14px; line-height: 1.4; }
.title-screen .instruction, .title-screen .eyebrow { display: none; }

.primary-button {
  border-color: #1E2023;
  color: #F6F1E6;
  background: #1E2023;
  box-shadow: 0 4px 0 #34373C;
  font-weight: 850;
}
.primary-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #34373C; }

#play-screen { padding: 12px 0 0; }
.goal-line { margin: 7px 3px 5px; color: #234b4d; font-size: 15px; font-weight: 850; line-height: 1.3; }
.pond-readout { display: grid; gap: 7px; margin: 0 0 5px; padding: 8px; border: 1px solid rgb(29 80 84 / .24); border-radius: 14px; background: rgb(235 247 241 / .78); }
.pond-readout .plc-target { padding: 0; border: 0; background: transparent; }.pond-readout .plc-target__head { font-size: 13px; }.pond-readout .plc-target__fill { background: #4d9c84; }
.duck-bars { display: grid; gap: 5px; }.duck-bar { display: grid; grid-template-columns: 74px 1fr 74px; gap: 7px; align-items: center; color: #3f5651; font-size: 11px; font-weight: 750; }.duck-bar.asleep { color: #25684f; }.rock-track { position: relative; height: 10px; overflow: visible; border-radius: 99px; background: #c2d8d3; }.rock-track i { display: block; height: 100%; border-radius: inherit; background: #d27859; transition: width .22s ease-out; }.duck-bar.asleep .rock-track i { background: #5aab8a; }.rock-track b { position: absolute; top: -3px; left: 50%; width: 2px; height: 16px; background: #285a59; opacity: .55; }.rock-word { text-align: right; white-space: nowrap; }
.level-row { justify-content: space-between; gap: 12px; padding: 0 3px; }
.level-name { margin: 0; font-family: ui-rounded, system-ui, sans-serif; font-size: 18px; font-weight: 850; }
.move-count { margin: 0; color: #686d63; font-size: 13px; font-variant-numeric: tabular-nums; }

.board-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #34373C;
  box-shadow: 0 5px 0 rgb(30 32 35 / .18);
}
.board-shell.missed { animation: missed-nudge .32s ease-in-out both; }
@keyframes missed-nudge { 0%, 100% { transform: translateX(0); } 28% { transform: translateX(-4px); } 72% { transform: translateX(4px); } }

#board { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
#board-overlay, #board-lift { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
#board-overlay { opacity: .34; }
#board { cursor: grab; -webkit-user-select: none; -webkit-touch-callout: none; }
#board.holding { cursor: grabbing; }
.message { min-height: 1.4em; margin: 11px 5px 6px; color: #51574e; font-size: 14px; line-height: 1.35; }
.message.refused { color: #9b3b31; }

.controls { justify-content: center; gap: 9px; padding: 8px 0 11px; }
.controls button { min-width: 92px; font-weight: 750; }
#time-controls { margin: 0 0 10px; }.plc-steps { grid-template-columns: repeat(2, 1fr); }.plc-steps__speed { display: none; }.plc-steps__readout::after { content: ' · croak is the beat'; }.plc-steps .plc-control { font-weight: 850; }

.why-panel {
  margin: 0 4px 12px;
  border: 1px solid #b8b3a7;
  border-radius: 13px;
  background: rgb(246 241 230 / .56);
  color: #596056;
  font-size: 13px;
  line-height: 1.4;
}
.why-panel summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}
.why-panel p { margin: 0; padding: 0 12px 12px; }

.result-card {
  margin: 4px 0 12px;
  padding: 20px 16px 16px;
  border: 1px solid #a7c7a6;
  border-radius: 20px;
  background: #f5fbef;
  text-align: center;
}
.result-title { margin: 0; color: #24594c; font-size: 24px; font-weight: 900; }
.result-marks { margin: 7px 0 5px; font-size: 16px; font-weight: 800; }
.share-line { min-height: 1.4em; margin: 0 auto 14px; color: #5a6758; font-size: 13px; line-height: 1.4; }
.result-actions { justify-content: center; flex-wrap: wrap; gap: 8px; }
.result-actions button { font-weight: 750; }

.map-heading { justify-content: space-between; gap: 15px; padding: 28px 4px 3px; }
.map-heading h1 { font-size: 32px; }
.level-map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.level-tile { min-height: 76px; padding: 10px 7px; text-align: left; }
.level-tile strong, .level-tile small { display: block; }
.level-tile strong { font-size: 17px; }
.level-tile small { margin-top: 4px; color: #687067; font-size: 11px; line-height: 1.25; }
.level-tile.complete { border-color: #79a982; background: #f4fbef; }

.hand-demo {
  position: absolute;
  z-index: 2;
  display: none;
  width: 40px;
  height: 50px;
  /* The fingertip (13, 2 in the glove) sits exactly on the point. */
  margin: -2px 0 0 -13px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 50'%3E%3Cg fill='%23FFFDF7' stroke='%231E2023' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M9 6.5a4.5 4.5 0 0 1 9 0V22h2.5a4 4 0 0 1 7.5 1.5h.5a4 4 0 0 1 7.5 2v2a4 4 0 0 1 3 4V36c0 6-4 9-10 9h-8c-5 0-8-2-10-6l-6-9a3.6 3.6 0 0 1 5.6-4.4L9 28Z'/%3E%3Cpath d='M12 42.5h18v6H12z'/%3E%3C/g%3E%3Cg fill='none' stroke='%231E2023' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M20.5 23v6M28.5 25v5M14 4.5h4'/%3E%3Cpath d='M15 45.5h12' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E") no-repeat 0 0 / 40px 50px;
  filter: drop-shadow(2px 3px 0 rgb(0 0 0 / .18));
  pointer-events: none;
  transform-origin: 13px 2px;
  transition: transform 90ms ease-out;
}
/* The press ripple at the fingertip: it grows and fades on every press. */
.hand-demo::before { content: ''; position: absolute; left: 13px; top: 2px; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 3px solid rgb(255 236 170 / .95); border-radius: 50%; opacity: 0; transform: scale(.3); }
.hand-demo.tapping::before, .hand-demo.pressing::before { animation: press-ripple .5s ease-out both; }
@keyframes press-ripple { 0% { opacity: .95; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.25); } }
.hand-demo.running { display: block; }

.sound-button { position: relative; }
.sound-mark { display: block; width: 21px; height: 16px; margin: 0 auto; border: 2px solid #1E2023; border-radius: 3px; background: #F6F1E6; }
.sound-mark::before, .sound-mark::after { content: ''; position: absolute; border: 2px solid #1E2023; border-left: 0; border-top-color: transparent; border-bottom-color: transparent; border-radius: 0 14px 14px 0; }
.sound-mark::before { width: 8px; height: 12px; left: 29px; top: 14px; }
.sound-mark::after { width: 13px; height: 20px; left: 29px; top: 10px; }
.sound-button.muted .sound-mark::before, .sound-button.muted .sound-mark::after { display: none; }
.sound-button.muted .sound-mark { background: #A7A296; }

#play-screen.opening-room .controls { display: none; }

.success-effect { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.success-effect i { position: absolute; top: 47%; left: 50%; width: 9px; height: 9px; border-radius: 2px; opacity: 0; background: #e5a52d; }
.success-effect.on i { animation: confetti .72s ease-out both; }
.success-effect i:nth-child(2) { background: #4d91ae; animation-delay: .05s; }
.success-effect i:nth-child(3) { background: #bb5f70; animation-delay: .1s; }
.success-effect i:nth-child(4) { background: #5d9663; animation-delay: .02s; }
.success-effect i:nth-child(5) { background: #9d71ad; animation-delay: .12s; }
@keyframes confetti { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x, 0), var(--y, 0)) rotate(240deg); opacity: 0; } }
.success-effect i:nth-child(1) { --x: -112px; --y: -105px; }.success-effect i:nth-child(2) { --x: 106px; --y: -96px; }.success-effect i:nth-child(3) { --x: 130px; --y: 92px; }.success-effect i:nth-child(4) { --x: -126px; --y: 78px; }.success-effect i:nth-child(5) { --x: 8px; --y: -145px; }

.load-error { margin: 54px 8px; padding: 18px; border: 1px solid #c4695e; border-radius: 14px; background: #fff5f2; color: #742f27; line-height: 1.4; }
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }
@media (min-width: 700px) { .shell { margin-top: 18px; min-height: calc(100dvh - 36px); border: 1px solid rgb(30 32 35 / .2); border-radius: 28px; background: rgb(246 241 230 / .45); box-shadow: 0 20px 60px rgb(30 32 35 / .16); } }

/* The small shell stays present on every screen. The rules card owns first visit. */
.shell { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.top-actions { gap: 8px; }
.quiet-button { min-width: 44px; padding-inline: 8px; white-space: nowrap; }
.quiet-button.icon-button { width: 44px; padding: 0; font-size: 20px; }
.credit-line { margin: 0 6px 14px; color: #6a6f66; font-size: 12px; line-height: 1.4; }
.hand-demo.tapping, .hand-demo.pressing { transform: scale(.9); }
.title-screen[hidden] { display: none; }
.level-name { font-family: Sniglet, ui-rounded, system-ui, sans-serif; }
.message { min-height: 1.2em; margin: 7px 5px 2px; }
.controls { padding: 5px 0 9px; }
.controls button { min-width: 106px; }

.result-card {
  position: fixed;
  z-index: 10;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  width: min(406px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 12px 14px 14px;
  box-shadow: 0 12px 32px rgb(30 32 35 / .24);
}
.result-title { font-size: 22px; }
.result-marks { margin: 3px 0; font-size: 15px; }
.result-marks { margin-bottom: 10px; }
.result-actions { flex-wrap: nowrap; gap: 6px; }
.result-actions button { min-width: 0; padding-inline: 9px; font-size: 13px; white-space: nowrap; }

.howto-modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: start center; overflow: auto; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgb(30 32 35 / .46); }
.howto-modal[hidden] { display: none; }
.howto-card { width: min(406px, 100%); margin: 0 auto; padding: 14px; border: 1px solid #8d8a82; border-radius: 22px; background: #f7f4ed; box-shadow: 0 16px 48px rgb(0 0 0 / .3); }
.howto-card h1 { font-size: clamp(26px, 8vw, 34px); }
.howto-pictures { position: relative; display: grid; grid-template-columns: 1fr 18px 1fr; align-items: center; gap: 4px; margin: 10px 0; }
.howto-picture { position: relative; overflow: hidden; border-radius: 12px; background: #34373C; }
.howto-picture canvas { display: block; width: 100%; height: auto; }
.picture-arrow::before { content: '\2192'; display: block; color: #1E2023; font-size: 18px; font-weight: 900; text-align: center; }
.picture-hand { position: absolute; left: 16%; top: 88%; width: 26px; height: 32px; margin: -1px 0 0 -8px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 50'%3E%3Cg fill='%23FFFDF7' stroke='%231E2023' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M9 6.5a4.5 4.5 0 0 1 9 0V22h2.5a4 4 0 0 1 7.5 1.5h.5a4 4 0 0 1 7.5 2v2a4 4 0 0 1 3 4V36c0 6-4 9-10 9h-8c-5 0-8-2-10-6l-6-9a3.6 3.6 0 0 1 5.6-4.4L9 28Z'/%3E%3Cpath d='M12 42.5h18v6H12z'/%3E%3C/g%3E%3Cg fill='none' stroke='%231E2023' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M20.5 23v6M28.5 25v5M14 4.5h4'/%3E%3Cpath d='M15 45.5h12' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E") no-repeat 0 0 / 26px 32px; filter: drop-shadow(1px 2px 0 rgb(0 0 0 / .18)); }
.picture-hand::before { content: ''; position: absolute; left: 8px; top: 1px; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid rgb(255 236 170 / .95); border-radius: 50%; }
.howto-lines { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.howto-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 2px; color: #596056; font-size: 13px; font-weight: 800; }.howto-pager button { min-width: 44px; padding: 4px; font-size: 22px; }
.howto-lines li, .howto-lines p { margin: 0; color: #3f453e; font-size: 15px; line-height: 1.35; }
.howto-footer { display: grid; gap: 6px; margin-top: 10px; }
.howto-toggles { display: flex; justify-content: space-between; gap: 8px; }
#begin-button { width: 100%; white-space: nowrap; }
.footer-toggle { min-height: 44px; border-color: transparent; padding: 7px 8px; background: transparent; color: #363a36; font-size: 12px; font-weight: 750; white-space: nowrap; }
.footer-toggle.muted { color: #8a4039; }
@media (max-width: 355px) {
  .shell { padding-inline: 8px; }
  .top-actions { gap: 3px; }
  .quiet-button { padding-inline: 5px; font-size: 12px; }
  .howto-card { padding: 12px; }
  .howto-lines li, .howto-lines p { font-size: 14px; }
  .level-tile strong { font-size: 14px; }
  .result-actions { gap: 4px; }
  .result-actions button { padding-inline: 6px; font-size: 12px; }
  .duck-bar { grid-template-columns: 64px 1fr 67px; font-size: 10px; }
}

/* Still Water polish (2026-10-21): the brand never shrinks under its own text, the level cabinet spans the page, quieter helper text reads clearly. */
.lab-link { flex: 0 0 auto; white-space: nowrap; }
.top-actions { min-width: 0; }
.level-map > .plc-cabinet, .level-map > .plc-modes { grid-column: 1 / -1; }
.message, .instruction { color: #3b423a; }

/* ===== 2026-10-23 refine: an ink-wash pond on paper =====
   One paper, one ink, celadon water, one accent (koi vermilion, on the koi and the first-move ring only).
   Shippori Mincho for names and titles, Alegreya Sans for everything else. Text at the Play Lab sizes
   (body 20, rules 22, buttons 20, numbers 24, titles 28), no gradients, no drop shadows, no confetti. */
@font-face { font-family: "Shippori Mincho B1"; src: url("fonts/ShipporiMinchoB1-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --sw-paper: #F3EEE3; --sw-paper-2: #EAE3D3; --sw-ink: #24231F; --sw-ink-2: #4A4740; --sw-line: #24231F; --sw-hair: rgb(36 35 31 / .22);
  --sw-water: #C3D3CB; --sw-koi: #C9502A;
  --sw-title: "Shippori Mincho B1", "Noto Serif TC", "Songti TC", serif;
  --sw-body: "Alegreya Sans", "Noto Sans TC", "PingFang TC", sans-serif;
  --plc-ink: var(--sw-ink); --plc-paper: var(--sw-paper); --plc-line: var(--sw-line); --plc-moss: var(--sw-ink); --plc-warm: var(--sw-ink); --plc-dim: var(--sw-ink-2); --plc-shadow: transparent;
  font-family: var(--sw-body); font-weight: 500; background: var(--sw-paper); color: var(--sw-ink);
}
body { background: var(--sw-paper); font-family: var(--sw-body); line-height: 1.45; }
html[lang="zh-Hant"] body { line-height: 1.6; }
button, .plc-control, .plc-level, .plc-mode, .plc-mode strong, .plc-mode small, .plc-difficulty, .plc-speed, .plc-steps__readout, .plc-target__head, .plc-cabinet__head { font-family: var(--sw-body) !important; }
button { min-height: 48px; border: 1.6px solid var(--sw-line); border-radius: 6px; background: var(--sw-paper); color: var(--sw-ink); font-size: 20px; font-weight: 500; box-shadow: none; }
button:focus-visible, a:focus-visible, .plc-control:focus-visible { outline: 3px solid var(--sw-ink); outline-offset: 3px; }
button:disabled { opacity: 1; color: #77736A; border-color: #A8A397; border-style: dashed; }
.primary-button, .plc-control--primary { border-color: var(--sw-ink); background: var(--sw-ink); color: var(--sw-paper); box-shadow: none; font-weight: 500; }
.primary-button:active { transform: translateY(1px); box-shadow: none; }

/* top bar: the name in the title face, the controls as plain words */
.topbar { flex-wrap: wrap; row-gap: 0; border-bottom: 1.6px solid var(--sw-line); padding-bottom: 2px; }
.lab-link { font-family: var(--sw-title); font-size: 22px; font-weight: 600; color: var(--sw-ink); }
.brand-mark { width: 26px; height: 26px; }
.quiet-button { border: 0; background: transparent; font-size: 20px; font-weight: 500; padding-inline: 6px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.top-actions { gap: 4px; margin-left: auto; }

/* the play page: level name, one rule line, a quiet readout */
#play-screen { padding-top: 10px; }
.level-name { font-family: var(--sw-title); font-size: 26px; font-weight: 600; line-height: 1.2; }
.move-count { color: var(--sw-ink); font-size: 24px; font-variant-numeric: tabular-nums; }
.goal-line { margin: 4px 2px 8px; color: var(--sw-ink); font-size: 22px; font-weight: 500; line-height: 1.35; }
.instruction, .message { color: var(--sw-ink-2); font-size: 20px; line-height: 1.4; }
.message.refused { color: #8A2E1C; }
.pond-readout { gap: 4px; padding: 6px 10px 8px; border: 0; border-top: 1px solid var(--sw-hair); border-bottom: 1px solid var(--sw-hair); border-radius: 0; background: transparent; }
.pond-readout .plc-target { gap: 4px; }
.pond-readout .plc-target__head { font-size: 20px; font-weight: 500; }
.pond-readout .plc-target__count { color: var(--sw-ink); font-size: 24px; }
.pond-readout .plc-target__track { height: 4px; background: var(--sw-hair); }
.pond-readout .plc-target__fill { background: var(--sw-ink); }
.duck-bars { gap: 2px; }
.duck-bar { grid-template-columns: 30px 1fr auto; gap: 10px; color: var(--sw-ink); font-size: 20px; font-weight: 500; }
.duck-bar.asleep { color: var(--sw-ink); }
.duck-head { display: block; }
.rock-track { height: 8px; border-radius: 0; background: var(--sw-hair); }
.rock-track i { border-radius: 0; background: var(--sw-ink-2); }
.duck-bar.asleep .rock-track i { background: var(--sw-ink); }
.rock-track b { top: -4px; height: 16px; background: var(--sw-ink); opacity: 1; }
.rock-word { min-width: 4.2em; }
.board-shell { border-radius: 0; background: var(--sw-paper); box-shadow: none; }
#hand-demo { filter: none; }
.hand-demo::before, .picture-hand::before { border-color: var(--sw-koi); }
.success-effect { display: none !important; }
.controls { gap: 10px; }
.controls button { min-width: 120px; }

/* pace and hint: rows with hairlines, not cards */
.plc-steps { gap: 8px; padding: 10px 0; border: 0; border-top: 1px solid var(--sw-hair); border-radius: 0; background: transparent; }
.plc-steps__readout { color: var(--sw-ink-2); font-size: 18px !important; font-weight: 500; }
.plc-steps .plc-control, .plc-control { min-height: 48px; border: 1.6px solid var(--sw-line); border-radius: 6px; font-size: 20px !important; font-weight: 500; }
.why-panel { margin: 0 2px 12px; border: 0; border-top: 1px solid var(--sw-hair); border-bottom: 1px solid var(--sw-hair); border-radius: 0; background: transparent; color: var(--sw-ink); font-size: 20px; }
.why-panel summary { font-weight: 500; font-size: 20px; }
.credit-line { color: var(--sw-ink-2); font-size: 18px; }

/* the result: a paper slip with an ink border, one row of buttons */
.result-card { border: 1.6px solid var(--sw-line); border-radius: 6px; background: var(--sw-paper); box-shadow: 0 0 0 6px rgb(243 238 227 / .92); padding: 12px 12px 14px; }
.result-title { color: var(--sw-ink); font-family: var(--sw-title); font-size: 28px; font-weight: 600; }
.result-marks { font-size: 24px; font-weight: 500; }
.result-actions { flex-wrap: wrap; gap: 6px; }
.result-actions button { flex: 1 1 auto; min-height: 48px; padding-inline: 8px; font-size: 20px; }

/* levels: a ledger of ponds */
.map-heading h1, #map-title { font-family: var(--sw-title); font-size: 32px; font-weight: 600; letter-spacing: 0; }
.eyebrow { color: var(--sw-ink-2); font-size: 18px; font-weight: 500; letter-spacing: .06em; text-transform: none; }
#map-copy { font-size: 20px; }
.plc-cabinet__group, .plc-mode { border: 0; border-top: 1.6px solid var(--sw-line); border-radius: 0; background: transparent; box-shadow: none; }
.plc-cabinet__head { padding: 10px 2px; background: transparent; font-family: var(--sw-title) !important; font-size: 22px; font-weight: 600; }
.plc-cabinet__grid { padding: 4px 0 12px; }
.plc-level { min-height: 56px; border: 1.6px solid var(--sw-line); border-radius: 6px; background: var(--sw-paper); font-size: 24px; font-weight: 500; }
.plc-level[data-solved='true'] { background: var(--sw-paper-2); }
.plc-level[data-solved='true']::after { color: var(--sw-ink); font-size: 18px; }
.plc-mode { padding: 12px 2px; }
.plc-mode strong { font-family: var(--sw-title) !important; font-size: 22px; font-weight: 600; }
.plc-mode small { color: var(--sw-ink-2); font-size: 18px; }
.plc-mode__seal { border: 1.6px solid var(--sw-line); background: transparent; color: var(--sw-ink); }
.plc-difficulty, .plc-speed { min-height: 48px; border: 1.6px solid var(--sw-line); border-radius: 6px; font-size: 20px !important; }
.plc-difficulty[aria-pressed='true'], .plc-speed[aria-pressed='true'] { border-color: var(--sw-ink); background: var(--sw-ink); color: var(--sw-paper); }

/* how to play: a paper card, ink border, the pictures framed like the pond */
.howto-modal { background: rgb(36 35 31 / .55); }
.howto-card { border: 1.6px solid var(--sw-line); border-radius: 6px; background: var(--sw-paper); box-shadow: none; }
.howto-card h1 { font-family: var(--sw-title); font-size: 30px; font-weight: 600; letter-spacing: 0; }
.howto-picture { border: 1.6px solid var(--sw-line); border-radius: 4px; background: var(--sw-paper); }
.howto-lines li, .howto-lines p { color: var(--sw-ink); font-size: 22px; line-height: 1.4; }
.howto-pager { color: var(--sw-ink); font-size: 20px; font-weight: 500; }
.footer-toggle { min-height: 48px; border: 0; background: transparent; color: var(--sw-ink); font-size: 20px; font-weight: 500; text-decoration: underline; text-underline-offset: 5px; }
.footer-toggle.muted { color: var(--sw-ink-2); }
@media (max-width: 355px) {
  .quiet-button { font-size: 20px; padding-inline: 5px; }
  .howto-lines li, .howto-lines p { font-size: 22px; }
  .level-tile strong { font-size: 20px; }
  .result-actions button { padding-inline: 5px; font-size: 20px; }
  .duck-bar { grid-template-columns: 30px 1fr auto; font-size: 20px; }
}
/* refine, round 2 */
.lab-link { background: transparent !important; box-shadow: none !important; padding: 0 !important; font-size: 21px; }
.quiet-button { padding-inline: 4px; }
.level-row { align-items: baseline; }
.level-name { flex: 1 1 auto; min-width: 0; }
.move-count { flex: 0 0 auto; white-space: nowrap; }
.howto-lines, .howto-lines li, .howto-lines p { font-family: var(--sw-body); font-weight: 500; }
.plc-cabinet__head span:last-child { font-family: var(--sw-body); font-size: 18px; font-weight: 500; white-space: nowrap; align-self: center; }
/* short phones: the pond comes first. The readout becomes one row of duck chips (head + word), the bars go. */
@media (max-height: 740px) {
  .pond-readout { grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; padding: 4px 4px 6px; }
  .pond-readout .plc-target__track { display: none; }
  .duck-bars { display: flex; flex-wrap: wrap; gap: 2px 12px; justify-content: flex-end; }
  .duck-bar { display: inline-flex; gap: 4px; }
  .duck-bar .rock-track { display: none; }
  .rock-word { min-width: 0; }
  .goal-line { margin-bottom: 4px; }
  .instruction { margin: 4px 2px; }
  #play-screen { padding-top: 4px; }
}
@media (max-width: 359px) {
  .lab-link { font-size: 20px; }
  .brand-mark { width: 22px; height: 22px; margin-right: 4px; }
  .top-actions { gap: 0; }
  .level-name { font-size: 24px; }
}
/* refine, round 3: the top bar is one row with 8 px between targets; the result title and count share a line */
.topbar { flex-wrap: nowrap; }
.top-actions { gap: 8px; }
.quiet-button { padding-inline: 2px; min-width: 44px; }
.result-card { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: baseline; column-gap: 12px; padding-top: 8px; }
.result-card > .result-actions { grid-column: 1 / -1; margin-top: 6px; }
.result-card > :not(.result-title):not(.result-marks):not(.result-actions) { grid-column: 1 / -1; }
.result-title, .result-marks { margin: 0; }
@media (max-width: 359px) { .lab-link { font-size: 19px; } .top-actions { gap: 8px; } }
.plc-mode__seal { font-size: 22px !important; width: 44px; height: 44px; }
.result-card { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 12px; }
.result-card[hidden] { display: none !important; }
.result-card > .result-actions { flex: 1 1 100%; }

/* How to play opens under the top bar, like the play template */
.howto-modal { inset: var(--howto-top, 64px) 0 0 0; padding-top: 0; }
