/* I Gnome What You Mean: game CSS. Tokens from /design/garden.css; card and app bar patterns follow our Grow Worm sprout.
   The page is a column: the app bar, then the main area. Portrait: clue on top, the garden in the middle (as big as the
   space allows, ui.js sizes the canvas), the controls row at the bottom. Landscape (wider than tall): clue on the left,
   the garden in the middle, the controls on the right. Nothing scrolls. */
html, body { height: 100%; }
body { display: flex; flex-direction: column; height: 100svh; overflow: hidden; overscroll-behavior: none; background: var(--gg-cream); }
.wb-appbar { position: relative; z-index: 5; flex: none; }
.wb-appbar .gg-wordmark { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.wb-namechip { min-height: 30px; }
/* the garden identity chip (platform/gg.js mountChip, Keepline's pattern): desktop only, like the name pill */
.wb-ggchip:empty { display: none; }
@media (max-width: 560px) { .wb-namechip, .wb-ggchip { display: none; } }
@media (max-width: 370px) { .wb-appbar .gg-wordmark span { display: none; } }
@media (orientation: landscape) and (max-height: 500px) {
  .wb-appbar .gg-appbar__in { min-height: 50px; }
  .wb-appbar .gg-wordmark { font-size: 19px; }
  .wb-appbar .gg-wordmark svg { width: 30px; height: 30px; }
}

:root { --wb-sab: env(safe-area-inset-bottom, 0px); --wb-sal: env(safe-area-inset-left, 0px); --wb-sar: env(safe-area-inset-right, 0px); }

.wb-main {
  position: relative; flex: 1 1 auto; min-height: 0; width: 100%;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  gap: 8px; padding: 10px max(12px, var(--wb-sal)) calc(10px + var(--wb-sab)) max(12px, var(--wb-sar));
  max-width: 760px; margin: 0 auto;
}
.wb-main.is-land {
  grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr);
  max-width: none; gap: 14px; align-items: center;
}
.wb-main.is-land .wb-top { grid-column: 1; grid-row: 1; align-self: center; }
.wb-main.is-land .wb-boardwrap { grid-column: 2; grid-row: 1; }
.wb-main.is-land .wb-pad { grid-column: 3; grid-row: 1; }

/* ---------- the clue card ---------- */
.wb-top {
  background: var(--gg-paper); border: 2.5px solid var(--gg-ink); border-radius: var(--gg-r-lg); box-shadow: 0 4px 0 var(--gg-ink);
  padding: 10px 12px 10px; display: grid; gap: 6px; min-width: 0;
}
.wb-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wb-level { background: var(--gg-lime); font-family: var(--gg-font-display); font-weight: 800; }
/* round 10: "By <name>" on a player level; a long garden name ends in an ellipsis, so the pill is never wider than
   "Player level" was and the HUD row never wraps for it (measured at 375, 390, 844 x 390 and 1440) */
