/* §47.34: one scrolling region; the room-play return button stays outside it. */
.pg-menu-scroll { width: min(var(--pg-full), var(--pg-wide)); max-height: var(--pg-full); overflow-y: auto; padding: var(--pg-pad); min-height: var(--pg-zero); overscroll-behavior: contain; }
.pg-menu-scroll .pt-play-choices { max-height: none; overflow: visible; width: var(--pg-full); }
.pg-main-choices .pt-play-choice { min-height: var(--pg-menu-main); }
.pg-panel { width: min(var(--pg-full), var(--pg-wide)); min-height: var(--pg-zero); max-height: var(--pg-full); overflow-y: auto; overscroll-behavior: contain; padding: var(--pg-pad); text-align: center; }
.pg-panel h2 { font-size: var(--pg-title); margin: var(--pg-zero) var(--pg-zero) var(--gap); }
.pg-panel button { touch-action: manipulation; min-height: var(--pg-target); }
.pg-panel button:active, .pg-level:active { transform: scale(var(--pg-scale)); }
.pg-panel button:disabled { opacity: var(--pg-dim); }
.pg-hint { font-size: var(--pg-font); color: var(--text); min-height: var(--pg-target); display: grid; align-content: center; margin: var(--pg-pad) var(--pg-zero); line-height: var(--pg-leading); }
.pg-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: var(--gap); }
.pg-level { border: var(--pg-line) solid var(--line); color: var(--text); background: var(--surface); border-radius: var(--r-m); min-width: var(--pg-zero); min-height: var(--pg-level); height: var(--pg-full); font: inherit; display: grid; place-items: center; padding: var(--pg-small); }
.pg-stars { display: inline-flex; align-items: center; justify-content: center; color: var(--pineapple-deep); gap: var(--pg-one); }
.pg-stars svg { width: var(--pg-star); height: var(--pg-star); }
.pg-stars .is-empty { color: var(--line); }
.pg-result { display: grid; gap: var(--gap); padding: var(--card-pad); border-radius: var(--r-l); background: var(--surface); }
.pg-result-actions, .pg-voice-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: var(--gap); }
.pg-result-actions > button, .pg-voice-choices > button { height: var(--pg-full); white-space: normal; min-width: var(--pg-zero); }
.pg-theme-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.pg-theme-choices [aria-pressed=true], .pg-voice-choices [aria-pressed=true] { outline: var(--pg-line) solid var(--accent); outline-offset: var(--pg-one); }
.pg-memory { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--pg-small); max-width: var(--pg-board); margin: var(--pg-zero) auto; }
.pg-memory--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pg-memory-card { position: relative; display: grid; place-items: center; min-width: var(--pg-zero); min-height: var(--pg-memory-card); aspect-ratio: 1; border: var(--pg-line) solid var(--mangosteen-soft); background: var(--mangosteen); border-radius: var(--r-s); overflow: hidden; padding: var(--pg-small); color: var(--surface); }
.pg-card-back svg { width: var(--pg-menu-icon); height: var(--pg-menu-icon); }
.pg-card-face { display: none; width: var(--pg-full); height: var(--pg-full); min-height: var(--pg-zero); place-items: center; grid-template-rows: minmax(0, 1fr) auto; }
.pg-card-face > span:first-child, .pg-card-face > img { grid-row: 1; grid-column: 1; width: var(--pg-full); height: var(--pg-full); object-fit: contain; min-height: var(--pg-zero); }
.pg-card-face svg { width: var(--pg-small-icon); height: var(--pg-small-icon); }
.pg-word { grid-row: 2; font-size: var(--pg-font); max-width: var(--pg-full); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pg-memory-card.is-open, .pg-memory-card.is-matched { background: var(--surface); color: var(--text); }
.pg-memory-card.is-open .pg-card-face, .pg-memory-card.is-matched .pg-card-face { display: grid; }
.pg-memory-card.is-open .pg-card-back, .pg-memory-card.is-matched .pg-card-back { display: none; }
.pg-panel .pg-memory-card.is-matched { border-color: var(--positive); opacity: 1; }
.pg-fish-bowl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--pg-small); background: var(--sky-soft); border-radius: var(--r-xl); padding: var(--card-pad); min-height: var(--pg-bowl-min); max-width: var(--pg-board); margin: var(--pg-zero) auto; }
.pg-fish { display: grid; place-items: center; color: var(--sky); }
.pg-fish svg { width: var(--pg-fish); height: var(--pg-fish); }
.pg-fish.is-taken { opacity: var(--pg-taken); }
/* The paw and rounded, individually lit fish carry the counting hint.
   This non-interactive grid needs no extra outline across the bowl artwork. */
.pg-count { display: block; font-size: var(--pg-title); margin: var(--gap); }
.pg-answer { font: var(--pg-title) var(--font-rounded); }
.pg-paws { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--gap); max-width: var(--pg-board); margin: var(--pg-zero) auto var(--gap); }
.pg-paw { display: grid; place-items: center; min-width: var(--pg-zero); min-height: var(--pg-paw); border: var(--pg-line) solid transparent; border-radius: var(--r-l); font: var(--pg-title) var(--font-rounded); box-shadow: var(--shadow-1); color: var(--text); }
.pg-paw svg { width: var(--pg-menu-icon); height: var(--pg-menu-icon); }
.pg-mic { min-height: var(--pg-mic); width: var(--pg-full); margin-top: var(--gap); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.pg-mic svg { width: var(--pg-menu-icon); height: var(--pg-menu-icon); }
.pg-mimic-cat { display: block; width: var(--pg-cat-preview); height: var(--pg-cat-preview); margin: var(--pg-zero) auto var(--gap); }
.pg-runner { position: relative; height: var(--pg-run-height); overflow: hidden; border-radius: var(--r-l); background: linear-gradient(var(--pg-art-sky), var(--sky-soft)); touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pg-run-far, .pg-run-ground { position: absolute; left: var(--pg-zero); transform: translateX(var(--pg-scroll)); }
.pg-run-far { background: var(--pg-art-sky); }
.pg-run-soil { position: absolute; left: var(--pg-zero); width: var(--pg-full); background: var(--pg-art-soil); pointer-events: none; }
.pg-run-ground { background: transparent; }
.pg-run-far.has-art, .pg-run-ground.has-art { background: transparent; }
.pg-run-far img, .pg-run-ground img { position: absolute; width: var(--pg-half); height: var(--pg-full); object-fit: fill; max-width: none; left: var(--pg-zero); }
.pg-run-far img + img, .pg-run-ground img + img { left: var(--pg-half); }
.pg-run-cat, .pg-run-obstacle, .pg-run-fish { position: absolute; color: var(--peach-ink); }
.pg-run-obstacle { color: var(--mangosteen); }
.pg-run-cat > svg, .pg-run-obstacle > svg, .pg-run-fish > svg { position: absolute; inset: var(--pg-math-art-inset); width: var(--pg-math-art-size); height: var(--pg-math-art-size); }
.pg-run-cat img, .pg-run-obstacle img, .pg-run-fish img { width: var(--pg-full); height: var(--pg-full); object-fit: contain; position: absolute; inset: var(--pg-zero); }
.pg-run-cat.has-art > svg, .pg-run-obstacle.has-art > svg, .pg-run-fish.has-art > svg { visibility: hidden; }
.pg-field progress { width: var(--pg-full); accent-color: var(--mangosteen); }
.pg-jump { width: var(--pg-full); }
.pg-parent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--gap); }
.pg-parent-game { min-height: var(--pg-parent-min); min-width: var(--pg-zero); padding: var(--pg-pad); border-radius: var(--r-s); background: var(--surface-2); display: grid; align-content: center; gap: var(--pg-small); }
.pg-parent-game strong, .pg-parent-game span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-parent-game span { color: var(--text-2); }
@media (min-width: 700px) {
  .pg-levels { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pg-parent-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .pg-panel button:active, .pg-level:active, .pg-paw.is-lit { transform: none; }
}

.pg-count-paw { color: var(--mangosteen); display: inline-grid; place-items: center; width: var(--pg-menu-icon); height: var(--pg-menu-icon); }
.pg-count-paw svg { width: var(--pg-full); height: var(--pg-full); }
.pg-fish.is-counted { color: var(--mangosteen); outline: var(--pg-line) solid currentColor; border-radius: var(--r-xs); }
.pg-run-dizzy { position: absolute; top: var(--pg-zero); right: var(--pg-zero); width: var(--pg-star); height: var(--pg-star); color: var(--mangosteen); }
.pg-run-dizzy svg { width: var(--pg-full); height: var(--pg-full); }

.pg-question { margin-bottom: var(--pg-zero); }
.pg-bowl-art { position: relative; width: var(--pg-math-bowl); height: var(--pg-math-bowl); margin: var(--pg-zero) auto; }
.pg-bowl-art > svg, .pg-bowl-art > img { position: absolute; width: var(--pg-full); height: var(--pg-full); inset: var(--pg-zero); object-fit: contain; }
.pg-bowl-art:has(img) > svg { visibility: hidden; }
.pg-fish { position: relative; width: var(--pg-full); height: var(--pg-math-fish); min-width: var(--pg-zero); }
.pg-fish > img { position: absolute; inset: var(--pg-zero); width: var(--pg-full); height: var(--pg-full); object-fit: contain; }
.pg-fish.has-art > svg { visibility: hidden; }

/* Fullscreen games own the viewport; the room keeps its state underneath. */
.pt-room.is-game-fullscreen { padding: var(--pg-zero); gap: var(--pg-zero); grid-template-rows: minmax(0, 1fr); }
.pt-room.is-game-fullscreen > :not(.pt-scene) { display: none; pointer-events: none; }
.pt-room.is-game-fullscreen > .pt-scene { grid-area: 1 / 1 / -1 / -1; }
.pt-room.is-game-fullscreen .pt-scene > :not(.pg-fullscreen) { visibility: hidden; pointer-events: none; }
.pg-fullscreen {
  --shadow-cta: var(--pg-shadow-cta);
  position: fixed; inset: var(--pg-zero); z-index: var(--pg-game-z); width: var(--pg-full); height: 100dvh;
  display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--pg-small); overflow: hidden;
  padding: calc(var(--safe-top) + var(--pg-pad)) calc(var(--safe-right) + var(--pg-pad)) calc(var(--safe-bottom) + var(--pg-pad)) calc(var(--safe-left) + var(--pg-pad));
  background: var(--cream); color: var(--text);
}
.pg-chrome { min-width: var(--pg-zero); }
.pg-toolbar { display: grid; grid-template-columns: var(--pg-toolbar-button) var(--pg-toolbar-button) minmax(0, 1fr) auto; align-items: center; gap: var(--pg-small); }
.pg-heading { display: contents; }
.pg-fullscreen .pt-play-back { position: static; min-width: var(--pg-zero); min-height: var(--pg-toolbar-height); font-size: var(--pg-title); }
.pg-choose { min-height: var(--pg-toolbar-height); padding: var(--pg-small); }
.pg-game-name { grid-column: 3; text-align: center; min-width: var(--pg-zero); font-size: var(--pg-title); line-height: var(--pg-leading); }
.pg-toolbar .pg-stars { grid-column: 4; }
.pg-caption { height: var(--pg-caption-height); display: grid; place-items: center; overflow: hidden; }
.pt-room.is-game-fullscreen .pg-caption .pt-say {
  position: static; width: var(--pg-full); max-width: none; margin: var(--pg-zero); padding: var(--pg-zero) var(--pg-small);
  border-radius: var(--r-xs); box-shadow: none; background: var(--accent-soft); font-size: var(--pg-font); line-height: var(--pg-leading);
  text-align: center; animation: none; display: block;
}
.pt-room.is-game-fullscreen .pg-caption .pt-say[hidden] { display: none; }
.pg-caption .pt-say::before, .pg-caption .pt-say-who { display: none; }
.pg-caption .pt-say-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* Borrow the shell's existing side/bottom gutters for paint only. The extra
   border-box size exactly cancels this padding: content keeps its original
   width, height and position, including on short screens with safe areas. */
