.play-page .nav {
  padding: 16px 28px;
}
.play-page .page-wrap {
  padding: 28px 28px 40px;
}
.house-page main,
.cork-page .page-wrap {
  padding: 18px 28px 36px;
}
@media (min-width: 801px) {
  .cork-page .page-wrap { padding-right: 168px; }
}
.play-page h1,
.cork-page h1 {
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-weight: 900;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}
.play-page h1 {
  line-height: normal;
}
.play-page .sub,
.cork-page .sub {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6f655b;
  margin-bottom: 12px;
}
.play-page .sub {
  margin-bottom: 18px;
}
.play-page .reader {
  display: block;
  min-height: 62vh;
}
.play-page .dots-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.play-page .dot,
.play-page .dot-skip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(44, 39, 34, 0.16);
  background: transparent;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: #2c2722;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.play-page .dots-bar .dot {
  width: auto;
  min-width: 34px;
  padding: 0 12px;
  border-radius: 999px;
}
.play-page .dot.on {
  background: #2c2722;
  color: #fbf6ee;
  border-color: #2c2722;
}
.play-page .windows {
  height: 68vh;
  min-height: 480px;
  position: relative;
}
.play-page .window {
  flex: 0.18 1 0;
  height: 100%;
  transition: flex 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.play-page .window.is-open {
  flex: 5.2 1 0;
}
.play-page .window:not(.is-open) .book-side {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #efe6d6;
}
.play-page .window.is-open .split {
  display: grid;
  grid-template-columns: 3fr 1fr;
  position: absolute;
  inset: 0;
}
.play-page .window.is-open .book-side {
  position: relative;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  background: #efe6d6;
}
/* Page photos on the landing may crop. Character portraits do not. */
.play-page[data-game="spell"] .window.is-open .book-side.is-landing,
.play-page[data-game="count"] .window.is-open .book-side.is-landing {
  overflow: hidden;
}
.play-page .window.is-open .draw-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #fbf6ee;
  border-left: 1px solid rgba(44, 39, 34, 0.16);
  padding: 14px;
  box-sizing: border-box;
}
.play-page .draw-side.info-panel {
  align-items: stretch;
  justify-content: flex-start;
  overflow: auto;
  text-align: left;
  padding: 14px;
  background-color: rgba(251, 246, 238, 0.1);
}
.play-page .info-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.play-page .info-kicker {
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-weight: 900;
  font-size: clamp(22px, 1.8vw, 32px);
  letter-spacing: -0.03em;
  text-transform: none;
  color: #1f6a64;
  margin: 0 0 6px;
}
.play-page .book-side.is-landing {
  padding: 0;
}
.play-page .window.is-open .book-side.is-landing > img.landing-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  display: block;
}
/* Math and Shapes only: show the left-panel character at 90% of the panel, uncropped. */
.play-page[data-game="math"] .window.is-open .book-side.is-landing,
.play-page[data-game="shapes"] .window.is-open .book-side.is-landing {
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-page[data-game="math"] .window.is-open .book-side.is-landing > img.landing-art,
.play-page[data-game="shapes"] .window.is-open .book-side.is-landing > img.landing-art {
  position: relative;
  inset: auto;
  width: auto;
  height: 90%;
  max-width: 100%;
  max-height: 90%;
  object-fit: contain;
  object-position: center center;
}
.play-page .info-panel #gameName {
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-weight: 900;
  font-size: clamp(44px, 4.4vw, 64px);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 0.95;
  color: #2c2722;
}
.play-page .info-panel #funFact {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 20px;
  color: #2c2722;
}
.play-page .high-score {
  align-self: flex-end;
  width: 100%;
  margin: 0 0 8px;
  text-align: right;
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.play-page .play-dock {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}
.play-page .go-above {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
}
.play-page .go-above .paint-btn,
.play-page .go-above .chip {
  flex: 0 0 auto;
}
.play-page .level-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
}
.play-page .controls {
  display: flex;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
}
.play-page .score-timer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}
.play-page .play-score {
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: none;
  color: #2c2722;
  text-align: left;
  line-height: 1.15;
}
.play-page .play-timer {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: #2c2722;
  text-align: right;
  line-height: 1.15;
  margin-left: auto;
}
.play-page .level-row .chip,
.play-page .controls .chip {
  border: 1px solid rgba(44, 39, 34, 0.16);
  background: rgba(251, 246, 238, 0.78);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2c2722;
  cursor: pointer;
}
.play-page .level-row .chip.on,
.play-page #playBtn.on,
.play-page #restartBtn.on {
  background: #111;
  color: #fff;
  border-color: #111;
}
.play-page .info-panel h2#question {
  margin: 6px 0 8px;
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-weight: 900;
  font-size: clamp(26px, 2vw, 36px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  white-space: pre-line;
}
.play-page .info-body p {
  margin: 0 0 10px;
  line-height: 1.35;
}
.play-page .feedback {
  min-height: 1.2em;
  font-weight: 700;
}
.play-page .score-line {
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-weight: 900;
  font-size: clamp(20px, 1.6vw, 28px);
  letter-spacing: -0.03em;
  margin-top: 8px;
}
.play-page .tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.play-page .tool-row .chip.on {
  background: #2c2722;
  color: #fbf6ee;
}
.play-page .paint-nav {
  flex: 0 0 auto;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.paint-btn,
.house-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  background-color: #f6f0e4;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  cursor: pointer;
  text-decoration: none;
}
.paint-btn.back,
.house-nav #playBack { background-image: url("assets/shapes/back-arrow.jpg"); }
.paint-btn.go,
.house-nav #playGo { background-image: url("assets/shapes/go-yellow.jpg"); }
.paint-btn.next,
.house-nav #playNext { background-image: url("assets/shapes/next-arrow.jpg"); }
.paint-btn.go.is-right,
.house-nav #playGo.is-right { background-image: url("assets/shapes/go-green.jpg"); }
.paint-btn.go.is-wrong,
.house-nav #playGo.is-wrong { background-image: url("assets/shapes/go-red.jpg"); }
.paint-btn.go span,
.house-nav #playGo span {
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #2c2722;
  text-shadow: 0 1px 0 rgba(255, 250, 242, 0.7);
  pointer-events: none;
}
.house-nav {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.house-nav a { width: 120px; height: 120px; }
.house-nav #playGo span { font-size: 42px; }
.house-page .house-decorate {
  margin: 8px 28px 28px;
}
.house-page .house-decorate a {
  color: inherit;
}
.house-page .activity-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  flex-wrap: wrap;
}
.house-page .activity-links .dot {
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(44, 39, 34, 0.16);
  background: transparent;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: #2c2722;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Fills the left play panel. Question and sticker blocks anchor to its midline. */
.play-stage {
  position: absolute;
  inset: 0;
  height: auto;
  width: auto;
  min-height: 0;
  display: block;
  overflow: visible;
}
.level-board {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 18px;
}
.level-card {
  border: 2px solid rgba(44, 39, 34, 0.16);
  background: #fbf6ee;
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-weight: 900;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.03em;
  color: #2c2722;
}
.level-card.is-on {
  background: #e7f3f1;
  border-color: #1f6a64;
  box-shadow: inset 0 0 0 2px #1f6a64;
}
.graph,
.drop-board,
.paper-strip {
  position: relative;
  flex: 1 1 auto;
  min-height: 160px;
  margin: 12px;
  border-radius: 16px;
  overflow: visible;
}
.play-page[data-game="math"] .graph {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(50% + 8px);
  height: min(340px, calc(50% - 16px));
  min-height: 0;
  margin: 0;
  overflow: visible;
}
.play-page[data-game="math"] .supply {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 8px);
  width: auto;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0 12px 12px;
  box-sizing: border-box;
  justify-content: center;
  align-content: flex-start;
  align-items: flex-end;
  overflow: visible;
}
.play-page[data-game="math"] .supply .piece:not(.tile) img,
.play-page[data-game="math"] .graph .piece:not(.tile) img {
  height: 264px;
  width: auto;
  max-width: none;
  object-fit: contain;
}
/* Capitals use the last 2× counting size (176px). That is larger than 3× the 52px pass (156px).
   Lowercase bodies, dots, and descenders keep the 28/52, 38/52, and 15/52 ratios. */
