.wm-dg-page {
  margin: 0;
  padding: clamp(12px, 4vw, 52px);
  background: #091136;
}
.wm-dg-page .wm-dg + .wm-dg { margin-top: 3rem; }
.wm-dg {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 4rem);
  max-width: 58rem;
  margin-inline: auto;
  color: #f3f1e7;
  background: #091136;
  font-family: inherit;
  text-align: left;
  color-scheme: dark;
}
.wm-dg .wm-dg-board {
  flex: 0 1 420px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #365363;
  border-radius: 14px;
  background: #060d22;
}
.wm-dg[data-size="small"] .wm-dg-board { flex-basis: 300px; }
/* the whole board fits under the header on short laptop screens too (1280x720: 697 px tall before) */
.wm-dg .wm-dg-board { max-width: calc((100vh - 100px) * .6); max-width: calc((100svh - 100px) * .6); scroll-margin: 72px 0 16px; }
.wm-dg canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 5;
}
.wm-dg.wm-dg-playing canvas { touch-action: none; cursor: crosshair; }
.wm-dg .wm-dg-caption {
  display: block;
  padding: .5rem .75rem;
  color: #cad6d8;
  font: 11px/1.4 ui-monospace, monospace;
  border-top: 1px solid #365363;
}
.wm-dg .wm-dg-panel { flex: 1 1 15rem; min-width: 0; }
.wm-dg h2 {
  margin: 0;
  color: #f3f1e7;
  font: 650 clamp(2.1rem, 5vw, 4rem)/1.03 'DM Sans', system-ui, sans-serif;
  letter-spacing: -.045em;
}
.wm-dg[data-size="small"] h2 { font-size: 2.1rem; }
.wm-dg .wm-dg-status { max-width: 32ch; margin: 1rem 0; font-size: 1rem; line-height: 1.55; }
.wm-dg progress {
  display: block;
  width: min(100%, 20rem);
  height: 5px;
  margin-bottom: 1.4rem;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  appearance: none;
  background: #263651;
  color: #4fe0e4;
}
.wm-dg progress::-webkit-progress-bar { background: #263651; }
.wm-dg progress::-webkit-progress-value { background: #4fe0e4; }
.wm-dg progress::-moz-progress-bar { background: #4fe0e4; }
.wm-dg .wm-dg-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; }
.wm-dg button {
  padding: .75rem 1.25rem;
  min-height: 44px;
  border: 1px solid #d2f26b;
  border-radius: 2rem;
  background: #d2f26b;
  color: #091136;
  line-height: 1.25;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;
}
.wm-dg a { color: #d2f26b; text-underline-offset: .24em; }
.wm-dg button:focus-visible, .wm-dg a:focus-visible { outline: 3px solid #4fe0e4; outline-offset: 4px; }
.wm-dg [hidden] { display: none; }
@media (max-width: 660px) {
  .wm-dg { display: grid; gap: 1rem; }
  .wm-dg .wm-dg-panel { grid-row: 1; }
  .wm-dg .wm-dg-board { width: min(100% - 2px, 420px); }
  .wm-dg[data-size="small"] .wm-dg-board { width: min(100% - 2px, 300px); }
  /* the words above the board keep one height through play, so the board never moves under a finger
     (the longest line, "Drag from the low spot...", wraps to four lines at 390 px) */
  .wm-dg .wm-dg-status { min-height: 6.2em; }
  /* the whole board fits between the header and the bottom bar, so the low spot and the boxes at the curb show at once */
  .wm-dg .wm-dg-board { max-width: calc((100vh - 170px) * .6); max-width: calc((100svh - 170px) * .6); scroll-margin: 70px 0 80px; }
}

/* watermri.com: the home section that holds the full game (navy, like the orbit section above it) */
.k-drain {
  background: #091136;
  padding: 72px clamp(16px, 4vw, 40px) 88px;
}
/* no game mounted (?look=nogame, or no script): no empty navy band */
.k-drain:not(:has(.wm-dg)) { display: none; }
.nf .wm-dg { margin-top: 40px; margin-inline: 0; background: transparent; }
/* Keep the site's floating droplet art (css/alive.css, z-index 15, above the page) off the yard map; the header (20) stays above. */
.k-drain .wm-dg-board,
.nf .wm-dg-board {
  position: relative;
  z-index: 16;
}
/* On the not-found page the board sits inside `.wmsite section>.wrap` (its own layer at z-index 1): lift that wrap instead (header 40 and dock 50 stay above). */
.wmsite .nf > .wrap {
  z-index: 16;
}

/* "Help Linah drain her property!" (owner, 29 Nov 2026; card ~/watermri/docs/SITE-LINAH-20261129, part 3): on the home
   page Linah stands in the low spot and asks for help in a speech bubble over the yard. drain-game.js draws every line
   once; a line shows by fading its whole layer. Her drawing is drop.ts Linah (drain-linah.js); her sad and wince faces
   live here. Undo: drop `data-linah` from the #drain mount in index.html. */
.wm-dg[data-linah] .wm-dg-board { position: relative; container-type: inline-size; }
/* the heading's descenders stay clear of the water bar (the status line used to sit between them) */
.wm-dg[data-linah] progress { margin-top: 1.1rem; }
/* her words are in the bubble; the panel line stays for screen readers only */
.wm-dg[data-linah] .wm-dg-status {
  position: absolute; width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wm-dg .dg-bub {
  position: absolute; left: 23.5%; right: 2%; top: 2.2%; z-index: 2;
  display: grid; box-sizing: border-box; padding: 8px 11px 9px;
  border: 2px solid #0a1442; border-radius: 14px; background: #f6f3e8; color: #0a1442;
  font: 500 13px/1.32 "Inter Tight", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  text-align: left; box-shadow: 0 12px 28px -12px #000d; pointer-events: none;
  transition: opacity .18s ease-out;
}
/* while a finger draws, the bubble fades back so the pipe and its fall readout show through */
.wm-dg.dg-drawing .dg-bub { opacity: .12; }
.wm-dg .dg-tail {
  position: absolute; left: -8px; bottom: 14px; width: 12px; height: 12px; background: #f6f3e8;
  border: 2px solid #0a1442; border-top: 0; border-right: 0; transform: rotate(45deg);
}
/* every line sits in the same grid cell: the bubble keeps one size and never jumps */
.wm-dg .dg-l { grid-area: 1 / 1; align-self: center; opacity: 0; visibility: hidden; transition: opacity .22s ease-out, visibility 0s .22s; }
.wm-dg .dg-l.on { opacity: 1; visibility: visible; transition: opacity .22s ease-out, visibility 0s; }
.wm-dg .dg-line { margin: 0; font-weight: 700; font-size: 14px; font-size: clamp(11.5px, 3.95cqw, 14px); line-height: 1.28; }
.wm-dg .dg-sub { margin: .35em 0 0; font-size: 12.5px; font-size: clamp(10.5px, 3.5cqw, 12.5px); line-height: 1.3; color: #2c3663; }
.wm-dg .dg-proof { margin: .4em 0 0; font: 650 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(10px, 3.35cqw, 12px); color: #1d5b3a; }

/* Linah in the puddle: 10 yard units wide, her feet in the low spot (drop.css sizes her by --wd-size; here the spot does) */
.wm-dg .dg-linah-spot { position: absolute; left: 4.17%; top: 15.2%; width: 16.67%; aspect-ratio: 1; z-index: 1; pointer-events: none; }
.wm-dg .dg-linah-spot > .wd { width: 100%; height: 100%; transition: transform .7s cubic-bezier(.22, .8, .32, 1); }
.wm-dg .dg-linah .dg-face { display: none; }
.wm-dg .dg-linah.sad .dg-brow, .wm-dg .dg-linah.sad .dg-frown, .wm-dg .dg-linah.sad .dg-tear { display: inline; }
/* wince: eyes squeezed shut for a moment */
.wm-dg .dg-linah.wince .wd-eyes, .wm-dg .dg-linah.wince .dg-tear { display: none; }
.wm-dg .dg-linah.wince .dg-squint { display: inline; }
/* sad: wings hang low, she sits a little down in the water */
.wm-dg .dg-linah.sad.wd-linah .wd-wing { animation: none; }
.wm-dg .dg-linah.sad.wd-linah .wd-wing-l { transform: rotate(-26deg) scaleX(.82); }
.wm-dg .dg-linah.sad.wd-linah .wd-wing-r { transform: rotate(26deg) scaleX(.82); }
.wm-dg .dg-linah.sad.wd-linah .wd-stage { animation: none; transform: translateY(4%); }
/* win: she cheers (drop.ts cheer: the hop, the splash, wings beating) and flutters up out of the puddle */
.wm-dg .dg-linah.won { transform: translateY(-30%); }
@media (prefers-reduced-motion: no-preference) {
  .wm-dg .dg-linah.sad.wd-linah:not(.wd-still) .wd-wing-l { animation: dg-droop-l 2.4s ease-in-out infinite alternate; }
  .wm-dg .dg-linah.sad.wd-linah:not(.wd-still) .wd-wing-r { animation: dg-droop-r 2.4s ease-in-out infinite alternate; }
  .wm-dg .dg-linah.sad.wd-linah:not(.wd-still) .wd-stage { animation: dg-sulk 3.2s ease-in-out infinite; }
  .wm-dg .dg-linah.sad.wince.wd-linah:not(.wd-still) .wd-stage { animation: dg-wince 520ms ease-out 1; }
}
@keyframes dg-droop-l { from { transform: rotate(-26deg) scaleX(.82); } to { transform: rotate(-20deg) scaleX(.7); } }
@keyframes dg-droop-r { from { transform: rotate(26deg) scaleX(.82); } to { transform: rotate(20deg) scaleX(.7); } }
@keyframes dg-sulk { 0%, 100% { transform: translateY(4%); } 50% { transform: translateY(6%) scale(1.02, .98); } }
@keyframes dg-wince {
  0% { transform: translateY(4%); }
  20% { transform: translate(-5%, 6%) scale(1.08, .9); }
  45% { transform: translate(5%, 5%) scale(1.04, .94); }
  70% { transform: translate(-2%, 4%); }
  100% { transform: translateY(4%); }
}
@media (prefers-reduced-motion: reduce) {
  .wm-dg .dg-bub, .wm-dg .dg-l, .wm-dg .dg-l.on, .wm-dg .dg-linah-spot > .wd { transition: none; }
}