.pg-fullscreen .pg-panel { width: calc(var(--pg-full) + var(--pg-panel-bleed) * 2); height: calc(var(--pg-full) + var(--pg-panel-bleed)); margin-inline: calc(var(--pg-panel-bleed) * -1); max-height: none; overflow: hidden; padding: var(--pg-zero) var(--pg-panel-bleed) var(--pg-panel-bleed); display: grid; gap: var(--pg-round-gap); min-width: var(--pg-zero); }
.pg-panel[data-screen=round] { grid-template-rows: auto minmax(0, 1fr); }
.pg-panel[data-screen=levels] { grid-template-rows: minmax(0, 1fr) auto; }
.pg-panel[data-screen=result] { place-items: center; }
.pg-panel[data-screen=mimic] { grid-template-rows: minmax(0, 1fr) auto auto auto; }
.pg-fullscreen .pg-hint { margin: var(--pg-zero); min-height: var(--pg-zero); line-height: var(--pg-leading); }
.pg-panel[data-screen=round][data-hint=none] > .pg-hint { display: none; }
.pg-panel[data-screen=round][data-hint=none] { grid-template-rows: minmax(0, 1fr); }
.pg-fullscreen .pg-field { min-width: var(--pg-zero); min-height: var(--pg-zero); display: grid; gap: var(--pg-round-gap); }
.pg-fullscreen .pg-levels { width: min(var(--pg-full), var(--pg-wide)); justify-self: center; align-self: center; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--pg-small); max-height: var(--pg-full); }
.pg-fullscreen .pg-level { min-height: var(--pg-level-phone); border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-1); }
.pg-fullscreen .pg-level:disabled { background: var(--surface-2); border-color: var(--line); box-shadow: none; }
.pg-fullscreen .pg-level strong { white-space: nowrap; font-size: var(--pg-level-font); }
.pg-fullscreen .pg-level .pg-stars svg { width: var(--pg-level-star); height: var(--pg-level-star); }
.pg-fullscreen .pg-stars .is-empty { color: var(--text-3); }
.pg-fullscreen .pg-level:disabled .pg-stars .is-empty { color: var(--text-3); }
.pg-fullscreen .pg-result { width: min(var(--pg-full), var(--pg-result-wide)); }
.pg-fullscreen .pg-result-actions { gap: var(--pg-small); }
.pg-fullscreen .pg-result-actions button { padding: var(--pg-small); }
.pg-fullscreen .pg-result > .pg-stars svg { width: var(--pg-menu-icon); height: var(--pg-menu-icon); }
.pg-field--memory { grid-template-rows: auto var(--pg-preview-height) minmax(0, 1fr); }
.pg-fullscreen .pg-theme-choices { margin: var(--pg-zero); width: min(var(--pg-full), var(--pg-result-wide)); justify-self: center; }
.pg-fullscreen .pg-theme-choices[data-choices=single] { width: min(var(--pg-full), var(--pg-theme-single)); grid-template-columns: minmax(0, 1fr); }
.pg-memory-space { container-type: size; min-height: var(--pg-zero); display: grid; place-items: center; }
.pg-fullscreen .pg-memory {
  grid-template-columns: repeat(var(--pg-cols), minmax(0, 1fr));
  width: min(var(--pg-board), 100cqw, calc((100cqh - (var(--pg-rows) - 1) * var(--pg-small)) / var(--pg-rows) * var(--pg-cols) + (var(--pg-cols) - 1) * var(--pg-small)));
  max-width: var(--pg-full); margin: var(--pg-zero);
}
.pg-fullscreen .pg-memory-card { min-height: var(--pg-zero); padding: var(--pg-small); }
.pg-fullscreen .pg-memory-card .pg-word { font-size: var(--pg-font); }
.pg-fullscreen .pg-memory-card .pg-card-back svg { max-width: var(--pg-full); }
.pg-field--math { grid-template-rows: minmax(0, 1fr); }
/* Eight-pixel rows keep every question in the same place, including feedback. */
.pg-math { display: grid; grid-template-rows: auto var(--pg-math-hint-height) minmax(0, 1fr) var(--pg-feedback-height) var(--pg-math-button-height); gap: var(--pg-small); min-height: var(--pg-zero); width: min(var(--pg-full), var(--pg-wide)); justify-self: center; }
.pg-math-question { display: grid; grid-template-columns: var(--pg-question-icon) minmax(0, 1fr) var(--pg-question-icon); align-items: center; column-gap: var(--pg-small); row-gap: var(--pg-small); padding: var(--pg-small); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-1); }
.pg-math-prompt { grid-column: 2; min-width: var(--pg-zero); }
.pg-fullscreen .pg-question { display: flex; align-items: baseline; justify-content: center; gap: var(--pg-small); margin: var(--pg-zero); font-size: var(--pg-title); line-height: 1; white-space: nowrap; }
.pg-target { display: inline-block; font-size: var(--pg-equation-number); line-height: 1; color: var(--mangosteen); }
.pg-math[data-operation=count] .pg-target { font-size: var(--pg-target-number); }
.pg-math-blank { display: inline-grid; place-items: center; min-width: var(--pg-blank-size, var(--pg-equation-number)); font-size: var(--pg-blank-size, var(--pg-equation-number)); color: var(--mangosteen); background: var(--mangosteen-soft); border-radius: var(--r-xs); border-bottom: var(--pg-line) solid var(--mangosteen); }
.pg-fullscreen .pg-question-repeat { grid-column: 3; min-height: var(--pg-question-icon); width: var(--pg-question-icon); height: var(--pg-question-icon); padding: var(--pg-zero); border-radius: var(--r-pill); display: grid; place-items: center; }
.pg-question-repeat svg { width: var(--pg-star); height: var(--pg-star); }
.pg-question-dots { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: var(--pg-small); height: var(--pg-small); }
.pg-question-dots > span { width: var(--pg-small); height: var(--pg-small); border-radius: var(--r-pill); background: var(--line); }
.pg-question-dots > .is-current { background: var(--mangosteen); outline: var(--pg-line) solid var(--mangosteen-soft); }
.pg-question-dots > .is-done { background: var(--positive); }
.pg-fish-shadows { display: flex; justify-content: center; align-items: center; gap: var(--pg-small); color: var(--text-2); height: var(--pg-full); min-height: var(--pg-zero); font-size: var(--pg-level-font); }
.pg-fish-shadows > span { width: min(var(--pg-fish-outline), var(--pg-outline-share)); min-width: var(--pg-zero); }
.pg-fish-shadows svg { width: var(--pg-full); height: var(--pg-full); max-height: var(--pg-fish-outline); }
.pg-math-scene { position: relative; display: flex; align-items: center; justify-content: center; gap: var(--pg-small); min-height: var(--pg-zero); width: var(--pg-full); height: var(--pg-full); max-height: var(--pg-stage-limit); align-self: center; container-type: size; }
.pg-math-scene > .pg-game-cat { position: relative; flex: none; width: min(var(--pg-stage-cat-width), var(--pg-stage-cat-height), var(--pg-cat-limit)); height: min(var(--pg-stage-cat-width), var(--pg-stage-cat-height), var(--pg-cat-limit)); top: auto; }
.pg-bowl-group { position: relative; flex: none; width: min(var(--pg-stage-bowl-width), var(--pg-stage-bowl-height), var(--pg-stage-bowl-max)); height: min(var(--pg-stage-bowl-width), var(--pg-stage-bowl-height), var(--pg-stage-bowl-max)); min-height: var(--pg-zero); min-width: var(--pg-zero); }
.pg-fullscreen .pg-bowl-art { position: absolute; width: var(--pg-full); height: var(--pg-half); bottom: var(--pg-small); overflow: hidden; }
.pg-fullscreen .pg-bowl-art > img { height: var(--pg-run-double); top: var(--pg-bowl-crop); }
.pg-fullscreen .pg-count { position: absolute; bottom: var(--pg-small); left: var(--pg-half); transform: translateX(calc(-1 * var(--pg-half))); display: grid; place-items: center; width: var(--pg-count-badge); height: var(--pg-count-badge); border-radius: var(--r-pill); border: var(--pg-line) solid var(--sky-soft); background: var(--surface); color: var(--mangosteen); box-shadow: var(--shadow-1); text-align: center; margin: var(--pg-zero); z-index: 2; font-size: var(--pg-count-number); line-height: 1; }
.pg-fullscreen .pg-count--remaining { display: flex; align-items: center; justify-content: center; gap: var(--pg-small); width: var(--pg-count-capsule); max-width: var(--pg-full); padding-inline: var(--pg-small); font-size: var(--pg-level-font); white-space: nowrap; }
.pg-count--remaining > .pg-count-value { --pg-blank-size: var(--pg-count-number); display: inline-grid; place-items: center; flex: none; width: var(--pg-count-slot); height: var(--pg-count-slot); font-size: var(--pg-blank-size); }
.pg-bowl-group .pg-count-paw { position: absolute; bottom: var(--pg-small); right: var(--pg-small); }
.pg-fullscreen .pg-fish-bowl { position: absolute; z-index: 1; top: var(--pg-zero); left: var(--pg-zero); grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); align-items: center; gap: var(--pg-zero); width: var(--pg-full); height: var(--pg-fish-grid-height); min-height: var(--pg-zero); padding: var(--pg-zero); background: transparent; border-radius: var(--pg-zero); }
.pg-fullscreen .pg-fish { justify-self: center; width: var(--pg-full); height: var(--pg-full); min-height: var(--pg-zero); }
.pg-fullscreen .pg-fish > img { inset: var(--pg-fish-overhang); width: var(--pg-fish-image); height: var(--pg-fish-image); }
.pg-fullscreen .pg-fish > svg { width: var(--pg-full); height: var(--pg-full); }
.pg-fullscreen .pg-feedback { height: var(--pg-feedback-height); overflow: hidden; font-size: var(--pg-level-font); line-height: var(--pg-leading); }
.pg-fullscreen .pg-math-actions > button { display: flex; align-items: center; justify-content: center; gap: var(--pg-math-icon-gap); min-height: var(--pg-zero); font-size: var(--pg-level-font); padding: var(--pg-small); white-space: nowrap; }
.pg-math-actions svg { flex: none; width: var(--pg-math-button-icon); height: var(--pg-math-button-icon); }
.pg-fullscreen .pg-math-actions > .pg-answer { font-size: var(--pg-answer-number); font-weight: 800; line-height: 1; }
.pg-field--sequence { position: relative; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; }
.pg-fullscreen .pg-paws { width: min(var(--pg-full), var(--pg-board)); height: var(--pg-full); min-height: var(--pg-zero); margin: var(--pg-zero); gap: var(--pg-round-gap); }
.pg-fullscreen .pg-paw { position: relative; min-height: var(--pg-zero); container-type: size; transition: transform var(--dur-1), filter var(--dur-1), box-shadow var(--dur-1); }
.pg-fullscreen .pg-paw > svg { position: absolute; width: var(--pg-paw-size); height: var(--pg-paw-size); fill: currentColor; }
.pg-fullscreen .pg-paw > span { position: absolute; bottom: var(--pg-small); font-size: var(--pg-title); font-weight: 800; }
.pg-paw--0 { --pg-lit-color: var(--pg-paw-red); background: var(--pg-paw-red); color: var(--surface); }
.pg-paw--1 { --pg-lit-color: var(--pg-paw-yellow); background: var(--pg-paw-yellow); color: var(--ink); }
.pg-paw--2 { --pg-lit-color: var(--pg-paw-green); background: var(--pg-paw-green); color: var(--surface); }
.pg-paw--3 { --pg-lit-color: var(--pg-paw-blue); background: var(--pg-paw-blue); color: var(--surface); }
.pg-paw.is-lit { z-index: 2; outline: var(--pg-line) solid var(--ink); border-color: var(--surface); filter: brightness(var(--pg-paw-brightness)); box-shadow: var(--pg-paw-glow); transform: scale(var(--pg-paw-lift)); }
.pg-game-cat { position: relative; width: var(--pg-full); height: var(--pg-full); max-width: var(--pg-cat-limit); min-height: var(--pg-zero); align-self: center; pointer-events: none; transition: transform var(--dur-2) var(--ease-out); }
.pg-game-cat > img, .pg-cat-fallback, .pg-cat-fallback > svg { position: absolute; inset: var(--pg-zero); width: var(--pg-full); height: var(--pg-full); object-fit: contain; color: var(--coral); }
.pg-game-cat [hidden] { display: none; }