.wb-level { gap: 0; min-width: 0; }
.wb-by { display: inline-block; max-width: 5.6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.wb-moves { font-variant-numeric: tabular-nums; }
.wb-fewest { font-size: var(--gg-text-xs); color: var(--gg-ink-2); margin-left: auto; }
.wb-clue { margin: 0; font-family: var(--gg-font-display); font-weight: 800; font-size: clamp(18px, 4.8vw, 24px); line-height: 1.15; }
.wb-clue__k { display: inline-block; font-family: var(--gg-font-body); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; vertical-align: 3px; padding: 1px 6px; border: 1.5px solid var(--gg-ink); border-radius: 6px; background: var(--gg-butter); }
.wb-clues { display: grid; gap: 6px; }
.wb-cluerow { display: grid; gap: 5px; }
.wb-clues.is-two { gap: 5px; }
.wb-clues.is-two .wb-clue { font-size: clamp(16px, 4.2vw, 21px); }
.wb-clues.is-two .wb-cluerow { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; }
.wb-kind { background: var(--gg-butter); font-weight: 800; }
.wb-kind[hidden] { display: none; }
.wb-slots { display: flex; gap: 5px; }
.wb-slot {
  width: 26px; height: 30px; border: 2px dashed var(--gg-ink-3, #777); border-radius: 7px; display: grid; place-items: center;
  font-family: var(--gg-font-display); font-weight: 800; font-size: 17px; background: var(--gg-cream);
}
.wb-slot.is-on { border-style: solid; border-color: var(--gg-ink); background: var(--gg-lime); }
.wb-tip { margin: 0; font-size: var(--gg-text-sm); font-weight: 700; background: var(--gg-lime-100, #EEFFD6); border: 1.5px solid var(--gg-ink); border-radius: 10px; padding: 5px 9px; }
.wb-tip[hidden] { display: none; }

/* ---------- the garden ---------- */
.wb-boardwrap { position: relative; min-height: 0; min-width: 0; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.wb-canvas { display: block; touch-action: none; }
.wb-main *, .wb-appbar, .wb-appbar * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.wb-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 250, 240, .6); z-index: 4; }
.wb-busy[hidden] { display: none; }

/* ---------- controls: portrait = one row [Undo] [left] [up over down] [right] [Restart] ---------- */
.wb-pad { display: flex; align-items: center; justify-content: center; gap: 8px; }
.wb-pad .gg-btn { min-height: 44px; padding: 0; box-shadow: 0 3px 0 var(--gg-ink); }
.wb-pad .gg-btn svg { width: 24px; height: 24px; flex: none; }
.wb-undo, .wb-restart { min-width: 64px; height: 96px; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 800; border-radius: 16px; }
.wb-undo { background: var(--gg-butter); }
.wb-undo span, .wb-restart span { line-height: 1; }
.wb-dpad { display: grid; grid-template-columns: 58px 58px 58px; grid-template-rows: 44px 44px; gap: 8px; }
.wb-arrow { width: 58px; border-radius: 14px; }
.wb-arrow svg { width: 26px !important; height: 26px !important; }
.wb-arrow--l { grid-column: 1; grid-row: 1 / span 2; height: 96px; }
.wb-arrow--u { grid-column: 2; grid-row: 1; height: 44px; }
.wb-arrow--d { grid-column: 2; grid-row: 2; height: 44px; }
.wb-arrow--r { grid-column: 3; grid-row: 1 / span 2; height: 96px; }
.wb-pad .gg-btn.is-down { transform: translateY(3px); box-shadow: 0 0 0 var(--gg-ink); background: var(--gg-lime); }
.wb-pad .gg-btn:disabled { opacity: .45; }
.wb-arrow.is-hint { animation: wb-breathe 1.1s ease-in-out infinite; background: var(--gg-lime); }
@keyframes wb-breathe { 50% { transform: translateY(-3px) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .wb-arrow.is-hint { animation: none; } }
@media (max-width: 370px) {
  .wb-pad { gap: 6px; }
  .wb-undo, .wb-restart { min-width: 52px; font-size: 11px; }
  .wb-dpad { grid-template-columns: 52px 52px 52px; gap: 6px; }
  .wb-arrow { width: 52px; }
  .wb-arrow--l, .wb-arrow--r { height: 94px; }
}
/* a short portrait screen: a tighter clue card and controls */
.wb-main.is-short { gap: 6px; padding-top: 6px; }
.wb-main.is-short .wb-top { padding: 7px 10px; gap: 4px; }
.wb-main.is-short .wb-clue { font-size: 18px; }
.wb-main.is-short .wb-slot { height: 24px; width: 22px; font-size: 14px; }
.wb-main.is-short .wb-clues.is-two .wb-clue { font-size: 15px; }

/* landscape: a full cross on the right with Undo and Restart under it */
.wb-main.is-land .wb-pad { flex-direction: column; gap: 10px; }
.wb-main.is-land .wb-dpad { grid-template-columns: 54px 54px 54px; grid-template-rows: 54px 54px 54px; gap: 4px; order: 1; }
.wb-main.is-land .wb-arrow { width: 54px; height: 54px !important; }
.wb-main.is-land .wb-arrow--u { grid-column: 2; grid-row: 1; }
.wb-main.is-land .wb-arrow--l { grid-column: 1; grid-row: 2; }
.wb-main.is-land .wb-arrow--r { grid-column: 3; grid-row: 2; }
.wb-main.is-land .wb-arrow--d { grid-column: 2; grid-row: 3; }
.wb-main.is-land .wb-undo, .wb-main.is-land .wb-restart { height: 48px; flex-direction: row; min-width: 0; width: 170px; gap: 8px; font-size: 15px; }
.wb-main.is-land .wb-undo { order: 2; }
.wb-main.is-land .wb-restart { order: 3; }
.wb-main.is-land.is-tight .wb-dpad { grid-template-columns: 48px 48px 48px; grid-template-rows: 48px 48px 48px; }
.wb-main.is-land.is-tight .wb-arrow { width: 48px; height: 48px !important; }
.wb-main.is-land.is-tight .wb-undo, .wb-main.is-land.is-tight .wb-restart { height: 44px; width: 152px; }
.wb-main.is-land.is-tight .wb-pad { gap: 6px; }
.wb-main.is-land .wb-top { max-width: 320px; justify-self: end; width: 100%; }
.wb-main.is-land .wb-pad { justify-self: start; }
.wb-main.is-land.is-tight .wb-top { padding: 8px 10px; gap: 5px; }
.wb-main.is-land.is-tight .wb-clue { font-size: 18px; }
.wb-main.is-land.is-tight .wb-fewest { margin-left: 0; width: 100%; }

/* ---------- cards ---------- */
.wb-modal { z-index: 60; }
.wb-card { text-align: center; }
.wb-title { font-family: var(--gg-font-display); font-weight: 800; font-size: clamp(38px, 11vw, 56px); line-height: 1; margin: 6px 0 4px; }
.wb-titleart { display: block; width: 100%; max-width: 360px; height: auto; aspect-ratio: 600 / 220; margin: 0 auto 6px; }
.wb-lede { color: var(--gg-ink-2); margin: 0 0 16px; }
.wb-lede b { color: var(--gg-ink); }
.wb-btns { display: grid; gap: 10px; margin-top: 4px; }
.wb-btns [hidden] { display: none; }
.wb-best { margin: 12px 0 0; font-size: var(--gg-text-sm); color: var(--gg-ink-2); }
.wb-best:empty { display: none; }
.wb-h2 { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-2xl); margin: 4px 0 10px; }
.wb-word { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.wb-word .wb-word__gap { flex-basis: 100%; height: 0; }
.wb-word span { display: grid; place-items: center; width: 44px; height: 50px; background: var(--gg-lime); border: 2.5px solid var(--gg-ink); border-radius: 10px; box-shadow: 0 4px 0 var(--gg-ink); font-size: 28px; }
.wb-howlist { text-align: left; margin: 0 0 18px; padding-left: 20px; display: grid; gap: 8px; font-size: var(--gg-text-sm); }
/* round 7 (Jeep 11-13): a star on the solved card when the level is done in the fewest moves; it pops in with a
   little turn (no motion with reduced motion) */
.wb-sstar { width: 64px; height: 64px; margin: -6px auto 4px; filter: drop-shadow(0 3px 0 var(--gg-ink)); }
.wb-sstar svg { display: block; width: 100%; height: 100%; }
.wb-sstar.is-pop { animation: wb-star-pop .7s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes wb-star-pop { 0% { transform: scale(0) rotate(-120deg); opacity: 0; } 60% { transform: scale(1.25) rotate(12deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .wb-sstar.is-pop { animation: none; } }
/* the solved card sits low so the solved word on the garden stays in view above it */
.wb-modal--solved { place-items: end center; background: rgba(14, 44, 14, .28); }
@media (orientation: landscape) and (max-height: 560px) {
  .wb-modal .gg-modal__card { width: min(640px, 100%); padding: 14px 20px 12px; max-height: calc(100svh - 16px); overflow: auto; }
  .wb-title { font-size: 36px; margin: 0 0 2px; }
  .wb-titleart { max-width: 230px; margin-bottom: 2px; }
  .wb-lede { margin: 0 0 10px; font-size: var(--gg-text-sm); }
  .wb-btns { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wb-btns .gg-btn--lg { min-height: 48px; }
  .wb-btns > :only-child, .wb-btns > :first-child:has(+ [hidden]:last-child) { grid-column: 1 / -1; }
  .wb-howlist { gap: 4px; margin-bottom: 10px; }
  .wb-modal--solved { place-items: center end; }
  .wb-modal--solved .gg-modal__card { width: min(300px, 100%); }
  .wb-modal--solved .wb-btns { grid-template-columns: 1fr; }
  .wb-sstar { width: 44px; height: 44px; margin: -4px auto 2px; }
  .wb-word .wb-word__gap { flex-basis: 100%; height: 0; }
.wb-word span { width: 34px; height: 40px; font-size: 22px; }
}

/* a big desktop screen: a roomier clue card and controls next to the bigger garden */
@media (min-width: 1100px) and (min-height: 700px) {
  .wb-main.is-land .wb-top { max-width: 380px; padding: 14px 16px; gap: 9px; }
  .wb-main.is-land .wb-clue { font-size: 28px; }
  .wb-main.is-land .wb-slot { width: 34px; height: 40px; font-size: 22px; }
  .wb-main.is-land .wb-tip { font-size: var(--gg-text-md); }
  .wb-main.is-land .wb-dpad { grid-template-columns: 64px 64px 64px; grid-template-rows: 64px 64px 64px; }
  .wb-main.is-land .wb-arrow { width: 64px; height: 64px !important; }
  .wb-main.is-land .wb-undo, .wb-main.is-land .wb-restart { width: 200px; height: 54px; font-size: 16px; }
}
/* a phone in portrait: a compact solved card, so more of the garden (and the solved word on it) stays in view */
@media (orientation: portrait) and (max-height: 760px) {
  .wb-modal--solved .gg-modal__card { padding: 12px 16px 12px; }
  .wb-modal--solved .wb-h2 { margin: 2px 0 6px; }
  .wb-modal--solved .wb-word .wb-word__gap { flex-basis: 100%; height: 0; }
.wb-word span { width: 36px; height: 42px; font-size: 22px; box-shadow: 0 3px 0 var(--gg-ink); }
  .wb-modal--solved .wb-lede { margin: 0 0 8px; font-size: var(--gg-text-sm); }
  .wb-modal--solved .wb-best { margin: 0 0 8px; }
  .wb-modal--solved .gg-btn--lg { min-height: 50px; }
}
/* two-word levels in landscape: the clue column is narrow, so each word's slots sit under its clue */
.wb-main.is-land .wb-clues.is-two .wb-cluerow { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
.wb-main.is-land .wb-clues.is-two .wb-clue { font-size: 17px; }
.wb-main.is-land.is-tight .wb-clues.is-two .wb-slot { width: 22px; height: 26px; font-size: 14px; }
.wb-main.is-short .wb-tip { font-size: 13px; padding: 4px 8px; line-height: 1.3; }

/* ---------- round 6: the title card with its logo and the level picker ---------- */
.wb-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wb-titlecard { width: min(440px, 100%); }
.wb-titlecard .wb-titleart { max-width: 380px; aspect-ratio: 600 / 280; margin: 2px auto 4px; }
.wb-titlecard .gg-eyebrow { margin: 0; }
.wb-titlecard .wb-lede { margin: 0 0 10px; }
.wb-titlecard .wb-best { margin: 8px 0 0; }
.wb-picker { margin-top: 12px; padding-top: 10px; border-top: 2px dashed var(--gg-ink-3, #999); }
.wb-pnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.wb-pnav .gg-btn svg { width: 22px; height: 22px; }
.wb-pnav .gg-btn:disabled { opacity: .35; }
.wb-plabel { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-md, 17px); }
.wb-pgrid { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 7px; }
.wb-lvl {
  position: relative; min-width: 44px; min-height: 44px; height: 46px; padding: 0; border: 2px solid var(--gg-ink); border-radius: 12px;
  background: var(--gg-cream); box-shadow: 0 3px 0 var(--gg-ink); font-family: var(--gg-font-display); font-weight: 800; font-size: 18px;
  color: var(--gg-ink); cursor: pointer; display: grid; place-items: center; touch-action: manipulation;
}
.wb-lvl:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--gg-ink); }
.wb-lvl.is-solved { background: var(--gg-lime); }
.wb-lvl.is-next { background: var(--gg-butter); outline: 3px solid var(--gg-ink); outline-offset: 2px; }
.wb-lvl.is-locked { background: transparent; border-style: dashed; box-shadow: none; color: var(--gg-ink-3, #888); cursor: default; }
.wb-lvl.is-locked .wb-lvl__n { opacity: .55; }
.wb-lvl__star { position: absolute; top: -9px; right: -8px; width: 22px; height: 22px; }
.wb-lvl__star svg, .wb-lvl__lock svg, .wb-plegend svg { display: block; width: 100%; height: 100%; }
.wb-lvl__lock { position: absolute; bottom: 2px; right: 3px; width: 13px; height: 13px; opacity: .6; }
.wb-plegend { margin: 10px 0 0; font-size: var(--gg-text-xs); color: var(--gg-ink-2); display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }
.wb-plegend__solved { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--gg-ink); border-radius: 4px; background: var(--gg-lime); }
.wb-plegend__star { display: inline-block; width: 16px; height: 16px; margin-left: 6px; }
/* small phones: a smaller logo, a tighter grid (round 8: room for the Player levels / Make a level row) */
@media (max-height: 700px) and (orientation: portrait) {
  .wb-titlecard .wb-titleart { max-width: 220px; }
  .wb-titlecard .gg-eyebrow { display: none; }
  .wb-titlecard #playbtn { min-height: 48px; }
  .wb-tbtns .gg-btn { min-height: 44px; font-size: 14px; }
  .wb-titlecard .wb-lede { display: none; }
  .wb-picker { margin-top: 8px; padding-top: 8px; }
  .wb-pgrid { gap: 6px; }
  .wb-lvl { height: 44px; }
}
/* a phone on its side: the logo and Play on the left, the picker on the right; 10 levels a row */
@media (orientation: landscape) and (max-height: 560px) {
  .wb-titlecard { width: min(820px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: center; }
  .wb-titlecard .wb-titleart { max-width: 300px; }
  .wb-titlecard .wb-lede { display: none; }
  .wb-titlecard .wb-btns { grid-template-columns: 1fr; }
  .wb-picker { margin: 0; padding: 0 0 0 16px; border-top: 0; border-left: 2px dashed var(--gg-ink-3, #999); }
  .wb-pgrid { grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 6px; }
  .wb-lvl { height: 44px; }
}
/* a big screen: logo and picker side by side */
@media (min-width: 900px) and (min-height: 640px) {
  .wb-titlecard { width: min(860px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 28px 30px; }
  .wb-titlecard .wb-titleart { max-width: 400px; }
  .wb-picker { margin: 0; padding: 0 0 0 24px; border-top: 0; border-left: 2px dashed var(--gg-ink-3, #999); }
  .wb-lvl { height: 54px; font-size: 20px; }
}

/* the leaderboard moment on the solved card (live, 11-13) */
.wb-rgg { margin: 12px 0 0; }
.wb-rgg[hidden] { display: none; }
/* the Leaderboard trophy makes four round buttons in the app bar: the wordmark keeps its leaf only on a phone */
@media (max-width: 420px) { .wb-appbar .gg-wordmark span { display: none; } }

/* ---------- round 8 (Jeep 11-14): player levels. The editor (#maker, src/maker.js) uses the play screen's grid:
   the word card on top, the garden in the middle, the tools at the bottom (landscape: left, middle, right) ---------- */
.wb-tbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wb-tbtns .gg-btn { min-height: 46px; padding-inline: 8px; }
.wb-editbtn { min-height: 44px; min-width: 72px; margin-left: auto; background: var(--gg-butter); }
.wb-editbtn[hidden], .wb-fewest[hidden] { display: none; }
.wb-main[hidden] { display: none; }

.mk-top { gap: 6px; }
.mk-wordrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.mk-wordbtn { flex: none; min-height: 44px; padding: 4px 10px; gap: 0; flex-direction: column; line-height: 1.05; font-weight: 800; }
.mk-wordbtn__k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.mk-wordbtn__w { font-family: var(--gg-font-display); font-size: 16px; }
.mk-clue::before { content: 'Clue'; display: inline-block; font-family: var(--gg-font-body); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; vertical-align: 3px; padding: 1px 6px; margin-right: 6px; border: 1.5px solid var(--gg-ink); border-radius: 6px; background: var(--gg-butter); }
.mk-clue { margin: 0; min-width: 0; font-family: var(--gg-font-display); font-weight: 800; font-size: clamp(16px, 4.4vw, 20px); line-height: 1.15; }
.mk-cut { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mk-cutpiece { display: inline-flex; padding: 2px; gap: 0; border: 2.5px solid var(--gg-ink); border-radius: 12px; background: var(--gg-butter); box-shadow: 0 3px 0 var(--gg-ink); }
.mk-letter {
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent; border-radius: 9px; font-family: var(--gg-font-display);
  font-weight: 800; font-size: 22px; color: var(--gg-ink); cursor: pointer; touch-action: manipulation;
}
.mk-letter:disabled { cursor: default; color: var(--gg-ink); opacity: 1; }
.mk-letter:not(:disabled):active { background: var(--gg-lime); }
.mk-cutpiece + .mk-cutpiece .mk-letter:first-child { box-shadow: inset 0 0 0 0 transparent; }
.mk-status { margin: 0; font-size: var(--gg-text-sm); font-weight: 700; color: var(--gg-ink-2); }
.mk-status.is-ready { color: var(--gg-ink); background: var(--gg-lime-100, #EEFFD6); border: 1.5px solid var(--gg-ink); border-radius: 10px; padding: 4px 9px; }
.mk-boardwrap .wb-canvas { cursor: crosshair; }

.mk-pad { display: grid; gap: 8px; min-width: 0; }
.mk-tools, .mk-pieces { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.mk-tool {
  min-width: 44px; min-height: 48px; padding: 3px 6px; flex: 1 1 0; max-width: 84px; flex-direction: column; gap: 1px;
  font-size: 11px; font-weight: 800; border-radius: 12px; box-shadow: 0 3px 0 var(--gg-ink);
}
.mk-tool canvas { display: block; border-radius: 6px; }
.mk-tool[aria-pressed="true"] { background: var(--gg-lime); transform: translateY(2px); box-shadow: 0 1px 0 var(--gg-ink); outline: 3px solid var(--gg-ink); outline-offset: 1px; }
.mk-piece { max-width: 64px; }
.mk-piece:not(.is-placed) { border-style: dashed; animation: mk-wait 1.4s ease-in-out infinite; }
.mk-piece.is-placed::after { content: ''; position: absolute; right: 3px; top: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--gg-green-600, #267A40); border: 1.5px solid var(--gg-ink); }
.mk-piece { position: relative; }
@keyframes mk-wait { 50% { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .mk-piece:not(.is-placed) { animation: none; } }
.mk-actions { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; }
.mk-actions .gg-btn { min-height: 48px; padding-inline: 12px; }
.mk-test.is-ready { animation: wb-breathe 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .mk-test.is-ready { animation: none; } }
/* a short phone: a tighter word card and tools */
.mk-main.is-short .mk-tool { min-height: 44px; }
.mk-main.is-short .mk-tool span { display: none; }
.mk-main.is-short .mk-actions .gg-btn { min-height: 44px; }
.mk-main.is-short .mk-top { padding: 7px 10px; gap: 4px; }
/* landscape: the word card on the left, the garden in the middle, the tools on the right (icons only) */
.mk-main.is-land .mk-pad { grid-column: 3; grid-row: 1; width: 206px; justify-self: start; align-content: center; }
.mk-main.is-land .mk-top { max-width: 300px; }
.mk-main.is-land .mk-tools, .mk-main.is-land .mk-pieces { display: grid; grid-template-columns: repeat(4, 46px); gap: 6px; justify-content: start; }
.mk-main.is-land .mk-tool { min-height: 46px; max-width: none; padding: 2px; }
.mk-main.is-land .mk-tool span { display: none; }
.mk-main.is-land .mk-actions { grid-template-columns: 1fr 1fr; }
.mk-main.is-land .mk-actions .mk-test { grid-column: 1 / -1; }
.mk-main.is-land .mk-actions .gg-btn { min-height: 44px; }
.mk-main.is-land.is-tight .mk-cut { gap: 4px; }
.mk-main.is-land.is-tight .mk-letter { width: 44px; height: 44px; font-size: 19px; }
@media (min-width: 1100px) and (min-height: 700px) {
  .mk-main.is-land .mk-pad { width: 260px; }
  .mk-main.is-land .mk-tools, .mk-main.is-land .mk-pieces { grid-template-columns: repeat(4, 56px); }
  .mk-main.is-land .mk-tool { min-height: 58px; }
  .mk-main.is-land .mk-tool span { display: block; }
  .mk-main.is-land .mk-top { max-width: 360px; padding: 14px 16px; }
}

/* the word sheet: a search box and a list that scrolls inside the card */
.mk-sheet { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.mk-sheet .wb-h2, .mk-sheet__lede { margin: 0; text-align: center; }
.mk-sheet__lede { font-size: var(--gg-text-sm); }
.mk-search { width: 100%; min-height: 46px; padding: 8px 12px; border: 2.5px solid var(--gg-ink); border-radius: 12px; font: inherit; font-size: 16px; font-weight: 700; background: var(--gg-cream); }
.mk-wlist { flex: 1 1 auto; min-height: 120px; max-height: min(52vh, 460px); overflow: auto; overscroll-behavior: contain; display: grid; gap: 6px; padding: 2px; align-content: start; }
.mk-wrow {
  display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px;
  border: 2px solid var(--gg-ink); border-radius: 12px; background: var(--gg-paper); text-align: left; font: inherit; color: var(--gg-ink); cursor: pointer;
}
.mk-wrow b { font-family: var(--gg-font-display); font-weight: 800; font-size: 17px; letter-spacing: .04em; }
.mk-wrow span { font-size: var(--gg-text-sm); color: var(--gg-ink-2); }
.mk-wrow[aria-selected="true"] { background: var(--gg-lime); }
.mk-none { margin: 8px 0; text-align: center; color: var(--gg-ink-2); }
@media (orientation: landscape) and (max-height: 560px) { .mk-wlist { max-height: 48vh; } .mk-sheet__lede { display: none; } }
/* round 10: Our words | Your own (the player list's tab look), and the own word + hint form */
.mk-wtabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mk-wtab { min-height: 44px; min-width: 0; padding-inline: 6px; }
.mk-wtab[aria-selected="true"] { background: var(--gg-ink); color: var(--gg-cream); }
.mk-wpane { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.mk-wpane[hidden] { display: none; }
.mk-own { gap: 6px; }
.mk-own__k { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 800; font-size: var(--gg-text-sm); margin-top: 4px; }
.mk-own__k span { font-weight: 600; color: var(--gg-ink-2); font-size: var(--gg-text-xs); }
.mk-own__word { font-family: var(--gg-font-display); font-size: 20px; letter-spacing: .12em; text-transform: uppercase; }
.mk-own__hint { resize: none; line-height: 1.3; min-height: 72px; font-weight: 600; }
.mk-own__check, .mk-own__msg { margin: 0; min-height: 1.3em; font-size: var(--gg-text-sm); font-weight: 700; color: var(--gg-ink-2); }
.mk-own__check.is-ok { color: var(--gg-green-700); }
.mk-own__check.is-bad, .mk-own__msg { color: #A3271A; }
.mk-own__msg:empty { display: none; }
#owuse { margin-top: 4px; }
/* the card scrolls when it must (landscape): nothing in it may shrink under its content, or Close slides over "Use my
   word" (seen at 844 x 390); only the word list gives (it has its own scroll) */
.mk-sheet > * { flex-shrink: 0; }
.mk-sheet > #wspane-list { flex-shrink: 1; min-height: 0; }
@media (orientation: landscape) and (max-height: 560px) {
  .mk-own__hint { min-height: 48px; }
  .mk-sheet:has(#wspane-own:not([hidden])) .wb-h2 { display: none; }
}

/* the share card */
.mk-link { display: flex; gap: 8px; margin: 0 0 12px; }
.mk-linkin { flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 6px 10px; border: 2.5px solid var(--gg-ink); border-radius: 12px; font: inherit; font-size: 16px; background: var(--gg-cream); }
/* (16 px: an iPhone zooms the page in on a smaller input it focuses) */
.mk-link .gg-btn { min-height: 46px; }

/* the player levels list */
.pl-card { display: flex; flex-direction: column; gap: 10px; width: min(520px, 100%); text-align: left; }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-head .wb-h2 { margin: 0; }
.pl-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pl-tab { min-height: 44px; min-width: 0; padding-inline: 6px; }
.pl-tab[aria-selected="true"] { background: var(--gg-ink); color: var(--gg-cream); }
.pl-tab[hidden] { display: none; }
.pl-list { flex: 1 1 auto; min-height: 120px; max-height: min(54vh, 520px); overflow: auto; overscroll-behavior: contain; display: grid; gap: 8px; padding: 2px 2px 6px; align-content: start; }
.pl-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 58px; padding: 8px 12px;
  border: 2px solid var(--gg-ink); border-radius: 14px; background: var(--gg-paper); box-shadow: 0 3px 0 var(--gg-ink); text-align: left; font: inherit; color: var(--gg-ink); cursor: pointer;
}
.pl-row:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gg-ink); }
.pl-row.is-done { background: var(--gg-lime-100, #EEFFD6); }
.pl-row.is-now { box-shadow: 0 3px 0 var(--gg-ink), inset 0 0 0 2px var(--gg-ink); }
.pl-row__by { white-space: nowrap; font-weight: 700; color: var(--gg-ink); }
.pl-row__clue { display: block; font-family: var(--gg-font-display); font-weight: 800; font-size: 17px; line-height: 1.2; }
.pl-row__meta { display: block; margin-top: 2px; font-size: var(--gg-text-xs); color: var(--gg-ink-2); }
.pl-row__side { display: grid; justify-items: end; gap: 2px; font-size: var(--gg-text-xs); font-weight: 800; }
.pl-row__tick { width: 26px; height: 26px; }
.pl-row__tick svg { display: block; width: 100%; height: 100%; }
.pl-row__mine { padding: 1px 6px; border: 1.5px solid var(--gg-ink); border-radius: 6px; background: var(--gg-butter); }
.pl-empty { margin: 16px 4px; text-align: center; color: var(--gg-ink-2); }
.pl-more { min-height: 44px; }
.pl-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pl-foot .gg-btn { min-height: 46px; padding-inline: 8px; }
.pl-foot.is-one { grid-template-columns: 1fr; }
.pl-foot [hidden] { display: none; }
@media (orientation: landscape) and (max-height: 560px) {
  .pl-card { width: min(640px, 100%); gap: 6px; }
  .pl-list { max-height: calc(100svh - 190px); }
}

/* ---------------------------------------------------------------- round 9: blocks in any order, spares, the like, reports */
.mk-group {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 8px; gap: 1px;
  border: 2.5px solid var(--gg-ink); border-radius: 11px; background: var(--gg-butter); box-shadow: 0 3px 0 var(--gg-ink);
  font-family: var(--gg-font-display); font-weight: 800; font-size: 21px; letter-spacing: .02em; color: var(--gg-ink);
  cursor: pointer; touch-action: manipulation;
}
.mk-group span { display: inline-block; min-width: .7em; text-align: center; }
.mk-group span.is-spare { text-decoration: underline dotted 2px; text-underline-offset: 4px; color: var(--gg-ink-2); }
.mk-group.is-open { background: var(--gg-lime); outline: 3px solid var(--gg-ink); outline-offset: 2px; transform: translateY(2px); box-shadow: 0 1px 0 var(--gg-ink); }
.mk-group:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gg-ink); }
.mk-cut { gap: 7px; }
.mk-addspare { min-height: 44px; padding-inline: 10px; font-size: 14px; }
.mk-spgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.mk-spbtn {
  min-height: 44px; border: 2.5px solid var(--gg-ink); border-radius: 10px; background: var(--gg-cream);
  font-family: var(--gg-font-display); font-weight: 800; font-size: 20px; color: var(--gg-ink); cursor: pointer; touch-action: manipulation;
}
.mk-spbtn[aria-pressed="true"] { background: var(--gg-lime); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.mk-spbtn:disabled { opacity: .3; cursor: default; }
.mk-main.is-short .mk-group { height: 44px; font-size: 19px; padding: 0 6px; }

.wb-like { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0 2px; }
.wb-like[hidden] { display: none; }
.wb-heart { min-height: 44px; gap: 6px; padding-inline: 14px; }
.wb-heart svg { width: 22px; height: 22px; fill: #fff; transition: transform .2s ease; }
.wb-heart[aria-pressed="true"] { background: var(--gg-pink-100, #FFE1EC); }
.wb-heart[aria-pressed="true"] svg { fill: var(--gg-pink); transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .wb-heart svg { transition: none; } }
.wb-likes { font-size: var(--gg-text-sm); font-weight: 700; color: var(--gg-ink-2); }
.wb-report { display: block; margin: 10px auto 0; min-height: 44px; background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; font-weight: 700; color: var(--gg-ink-2); }
.wb-report[hidden] { display: none; }
.wb-btns .wb-report { margin: 0; }
.pl-row__likes { display: inline-flex; align-items: center; gap: 3px; }
.pl-row__likes svg { width: 15px; height: 15px; }
/* a phone on its side: the heart goes to the card's top corner (icon only), so it is never under the pinned buttons */
@media (orientation: landscape) and (max-height: 500px) {
  .wb-modal--solved .wb-like { position: absolute; top: 10px; right: 12px; margin: 0; gap: 6px; flex-direction: row-reverse; }
  .wb-modal--solved .wb-heart { width: 44px; padding: 0; }
  .wb-modal--solved .wb-heart span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
/* round 9, many blocks (a 6 letter word, 3 spares, every letter alone = 9 chips and 9 pieces): on short phones the chips
   and the piece buttons keep to ONE row that scrolls sideways, so the garden keeps its size; on a phone on its side the
   pieces scroll inside two rows */
.mk-cut > * { flex: none; }
.mk-main.is-short .mk-wordrow { flex-wrap: nowrap; }
.mk-main.is-short .mk-cut, .mk-main.is-short .mk-pieces {
  flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain;
  padding: 2px 2px 5px; scrollbar-width: thin;
}
.mk-main.is-short .mk-pieces .mk-tool { flex: none; width: 52px; }
.mk-main.is-land .mk-pieces { max-height: 104px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 4px; }
/* short phones: once the level is ready the breathing Test button says so; the line gives its room to the garden */
.mk-main.is-short .mk-status.is-ready { display: none; }