.play-page[data-game="count"] {
  --count-cap: 176px;
  --count-x: calc(176px * 28 / 52);
  --count-dot: calc(176px * 38 / 52);
  --count-desc: calc(176px * 15 / 52);
}
.play-page[data-game="count"] .drop-board.count-board {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 40%;
  bottom: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  overflow: visible;
}
.play-page[data-game="count"] .supply {
  --count-tray: 1;
  position: absolute;
  left: 8px;
  right: 8px;
  top: 40%;
  bottom: 0;
  z-index: 4;
  width: auto;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 10px 8px calc(var(--count-desc) * var(--count-tray) + 8px);
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  align-items: flex-end;
  gap: calc(var(--count-desc) * var(--count-tray) + 8px) 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.play-page[data-game="count"] .supply[data-grade="g1"] { --count-tray: 0.7; }
.play-page[data-game="count"] .supply[data-grade="g2"],
.play-page[data-game="count"] .supply[data-grade="g3"] { --count-tray: 0.5; }
.play-page[data-game="spell"] {
  --spell-cap: 176px;
  --spell-x: 97px;
  --spell-dot: 129px;
  --spell-desc: 50px;
  --spell-pad: 16px;
  /* Space between writing rows. Baseline to the next cap is desc + 8px + this + pad. */
  --spell-line-gap: 72px;
}
.play-page[data-game="spell"] .play-stage {
  position: absolute;
  inset: 0;
  display: block;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  overflow: visible;
}
.play-page[data-game="spell"] .paper-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(50% + 8px);
  width: max-content;
  max-width: calc(100% - 24px);
  height: auto;
  min-height: 0;
  margin: 0 auto;
  padding: 10px 22px 6px;
  overflow: visible;
}
.play-page[data-game="spell"] .supply {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 8px);
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  box-sizing: border-box;
  overflow: visible;
  justify-content: center;
  align-items: flex-end;
  align-content: flex-start;
  gap: 8px 10px;
  padding: 8px 12px 12px;
}
.graph,
.drop-board {
  background-color: #f7f1e6;
  background-image:
    linear-gradient(rgba(70, 128, 148, 0.35) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(70, 128, 148, 0.35) 1.5px, transparent 1.5px),
    linear-gradient(rgba(96, 156, 176, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 156, 176, 0.2) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 32px 32px, 32px 32px;
}
.drop-board.count-board {
  background-color: #c4a574;
  background-image: url("shapes/assets/cork-board.jpg");
  background-size: cover;
  background-position: center;
  border: none;
  box-shadow: none;
}
.paper-strip {
  background: #f4ecdc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 12px 8px;
}
.play-page[data-game="spell"] .paper-strip.is-stacked,
.play-page[data-game="spell"] .paper-strip.is-sentence {
  align-items: center;
  gap: 8px;
}
.play-page[data-game="spell"] .window.is-open .book-side:has(.paper-strip.is-stacked) {
  overflow: auto;
}
.play-page[data-game="spell"] .play-stage:has(.paper-strip.is-stacked) {
  position: relative;
  inset: auto;
  height: auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.play-page[data-game="spell"] .paper-strip.is-stacked {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex: 0 0 auto;
  width: max-content;
  max-width: none;
  margin: 12px auto 16px;
  padding-bottom: 64px;
}
.play-page[data-game="spell"] .play-stage:has(.paper-strip.is-stacked) > .supply {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 12px 24px;
}
.play-page[data-game="spell"] .spell-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spell-line-gap);
}
.spell-lines {
  position: relative;
  height: 150px;
  margin: 0 8px 8px;
}
.play-page[data-game="spell"] .spell-lines {
  height: auto;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: var(--spell-pad) 16px 8px;
  overflow: visible;
}
.play-page[data-game="spell"] .spell-lines .guide.cap { top: var(--spell-pad); }
.play-page[data-game="spell"] .spell-lines .guide.mid {
  top: calc(var(--spell-pad) + var(--spell-cap) - var(--spell-x));
  border-top-style: dashed;
}
.play-page[data-game="spell"] .spell-lines .guide.base {
  top: calc(var(--spell-pad) + var(--spell-cap));
}
.spell-lines .guide {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 4px solid #2c2722;
}
.spell-lines .guide.cap { top: 18%; }
.spell-lines .guide.mid { top: 52%; border-top-style: dashed; }
.spell-lines .guide.base { top: 82%; }
.spell-boxes {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8%;
  bottom: 8%;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: stretch;
}
.spell-box {
  flex: 0 0 auto;
  max-width: none;
  min-width: 72px;
  border-radius: 10px;
  background: rgba(255, 250, 242, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  overflow: visible;
}
.play-page[data-game="spell"] .spell-boxes {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  height: calc(var(--spell-cap) + var(--spell-desc));
  gap: 12px;
  overflow: visible;
}
.play-page[data-game="spell"] .spell-gap {
  flex: 0 0 48px;
  width: 48px;
  position: relative;
  align-self: stretch;
}
.play-page[data-game="spell"] .spell-gap::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 22px;
  height: 14px;
  top: calc(var(--spell-cap) - 18px);
  transform: translateX(-50%);
  border: 2px solid rgba(44, 39, 34, 0.35);
  border-radius: 4px;
  background: rgba(255, 250, 242, 0.8);
}
.play-page[data-game="spell"] .spell-box {
  overflow: visible;
  height: calc(var(--spell-cap) + var(--spell-desc));
  min-width: 36px;
  padding: 0 0 var(--spell-desc);
  box-sizing: border-box;
  align-items: flex-end;
  justify-content: center;
}
.play-page[data-game="spell"] .slot-guide {
  position: absolute;
  height: auto;
  width: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  display: block;
  opacity: 0;
  pointer-events: none;
  transform: none;
  animation: none;
  transition: opacity 0.2s ease;
}
.play-page[data-game="spell"] .spell-box.is-hint .slot-guide { opacity: 0.28; }
.play-page[data-game="spell"] .spell-box.is-hint.is-letter-now .slot-guide { opacity: 1; }
.play-page[data-game="spell"] .spell-box.is-fading .slot-guide { transition: opacity 1s ease; }
.play-page[data-game="spell"] .spell-box.is-faded .slot-guide,
.play-page[data-game="spell"] .spell-box.is-hint.is-faded .slot-guide,
.play-page[data-game="spell"] .spell-box.is-hint.is-letter-now.is-faded .slot-guide { opacity: 0; }
.play-page[data-game="spell"] .piece {
  position: relative;
  padding: 0;
  gap: 0;
  overflow: visible;
}
.play-page[data-game="spell"] .piece .sticker-spin {
  position: absolute;
  inset: 0;
  overflow: visible;
  line-height: 0;
  transform: none;
}
.play-page[data-game="spell"] .supply .piece:hover .sticker-spin {
  transform: scale(1.12);
}
/* On the paper, hover scale and the m1 bob lift the ink off the lines. */
.play-page[data-game="spell"] .spell-box .piece .sticker-spin,
.play-page[data-game="spell"] .spell-box .piece:hover .sticker-spin {
  transform: none !important;
  animation: none !important;
  transition: none !important;
}
.play-page[data-game="spell"] .spell-box .piece {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: auto;
  width: auto;
  margin: 0;
  transform: translateX(-50%);
  z-index: 2;
}
.play-page[data-game="spell"] .piece.is-drag {
  transform: none !important;
  bottom: auto !important;
}
.play-page[data-game="spell"] .piece.is-drag .sticker-spin,
.play-page[data-game="spell"] .piece.is-drag:hover .sticker-spin {
  transform: none;
  transition: none;
}
.spell-box .hint-letter {
  position: absolute;
  left: 50%;
  bottom: 8%;
  height: 78%;
  width: auto;
  max-width: none;
  object-fit: contain;
  transform: translateX(-50%);
  opacity: 0.28;
  pointer-events: none;
}
.supply {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  max-height: none;
  overflow: visible;
  padding: 0 12px 12px;
}
.piece {
  border: none;
  background: transparent;
  padding: 2px;
  cursor: grab;
  overflow: visible;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  touch-action: none;
}
.play-page .sticker .sticker-spin,
.play-page .sticker-spin {
  display: inline-block;
  overflow: hidden;
  transform-origin: center center;
  transition: transform 0.35s ease;
}
.play-page .piece .sticker-spin,
.play-page .portrait .sticker-spin {
  overflow: visible;
}
.play-page .piece:hover .sticker-spin,
.play-page .portrait:hover .sticker-spin {
  transform: scale(1.12);
}
.piece.is-drag .sticker-spin,
.portrait.is-drag .sticker-spin {
  overflow: visible;
  transform: scale(1.12);
  transform-origin: center center;
  transition: none;
}
.piece.is-drag img,
.portrait.is-drag img {
  animation: none !important;
}
.play-page .m1 img {
  animation: floaterMotion1 3.6s ease-in-out infinite;
}
.piece img {
  height: 88px;
  width: auto;
  max-width: none;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.play-page[data-game="spell"] .supply .piece img {
  max-height: 72px;
}
.play-page[data-game="spell"] .piece img {
  height: auto;
  width: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  animation: none !important;
  transform: none !important;
  transition: none !important;
}
.play-page[data-game="count"] .piece[data-ch] img {
  height: var(--count-cap) !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center bottom !important;
}
.play-page[data-game="count"] .piece[data-case="x"] img { height: var(--count-x) !important; }
.play-page[data-game="count"] .piece[data-case="dot"] img { height: var(--count-dot) !important; }
.play-page[data-game="count"] .piece[data-case="asc"] img { height: var(--count-cap) !important; }
.play-page[data-game="count"] .piece[data-case="desc"] img {
  height: calc(var(--count-x) + var(--count-desc)) !important;
}
.play-page[data-game="count"] .supply .piece[data-ch] img {
  height: calc(var(--count-cap) * var(--count-tray, 1)) !important;
}
.play-page[data-game="count"] .supply .piece[data-case="x"] img {
  height: calc(var(--count-x) * var(--count-tray, 1)) !important;
}
.play-page[data-game="count"] .supply .piece[data-case="dot"] img {
  height: calc(var(--count-dot) * var(--count-tray, 1)) !important;
}
.play-page[data-game="count"] .supply .piece[data-case="asc"] img {
  height: calc(var(--count-cap) * var(--count-tray, 1)) !important;
}
.play-page[data-game="count"] .supply .piece[data-case="desc"] img {
  height: calc((var(--count-x) + var(--count-desc)) * var(--count-tray, 1)) !important;
}
.play-page[data-game="count"] .supply .num-piece img {
  height: calc(var(--count-cap) * var(--count-tray, 1)) !important;
}
.play-page[data-game="count"] .supply .piece[data-id] img {
  height: calc(88px * var(--count-tray, 1)) !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
}
.play-page[data-game="count"] .drop-board .piece[data-id] img,
.play-page[data-game="count"] .piece.is-drag[data-id] img {
  height: 96px !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
}
.play-page[data-game="count"] .supply .piece[data-case="desc"] {
  transform: translateY(calc(var(--count-desc) * var(--count-tray, 1)));
}
.play-page[data-game="count"] .supply .piece-name {
  font-size: calc(10px * var(--count-tray, 1));
}
.play-page[data-game="count"] .piece.is-drag {
  transform: none !important;
}
.play-page[data-game="count"] .piece.is-drag .sticker-spin {
  transform: none;
  transition: none;
}
.play-page[data-game="count"] .num-piece img,
.play-page[data-game="count"] .drop-board .num-piece img {
  height: var(--count-cap) !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center bottom !important;
}
.piece.tile {
  flex-direction: row;
  background: #fffaf2;
  border-radius: 12px;
  padding: 4px;
}
.piece.tile img { height: 64px; }
.piece-name {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.names-off .piece-name,
.names-off .cut-name { display: none; }
.graph .piece,
.drop-board .piece {
  position: absolute;
}
.graph .piece img,
.drop-board .piece img { height: 96px; }
.play-page[data-game="count"] .num-rows {
  display: flex;
  flex-wrap: wrap;
  flex: 1 0 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: center;
  align-items: flex-end;
  gap: calc(14px * var(--count-tray, 1)) calc(16px * var(--count-tray, 1));
  overflow: visible;
}
.play-page[data-game="count"] .num-rows .num-piece {
  width: auto;
  max-width: none;
  overflow: visible;
}
.match {
  position: relative;
  height: 100%;
  width: 100%;
  min-height: 0;
  display: block;
}
.cutouts,
.shelf {
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 12px;
  padding: 6px 12px;
  box-sizing: border-box;
}
.play-page[data-game="shapes"] .cutouts {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(50% + 8px);
  height: auto;
  max-height: none;
  justify-content: center;
  align-content: flex-end;
  align-items: flex-end;
}
.play-page[data-game="shapes"] .shelf {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 8px);
  height: auto;
  max-height: none;
  justify-content: center;
  align-content: flex-start;
  align-items: flex-start;
}
.cutout,
.portrait {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: auto;
  max-width: none;
  gap: 4px;
  cursor: grab;
  overflow: visible;
  touch-action: none;
}
.cutout { cursor: default; }
.cutout img,
.portrait img {
  height: 264px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  pointer-events: none;
}
.cutout.easy img { filter: brightness(0.5) saturate(0.8); }
.cutout.medium img { filter: brightness(0.16) saturate(0.22); }
.cutout.hard img { filter: url("#shapeOutline"); }
.cutout.is-filled img { filter: none; }
.cut-name {
  font-family: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
/* Shapes only. Kinder names are 2x; Grade 1 names are 1.5x. Grade 2 and Grade 3 stay at 10px / 18px. */
.play-page[data-game="shapes"]:has(#levelRow .chip.on[data-level="kinder"]) .piece-name {
  font-size: 20px;
}
.play-page[data-game="shapes"]:has(#levelRow .chip.on[data-level="kinder"]) .cut-name {
  font-size: 36px;
}
.play-page[data-game="shapes"]:has(#levelRow .chip.on[data-level="g1"]) .piece-name {
  font-size: 15px;
}
.play-page[data-game="shapes"]:has(#levelRow .chip.on[data-level="g1"]) .cut-name {
  font-size: 27px;
}
.cork-wrap {
  display: grid;
  grid-template-columns: 1fr 168px;
  gap: 16px;
  min-height: 68vh;
  align-items: stretch;
}
.cork-board {
  position: relative;
  min-height: 68vh;
  background: #c4a574 url("shapes/assets/cork-board.jpg") center / cover no-repeat;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
.cork-page .board-col { max-height: 68vh; }
.cork-page .sticker-menu .chip {
  width: 100%;
  margin-top: 6px;
  cursor: pointer;
}
/* Game pieces paint in full. Slider strips and the decorate cork may still crop. */
.play-page .windows,
.play-page .windows.has-slider-nav,
.play-page .window.is-open,
.play-page .window.is-open .split,
.play-page .play-stage,
.play-page .match,
.play-page .spell-lines,
.play-page .spell-boxes {
  overflow: visible;
}
.play-page .window:not(.is-open),
.play-page .window:not(.is-open) .book-side {
  overflow: hidden;
}
/* Win confetti covers the book window and both slider strips. The header menu stays above it. */
.play-page #bursts {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4500;
  display: block;
  opacity: 1;
}
@media (max-width: 900px) {
  .play-page #windows,
  .play-page .windows.has-slider-nav,
  .play-page .window.is-open,
  .play-page .window.is-open .split,
  .play-page .window.is-open .book-side:not(.is-landing),
  .play-page[data-game="math"] .window.is-open .book-side.is-landing,
  .play-page[data-game="shapes"] .window.is-open .book-side.is-landing {
    overflow: visible !important;
  }
  .play-page .window:not(.is-open),
  .play-page .window:not(.is-open) .book-side {
    overflow: hidden !important;
  }
}
@media (max-width: 800px) {
  .play-page .windows { height: auto; min-height: 0; }
  .play-page .window.is-open { height: auto; }
  .play-page .window.is-open .split {
    display: flex;
    flex-direction: column;
    position: relative;
    height: auto;
  }
  .play-page .window.is-open .book-side { min-height: 360px; }
  .cork-wrap { grid-template-columns: 1fr; }
  .house-nav { position: static; transform: none; flex-direction: row; justify-content: flex-end; margin: 0 22px 24px; }
}