.pg-game-cat[data-pose=think] { transform: rotate(var(--pg-cat-tilt)); }
.pg-game-cat[data-pose=eat] { transform: translateY(var(--pg-cat-step)) scale(var(--pg-scale)); }
.pg-game-cat[data-pose=happy] { transform: translateY(calc(var(--pg-cat-step) * -1)) scale(var(--pg-cat-scale)); }
.pg-game-cat[data-point="0"] { transform: translate(calc(var(--pg-cat-step) * -1), calc(var(--pg-cat-step) * -1)) rotate(calc(var(--pg-cat-tilt) * -1)); }
.pg-game-cat[data-point="1"] { transform: translate(var(--pg-cat-step), calc(var(--pg-cat-step) * -1)) rotate(var(--pg-cat-tilt)); }
.pg-game-cat[data-point="2"] { transform: translate(calc(var(--pg-cat-step) * -1), var(--pg-cat-step)) rotate(calc(var(--pg-cat-tilt) * -1)); }
.pg-game-cat[data-point="3"] { transform: translate(var(--pg-cat-step), var(--pg-cat-step)) rotate(var(--pg-cat-tilt)); }
.pg-field--sequence > .pg-game-cat, .pg-field--sequence > .pg-game-cat * { pointer-events: none; }
.pg-field--sequence > .pg-game-cat { position: absolute; z-index: 3; width: var(--pg-cat-preview); height: var(--pg-cat-preview); top: var(--pg-half); left: var(--pg-half); margin-top: calc(var(--pg-cat-preview) / -2); margin-left: calc(var(--pg-cat-preview) / -2);  }
.pg-field--runner { grid-template-rows: minmax(0, 1fr) auto auto auto; }
.pg-fullscreen .pg-runner { height: var(--pg-full); width: var(--pg-full); min-height: var(--pg-zero); }
.pg-field--runner progress { height: var(--pg-progress-height); }
.pg-fullscreen .pg-jump, .pg-run-controls > button { min-height: var(--pg-level-phone); font-size: var(--pg-title); }
.pg-run-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-run-controls--static { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pg-fullscreen .pg-mimic-cat { align-self: center; justify-self: center; height: auto; width: min(var(--pg-full), var(--pg-mimic-vh), var(--pg-mimic-preview)); max-height: var(--pg-full); object-fit: contain; margin: var(--pg-zero); }
.pg-fullscreen .pg-mic { margin: var(--pg-zero); }
.pg-fullscreen .pg-voice-choices { gap: var(--pg-small); }
.pg-fullscreen .pg-voice-choices > button { padding: var(--pg-small); }

/* Equal game cards share the responsive menu grid. */
.pg-menu-scroll .pg-main-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-main-choices .pt-play-choice { min-height: var(--pg-menu-card); padding: var(--pg-pad); gap: var(--pg-small); box-shadow: var(--shadow-2); }
.pg-menu-name { color: var(--text); font-size: var(--pg-title); font-weight: 800; }
.pg-menu-art { display: block; position: relative; width: min(var(--pg-full), var(--pg-menu-art-wide)); height: var(--pg-menu-art); border-radius: var(--r-m); overflow: hidden; background: var(--pineapple-soft); }
.pg-menu-art--memory { background: var(--mangosteen-soft); }
.pg-menu-art--math { background: var(--sky-soft); }
.pg-menu-art--sequence { background: var(--leaf-soft); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pg-small); padding: var(--pg-small); }
.pg-menu-art--mimic { background: var(--coral-soft); }
.pg-menu-part { display: grid; place-items: center; position: absolute; inset: var(--pg-zero); color: var(--mangosteen); }
.pg-menu-part > img { position: absolute; inset: var(--pg-zero); height: var(--pg-full); width: var(--pg-full); object-fit: contain; }
.pg-menu-part > svg { width: var(--pg-half); height: var(--pg-half); stroke-width: var(--pg-menu-stroke); }
.pg-menu-part.has-art > svg { visibility: hidden; }
.pg-menu-card { inset: var(--pg-menu-offset) auto var(--pg-menu-offset) var(--pg-menu-offset); width: var(--pg-menu-piece); background: var(--surface); border-radius: var(--r-s); transform: rotate(calc(var(--pg-menu-tilt) * -1)); box-shadow: var(--shadow-1); }
.pg-menu-card--second { left: auto; right: var(--pg-menu-offset); transform: rotate(var(--pg-menu-tilt)); }
.pg-menu-bowl { top: var(--pg-menu-offset); }
.pg-menu-fish { inset: var(--pg-zero) var(--pg-zero) auto auto; width: var(--pg-menu-fish); height: var(--pg-menu-piece); }
.pg-menu-paw { display: grid; place-items: center; border-radius: var(--r-xs); }
.pg-menu-paw > svg { width: var(--pg-menu-icon); height: var(--pg-menu-icon); fill: currentColor; }
.pg-menu-mic { position: absolute; bottom: var(--pg-small); right: var(--pg-small); display: grid; place-items: center; width: var(--pg-menu-icon); height: var(--pg-menu-icon); border-radius: var(--r-pill); background: var(--mangosteen); color: var(--surface); }
.pg-menu-mic > svg { width: var(--pg-small-icon); height: var(--pg-small-icon); stroke-width: var(--pg-menu-stroke); }
.pg-menu-sudoku { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); height: 75%; max-width: 75%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); padding: var(--pg-small); background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow-1); color: var(--text); font: 800 var(--pg-title) var(--font-rounded); }
.pg-menu-sudoku > span { display: grid; place-items: center; border: var(--pg-one) solid var(--line); }
.pg-menu-sudoku > .is-filled { color: var(--mangosteen); background: var(--mangosteen-soft); }
.pg-menu-go { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); height: 75%; max-width: 75%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); padding: var(--pg-small); background: var(--pgo-wood) var(--pgo-wood-art) center / cover no-repeat; border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.pg-menu-go > span { display: grid; place-items: center; border: var(--pg-one) solid var(--pgo-grid); }
.pg-menu-go > .is-b::after, .pg-menu-go > .is-w::after { content: ''; width: 70%; aspect-ratio: 1; border-radius: var(--pg-half); background: var(--pgo-black-art) center / cover no-repeat; box-shadow: var(--pgo-menu-shadow); }
.pg-menu-go > .is-w::after { background-image: var(--pgo-white-art); }
.pg-menu-chess { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); height: 75%; max-width: 75%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); border-radius: var(--r-m); overflow: hidden; box-shadow: var(--shadow-1); }
.pg-menu-chess > .is-light { background: var(--pch-light) var(--pch-light-art) center / cover no-repeat; }
.pg-menu-chess > .is-dark { background: var(--pch-dark) var(--pch-dark-art) center / cover no-repeat; }
.pg-menu-chess > [data-piece]::after { content: ''; display: block; width: 100%; height: 100%; background: center / contain no-repeat; }
.pg-menu-chess > [data-piece=bK]::after { background-image: url('/img/chess/bK.png'); }
.pg-menu-chess > [data-piece=bP]::after { background-image: url('/img/chess/bP.png'); }
.pg-menu-chess > [data-piece=wN]::after { background-image: url('/img/chess/wN.png'); }
.pg-menu-chess > [data-piece=wP]::after { background-image: url('/img/chess/wP.png'); }
@media (min-width: 700px) {
  .pg-fullscreen .pg-levels { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pg-fullscreen .pg-level { min-height: var(--pg-level-tablet); }
  .pg-fullscreen .pg-level strong { font-size: var(--pg-font); }
  .pg-fullscreen .pg-level .pg-stars svg { width: var(--pg-star); height: var(--pg-star); }
}
@media (max-width: 699px) {
  .pg-toolbar { grid-template-columns: var(--pg-toolbar-button) minmax(0, 1fr) auto; }
  .pg-game-name { grid-row: 2; grid-column: 1 / -1; font-size: var(--pg-font); }
  .pg-toolbar .pg-stars { grid-column: 3; }
  .pg-toolbar .pg-choose { justify-self: start; width: var(--pg-toolbar-button); }
}
@media (min-width: 1000px) and (orientation: landscape) {
  .pg-menu-scroll .pg-main-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .pg-menu-card { transform: none; }
}

/* The menu owns the same fullscreen shell, with all room controls hidden. */
.pg-fullscreen.pt-play-layer--menu { place-items: stretch; }
.pg-fullscreen[data-screen=round] .pg-caption,
.pg-fullscreen.pt-play-layer--menu .pg-caption { display: none; }
.pg-toolbar:not([data-choose=true]) { grid-template-columns: var(--pg-toolbar-button) minmax(0, 1fr) auto; }
.pg-toolbar:not([data-choose=true]) .pg-game-name { grid-column: 2; }
.pg-toolbar:not([data-choose=true]) .pg-stars { grid-column: 3; }
.pg-fullscreen .pg-menu-scroll { width: min(var(--pg-full), var(--pg-wide)); padding: var(--pg-zero); justify-self: center; align-self: center; }
.pg-fullscreen .pg-main-choices { gap: var(--gap); }
.pg-fullscreen .pg-main-choices .pt-play-choice { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; height: var(--pg-full); min-height: var(--pg-menu-phone-card); }
.pg-fullscreen .pg-menu-art { width: var(--pg-full); height: var(--pg-menu-phone-art); }
.pg-fullscreen .pg-menu-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: var(--pg-full); }
@media (min-width: 700px) {
  .pg-fullscreen .pg-menu-scroll { display: grid; grid-template-rows: minmax(0, 1fr); overflow: hidden; gap: var(--pg-small); align-self: stretch; }
  .pg-fullscreen .pg-main-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); min-height: var(--pg-zero); }
  .pg-fullscreen .pg-main-choices .pt-play-choice { min-height: var(--pg-zero); }
  .pg-fullscreen .pg-menu-art { height: var(--pg-full); max-height: var(--pg-menu-tablet-art); }
}
@media (max-width: 699px) {
  .pg-toolbar:not([data-choose=true]) .pg-game-name { grid-row: 1; }
  .pg-fullscreen .pg-fish-bowl { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .pg-game-cat { transition: none; transform: none; }
  .pg-game-cat[data-pose], .pg-game-cat[data-point], .pg-fullscreen .pg-paw.is-lit { transform: none; }
  .pg-fullscreen .pg-paw { transition: none; }
}

.pg-preview { display: flex; justify-content: center; align-items: center; gap: var(--pg-small); height: var(--pg-preview-height); }
.pg-preview.is-finished { visibility: hidden; pointer-events: none; }

.pg-preview-ring { display: grid; place-items: center; width: var(--pg-preview-height); height: var(--pg-preview-height); flex: none; border-radius: var(--r-pill); background: conic-gradient(var(--mangosteen) var(--pg-preview-angle), var(--mangosteen-soft) var(--pg-preview-zero)); }
.pg-preview-number { display: grid; place-items: center; width: var(--pg-preview-inner); height: var(--pg-preview-inner); border-radius: var(--r-pill); background: var(--surface); font-size: var(--pg-preview-font); color: var(--mangosteen); line-height: 1; }
.pg-run-cat.is-ducking:not(.has-art) > svg { transform: scaleY(var(--pg-duck-scale)); transform-origin: center bottom; }
.pg-run-guide { position: absolute; z-index: var(--pg-guide-z); inset: var(--pg-small) var(--pg-small) auto; display: flex; justify-content: center; align-items: center; gap: var(--pg-small); padding: var(--pg-small); border-radius: var(--r-m); background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); font-size: var(--pg-font); pointer-events: none; }
.pg-run-guide[hidden] { display: none; }
.pg-run-guide-picture { position: relative; width: var(--pg-level-phone); height: var(--pg-level-phone); flex: none; }
.pg-run-guide-picture > svg, .pg-run-guide-picture > img { position: absolute; inset: var(--pg-zero); width: var(--pg-full); height: var(--pg-full); object-fit: contain; }
.pg-run-guide-picture.has-art > svg { visibility: hidden; }
.pg-run-controls svg { width: var(--pg-star); height: var(--pg-star); }

/* Every accepted tap paints in the event handler; no asset or voice wait. */
.pg-field--sequence { grid-template-rows: auto minmax(0, 1fr) auto; }
.pg-sequence-dots { display: flex; justify-content: center; align-items: center; gap: var(--pg-small); min-height: var(--pg-sequence-dot); }
.pg-sequence-dots > span { width: var(--pg-sequence-dot); height: var(--pg-sequence-dot); border-radius: var(--r-pill); background: var(--line); }
.pg-sequence-dots > .is-done { background: var(--positive); box-shadow: var(--shadow-1); }
.pg-paw.is-correct[data-tap="0"] { animation: pg-tap-a var(--dur-3) var(--ease-out); }
.pg-paw.is-correct[data-tap="1"] { animation: pg-tap-b var(--dur-3) var(--ease-out); }
.pg-paw.is-retry { filter: brightness(var(--pg-tap-dim)); animation: pg-tap-retry var(--dur-3) var(--ease-out); }
.pg-game-cat.is-nodding[data-tap="0"] { animation: pg-nod-a var(--dur-3) var(--ease-out); }
.pg-game-cat.is-nodding[data-tap="1"] { animation: pg-nod-b var(--dur-3) var(--ease-out); }
.pg-game-cat[data-pose=laugh] { filter: brightness(var(--pg-paw-brightness)); }
.pg-fullscreen .pg-paw > .pg-tap-particles { bottom: var(--pg-zero); }
.pg-tap-particles { position: absolute; inset: var(--pg-zero); pointer-events: none; }
.pg-tap-particles > i { position: absolute; top: var(--pg-half); left: var(--pg-half); width: var(--pg-tap-particle); height: var(--pg-tap-particle); margin: calc(var(--pg-tap-particle) / -2); color: var(--surface); animation: pg-tap-star var(--dur-3) var(--ease-out) forwards; }
.pg-tap-particles > i:first-child { left: calc(var(--pg-half) - var(--pg-tap-spread)); }
.pg-tap-particles > i:last-child { left: calc(var(--pg-half) + var(--pg-tap-spread)); }
.pg-tap-particles svg { width: var(--pg-full); height: var(--pg-full); fill: currentColor; }
@keyframes pg-tap-a { 50% { transform: scale(var(--pg-tap-peak)); } }
@keyframes pg-tap-b { 50% { transform: scale(var(--pg-tap-peak)); } }
@keyframes pg-nod-a { 50% { transform: translateY(var(--pg-cat-step)) rotate(var(--pg-tap-nod)); } }
@keyframes pg-nod-b { 50% { transform: translateY(var(--pg-cat-step)) rotate(var(--pg-tap-nod)); } }
@keyframes pg-tap-retry { 25%, 75% { transform: translateX(calc(var(--pg-tap-shake) * -1)); } 50% { transform: translateX(var(--pg-tap-shake)); } }
@keyframes pg-tap-star { from { transform: scale(var(--pg-tap-in)); opacity: 1; } to { transform: translateY(var(--pg-tap-flight)) scale(var(--pg-tap-out)); opacity: 0; } }
.pg-field--sequence[data-reduced=true] .pg-paw,
.pg-field--sequence[data-reduced=true] .pg-game-cat { animation: none; transition: none; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .pg-field--sequence .pg-paw:is(.is-correct, .is-retry), .pg-field--sequence .pg-game-cat.is-nodding { animation: none; transition: none; transform: none; }
  .pg-tap-particles { display: none; }
}

/* Six cards use the complete existing two/three-column grid. */
.pg-fullscreen .pg-main-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; align-items: stretch; }
@media (min-width: 700px) {
  .pg-fullscreen .pg-main-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* §47.35: two identical rooms, separate non-overlapping physical tap regions. */
.pg-menu-art--spot { background: var(--sky-soft); }
.pg-fullscreen[data-game=spot][data-screen=round] { --pg-panel-bleed: var(--pg-spot-pad); padding: calc(var(--safe-top) + var(--pg-spot-pad)) calc(var(--safe-right) + var(--pg-spot-pad)) calc(var(--safe-bottom) + var(--pg-spot-pad)) calc(var(--safe-left) + var(--pg-spot-pad)); gap: var(--pg-spot-gap); }
.pg-panel[data-game=spot][data-screen=round] { grid-template-rows: minmax(0, 1fr); }
.pg-field--spot { grid-template-rows: var(--pg-spot-status) minmax(0, 1fr) var(--pg-spot-controls); width: min(var(--pg-full), var(--pg-spot-wide)); justify-self: center; }
.pg-fullscreen .pg-field--spot { gap: var(--pg-spot-gap); }
.pg-spot-status { display: grid; grid-template-columns: var(--pg-spot-summary) minmax(0, 1fr); gap: var(--pg-small); align-items: center; min-width: var(--pg-zero); }
.pg-spot-summary { min-width: var(--pg-zero); }
.pg-spot-dots { display: flex; justify-content: center; gap: var(--pg-spot-gap); }
.pg-spot-dots > span { width: var(--pg-spot-dot); height: var(--pg-spot-dot); flex: none; border-radius: var(--r-pill); background: var(--line); }
.pg-spot-dots > .is-done { background: var(--positive); }
.pg-spot-count, .pg-spot-message { margin: var(--pg-zero); line-height: var(--pg-leading); color: var(--text); }
.pg-spot-count { font-size: var(--pg-spot-font); }
.pg-spot-message { font-size: var(--pg-spot-caption); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pg-spot-boards { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: var(--pg-small); min-height: var(--pg-zero); min-width: var(--pg-zero); }
.pg-spot-board { position: relative; min-width: var(--pg-zero); min-height: var(--pg-zero); border-radius: var(--r-s); overflow: hidden; isolation: isolate; touch-action: manipulation; user-select: none; -webkit-user-select: none; box-shadow: inset 0 0 0 var(--pg-line) var(--line); container-type: size; }
/* Uniform slot scale on both axes: minimum 56px, at most 96px. */
.pg-spot-sticker, .pg-spot-target, .pg-spot-ring { --pg-spot-item-size: clamp(var(--pg-spot-item), min(var(--pg-spot-item-width), var(--pg-spot-item-height)), var(--pg-spot-item-max)); }
.pg-spot-bg { position: absolute; inset: var(--pg-zero); pointer-events: none; }
.pg-spot-bg--wall { bottom: var(--pg-spot-floor); background: linear-gradient(var(--sky-soft), var(--surface)); }
.pg-spot-bg--floor { top: var(--pg-spot-seam); background: linear-gradient(var(--pineapple-soft), var(--peach-soft)); }
.pg-spot-bg img { width: var(--pg-full); height: var(--pg-full); object-fit: cover; }
.pg-spot-sticker { position: absolute; display: grid; place-items: center; width: var(--pg-spot-item-size); height: var(--pg-spot-item-size); border-radius: var(--r-xs); color: var(--coral); background: var(--coral-soft); transform: translate(-50%, -50%) scale(var(--pg-spot-scale)) rotate(var(--pg-spot-rotate)); pointer-events: none; }
.pg-spot-sticker--1, .pg-spot-sticker--5 { color: var(--sky); background: var(--sky-soft); }
.pg-spot-sticker--2, .pg-spot-sticker--6 { color: var(--mangosteen); background: var(--mangosteen-soft); }
.pg-spot-sticker--3, .pg-spot-sticker--7 { color: var(--positive); background: var(--positive-soft); }
.pg-spot-sticker--4 { color: var(--pineapple-deep); background: var(--pineapple-soft); }
.pg-spot-sticker::after { content: ''; position: absolute; top: var(--pg-spot-pad); right: var(--pg-spot-pad); width: var(--pg-small); height: var(--pg-small); border-radius: var(--r-pill); background: currentColor; border: var(--pg-one) solid var(--surface); }
.pg-spot-sticker > svg { width: var(--pg-spot-icon); height: var(--pg-spot-icon); }
.pg-spot-sticker > img { position: absolute; inset: var(--pg-zero); width: var(--pg-full); height: var(--pg-full); object-fit: contain; }
.pg-spot-sticker.has-art > svg { visibility: hidden; }
.pg-spot-sticker.is-colored { filter: sepia(1) saturate(5) hue-rotate(var(--pg-spot-hue)); }
.pg-spot-target, .pg-spot-ring { width: calc(var(--pg-spot-item-size) * var(--pg-spot-target-ratio)); height: calc(var(--pg-spot-item-size) * var(--pg-spot-target-ratio)); }
.pg-fullscreen .pg-spot-target { position: absolute; min-height: var(--pg-zero); padding: var(--pg-zero); border: none; background: transparent; border-radius: var(--pg-zero); transform: translate(-50%, -50%); }
.pg-fullscreen .pg-spot-target:active { transform: translate(-50%, -50%); background: var(--surface-2); }
.pg-spot-target:focus-visible { outline: var(--pg-line) solid var(--mangosteen); }
.pg-spot-ring { position: absolute; border: var(--pg-spot-ring) solid transparent; border-radius: var(--r-pill); pointer-events: none; transform: translate(-50%, -50%); }
.pg-spot-ring.is-found { border-color: var(--positive); box-shadow: inset 0 0 0 var(--pg-one) var(--surface), 0 0 0 var(--pg-one) var(--surface); }
.pg-spot-ring.is-hint { border-color: var(--pineapple-deep); box-shadow: var(--pg-spot-glow); }
.pg-spot-ring .pg-tap-particles { color: var(--pineapple-deep); }
.pg-spot-ring .pg-tap-particles > i { color: inherit; }
.pg-spot-ripple { position: absolute; width: var(--pg-spot-ripple); height: var(--pg-spot-ripple); border-radius: var(--r-pill); border: var(--pg-line) solid var(--text-3); pointer-events: none; transform: translate(-50%, -50%); animation: pg-spot-wave var(--dur-3) var(--ease-out); }
.pg-spot-footer { display: grid; grid-template-columns: var(--pg-spot-controls) minmax(0, 1fr); gap: var(--pg-small); min-height: var(--pg-zero); }
.pg-spot-footer > .pg-game-cat { width: var(--pg-spot-controls); height: var(--pg-spot-controls); }
.pg-spot-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--pg-small); }
.pg-fullscreen .pg-spot-controls > button { display: flex; align-items: center; justify-content: center; gap: var(--pg-small); min-height: var(--pg-spot-controls); padding: var(--pg-spot-pad); height: var(--pg-full); }
.pg-spot-controls svg { width: var(--pg-star); height: var(--pg-star); }
@keyframes pg-spot-wave { to { transform: translate(-50%, -50%) scale(var(--pg-spot-wave)); opacity: 0; } }
@media (min-width: 700px) and (orientation: landscape) {
  .pg-spot-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: var(--gap); }
}
@media (max-width: 699px) {
  .pg-fullscreen[data-game=spot][data-screen=round] .pg-toolbar { grid-template-columns: var(--pg-spot-controls) var(--pg-spot-controls) minmax(0, 1fr); }
  .pg-fullscreen[data-game=spot][data-screen=round] .pg-game-name { grid-column: 3; grid-row: 1; font-size: var(--pg-spot-caption); white-space: nowrap; }
  .pg-fullscreen[data-game=spot][data-screen=round] .pg-toolbar .pg-stars { display: none; }
  .pg-fullscreen[data-game=spot][data-screen=round] .pt-play-back, .pg-fullscreen[data-game=spot][data-screen=round] .pg-choose { min-height: var(--pg-spot-controls); padding: var(--pg-spot-pad); font-size: var(--pg-spot-caption); }
}
.pg-field--spot[data-reduced=true] .pg-spot-ripple, .pg-field--spot[data-reduced=true] .pg-game-cat { animation: none; transition: none; }
.pg-field--spot[data-reduced=true] .pg-game-cat[data-pose] { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .pg-spot-ripple, .pg-field--spot .pg-game-cat { animation: none; transition: none; }
}

/* Shared synchronous feedback. Positioned decorations never take a grid cell. */
.pg-field { position: relative; }
.pg-combo { position: absolute; z-index: var(--pg-guide-z); top: var(--pg-zero); left: var(--pg-half); transform: translateX(-50%); max-width: var(--pg-full); padding: var(--pg-small) var(--pg-pad); border-radius: var(--r-pill); background: var(--pineapple-soft); color: var(--text); box-shadow: var(--shadow-1); white-space: nowrap; pointer-events: none; font-weight: 800; }
.pg-combo[hidden] { display: none; }
.is-juice-hit { box-shadow: var(--pg-juice-glow); }
.pg-math-actions > .is-juice-hit { box-shadow: var(--pg-juice-inset-glow); }
.is-juice-hit[data-juice-motion=true][data-juice-tap="0"] { animation: pg-tap-a var(--dur-3) var(--ease-out); }
.is-juice-hit[data-juice-motion=true][data-juice-tap="1"] { animation: pg-tap-b var(--dur-3) var(--ease-out); }
.is-juice-miss { filter: brightness(var(--pg-tap-dim)); }
.is-juice-miss[data-juice-motion=true][data-juice-tap="0"] { animation: pg-tap-retry var(--dur-3) var(--ease-out); }
.is-juice-miss[data-juice-motion=true][data-juice-tap="1"] { animation: pg-juice-retry-b var(--dur-3) var(--ease-out); }
@keyframes pg-juice-retry-b { 25%, 75% { transform: translateX(calc(var(--pg-tap-shake) * -1)); } 50% { transform: translateX(var(--pg-tap-shake)); } }
.pg-memory-card .pg-tap-particles > i, .is-juice-hit > .pg-tap-particles > i { color: var(--pineapple-deep); }
.pg-card-face.is-flipping { animation: pg-card-flip var(--dur-2) var(--ease-out); }
@keyframes pg-card-flip { from { transform: rotateY(90deg); } to { transform: rotateY(0deg); } }
.pg-memory-preview { position: relative; height: var(--pg-preview-height); }
.pg-memory-preview > .pg-game-cat { position: absolute; width: var(--pg-preview-height); height: var(--pg-preview-height); inset: var(--pg-zero); margin: auto; }
.pg-memory-preview > .pg-game-cat[hidden] { display: none; }
.pg-collect { position: absolute; z-index: var(--pg-guide-z); top: var(--pg-half); left: var(--pg-half); color: var(--text); background: var(--pineapple-soft); border-radius: var(--r-pill); padding: var(--pg-small); font: 800 var(--pg-title) var(--font-rounded); animation: pg-tap-star var(--pg-juice-feed-time) var(--ease-out) forwards; pointer-events: none; }
.pg-fish.is-feeding { pointer-events: none; animation: pg-feed-fish var(--pg-juice-feed-time) var(--ease-out) forwards; }
@keyframes pg-feed-fish { 45% { transform: translateY(var(--pg-juice-feed-peak)); } to { transform: translate(var(--pg-juice-feed-x), var(--pg-juice-feed-y)) scale(var(--pg-juice-feed-end)); opacity: 0; } }
.pg-spot-ring.is-found { animation: pg-draw-ring var(--dur-3) var(--ease-out); }
@keyframes pg-draw-ring { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.pg-fullscreen .pg-result.pg-celebration { position: relative; width: min(var(--pg-full), var(--pg-result-wide)); height: var(--pg-full); min-height: var(--pg-zero); padding: var(--pg-small); gap: var(--pg-small); grid-template-rows: auto minmax(0, 1fr) auto var(--pg-clear-caption-height) var(--pg-math-button-height) auto; overflow: visible; isolation: isolate; }
.pg-celebration > :not(.pg-confetti) { z-index: 1; }
.pg-panel .pg-clear-title { grid-row: 1; margin: var(--pg-zero); font-size: var(--pg-clear-title); line-height: var(--pg-leading); color: var(--mangosteen); }
.pg-clear-cat { grid-row: 2; container-type: size; display: grid; place-items: center; min-height: var(--pg-zero); }
.pg-clear-cat > .pg-game-cat { width: min(100cqw, 100cqh, var(--pg-cat-limit)); height: min(100cqw, 100cqh, var(--pg-cat-limit)); }
.pg-clear-stars { grid-row: 3; gap: var(--pg-small); }
.pg-fullscreen .pg-celebration > .pg-clear-stars svg { width: var(--pg-clear-star); height: var(--pg-clear-star); }
.pg-clear-stars .is-arriving { animation: pg-star-arrive var(--dur-3) var(--ease-spring); }
@keyframes pg-star-arrive { from { transform: translateY(var(--pg-clear-star-from)) rotate(var(--pg-clear-star-tilt)) scale(var(--pg-tap-in)); opacity: 0; } to { transform: none; opacity: 1; } }
.pg-clear-caption { grid-row: 4; display: grid; place-items: center; margin: var(--pg-zero); color: var(--text); font-size: var(--pg-font); line-height: var(--pg-leading); }
.pg-clear-actions { grid-row: 5; }
.pg-clear-actions[hidden] { display: none; }
.pg-clear-actions[data-final=true] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-save-note { grid-row: 6; font-size: var(--pg-spot-font); }
.pg-confetti { position: absolute; inset: var(--pg-zero); overflow: hidden; pointer-events: none; }
.pg-confetti > i { position: absolute; left: var(--pg-confetti-x); top: var(--pg-zero); width: var(--pg-confetti-width); height: var(--pg-confetti-height); background: var(--pineapple); border-radius: var(--r-pill); animation: pg-confetti-fall var(--pg-confetti-time) var(--pg-confetti-delay) ease-in both; }
.pg-confetti > i:nth-child(3n) { background: var(--coral); }
.pg-confetti > i:nth-child(3n + 1) { background: var(--sky); }
@keyframes pg-confetti-fall { from { transform: translateY(var(--pg-clear-star-from)); opacity: 1; } to { transform: translateY(var(--pg-confetti-fall)) rotate(var(--pg-confetti-spin)); opacity: 0; } }
.pg-field[data-reduced=true] .is-juice-hit, .pg-field[data-reduced=true] .is-juice-miss,
.pg-field[data-reduced=true] .pg-game-cat, .pg-field[data-reduced=true] .pg-game-cat[data-pose],
.pg-field[data-reduced=true] .pg-memory-card, .pg-field[data-reduced=true] .pg-card-face, .pg-field[data-reduced=true] .pg-collect,
.pg-field[data-reduced=true] .pg-spot-ring, .pg-celebration[data-reduced=true] .pg-game-cat { animation: none; transition: none; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .is-juice-hit, .is-juice-miss, .pg-card-face.is-flipping, .pg-fish.is-feeding, .pg-collect,
  .pg-spot-ring.is-found, .pg-clear-stars .is-arriving { animation: none; }
  .pg-confetti { display: none; }
}

/* Keep the found ring's positioning transform even when decorative motion is off. */
.pg-field[data-reduced=true] .pg-spot-ring { transform: translate(-50%, -50%); }

/* Whole-scene edition. The two equal grid cells contain the same uncropped 4:3 canvas. */
.pg-spot-loading { grid-row: 2; display: grid; place-items: center; margin: var(--pg-zero); color: var(--text-2); }
.pg-spot-frame { display: grid; place-items: center; min-width: var(--pg-zero); min-height: var(--pg-zero); container-type: size; }
.pg-spot-image { width: min(var(--pg-full), var(--pg-spot-image-width)); height: auto; aspect-ratio: var(--pg-spot-ratio); border-radius: var(--r-xs); }
.pg-spot-image > img { position: absolute; inset: var(--pg-zero); width: var(--pg-full); height: var(--pg-full); pointer-events: none; }
.pg-spot-image > .pg-spot-patch { inset: auto; }
.pg-spot-marker, .pg-fullscreen .pg-spot-picture-target { position: absolute; min-width: var(--pg-zero); min-height: var(--pg-zero); padding: var(--pg-zero); border: none; border-radius: var(--pg-zero); background: transparent; }
.pg-fullscreen .pg-spot-picture-target:active { transform: none; background: var(--hero-glass-strong); }
.pg-spot-picture-target:focus-visible { outline: var(--pg-line) solid var(--mangosteen); }
.pg-spot-marker { pointer-events: none; border-radius: var(--r-pill); }
.pg-spot-marker > svg { width: var(--pg-full); height: var(--pg-full); overflow: visible; fill: none; stroke: var(--danger); stroke-width: var(--pg-spot-stroke); visibility: hidden; }
.pg-spot-marker > svg path { vector-effect: non-scaling-stroke; }
.pg-spot-marker.is-found > svg { visibility: visible; }
.pg-spot-marker.is-found > svg path { stroke-dasharray: var(--pg-spot-dash); stroke-dashoffset: var(--pg-zero); animation: pg-spot-stroke var(--dur-3) var(--ease-out); }
.pg-spot-lens { position: absolute; inset: var(--pg-zero); display: grid; place-items: center; border-radius: var(--r-pill); background: var(--pineapple-soft); box-shadow: var(--pg-spot-glow); color: var(--pineapple-deep); visibility: hidden; }
.pg-spot-lens > svg { width: var(--pg-spot-lens-size); height: var(--pg-spot-lens-size); }
.pg-spot-marker.is-hint .pg-spot-lens { visibility: visible; }
@keyframes pg-spot-stroke { from { stroke-dashoffset: var(--pg-spot-dash); } to { stroke-dashoffset: var(--pg-zero); } }
.pg-field[data-reduced=true] .pg-spot-marker.is-found > svg path { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .pg-spot-marker.is-found > svg path { animation: none; }
}
.pg-field--math > .pg-combo { top: auto; bottom: var(--pg-math-button-height); }
.pg-field--sequence > .pg-combo { top: auto; bottom: var(--pg-target); }

.pg-run-dizzy { z-index: var(--pg-guide-z); width: calc(var(--pg-star) * 3); display: flex; gap: var(--pg-one); }
.pg-run-dizzy > i { width: var(--pg-star); height: var(--pg-star); color: var(--pineapple-deep); }
.pg-run-dizzy > i:nth-child(2) { margin-top: calc(var(--pg-small) * -1); }

/* 数独：盘面随可用高度缩小，手机与横屏都留出数字键。 */
.pg-fullscreen .pg-field--sudoku { container-type: size; --sudoku-extra-height: var(--pg-zero); --sudoku-board-width: min(100cqw, calc(100cqh - 2 * var(--pg-target) - var(--pg-small) - var(--gutter) - var(--sudoku-extra-height)), var(--pg-sudoku-max)); grid-template-rows: auto auto; align-content: center; justify-content: center; justify-items: center; align-items: center; gap: var(--gutter); }
.pg-sudoku-board { container-type: inline-size; display: grid; grid-template-columns: repeat(var(--sudoku-size), minmax(0, 1fr)); width: var(--sudoku-board-width); aspect-ratio: 1; border-right: var(--pg-line) solid var(--text); border-bottom: var(--pg-line) solid var(--text); background: var(--surface); }
.pg-fullscreen .pg-sudoku-cell { display: grid; place-items: center; min-width: var(--pg-zero); min-height: var(--pg-zero); width: var(--pg-full); height: var(--pg-full); aspect-ratio: 1; padding: var(--pg-zero); border: var(--pg-one) solid var(--line); background: var(--surface); color: var(--mangosteen); font: bold var(--pg-title) var(--font-rounded); }
.pg-sudoku-cell.box-left { border-left: var(--pg-line) solid var(--text); }
.pg-sudoku-cell.box-top { border-top: var(--pg-line) solid var(--text); }
.pg-sudoku-cell.is-given { color: var(--text); }
.pg-sudoku-cell.is-related { background: var(--surface-3); }
.pg-sudoku-cell.is-same { background: var(--accent-soft); }
.pg-sudoku-cell.is-selected { background: var(--mangosteen-soft); outline: var(--pg-line) solid var(--mangosteen); outline-offset: calc(-1 * var(--pg-line)); z-index: 1; }
.pg-sudoku-cell.is-conflict { color: var(--danger); background: var(--danger-soft); }
.pg-sudoku-notes { display: grid; grid-template-columns: repeat(var(--sudoku-note-cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--sudoku-note-rows), minmax(0, 1fr)); width: var(--pg-full); height: var(--pg-full); align-items: center; font-size: max(var(--pg-sudoku-note-min), calc(28cqw / var(--sudoku-size))); line-height: 1; }
.pg-sudoku-input { width: var(--sudoku-board-width); display: grid; gap: var(--pg-small); }
.pg-sudoku-keys { display: grid; grid-template-columns: repeat(var(--sudoku-keys), minmax(0, 1fr)); gap: var(--pg-sudoku-key-gap); }
.pg-fullscreen .pg-sudoku-key { min-width: var(--pg-zero); min-height: var(--pg-target); padding: var(--pg-zero); color: var(--mangosteen); font: 800 var(--pg-sudoku-key-font) var(--font-rounded); }
.pg-sudoku-key.is-full { opacity: var(--pg-dim); }
.pg-sudoku-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--pg-small); }
.pg-fullscreen .pg-sudoku-control { min-width: var(--pg-zero); padding-inline: var(--pg-one); }
.pg-sudoku-control[aria-pressed=true] { outline: var(--pg-line) solid var(--mangosteen); }
.pg-sudoku-resume { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); width: min(var(--pg-full), var(--pg-result-wide)); }
@media (min-width: 900px) and (orientation: landscape) {
  .pg-fullscreen .pg-field--sudoku { --sudoku-input-width: min(30cqw, var(--pg-sudoku-input-wide)); --sudoku-board-width: min(100cqh, calc(100cqw - var(--sudoku-input-width) - var(--gutter)), var(--pg-sudoku-max)); grid-template-columns: max-content max-content; grid-template-rows: auto; }
  .pg-sudoku-input { width: var(--sudoku-input-width); }
  .pg-sudoku-keys { grid-template-columns: repeat(var(--sudoku-wide-cols), minmax(0, 1fr)); }
  .pg-fullscreen .pg-sudoku-key { min-width: var(--pg-sudoku-wide-key); min-height: var(--pg-sudoku-wide-key); aspect-ratio: 1; font-size: clamp(var(--pg-sudoku-key-font), 3cqw, var(--pg-sudoku-wide-key)); }
  .pg-sudoku-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
}

/* Nine keys need a second row on narrow phones to keep every target usable. */
@media (max-width: 460px) {
  .pg-fullscreen .pg-field--sudoku[data-sudoku-size="9"] { --sudoku-extra-height: calc(var(--pg-target) + var(--pg-sudoku-key-gap)); }
  [data-sudoku-size="9"] .pg-sudoku-keys { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.pg-level-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: var(--gap); width: min(var(--pg-full), var(--pg-wide)); }
.pg-level-group { width: var(--pg-full); height: var(--pg-full); min-width: var(--pg-zero); }
.pg-level-group[aria-pressed=true] { outline: var(--pg-line) solid var(--accent); }
.pg-spot-clock { display: flex; align-items: center; gap: var(--pg-small); color: var(--text-2); font-size: var(--pg-spot-caption); }
.pg-spot-clock progress { flex: 1; min-width: var(--pg-zero); height: var(--pg-line); }
.pg-spot-clock.is-expired { color: var(--text-3); }
.pg-spot-clock.is-expired progress { accent-color: var(--text-3); }
.pg-spot-controls > button[hidden] { display: none; }

.pg-panel[data-screen=levels][data-groups=true] { grid-template-rows: auto minmax(0, 1fr) auto; }
.pg-level-groups { justify-self: center; }

.pg-field--spot[data-challenge=true] .pg-spot-dots { display: grid; grid-template-columns: repeat(6, var(--pg-spot-dot)); justify-content: center; }

/* 和小猫下围棋 (§56): the board takes what is left above three equal buttons; text ≥ 22px for the child. */
.pg-fullscreen[data-game=go] .pg-caption { height: auto; min-height: var(--pg-caption-height); }
.pgo { container-type: size; min-height: var(--pg-zero); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--pg-small); justify-items: center; }
.pgo-status { margin: var(--pg-zero); min-height: calc(var(--pg-title) * var(--pg-leading)); font-size: var(--pg-title); line-height: var(--pg-leading); font-weight: 700; text-align: center; color: var(--text); }
.pgo-score { display: block; font-size: var(--pgo-score-font); font-weight: 500; color: var(--text-2); }
.pgo-board-wrap { container-type: size; width: var(--pg-full); height: var(--pg-full); min-height: var(--pg-zero); display: grid; place-items: center; }
.pgo-board { width: min(100cqw, 100cqh, var(--pgo-board-max)); height: auto; aspect-ratio: 1; background: var(--pgo-wood) var(--pgo-wood-art) center / cover no-repeat; border-radius: var(--pgo-board-radius); box-shadow: var(--shadow-1); touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
.pgo[data-state=thinking] .pgo-board, .pgo[data-state=over] .pgo-board { cursor: default; }
.pgo-line { stroke: var(--pgo-grid); stroke-width: var(--pgo-grid-stroke); stroke-linecap: square; }
.pgo-star { fill: var(--pgo-grid); }
.pgo-shadow { fill: var(--pgo-shadow); }
.pgo-stone.is-dead { opacity: var(--pgo-dead); }
.pgo-last--on-black { fill: var(--pgo-mark-on-black); }
.pgo-last--on-white { fill: var(--pgo-mark-on-white); }
.pgo-area--black { fill: var(--pgo-black); }
.pgo-area--white { fill: var(--pgo-white); stroke: var(--pgo-white-edge); stroke-width: var(--pgo-stroke); }
.pgo-controls { width: min(var(--pg-full), var(--pgo-board-max)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--pg-small); }
.pgo-controls[data-count="1"] { grid-template-columns: minmax(0, 1fr); width: min(var(--pg-full), var(--pg-wide), var(--pgo-board-max)); }
.pgo-button { min-height: var(--pg-target); min-width: var(--pg-zero); font-size: var(--pg-title); white-space: nowrap; }

/* 和小猫下国际象棋 (§58): the same layout as 下围棋 — the board above equal buttons, text ≥ 22px for the child. */
.pg-fullscreen[data-game=chess] .pg-caption { height: auto; min-height: var(--pg-caption-height); }
.pch { container-type: size; min-height: var(--pg-zero); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--pg-small); justify-items: center; }
.pch-status { margin: var(--pg-zero); min-height: calc(var(--pg-title) * var(--pg-leading)); font-size: var(--pg-title); line-height: var(--pg-leading); font-weight: 700; text-align: center; color: var(--text); }
.pch-score { display: block; font-size: var(--pgo-score-font); font-weight: 500; color: var(--text-2); }
.pch-board-wrap { container-type: size; width: var(--pg-full); height: var(--pg-full); min-height: var(--pg-zero); display: grid; place-items: center; }
.pch-board { width: min(100cqw, 100cqh, var(--pgo-board-max)); height: auto; aspect-ratio: 1; border-radius: var(--pgo-board-radius); overflow: hidden; box-shadow: var(--shadow-1); touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
.pch[data-state=thinking] .pch-board, .pch[data-state=over] .pch-board { cursor: default; }
.pch-square--light { fill: var(--pch-light); }
.pch-square--dark { fill: var(--pch-dark); }
.pch-last { fill: var(--pch-last); }
.pch-selected { fill: none; stroke: var(--pch-selected); stroke-width: var(--pch-selected-stroke); }
.pch-check { fill: var(--pch-check); }
.pch-piece { filter: var(--pch-piece-shadow); pointer-events: none; }
.pch-label { font-size: var(--pch-label-size); font-weight: 700; pointer-events: none; }
.pch-label--on-light { fill: var(--pch-label-on-light); }
.pch-label--on-dark { fill: var(--pch-label-on-dark); }
.pch-controls { width: min(var(--pg-full), var(--pgo-board-max)); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pg-small); }
.pch-controls[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pch-controls[data-count="1"] { grid-template-columns: minmax(0, 1fr); width: min(var(--pg-full), var(--pg-wide), var(--pgo-board-max)); }
.pch-button { min-height: var(--pg-target); min-width: var(--pg-zero); font-size: var(--pg-title); white-space: nowrap; }
