:root {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #745342;
  background: #e6e8df;
  font-synthesis: none;
  --cream: #fff7e9;
  --ink: #745342;
  --green: #69b59b;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
button:focus-visible {
  outline: 3px solid #7655a8;
  outline-offset: 4px;
}
img {
  object-fit: contain;
  user-select: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  letter-spacing: -0.7px;
}
h1 {
  font-size: 28px;
}
h2 {
  font-size: 23px;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.65;
}
.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}
.app-shell {
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: auto;
  background: var(--cream);
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.home-shell {
  background: radial-gradient(
    ellipse at 50% 30%,
    #fffdfa 0,
    #fff5df 58%,
    #f8eacc 100%
  );
}
.topbar {
  display: flex;
  align-items: center;
  min-height: 69px;
  padding: 15px 20px 6px;
  gap: 12px;
  position: relative;
  z-index: 3;
}
.header-actions {
  display: flex;
  margin-left: auto;
  gap: 9px;
}
.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  background: #fffdf5;
  border: 2px solid #e9d8be;
  border-radius: 16px;
  box-shadow: 0 3px 0 #e5d2b5;
  color: #a07c5f;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}
.icon-button:active {
  transform: translateY(3px);
  box-shadow: none;
}
.close-app {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  width: 32px;
}
.close-app .icon {
  width: 20px;
  height: 20px;
}
.progress-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 35px;
  padding: 0 12px 0 8px;
  border: 1px solid #e8d6b4;
  background: #fffdfa;
  border-radius: 20px;
}
.progress-pill .icon {
  width: 20px;
  height: 20px;
  color: #c39f6b;
  fill: #efdcbc;
}
.progress-pill b {
  font-size: 16px;
}
.progress-pill span {
  font-size: 11px;
  color: #9e836a;
}
.home-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 10px 30px 22px;
}
.title-logo {
  text-align: center;
  position: relative;
  z-index: 2;
}
.brand-logo {
  display: block;
  width: 210px;
  height: 133px;
  margin: auto;
}
.title-logo > span {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-top: 10px;
  color: #ae8b6d;
  letter-spacing: 0.2px;
}
.puzzle-scene {
  width: 310px;
  max-width: 100%;
  height: 265px;
  position: relative;
  flex-shrink: 0;
  margin: 10px auto 2px;
}
.demo-puzzle {
  position: absolute;
  width: 215px;
  left: 18px;
  top: 32px;
  transform: rotate(-9deg);
  padding: 8px;
  border-radius: 23px;
  background: #fffdf7;
  box-shadow:
    0 7px 0 #d8c6aa,
    0 16px 23px #ad8d5330;
  border: 2px solid #e5d9c4;
}
.demo-puzzle .board {
  border: 0;
  border-radius: 12px;
}
.demo-puzzle .cell {
  opacity: 1;
}
.demo-puzzle .cross {
  font-size: 26px;
}
.demo-puzzle .cell-panda {
  width: 89%;
  height: 89%;
}
.scene-panda {
  position: absolute;
  width: 150px;
  height: 142px;
  right: -3px;
  bottom: 13px;
  filter: drop-shadow(0 9px 3px #7051371c);
  z-index: 2;
  animation: panda-breathe 4s ease-in-out infinite;
  transform-origin: bottom center;
}
.mascot-shadow {
  position: absolute;
  bottom: 13px;
  right: 6px;
  width: 130px;
  height: 20px;
  background: #c4a77839;
  border-radius: 50%;
  filter: blur(3px);
}
.panda-greeting {
  position: absolute;
  bottom: 158px;
  right: -6px;
  z-index: 3;
  transform: rotate(7deg);
  border: 2px solid #e9d6ae;
  background: #fffdf6;
  border-radius: 16px 16px 16px 3px;
  padding: 8px 11px;
  font-size: 11px;
  font-weight: bold;
}
.scene-spark {
  position: absolute;
  color: #e7ab4f;
  font-size: 26px;
}
.spark-one {
  top: 3px;
  left: 0;
  transform: rotate(13deg);
}
.spark-two {
  top: 3px;
  right: 30px;
  font-size: 19px;
}
.scene-paw {
  position: absolute;
  left: 8px;
  bottom: 0;
  color: #d4b98b;
  transform: rotate(-20deg);
}
.scene-paw .icon {
  width: 28px;
  height: 28px;
}
.play-area {
  width: 100%;
  max-width: 320px;
  margin-top: 2px;
  text-align: center;
}
.stage-label {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  color: #947254;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 13px;
}
.stage-label > span {
  height: 2px;
  width: 30px;
  background: #e6ceaa;
  border-radius: 1px;
}
.button {
  min-height: 53px;
  border-radius: 18px;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}
.primary {
  border: 2px solid #4e9d84;
  border-top-color: #a8dbc1;
  background: linear-gradient(#85ceb0, #64b698);
  color: #fffef6;
  text-shadow: 0 2px #3c896f66;
  box-shadow:
    inset 0 2px 0 #e0f9e333,
    0 6px 0 #478d75,
    0 9px 0 #d9e1c7;
}
.primary:active {
  transform: translateY(5px);
  box-shadow:
    inset 0 2px 3px #3f886a22,
    0 1px 0 #478d75;
}
.play-button {
  min-height: 66px;
  border-radius: 22px;
  font-size: 24px;
  gap: 18px;
}
.play-button .icon {
  width: 22px;
  height: 22px;
  fill: #fff8e8;
  stroke: #fff8e8;
}
.play-ghost {
  visibility: hidden;
}
.play-note {
  color: #a58a6e;
  font-size: 11px;
  margin-top: 17px;
}
.daily-card {
  display: flex;
  align-items: center;
  text-align: left;
  width: 100%;
  max-width: 320px;
  min-height: 76px;
  padding: 10px 14px;
  margin-top: 20px;
  gap: 14px;
  border-radius: 19px;
  border: 2px solid #efcf88;
  background: #ffebba;
  box-shadow: 0 4px 0 #e5c68b;
  transition: transform 0.12s;
}
.daily-card:active {
  transform: translateY(3px);
}
.calendar-sticker {
  width: 43px;
  height: 49px;
  background: #fffaf0;
  border-radius: 9px;
  box-shadow: 0 3px 0 #cfb27d;
  transform: rotate(-7deg);
  text-align: center;
  flex-shrink: 0;
  overflow: hidden;
}
.calendar-sticker small {
  display: block;
  background: #eb9c78;
  color: white;
  font-weight: bold;
  font-size: 10px;
  line-height: 18px;
}
.calendar-sticker b {
  display: block;
  font-size: 23px;
  line-height: 29px;
  color: #ad7355;
}
.daily-card > span > strong {
  font-size: 16px;
  color: #8f693f;
}
.daily-card > span > small {
  display: block;
  font-size: 10px;
  margin-top: 6px;
  color: #a98758;
}
.daily-arrow {
  margin-left: auto;
  color: #c09856;
}
.daily-arrow .icon {
  width: 19px;
}
.bottom-nav {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 12px 20px 18px;
  margin-top: auto;
  background: #fffbf0c9;
  border-top: 2px solid #f1e4ca;
}
.nav-item {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 88px;
  min-height: 55px;
  padding: 5px;
  color: #baa285;
  font-size: 11px;
  font-weight: 600;
}
.nav-item .icon {
  width: 27px;
  height: 27px;
  stroke-width: 2;
}
.nav-item.selected {
  color: #aa784c;
}
.nav-item.selected .icon {
  fill: #edd29b;
  filter: drop-shadow(0 2px #e8d4b6);
}
.game-shell {
  background: #fff9ef;
}
.game-shell .topbar {
  min-height: 67px;
}
.game-main {
  padding: 0 18px 17px;
  flex: 1;
}
.game-title-row {
  text-align: center;
  position: relative;
  margin: 4px 0 26px;
}
.section-kicker {
  display: block;
  color: #b59575;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.game-title-row h1 {
  font-size: 27px;
  color: #875d47;
}
.timer-button {
  position: absolute;
  right: 0;
  top: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: #b39d86;
  padding: 9px 2px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.timer-button .icon {
  width: 13px;
  height: 13px;
}
.game-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 6px 17px;
}
.hearts {
  display: flex;
  gap: 4px;
}
.heart {
  width: 29px;
  height: 30px;
  filter: drop-shadow(0 2px 0 #cf405a1a);
}
.heart.empty {
  filter: grayscale(1);
  opacity: 0.24;
}
.difficulty {
  font-size: 12px;
  color: #b9a286;
  letter-spacing: 1px;
}
.panda-counter {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
}
.panda-counter img {
  width: 34px;
  height: 32px;
}
.panda-counter small {
  font-size: 13px;
  color: #baa083;
  font-weight: 500;
}
.board-wrap {
  padding: 7px;
  border-radius: 19px;
  background: #ede1d0;
  box-shadow: 0 5px 0 #deccb4;
  border: 1px solid #e6d9c6;
}
.board {
  display: grid;
  grid-template-columns: repeat(var(--size), minmax(0, 1fr));
  aspect-ratio: 1;
  border: 2px solid #867462;
  border-radius: 11px;
  overflow: hidden;
  isolation: isolate;
  background: #867462;
}
.cell {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  border: 0;
  border-right: 1px solid #785a3020;
  border-bottom: 1px solid #785a3020;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
}
.color-0 {
  background: #c9adee;
}
.color-1 {
  background: #ffd180;
}
.color-2 {
  background: #a8d5a0;
}
.color-3 {
  background: #a0d1e9;
}
.color-4 {
  background: #f0b1be;
}
.color-5 {
  background: #eee193;
}
.color-6 {
  background: #dac5ab;
}
.color-7 {
  background: #9edbcc;
}
.cell.edge-top {
  border-top: 1px solid #867462;
}
.cell.edge-left {
  border-left: 1px solid #867462;
}
.cell.edge-bottom {
  border-bottom: 2px solid #867462;
}
.cell.edge-right {
  border-right: 2px solid #867462;
}
.cell:focus-visible {
  outline: 3px solid #5d446c;
  outline-offset: -4px;
  z-index: 3;
}
.cell:active {
  filter: brightness(1.04);
}
.cell-panda {
  width: 88%;
  height: 88%;
  z-index: 1;
  filter: drop-shadow(0 2px 0 #64462a20);
}
.just-placed .cell-panda {
  animation: panda-pop 0.35s ease-out;
}
.wrong-cell {
  animation: wrong-shake 0.3s ease-in-out;
}
.cross {
  font-size: clamp(20px, 7vw, 36px);
  font-weight: 500;
  line-height: 1;
  color: #654f3b77;
}
.region-number {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 10px;
  color: #4b3a4188;
}
.board-caption {
  font-size: 12px;
  text-align: center;
  color: #a98c6b;
  margin: 23px 0 21px;
  min-height: 18px;
}
.board-caption b {
  font-weight: 700;
  color: #709b75;
}
.input-modes {
  display: flex;
  gap: 5px;
  padding: 4px;
  background: #eee4d3;
  border-radius: 15px;
}
.mode {
  flex: 1;
  min-height: 40px;
  border-radius: 11px;
  background: transparent;
  font-size: 11px;
  color: #b1987c;
  white-space: nowrap;
  padding: 8px 3px;
}
.mode.active {
  background: #fffcf4;
  color: #846847;
  box-shadow: 0 2px 0 #d9c5a6;
  font-weight: bold;
}
.tools {
  display: flex;
  justify-content: space-around;
  padding: 24px 9px 20px;
}
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  background: none;
  min-width: 80px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: #a18468;
}
.tool-disc {
  position: relative;
  height: 58px;
  width: 62px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #f1dfbe;
  box-shadow: 0 4px 0 #e3ceae;
  background: #fff9e9;
  transition: transform 0.12s;
}
.tool-disc img {
  height: 36px;
  width: 36px;
}
.tool-disc .icon {
  height: 36px;
  width: 36px;
}
.tool:active:not(:disabled) .tool-disc {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #e3ceae;
}
.tool:disabled .tool-disc {
  filter: grayscale(0.65);
  opacity: 0.5;
}
.tool:disabled > span:last-child {
  opacity: 0.6;
}
.hint-disc {
  background: #ffedb3;
  border-color: #f0d28b;
  box-shadow: 0 4px 0 #dcb974;
}
.hint-disc b {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 24px;
  height: 24px;
  background: #78b99b;
  color: #fff;
  border: 2px solid #fff9ed;
  border-radius: 50%;
  font-size: 12px;
  line-height: 20px;
}
.rule-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #b49b7d;
}
.rule-strip > .icon {
  width: 14px;
  height: 14px;
}
.text-button {
  width: 30px;
  height: 30px;
  background: #eee2cd;
  border-radius: 50%;
  color: #ac8c67;
  font-weight: bold;
  font-size: 13px;
  margin-left: 3px;
}
.levels-main,
.guide-main {
  padding: 22px 24px 30px;
  flex: 1;
}
.eyebrow {
  color: #baa07e;
  font-size: 11px;
  letter-spacing: 2px;
}
.levels-main h1 {
  margin-top: 9px;
}
.muted {
  color: #a78c70;
  font-size: 12px;
  margin-top: 9px;
}
.journey-progress {
  height: 10px;
  border: 2px solid #e3d2b7;
  border-radius: 8px;
  background: #eee3cd;
  margin: 22px 0;
  overflow: hidden;
}
.journey-progress span {
  display: block;
  height: 100%;
  background: #89c5a4;
  border-radius: 6px;
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px 10px;
}
.level-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #f6ecd9;
  border: 2px solid #e7d6b9;
  box-shadow: 0 4px 0 #ddc9a7;
  aspect-ratio: 1;
  border-radius: 17px;
}
.level-tile strong {
  font-size: 23px;
}
.level-tile small {
  font-size: 9px;
  color: #b0997a;
}
.level-tile.locked {
  opacity: 0.55;
}
.level-tile .icon {
  height: 19px;
  width: 19px;
  color: #c2ad8d;
}
.level-tile.current {
  color: white;
  background: #82bea3;
  border-color: #70a98d;
  box-shadow: 0 4px 0 #5b9478;
}
.level-tile.current small {
  color: #edf6df;
}
.level-tile.completed {
  background: #ffdf91;
  border-color: #e4c16f;
  box-shadow: 0 4px 0 #d8b362;
}
.guide-heading {
  text-align: center;
}
.guide-heading > img {
  width: 100px;
  height: 100px;
  display: block;
  margin: 0 auto 13px;
}
.guide-rule {
  display: flex;
  gap: 15px;
  margin: 24px 0;
  text-align: left;
}
.guide-rule > b {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 31px;
  height: 31px;
  border-radius: 11px;
  color: #9e7952;
  background: #f7e4b7;
  font-size: 12px;
  box-shadow: 0 3px #e6d0a4;
}
.guide-rule p {
  font-size: 12px;
  color: #a68a70;
  margin-top: 7px;
}
.rule-demo {
  display: flex;
  margin-top: 13px;
}
.rule-demo i {
  height: 37px;
  width: 39px;
  background: #d6bfee;
  border: 1px solid #a58cbd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  color: #9f81b4;
}
.rule-demo i:first-child {
  border-radius: 6px 0 0 6px;
}
.rule-demo i:last-child {
  border-radius: 0 6px 6px 0;
}
.rule-demo img {
  width: 30px;
}
.rule-demo.colors i:nth-child(n + 3) {
  background: #f7d89a;
  border-color: #d0ac74;
}
.guide-touch {
  background: #f2e8d4;
  padding: 17px;
  border-radius: 15px;
  font-size: 12px;
  margin-bottom: 25px;
}
.guide-touch p {
  margin-top: 8px;
  font-size: 11px;
  color: #a58b70;
}
dialog {
  border: 3px solid #e5cfac;
  padding: 0;
  border-radius: 29px;
  width: calc(100% - 38px);
  max-width: 400px;
  background: #fffaee;
  color: #866448;
  max-height: 85dvh;
  box-shadow:
    0 7px 0 #bfa07b,
    0 20px 80px #68472c33;
}
dialog::backdrop {
  background: #54412770;
  backdrop-filter: blur(4px);
}
.modal-content {
  padding: 26px 24px;
  text-align: center;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.modal-head + .muted {
  text-align: left;
  margin-bottom: 17px;
}
.modal-content > .primary {
  margin-top: 24px;
}
.subtle {
  color: #a58b70;
  background: transparent;
  font-size: 13px;
  margin-top: 10px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  width: 100%;
  background: none;
  text-align: left;
  border-bottom: 1px solid #eddeca;
}
.setting-row strong {
  font-size: 14px;
  display: block;
}
.setting-row small {
  font-size: 11px;
  display: block;
  color: #af9679;
  margin-top: 6px;
}
.switch {
  width: 42px;
  height: 25px;
  border-radius: 15px;
  background: #d9cbb4;
  position: relative;
}
.switch:before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  background: #fffcf3;
  border-radius: 50%;
  box-shadow: 0 2px #0001;
}
.switch.on {
  background: #7dbb9b;
}
.switch.on:before {
  left: 20px;
}
.settings-note {
  font-size: 10px;
  color: #b4a086;
  margin-top: 24px;
}
.result-panda {
  display: block;
  width: 170px;
  height: 150px;
  margin: 0 auto 13px;
}
.result-stats {
  display: flex;
  justify-content: space-around;
  background: #f4e8cf;
  border-radius: 16px;
  padding: 18px 5px;
  margin: 23px 0 8px;
}
.result-stats strong,
.result-stats small {
  display: block;
}
.result-stats strong {
  font-size: 22px;
}
.result-stats small {
  font-size: 10px;
  color: #b19775;
  margin-top: 7px;
}
.pause-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 65px;
  height: 65px;
  margin: 0 auto 22px;
  background: #f5dcaa;
  border-radius: 20px;
  color: #bc8a46;
  box-shadow: 0 4px #e6c791;
}
#toast {
  position: fixed;
  bottom: max(28px, var(--safe-bottom));
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  background: #365d46f5;
  color: #fffdf3;
  border: 1px solid #52755a;
  border-radius: 16px;
  padding: 12px 18px;
  z-index: 30;
  max-width: calc(100% - 32px);
  width: max-content;
  font-size: 12px;
  text-align: center;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.loading {
  padding: 40px;
  text-align: center;
  display:grid;
  place-content:center;
  background:#f3f3ee;
  color:#365d46;
  font-size:16px;
  line-height:1.7;
  min-height: 100dvh;
}
@keyframes panda-breathe {
  0%,
  100% {
    transform: rotate(3deg) translateY(0);
  }
  50% {
    transform: rotate(1deg) translateY(-5px);
  }
}
@keyframes panda-pop {
  0% {
    transform: scale(0.3) rotate(-10deg);
  }
  55% {
    transform: scale(1.12) rotate(5deg);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes wrong-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25%,
  75% {
    transform: translateX(-3px);
    background: #f7ac9b;
  }
  50% {
    transform: translateX(3px);
  }
}
@media (min-width: 600px) {
  .app-shell {
    margin: 25px auto;
    min-height: 850px;
    border-radius: 30px;
    border: 2px solid #fff8;
    box-shadow: 0 18px 65px #6c4d3020;
  }
  .home-main {
    padding-top: 8px;
  }
  .puzzle-scene {
    height: 280px;
    margin-top: 14px;
  }
  .demo-puzzle {
    top: 38px;
    width: 235px;
    left: 6px;
  }
  .scene-panda {
    bottom: 8px;
    width: 165px;
    height: 155px;
  }
  .panda-greeting {
    bottom: 165px;
  }
  .game-main {
    padding: 5px 23px 25px;
  }
}
@media (max-width: 599px) and (min-height: 750px) {
  .home-main {
    justify-content: center;
  }
  .game-main {
    padding-top: 6px;
  }
}
@media (max-height: 750px) and (max-width: 599px) {
  .topbar {
    min-height: 60px;
    padding-top: 10px;
  }
  .home-main {
    padding-top: 0;
  }
  .brand-logo {
    width: 173px;
    height: 108px;
  }
  .title-logo > span {
    font-size: 12px;
    margin-top: 4px;
  }
  .puzzle-scene {
    height: 226px;
    margin-top: 1px;
  }
  .demo-puzzle {
    width: 185px;
    left: 35px;
    top: 28px;
  }
  .scene-panda {
    width: 132px;
    height: 126px;
    right: 11px;
    bottom: 5px;
  }
  .panda-greeting {
    bottom: 131px;
    right: 8px;
  }
  .stage-label {
    margin-bottom: 10px;
  }
  .play-button {
    min-height: 58px;
    font-size: 22px;
  }
  .play-note {
    margin-top: 12px;
    font-size: 10px;
  }
  .daily-card {
    margin-top: 15px;
    min-height: 65px;
    padding: 8px 12px;
  }
  .bottom-nav {
    padding-top: 8px;
    padding-bottom: 10px;
  }
  .game-title-row {
    margin-bottom: 15px;
  }
  .game-status {
    margin-bottom: 12px;
  }
  .board-caption {
    margin: 18px 0 15px;
  }
  .tools {
    padding-top: 18px;
    padding-bottom: 17px;
  }
  .tool-disc {
    width: 56px;
    height: 52px;
  }
}
@media (max-width: 360px) {
  .home-main {
    padding-left: 25px;
    padding-right: 25px;
  }
  .puzzle-scene {
    height: 208px;
  }
  .demo-puzzle {
    left: 9px;
    width: 175px;
  }
  .scene-panda {
    width: 123px;
    height: 116px;
    right: -5px;
    bottom: 4px;
  }
  .panda-greeting {
    font-size: 10px;
    right: -2px;
    bottom: 128px;
  }
  .game-main {
    padding-left: 13px;
    padding-right: 13px;
  }
  .game-title-row h1 {
    font-size: 24px;
  }
  .timer-button {
    font-size: 10px;
  }
  .game-status {
    margin-bottom: 11px;
  }
  .heart {
    width: 25px;
    height: 26px;
  }
  .tool {
    font-size: 11px;
    min-width: 70px;
  }
  .tools {
    padding-left: 0;
    padding-right: 0;
  }
  .rule-strip {
    font-size: 10px;
  }
  .level-grid {
    gap: 12px 7px;
  }
  .levels-main {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
  .result-panda {
    content: none;
  }
}

.home-main { padding-bottom: 14px; }
@media (min-width: 361px) and (max-width: 599px) and (min-height: 751px) { .puzzle-scene { height: 259px; } .bottom-nav { padding-bottom: 16px; } }

/* v0.3 — compact puzzle HUD and character motion. */
.board { grid-template-rows: repeat(var(--size), minmax(0, 1fr)); }
.cell { min-height: 0; height: 100%; }
.cell > .panda-actor { position: absolute; left: 0; top: 0; }
.game-shell { background: #fff9ef; }
.game-shell .topbar { min-height: 60px; padding-top: 10px; }
.game-main { padding-top: 0; }
.game-title-row { margin: 1px 0 16px; }
.game-title-row h1 { font-size: 29px; font-weight: 800; text-shadow: 0 2px #fff; }
.game-title-row .section-kicker { font-size: 10px; letter-spacing: 1.3px; color: #b89677; }
.game-status { margin-bottom: 15px; }
.game-shell .board-wrap { position: relative; padding: 6px; background: #f0e6d8; border: 1px solid #e7dac7; box-shadow: 0 4px 0 #deceb7, inset 0 1px #fff; transition: box-shadow .4s; }
.game-shell .board { border-color: #a28a75; }
.game-shell .cell.edge-top { border-top-color: #a28a75; }
.game-shell .cell.edge-left { border-left-color: #a28a75; }
.game-shell .cell.edge-bottom { border-bottom-color: #a28a75; }
.game-shell .cell.edge-right { border-right-color: #a28a75; }
.panda-actor { position: relative; width: 100%; height: 100%; display: block; pointer-events: none; z-index: 2; flex-shrink: 0; transform-origin: 50% 78%; }
.panda-body { position: relative; display: block; width: 100%; height: 100%; transform-origin: 50% 90%; }
.panda-rest, .panda-expression { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 2px 0 #66472a14); }
.panda-expression { position: absolute; inset: 0; visibility: hidden; }
.panda-actor.arriving .panda-body { animation: panda-land .65s cubic-bezier(.2,.7,.3,1) both; }
.has-panda::after { content: ''; position: absolute; width: 55%; height: 9%; border-radius: 50%; background: #5c423b13; left: 22.5%; bottom: 5%; z-index: 0; }
.placement-burst { position: absolute; inset: 0; pointer-events: none; z-index: 4; animation: burst-fade .7s both; }
.placement-burst i { position: absolute; font-style: normal; color: #fffbe4; text-shadow: 0 1px 1px #b49a4f55; font-size: clamp(10px,4vw,19px); animation: sparkle-out .65s ease-out both; }
.placement-burst i:nth-of-type(1) { top: 8%; left: 8%; --dx: -3px; --dy: -5px; }
.placement-burst i:nth-of-type(2) { top: 16%; right: 4%; --dx: 5px; --dy: -3px; animation-delay: .07s; }
.placement-burst i:nth-of-type(3) { bottom: 13%; left: 14%; --dx: -4px; --dy: 4px; font-size: 12px; animation-delay: .1s; }
.placement-burst i:nth-of-type(4) { bottom: 17%; right: 12%; --dx: 5px; --dy: 3px; }
.trail-wrap { margin-top: 15px; min-height: 28px; }
.panda-trail { display: flex; align-items: center; justify-content: center; gap: 6px; }
.trail-slot { width: 27px; height: 27px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f0e5d5; border: 1px solid #e6d7c2; }
.trail-slot>.icon { height: 14px; width: 14px; color: #cdb99a; }
.trail-slot>img { width: 25px; height: 25px; }
.trail-slot.found { border-color: #a7c8a6; background: #e1edcf; }
.trail-pop { animation: trail-bounce .4s ease-out; }
.board-caption { margin: 7px 0 15px; font-size: 12px; min-height: 20px; color: #a48a6d; }
.tools { padding-top: 18px; padding-bottom: 16px; }
.tool-disc { border-radius: 21px; background: linear-gradient(#fffdf5,#fff1d8); }
.hint-disc { background: linear-gradient(#fff0b5,#ffe49d); }
.mode { font-size: 12px; color: #a38b70; }
.mode.active { color: #775c42; }
.mode:disabled { opacity: .65; }
.board-won { box-shadow: 0 4px 0 #a5c6a0, 0 0 0 4px #d6e8c8, 0 0 34px #a8ce8f42 !important; }
.board-won .marked .cross { opacity: .1; transition: opacity .4s; }
.board-won .cell:not(.has-panda) { filter: saturate(.85) brightness(1.04); }
.celebrate-panda { animation: panda-cheer .72s var(--celebrate-delay,0s) ease-in-out both; }


.celebration-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.clear-callout { position: absolute; top: 17%; left: 50%; width: max-content; max-width: 94%; transform: translateX(-50%); padding: 13px 20px; border: 2px solid #eac78c; border-radius: 25px; color: #a3723d; background: #fff3c9; box-shadow: 0 4px 0 #d6b177, 0 8px 18px #8d673422; font-size: 20px; font-weight: 800; animation: callout-in .4s .45s both; }
.clear-callout>span { color: #e3b04c; padding: 0 5px; }
.confetti { position: absolute; inset: 0; }
.confetti i { position: absolute; top: 18%; left: var(--x); width: 7px; height: 12px; border-radius: 3px; background: var(--confetti-color); animation: confetti-fall 1.45s calc(.25s + var(--delay)) both cubic-bezier(.18,.68,.44,1); }
.confetti i:nth-child(3n) { border-radius: 50%; width: 8px; height: 8px; }
.result-dialog { border: 3px solid #ead1a5; box-shadow: 0 6px 0 #bfa07b, 0 25px 90px #61482c44; }
.result-dialog[open] { animation: result-arrive .35s cubic-bezier(.15,.75,.3,1.12); }
.result-scene { position: relative; width: 230px; max-width: 100%; height: 173px; margin: 0 auto 7px; display: flex; align-items: center; justify-content: center; }
.result-scene .panda-actor { width: 185px; height: 185px; z-index: 2; }
.celebration-halo { width: 158px; height: 158px; border-radius: 50%; position: absolute; background: radial-gradient(#fff0b7,#f6e7c4 65%,transparent 67%); box-shadow: 0 0 0 10px #f9edcf66; }


.winner-panda { animation: winner-sway 3s 1.3s ease-in-out infinite; }
.result-star { position: absolute; color: #dfaf4b; z-index: 3; animation: star-twinkle 1.7s ease-in-out infinite; }
.star-a { font-size: 31px; left: 12px; top: 22px; }.star-b { font-size: 25px; right: 4px; top: 53px; animation-delay: .4s; }.star-c { font-size: 15px; left: 20px; bottom: 15px; animation-delay: .8s; }
.result-ribbon { display: inline-block; border-radius: 10px; background: #f4d98f; padding: 6px 17px; color: #a27a3e; font-size: 12px; font-weight: bold; margin-bottom: 14px; transform: rotate(-3deg); }
.result-dialog h2 { font-size: 22px; }
.result-dialog .muted { font-size: 12px; }
.result-dialog .result-stats { margin-top: 22px; }
.result-dialog .primary { margin-top: 22px; }
.motion-paused * { animation-play-state: paused!important; }
@keyframes panda-land { 0% { transform: translateY(-16%) scale(.45,.65); opacity: 0; } 38% { transform: translateY(-8%) scale(.95,1.08); opacity: 1; } 65% { transform: translateY(4%) scale(1.12,.9); } 83% { transform: translateY(-2%) scale(.98,1.03); } 100% { transform: none; opacity: 1; } }
@keyframes panda-cheer { 0%,100% { transform: none; } 20% { transform: translateY(4%) scale(1.06,.94); } 48% { transform: translateY(-15%) rotate(-5deg) scale(.98,1.04); } 75% { transform: translateY(2%) rotate(3deg) scale(1.03,.98); } }
@keyframes burst-fade { 0% { opacity: 0; } 18% { opacity: 1; } 75% { opacity: .8; } 100% { opacity: 0; } }
@keyframes sparkle-out { from { transform: translate(0,0) scale(.1); } 45% { transform: translate(var(--dx),var(--dy)) scale(1.2); } to { transform: translate(calc(var(--dx)*2),calc(var(--dy)*2)) scale(.5); } }
@keyframes trail-bounce { 0% { transform: scale(.7); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes callout-in { from { transform: translate(-50%,8px) scale(.7) rotate(-5deg); opacity: 0; } to { transform: translate(-50%,0) scale(1) rotate(-3deg); opacity: 1; } }
@keyframes confetti-fall { from { opacity: 0; transform: translate(0,-20px) rotate(0); } 12% { opacity: 1; } 80% { opacity: .9; } to { opacity: 0; transform: translate(var(--drift),350px) rotate(var(--turn)); } }
@keyframes result-arrive { from { opacity: 0; transform: translateY(18px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes winner-sway { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-3px); } }
@keyframes star-twinkle { 0%,100% { opacity: .7; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.1) rotate(9deg); } }
@media(max-width:360px) { .game-title-row h1 { font-size: 25px; }.trail-slot { height: 23px; width: 23px; }.trail-slot>img { width: 22px; height: 22px; }.panda-trail { gap: 5px; }.trail-wrap { margin-top: 13px; min-height: 23px; }.board-caption { margin-bottom: 12px; font-size: 11px; }.mode { font-size: 11px; }.clear-callout { font-size: 17px; } }
@media(prefers-reduced-motion:reduce) { *,*:before,*:after { animation: none!important; transition: none!important; }.placement-burst,.celebration-layer { display: none!important; } }

/* Royal Sudoku: readable wordmark and a compact crowned red panda silhouette. */
.title-logo .royal-wordmark { display: block; margin: 0; color: #855331; }
.royal-wordmark small { display: block; color: #b88a49; letter-spacing: 3.5px; font-size: 10px; font-weight: 800; margin-bottom: 8px; }
.royal-wordmark strong { display: block; font-size: clamp(38px, 10.5vw, 47px); font-weight: 950; line-height: 1.3; letter-spacing: -3px; color: #b97d38; -webkit-text-stroke: 5px #fff9e9; paint-order: stroke fill; filter: drop-shadow(0 3px 0 #ddc398); }
.royal-wordmark em { font-style: normal; color: #7b5840; }
.title-logo .brand-tagline { font-size: 12px; margin-top: 10px; font-weight: 500; letter-spacing: -.25px; color: #a5886a; }
.scene-panda { object-fit: contain; width: 172px; height: 172px; bottom: 0; right: -10px; }
.panda-greeting { bottom: 174px; right: -5px; }
.demo-puzzle .cell-panda { width: 100%; height: 100%; object-fit: contain; }
.panda-counter img { width: 30px; height: 30px; object-fit: contain; }
.rule-demo img { object-fit: contain; }
.guide-heading > img { object-fit: contain; width: 95px; height: 95px; }
.guide-intro { font-size: 12px; color: #a5886a; margin-top: 10px; line-height: 1.6; }
.result-scene.sad .result-panda { width: 170px; height: 170px; object-fit: contain; transform: rotate(-7deg); filter: saturate(.82); }
@media(max-width:360px) { .scene-panda { width: 140px; height: 140px; right: -10px; }.panda-greeting { bottom: 143px; }.title-logo .brand-tagline { font-size: 10px; }.royal-wordmark small { font-size: 9px; }.rule-strip { font-size: 10px; } }
@media(max-height:750px) and (min-width:361px) and (max-width:599px) { .scene-panda { width: 145px; height: 145px; }.panda-greeting { bottom: 147px; } }

.rule-strip > span { text-align: center; line-height: 1.6; }
.rule-strip small { display: block; font-size: 10px; color: #a38465; }

/* v0.5: face-only pieces, four-limb signature pose, contrasting outcomes. */
.cell > .panda-actor { width: 88%; height: 88%; left: 6%; top: 6%; }
.demo-puzzle .cell-panda { width: 88%; height: 88%; }
.has-panda::after { display: none; }
.panda-counter img { width: 27px; height: 27px; }
.scene-panda { width: 183px; height: 183px; right: -12px; }
.panda-greeting { bottom: 187px; }
.result-eyebrow { display: block; margin: 0 0 5px; font-size: 10px; font-weight: 800; letter-spacing: 3px; color: #b98d44; }
.result-scene { height: 205px; margin-bottom: 12px; isolation: isolate; }
.result-character { position: relative; width: 205px; height: 205px; object-fit: contain; z-index: 2; }
.result-win { background: linear-gradient(155deg,#fffbeb,#fff8ec 75%); }
.result-win .result-scene { width: 250px; }
.result-win .winner-panda { transform-origin: 50% 95%; animation: victory-hop 1.15s .12s both; }
.victory-rays { position: absolute; width: 220px; height: 220px; border-radius: 50%; background: repeating-conic-gradient(from 10deg,#efd58e30 0deg 13deg,transparent 13deg 32deg); mask-image: radial-gradient(black 30%,transparent 71%); animation: rays-turn 18s linear infinite; z-index: -1; }
.result-sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.result-sparkles i { position: absolute; left: 48%; top: 52%; color: #d8a440; font-style: normal; font-size: 13px; animation: victory-spark .9s calc(.12s + var(--i)*.035s) both; }
.result-loss { background: #f7f4fc; border-color: #d7cbe9; box-shadow: 0 6px 0 #b3a2c9,0 25px 90px #53436044; }
.result-loss[open] { animation: defeat-arrive .4s ease-out; }
.result-loss .result-eyebrow { color: #a18bb5; }
.result-loss .result-ribbon { background: #e5dced; color: #80658e; transform: rotate(3deg); }
.result-loss h2 { color: #756082; font-size: 20px; }
.result-loss .muted { color: #96829f; font-size: 11px; }
.result-loss .primary { background: linear-gradient(#b39bc9,#a38abd); border-color: #9378af; box-shadow: 0 5px 0 #88709f,inset 0 2px #ffffff55; }
.result-loss .button.subtle { color: #9a83a7; }
.result-loss .loser-panda { animation: tantrum-stamp 1.2s .15s 3 both; transform-origin: 50% 94%; }
.tantrum-cloud { position: absolute; width: 173px; height: 173px; border-radius: 50%; background: #e9e1f2; box-shadow: 0 0 0 12px #efe9f6; }
.tantrum-cry { position: absolute; top: 10px; right: -5px; z-index: 3; font-size: 14px; font-weight: 800; color: #9a7cae; transform: rotate(11deg); animation: cry-bob .6s .2s 6 both; }
.tantrum-puff { position: absolute; bottom: 6px; width: 27px; height: 12px; border-radius: 50%; background: #d0c1de88; z-index: 1; animation: stomp-puff .6s .25s 6 both; }
.puff-left { left: 35px; --puff-x:-18px; }.puff-right { right: 35px; --puff-x:18px; }
.retry-hearts { margin: 17px 0 0; padding: 12px; border-radius: 18px; background: #eee7f5; }
.retry-hearts > span { display: flex; gap: 5px; justify-content: center; margin-bottom: 7px; }
.retry-heart { width: 23px; height: 23px; object-fit: contain; animation: heart-return .35s .8s both; }
.heart-1 { animation-delay: .95s; }.heart-2 { animation-delay: 1.1s; }
.retry-hearts small { font-size: 10px; color: #96829f; }
@keyframes victory-hop { 0% { transform: translateY(20px) scale(.8); opacity: 0; } 30% { transform: translateY(-14px) scale(1.04); opacity: 1; } 48% { transform: translateY(2px) scale(1.04,.96); } 68% { transform: translateY(-8px) rotate(-4deg); } 86% { transform: rotate(3deg); } 100% { transform: none; } }
@keyframes victory-spark { 0% { opacity: 0; transform: rotate(var(--angle)) translateY(-35px) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--angle)) translateY(-115px) scale(1.1); } }
@keyframes rays-turn { to { transform: rotate(360deg); } }
@keyframes defeat-arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tantrum-stamp { 0%,45%,100% { transform: none; } 10% { transform: translate(-3px,-5px) rotate(-5deg); } 22% { transform: translateY(2px) rotate(3deg) scale(1.02,.98); } 32% { transform: translate(3px,-4px) rotate(4deg); } 60% { transform: translate(-3px,-5px) rotate(-4deg); } 72% { transform: translateY(2px) rotate(2deg); } 84% { transform: translate(2px,-3px) rotate(3deg); } }
@keyframes cry-bob { 0%,100% { transform: rotate(11deg) scale(1); } 50% { transform: rotate(5deg) scale(1.12); } }
@keyframes stomp-puff { from { opacity: 0; transform: scale(.3); } 25% { opacity: .7; } to { opacity: 0; transform: translateX(var(--puff-x)) scale(1.5); } }
@keyframes heart-return { from { opacity: .2; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@media(max-width:360px) { .scene-panda { width: 150px; height: 150px; }.panda-greeting { bottom: 153px; }.result-scene { height: 180px; }.result-character { width: 180px; height: 180px; }.result-dialog h2 { font-size: 19px; } }
@media(max-height:750px) and (min-width:361px) and (max-width:599px) { .scene-panda { width: 153px; height: 153px; }.panda-greeting { bottom: 156px; } }
@media(prefers-reduced-motion:reduce) { .result-sparkles,.tantrum-puff { display: none; } }
@media(max-height:700px) {
  .result-dialog .modal-content { padding: 18px; }
  .result-dialog .result-scene { height: 155px; margin-bottom: 8px; }
  .result-dialog .result-character { width: 155px; height: 155px; }
  .result-dialog .tantrum-cloud, .result-dialog .celebration-halo { width: 135px; height: 135px; }
  .result-dialog .result-ribbon { margin-bottom: 10px; padding: 5px 13px; }
  .result-dialog .result-stats { padding: 12px 5px; margin-top: 14px; }
  .result-dialog .retry-hearts { margin-top: 12px; padding: 10px; }
  .result-dialog .primary { margin-top: 16px; min-height: 50px; }
  .result-dialog .subtle { margin-top: 6px; min-height: 40px; }
}
/* v0.6 — royal garden game UI. Font license: /fonts/OFL-Jua.txt. */
@font-face { font-family: 'Jua'; src: url('/fonts/Jua-Regular.ttf') format('truetype'); font-style: normal; font-weight: 400; font-display: swap; }
.royal-wordmark strong, .game-title-row h1, .levels-main h1, .chapter-name strong, .level-tile strong, .result-dialog h2, .play-button strong, .daily-card strong, .stage-label b { font-family: 'Jua',sans-serif; font-weight: 400; }
.home-shell { background: radial-gradient(ellipse at 50% 32%,#fffef7 10%,#fff4d9 70%,#f4e4c2 100%); }
.home-shell::before { content: ''; pointer-events: none; position: absolute; inset: 0; opacity: .28; background-image: radial-gradient(#d5ba7c 1px,transparent 1.5px); background-size: 22px 22px; mask-image: linear-gradient(black,transparent 32%,transparent 75%,black); }
.home-main { padding-top: 2px; position: relative; }
.title-logo .logo-crown { display: block; width: 38px; height: 29px; margin: 0 auto 3px; fill: #f5ce72; color: #c8943f; stroke-width: 1.4; transform: rotate(-7deg); filter: drop-shadow(0 2px #fff8de); }
.title-logo .royal-wordmark small { font-size: 8px; letter-spacing: 3px; margin-bottom: 4px; color: #af8855; }
.title-logo .royal-wordmark strong { font-size: 52px; letter-spacing: -1.5px; line-height: 1.1; color: #c88a38; -webkit-text-stroke: 6px #fff9e8; filter: drop-shadow(0 4px 0 #c29c68); }
.title-logo .royal-wordmark em { color: #765342; }
.title-logo .brand-tagline { font-size: 11px; margin-top: 12px; color: #a08362; }
.puzzle-scene { height: 250px; margin-top: 6px; }
.scene-garden { position: absolute; width: 270px; height: 220px; left: 19px; top: 23px; border-radius: 48% 48% 35% 35%; background: radial-gradient(ellipse at 50% 15%,#e9f3d9,#dceac7 70%); border: 7px solid #fffaf0; box-shadow: 0 0 0 1px #e0d7af,0 8px 0 #e6d5ae; transform: rotate(5deg); }
.scene-garden::before,.scene-garden::after { content: ''; position: absolute; width: 35px; height: 60px; background: #b9d3a5; border: 3px solid #dbe9c8; border-radius: 80% 0 80% 0; bottom: 9px; }
.scene-garden::before { left: -13px; transform: rotate(-24deg); }.scene-garden::after { right: -7px; transform: rotate(34deg); }
.scene-cloud { position: absolute; width: 47px; height: 16px; border-radius: 20px; background: #fffdf3; box-shadow: 0 2px #e6d8b5; }
.scene-cloud::before { content: ''; position: absolute; width: 24px; height: 24px; border-radius: 50%; bottom: 3px; left: 10px; background: #fffdf3; }
.cloud-left { top: 19px; left: -9px; transform: scale(.8); }.cloud-right { top: 33px; right: -5px; transform: scale(.65); }
.demo-puzzle { top: 35px; width: 213px; left: 15px; transform: rotate(-10deg); border-color: #cdbb92; box-shadow: 0 7px #c9b086,0 14px 20px #866d4130; }
.scene-panda { width: 186px; height: 186px; bottom: -2px; right: -15px; }
.panda-greeting { bottom: 183px; right: -7px; background: #fffef8; font-size: 10px; box-shadow: 0 3px #e3cfac66; }
.scene-paw { bottom: 0; left: -9px; }
.spark-one { left: 3px; top: 57px; z-index: 2; font-size: 18px; }.spark-two { right: 0; top: 88px; z-index: 2; font-size: 17px; }
.play-area { position: relative; margin-top: 4px; }
.stage-label { width: max-content; margin: 0 auto 12px; min-width: 145px; padding: 5px 18px; gap: 6px; position: relative; background: #f4deb0; color: #926b3e; border-top: 1px solid #fff9e2; border-bottom: 2px solid #dcc18b; border-radius: 9px; font-size: 14px; }
.stage-label .icon { width: 17px; height: 17px; fill: #f7e7bb; stroke-width: 1.5; }
.stage-label b { font-size: 15px; }
.stage-label::before,.stage-label::after { content: ''; width: 15px; height: 23px; position: absolute; top: 5px; background: #e7cb91; z-index: -1; }
.stage-label::before { left: -10px; clip-path: polygon(0 0,100% 0,100% 100%,0 100%,30% 50%); }.stage-label::after { right: -10px; clip-path: polygon(0 0,100% 0,70% 50%,100% 100%,0 100%); }
.play-button { position: relative; overflow: hidden; min-height: 69px; border-radius: 24px; border: 3px solid #539b77; border-top-color: #aee4b9; background: linear-gradient(#98d7a8 0%,#7dc59a 48%,#6ab78c 49%,#73c096 100%); box-shadow: inset 0 3px #d7f4c580,0 6px #438867,0 10px #d9d7b3; gap: 14px; }
.play-button strong { font-size: 29px; letter-spacing: .2px; text-shadow: 0 3px #478963; }
.play-button::after { content: ''; position: absolute; top: -50%; left: -60%; width: 25%; height: 200%; background: linear-gradient(90deg,transparent,#fff8,transparent); transform: rotate(22deg); animation: button-glint 1.2s .6s both; pointer-events: none; }
.play-end { display: flex; align-items: center; justify-content: center; width: 27px; height: 27px; border-radius: 50%; background: #428d6e44; box-shadow: inset 0 2px #39806133; margin-left: auto; }
.play-end .icon { width: 17px; height: 17px; fill: none; stroke: #e8ffe4; }
.play-button > .icon { margin-right: auto; width: 20px; }
.play-note { font-size: 10px; margin-top: 15px; }
.daily-card { position: relative; background: linear-gradient(125deg,#fff4d3,#ffe3a0); border-style: solid; border-color: #e7c680; border-radius: 17px; min-height: 69px; margin-top: 17px; box-shadow: 0 4px #d9b977,inset 0 2px #fff7df; }
.daily-card::before,.daily-card::after { content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff1d5; border: 1px solid #e6c88e; top: calc(50% - 6px); }
.daily-card::before { left: -8px; }.daily-card::after { right: -8px; }
.daily-card > span > strong { font-size: 18px; }.daily-card > span > small { margin-top: 4px; }
.bottom-nav { position: relative; background: #fffaf0; border-top: 2px solid #e6d4b3; box-shadow: 0 -4px 0 #fffdf666; padding-top: 10px; }
.nav-item { border-radius: 17px; color: #b09b7c; transition: transform .15s,background .15s; }
.nav-item.selected { background: #f5e8c9; box-shadow: inset 0 2px #fff8dd,0 3px #ddc89e; color: #987142; }
.nav-item.selected .icon { fill: #edcc83; }.nav-item:active { transform: translateY(2px); }
.progress-pill { background: linear-gradient(#fffef4,#f8eccf); border: 2px solid #e7d3ac; box-shadow: 0 2px #dcc6a1; }
.game-shell { background: radial-gradient(ellipse at top,#fffdf6,#fff6e6 90%); }
.game-title-row { margin-bottom: 13px; }
.game-title-row .section-kicker { font-size: 8px; letter-spacing: 2px; margin-bottom: 6px; }
.game-title-row h1 { display: inline-block; font-size: 28px; padding: 4px 20px 6px; line-height: 1.1; background: #f4e3bc; border-radius: 9px; border-top: 2px solid #fff9e6; box-shadow: 0 3px #dfc897; color: #8c633f; }
.timer-button { top: 13px; padding: 8px 6px; border: 1px solid #eadcc5; border-radius: 10px; background: #fffdf7; font-size: 10px; }
.game-status { margin-bottom: 13px; }
.difficulty { padding: 4px 10px; border-radius: 12px; background: #f2e8d5; color: #a38a65; font-size: 10px; }
.panda-counter { padding: 2px 8px 2px 3px; border-radius: 17px; background: #fffdfa; border: 1px solid #ead9ba; font-size: 16px; }
.game-shell .board-wrap { padding: 7px; background: linear-gradient(135deg,#f9e6bd,#e9cca0); border: 2px solid #d9bc8c; border-radius: 22px; box-shadow: inset 0 2px #fff9e8,0 5px #c5a478,0 9px 0 #eadbc1; }
.game-shell .board { border-radius: 13px; }
.trail-slot { box-shadow: inset 0 2px 2px #bca07818; }.trail-slot.found { background: #fff2cf; border-color: #e5c68d; box-shadow: 0 2px #d8ba80; }
.board-caption { font-size: 11px; }
.input-modes { border: 2px solid #e6d4b2; background: #eee1c8; box-shadow: inset 0 2px #d8c5a344; padding: 3px; }
.mode { border-radius: 13px; font-size: 11px; }.mode.active { background: #fffcf1; box-shadow: 0 3px #d6bd92,inset 0 1px #fff; color: #916d44; }
.tool-disc { border: 2px solid #e7cca0; box-shadow: 0 4px #dbc197,inset 0 2px #fff; background: linear-gradient(#fffdf3,#f9e9c7); }
.undo-disc { background: linear-gradient(#edf8ef,#dcebd5); border-color: #c2d5ac; box-shadow: 0 4px #b2c59c,inset 0 2px #fff; }
.erase-disc { background: linear-gradient(#fff0df,#f4d9c2); border-color: #e5c2a2; box-shadow: 0 4px #d7b28f,inset 0 2px #fff9; }
.hint-disc { background: linear-gradient(#fff5bf,#ffdc7c); border-color: #e9c56c; box-shadow: 0 4px #d3af56,inset 0 2px #fffbd7; }
.tool:disabled { opacity: .5; }.tool:active:not(:disabled) .tool-disc { transform: translateY(3px); box-shadow: none; }
.journey-shell { background: linear-gradient(#fff9e9,#f4ebd5); }.journey-shell .bottom-nav { position: sticky; bottom: 0; z-index: 4; }
.levels-main { padding-top: 12px; }
.journey-heading { display: flex; align-items: center; justify-content: space-between; min-height: 110px; }.journey-heading h1 { font-size: 34px; margin-top: 6px; }.journey-heading .eyebrow { font-size: 9px; letter-spacing: 2px; }.journey-heading .muted { margin-top: 4px; }
.journey-mascot { width: 104px; height: 104px; transform: rotate(5deg); }
.journey-count { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; font-size: 11px; color: #ab906a; }.journey-count b { color: #98764b; font-size: 17px; }.journey-count small { font-size: 11px; font-weight: normal; }
.journey-progress { margin: 7px 0 24px; height: 11px; background: #eadebd; }.journey-progress span { background: linear-gradient(#9ed3a0,#6eb490); }
.chapters { display: grid; gap: 14px; }
.chapter { --chapter-accent: #a5bd8b; --chapter-bg:#edf1dc; border: 2px solid #dac8a4; border-radius: 22px; background: #fffaf0; box-shadow: 0 4px #e3d2b0; overflow: hidden; }
.chapter-1 { --chapter-accent:#d9b071; --chapter-bg:#fff0ce; }.chapter-2 { --chapter-accent:#c69a94; --chapter-bg:#f9e3dd; }.chapter-3 { --chapter-accent:#a69cc6; --chapter-bg:#eae5f5; }.chapter-4 { --chapter-accent:#d6b65e; --chapter-bg:#f9edc7; }
.chapter summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 13px; background: var(--chapter-bg); }
.chapter summary::-webkit-details-marker { display: none; }.chapter summary:focus-visible { outline: 3px solid #7655a8; outline-offset: -4px; }
.chapter-medal { width: 35px; height: 38px; border-radius: 11px 11px 16px 16px; background: var(--chapter-accent); display: flex; align-items: center; justify-content: center; color: #fffbee; box-shadow: inset 0 2px #fff7,0 3px #0001; }.chapter-medal .icon { width: 23px; fill: #fff8e333; }
.chapter-name { flex: 1; }.chapter-name small { font-size: 8px; letter-spacing: 1px; color: #a18c6e; display: block; }.chapter-name strong { font-size: 21px; display: block; margin-top: 3px; color: #84694d; }
.chapter-count { font-size: 15px; font-weight: bold; color: #937c5a; }.chapter-count small { font-weight: normal; font-size: 9px; }
.chapter-chevron .icon { width: 14px; color: #ac987c; transition: transform .2s; }.chapter[open] .chapter-chevron .icon { transform: rotate(90deg); }
.chapter-body { padding: 29px 17px 24px; background-image: radial-gradient(#e4d7b8 1px,transparent 1px); background-size: 18px 18px; }
.level-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 26px 14px; }
.level-tile { position: relative; width: 100%; border-radius: 50%; border: 3px solid #e3d3b5; background: linear-gradient(#fffaf0,#efe1c6); box-shadow: 0 4px #cbb894,inset 0 2px #fff; gap: 0; z-index: 1; }
.level-tile::before { content: ''; position: absolute; left: calc(100% + 3px); top: 50%; width: 14px; border-top: 3px dotted #d1bf9b; }.level-tile:nth-child(4n)::before { display: none; }
.level-tile strong { font-size: 26px; line-height: 1.1; }.level-tile small { line-height: 1; font-size: 8px; margin-top: 2px; }.level-tile small .icon { width: 12px; height: 12px; }
.level-tile.locked { opacity: 1; color: #c4b393; background: #eee5d3; border-color: #e4d8bf; box-shadow: 0 3px #d9caac; }
.level-tile.current { background: linear-gradient(#9dd5b0,#74b895); border-color: #c3e5bc; box-shadow: 0 5px #659776,0 0 0 3px #e5efd7; color: #fffdf0; }
.level-tile.current small { color: #fff9e6; }.current-flag { position: absolute; top: -21px; padding: 3px 9px; border-radius: 8px; background: #f5d688; color: #9a7237; box-shadow: 0 2px #d5b469; font-size: 10px; white-space: nowrap; }
.level-tile.completed { background: linear-gradient(#ffedb1,#f0ce78); border-color: #e5c26e; box-shadow: 0 4px #c8a250; color: #9f7538; }.level-tile.completed small .icon { color: #bb8d38; fill: #fff1bc; }
@keyframes button-glint { from { left: -60%; } to { left: 140%; } }
@media(min-width:361px) and (max-width:599px) and (min-height:751px) { .puzzle-scene { height: 250px; } }
@media(max-width:360px) { .title-logo .royal-wordmark strong { font-size: 43px; }.title-logo .brand-tagline { font-size: 10px; }.home-main { padding-left: 24px; padding-right: 24px; }.puzzle-scene { height: 215px; }.scene-garden { width: 225px; height: 183px; left: 18px; }.demo-puzzle { width: 178px; left: 10px; top: 28px; }.scene-panda { width: 154px; height: 154px; right: -11px; }.panda-greeting { bottom: 154px; font-size: 9px; }.play-button { min-height: 60px; }.play-button strong { font-size: 25px; }.game-title-row h1 { font-size: 24px; padding-left: 14px; padding-right: 14px; }.timer-button { right: -3px; font-size: 9px; }.chapter summary { gap: 7px; padding: 12px 10px; }.chapter-name strong { font-size: 19px; }.chapter-body { padding: 28px 12px 20px; }.level-grid { gap: 23px 12px; }.level-tile strong { font-size: 23px; }.level-tile::before { width: 12px; } }
@media(max-height:750px) and (min-width:361px) and (max-width:599px) { .title-logo .logo-crown { height: 23px; }.title-logo .royal-wordmark strong { font-size: 46px; }.puzzle-scene { height: 225px; }.scene-garden { height: 195px; }.demo-puzzle { width: 192px; top: 24px; }.scene-panda { width: 166px; height: 166px; }.panda-greeting { bottom: 165px; } }
/* v0.7 — tactile board, ad-backed tools and a bounded stage picker. */
.game-shell .topbar { min-height: 56px; padding-top: 8px; }
.game-title-row { margin-bottom: 12px; }
.game-shell .board-wrap { border-bottom-width: 3px; }
.game-shell .cell { transition: filter .1s, box-shadow .1s; }
.game-shell .cell:active:not(.has-panda) { box-shadow: inset 0 0 0 3px #fff9; filter: brightness(.96); }
.cell.landed,.lesson-cell.landed { animation: tile-press .5s ease-out; }
.panda-actor.arriving .panda-body { animation: panda-land .48s cubic-bezier(.18,.8,.3,1) both; }
@keyframes panda-land { 0% { transform: translateY(-28%) scale(.72,1.02); opacity: .3; } 35% { transform: translateY(5%) scale(1.15,.83); opacity: 1; } 58% { transform: translateY(-8%) scale(.94,1.07); } 78% { transform: translateY(1%) scale(1.04,.97); } 100% { transform: none; opacity: 1; } }
@keyframes tile-press { 0% { box-shadow: inset 0 0 0 1px #fff5; } 30% { box-shadow: inset 0 0 0 5px #fff9,inset 0 0 24px #fff7; } 100% { box-shadow: inset 0 0 0 0 #fff0; } }
.landing-ring { position: absolute; width: 65%; height: 28%; bottom: 5%; left: 17.5%; border-radius: 50%; border: 2px solid #fff7da; animation: landing-ring .55s .08s both; }
@keyframes landing-ring { from { opacity: 1; transform: scale(.35); } to { opacity: 0; transform: scale(1.6); } }
.placement-burst { animation-duration: .65s; }
.trail-wrap { margin-top: 13px; }
.board-caption { margin-bottom: 12px; }
.input-modes { min-height: 47px; }
.mode { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; padding: 6px 4px; }
.mode-glyph { font-size: 20px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 24px; opacity: .8; }
.mode-glyph img { width: 23px; height: 23px; }.mode.active .mode-glyph { opacity: 1; }
.tools-heading { display: flex; align-items: center; justify-content: space-between; margin: 18px 8px 0; font-size: 10px; color: #a68a66; }.tools-heading small { font-size: 9px; color: #b39b7b; }
.tools { padding-top: 11px; padding-bottom: 12px; }
.tool-disc { width: 55px; height: 53px; border-radius: 19px; transition: transform .1s,box-shadow .1s; }
.tool { gap: 7px; font-size: 10px; }.ad-badge { font-size: 8px; line-height: 1; padding: 4px 7px; border-radius: 6px; background: #e5d6b9; color: #8d7552; margin-top: -2px; }
.tool:not(:disabled) .ad-badge { background: #f5dda4; color: #9a723b; }
button.is-pressed:not(.cell) { transform: translateY(3px) scale(.97); filter: brightness(.97); }
.tool.is-pressed .tool-disc { transform: translateY(3px); box-shadow: 0 1px #c3a477,inset 0 1px #fff; }
button.button-release:not(.cell) { animation: button-release .22s ease-out; }
@keyframes button-release { 0% { transform: translateY(3px) scale(.97); } 58% { transform: translateY(-1px) scale(1.015); } 100% { transform: none; } }
.compact-journey .levels-main { padding-top: 2px; padding-bottom: 15px; }
.compact-journey .journey-heading { min-height: 86px; }.compact-journey .journey-mascot { width: 85px; height: 85px; }.compact-journey .journey-heading h1 { font-size: 31px; }
.stage-pager { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 13px; }.stage-pager > div { text-align: center; }.stage-pager small { display: block; font-size: 10px; color: #b29a74; margin-bottom: 3px; }.stage-pager strong { font: 23px 'Jua',sans-serif; color: #8d6c44; }.stage-pager button { width: 37px; height: 37px; border-radius: 13px; }.stage-pager button:disabled { opacity: .35; }
.compact-journey .chapter-body { padding: 28px 17px 23px; }.compact-journey .level-grid { gap: 26px 14px; }
.compact-journey .level-tile strong { font-size: clamp(17px,6vw,25px); }
.page-footer { display: flex; align-items: center; justify-content: space-between; margin: 16px 5px 14px; font-size: 10px; color: #b09976; }.text-link { background: none; display: flex; align-items: center; gap: 4px; color: #a38152; font-size: 11px; min-height: 32px; }.text-link .icon { width: 14px; height: 14px; }
.stage-jump { padding-top: 11px; border-top: 1px dashed #deccaa; }.stage-jump label { font-size: 10px; color: #af9571; display: block; margin-bottom: 7px; }.stage-jump > div { display: flex; gap: 8px; }.stage-jump input { width: 100%; min-width: 0; border: 1px solid #dfc9a2; border-radius: 11px; background: #fffdf6; padding: 10px 12px; font: inherit; font-size: 12px; color: #866644; }.stage-jump button { padding: 10px 18px; border-radius: 11px; background: #ecd8af; white-space: nowrap; font-size: 12px; box-shadow: 0 2px #ccb085; }
.item-offer > .icon { width: 43px; height: 43px; color: #c39853; padding: 10px; border-radius: 14px; background: #f4e3ba; margin-bottom: 17px; fill: #dfb966; }.ad-unavailable { font-size: 12px; color: #a58c6f; background: #f3e9d7; border-radius: 12px; padding: 12px; margin-top: 15px; }.item-offer .primary { margin-top: 20px; }.item-offer .primary:disabled { opacity: .45; }
.ad-spinner { display: block; width: 33px; height: 33px; border-radius: 50%; border: 4px solid #e8d7b5; border-top-color: #8abb96; margin: 5px auto 20px; animation: rays-turn 1s linear infinite; }
@media(max-width:360px) { .compact-journey .journey-heading { min-height: 70px; }.compact-journey .journey-mascot { width: 70px; height: 70px; }.compact-journey .level-grid { gap: 22px 11px; }.compact-journey .chapter-body { padding: 25px 13px 20px; }.stage-pager { margin-top: 10px; }.game-title-row { margin-bottom: 10px; }.mode { font-size: 10px; gap: 3px; }.tools-heading { margin-top: 15px; } }
.compact-journey .level-tile .long-number { font-size: 18px; }

/* v0.8 — one icon family, readable controls and a compact play HUD. */
.game-shell .game-topbar { gap: 10px; padding-bottom: 12px; min-height: 72px; }
.game-heading { flex: 1; min-width: 0; }
.game-heading h1 { font: 27px/1.15 'Jua',sans-serif; color: #775237; margin: 0; }
.game-heading small { display: block; font-size: 12px; color: #79624d; margin-top: 3px; }
.game-topbar .header-actions { gap: 3px; }
.game-topbar .icon-button { width: 40px; height: 40px; flex-shrink: 0; }
.game-topbar .close-app { width: 30px; }
.game-status { margin: 0 3px 12px; min-height: 36px; }
.game-status .timer-button { position: static; font-size: 13px; min-height: 40px; padding: 8px 10px; color: #72583f; border-color: #d8c4a1; gap: 6px; }
.difficulty { color: #765d44; font-size: 12px; background: #f1e5cc; padding: 5px 9px; }
.heart { width: 27px; height: 29px; filter: drop-shadow(0 2px 0 #c3836230); }
.heart.empty { opacity: 1; filter: none; stroke: #b49f86; }
.heart.empty path:first-child { fill: #e8dfd0; }.heart.empty path:last-child { stroke: #f9f3e7; }
.game-progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 3px; min-height: 34px; }
.game-progress .panda-counter { flex-shrink: 0; background: none; border: 0; padding: 0; color: #6c513c; font-size: 16px; }
.game-progress .panda-counter img { width: 29px; height: 29px; }
.panda-counter small { color: #79624d; font-size: 13px; }
.game-progress .board-caption { margin: 0; font-size: 12px; line-height: 1.5; color: #79624d; text-align: right; min-height: 0; }
.input-modes { border: 1px solid #dbc6a4; padding: 4px; gap: 4px; background: #eee4d2; box-shadow: inset 0 2px #d5c09d30; }
.mode { position: relative; min-height: 46px; font-size: 12px; color: #715b44; padding: 7px 5px; gap: 5px; border: 1px solid transparent; }
.mode[data-action="mode:smart"] { flex: 1.15; }
.mode.active { background: #47775f; color: #fffbed; border-color: #3b6751; box-shadow: 0 2px #31543f,inset 0 1px #ffffff30; }
.mode.active::after { content: '✓'; position: absolute; right: 3px; top: 0; font-size: 10px; color: #fffbed; }
.mode-glyph { opacity: 1; width: 21px; }.mode-glyph .icon { width: 19px; height: 22px; }
.mode-help { margin: 10px 0 0; min-height: 20px; text-align: center; font-size: 13px; color: #6e5944; line-height: 1.5; }
.tools-heading { margin: 14px 3px 0; border-top: 1px solid #e4d5bb; padding-top: 10px; font-size: 12px; color: #71573f; font-weight: 600; }
.tools-heading small { font-size: 11px; color: #79624d; font-weight: 400; }
.tools { padding: 10px 0; }
.tool { min-width: 78px; font-size: 12px; gap: 8px; color: #72583f; }
.tool .tool-disc { width: 59px; height: 56px; border-radius: 19px; border: 2px solid #dbc49d; background: linear-gradient(#fffdf2,#f5e7cb); box-shadow: 0 4px #cbb28b,inset 0 2px #fff; }
.item-icon { display: inline-block; vertical-align: middle; }
.tool-disc .item-icon { width: 34px; height: 36px; filter: drop-shadow(0 2px 0 #9b765029); }
.tool:disabled { opacity: 1; color: #806f5b; }
.tool:disabled .tool-disc { opacity: 1; filter: none; background: #ede6d9; border-color: #d5c9b6; box-shadow: 0 3px #c9bca7,inset 0 1px #f8f3e9; }
.tool:disabled .item-icon { filter: grayscale(.8); opacity: .75; }
.tool .ad-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; line-height: 1; padding: 4px 8px; margin-top: 0; background: #f1dfb5; color: #73572f; }
.ad-badge .icon { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.tool:disabled .ad-badge { background: #e8dfd0; color: #79674f; }
.rule-strip { font-size: 12px; color: #725a44; gap: 8px; }
.rule-strip small { font-size: 11px; color: #79624d; }
.rule-strip .text-button { min-width: 40px; min-height: 40px; color: #70543a; }
.stage-search { border-top: 1px solid #dfceb0; }
.stage-search summary { display: flex; align-items: center; gap: 7px; min-height: 46px; font-size: 13px; color: #73573b; cursor: pointer; list-style: none; }
.stage-search summary::-webkit-details-marker { display: none; }
.stage-search summary .icon { width: 18px; height: 18px; }
.stage-search summary span { margin-left: auto; font-size: 19px; transition: transform .15s; }
.stage-search[open] summary span { transform: rotate(45deg); }
.stage-search summary:focus-visible { outline: 3px solid #47775f; outline-offset: 2px; border-radius: 8px; }
.stage-search .stage-jump { border: 0; padding: 0 0 12px; }
.stage-jump label { color: #735a42; font-size: 12px; }
.stage-jump input,.stage-jump button { min-height: 44px; font-size: 14px; color: #6e533a; }
.page-footer { color: #796247; font-size: 12px; margin-top: 12px; margin-bottom: 5px; }
.text-link { font-size: 12px; min-height: 44px; color: #755638; }
.stage-pager small { color: #796247; font-size: 12px; }
.stage-pager button { width: 44px; height: 44px; }
.play-note,.daily-card small,.brand-tagline { color: #79624d; }
.ad-unavailable { color: #725a44; }.retry-hearts small { font-size: 12px; color: #725d7c; }
@media(max-width:360px) {
  .game-shell .game-topbar { gap: 6px; padding-bottom: 10px; min-height: 66px; }
  .game-heading h1 { font-size: 22px; }.game-topbar .icon-button { width: 36px; }.game-topbar .close-app { width: 26px; }
  .game-progress { gap: 7px; }.game-progress .board-caption { font-size: 11px; }
  .mode { font-size: 11px; gap: 3px; padding-left: 2px; padding-right: 2px; }.mode-glyph { width: 19px; }
  .mode-help { font-size: 12px; }.tools-heading { margin-top: 13px; }
}

/* v0.9 — visible rules, separated colorful tiles and guided practice. */
.rule-ribbon { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; padding: 6px; background: #fffdf9; border: 1px solid #e9d9bf; border-radius: 17px; }
.rule-card { display: flex; gap: 5px; align-items: center; justify-content: center; padding: 9px 3px; border-radius: 11px; background: #f5ecdd; color: #77503b; text-align: left; min-width: 0; }
.rule-card strong,.rule-card small { display: block; white-space: nowrap; }.rule-card strong { font-size: 13px; font-weight: 700; }.rule-card small { font-size: 13px; margin-top: 3px; }
.rule-picture { width: 31px; height: 31px; display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; flex-shrink: 0; }
.rule-picture i { background: #e4d7c1; border-radius: 2px; color: #fff; font-size: 11px; font-style: normal; line-height: 9px; text-align: center; }
.rule-picture .example-blocked { background: #aa7959; }.rule-picture .example-panda { background: #f1c786; }.rule-picture img { width: 13px; height: 13px; max-width: none; margin-left: -2px; margin-top: -2px; }
.rule-color .example-panda { background: #aa7959; }
.learn-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 1px 3px 7px; font-size: 11px; color: #79604a; }
.learn-link { background: transparent; font-size: 12px; font-weight: 700; color: #39654c; min-height: 38px; padding: 5px 0 5px 5px; text-decoration: underline; text-underline-offset: 3px; }
.game-shell .board-wrap { background: #fffefa; padding: 10px; border: 2px solid #e6d2ad; border-radius: 22px; box-shadow: 0 4px #d7bf96; }
.game-shell .board { background: transparent; border: 0; border-radius: 10px; gap: 4px; overflow: visible; }
.game-shell .cell { border: 0; border-radius: 7px; box-shadow: inset 0 1px #ffffff35; }
.game-shell .color-0,.lesson-board .color-0 { background: #c6a3e9; }
.game-shell .color-1,.lesson-board .color-1 { background: #70c2e4; }
.game-shell .color-2,.lesson-board .color-2 { background: #abd98d; }
.game-shell .color-3,.lesson-board .color-3 { background: #edc44f; }
.game-shell .color-4 { background: #efb1ce; }.game-shell .color-5 { background: #f2a77a; }
.game-shell .color-6 { background: #bcbfe6; }.game-shell .color-7 { background: #76cdb8; }
.game-shell .cross,.lesson-board .cross { color: #fff; font-weight: 800; font-size: clamp(32px,10vw,52px); line-height: 1; text-shadow: 0 1px 2px #60482c38; }
.game-shell .panda-actor { width: 94%; height: 94%; }
.panda-expression { visibility: visible; opacity: 0; pointer-events: none; }
.panda-love { position: absolute; right: 3%; top: 6%; color: #e86c80; font-size: clamp(12px,4vw,23px); text-shadow: 0 2px #fff4da; opacity: 0; }
.panda-actor.reacting { animation: panda-delight 1.25s ease-in-out; }
.reacting .panda-expression { animation: panda-wink 1.25s both; }
.reacting .panda-rest { animation: panda-rest-hide 1.25s both; }
.reacting .panda-love { animation: panda-heart 1.25s ease-out both; }
@keyframes panda-delight { 0%,100% { transform: none; } 16% { transform: translateY(3%) scale(1.08,.92); } 32% { transform: translateY(-12%) rotate(-8deg) scale(.97,1.06); } 48% { transform: translateY(1%) scale(1.06,.96); } 65% { transform: translateY(-6%) rotate(7deg); } 83% { transform: rotate(-3deg); } }
@keyframes panda-wink { 0%,13%,88%,100% { opacity: 0; } 25%,72% { opacity: 1; } }
@keyframes panda-rest-hide { 0%,13%,88%,100% { opacity: 1; } 25%,72% { opacity: 0; } }
@keyframes panda-heart { 0%,20% { opacity: 0; transform: translateY(8px) scale(.5); } 40%,70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-13px) scale(1.1); } }
.lesson-start { margin: 18px 0 5px; min-height: 48px; width: 100%; background: #e1edda; color: #3d694f; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; }
.tutorial-dialog { max-width: 430px; width: calc(100% - 24px); max-height: 94dvh; border: 2px solid #e8d4b1; background: #fffaf0; }
.tutorial-dialog .modal-content { padding: 16px 18px 20px; }
.lesson-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #796049; }
.lesson-head .icon-button { width: 36px; height: 36px; }
.lesson-dots { display: flex; gap: 5px; margin: 4px 0 16px; }.lesson-dots i { height: 5px; border-radius: 4px; background: #e8decb; flex: 1; }.lesson-dots i.done { background: #669b76; }
.tutorial-dialog h2 { font: 24px 'Jua',sans-serif; color: #77513a; margin: 0; outline: none; }
.lesson-instruction { font-size: 14px; line-height: 1.65; color: #72583f; margin: 12px 0 16px; min-height: 47px; }
.lesson-board { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; padding: 9px; background: #524e48; border-radius: 17px; }
.lesson-cell { position: relative; aspect-ratio: 1; border-radius: 9px; border: 0; padding: 0; display: flex; align-items: center; justify-content: center; min-width: 0; }
.lesson-cell:not(.lesson-lit)::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: #302c31bd; z-index: 4; }
.lesson-cell:disabled { opacity: 1; cursor: default; }
.lesson-target { outline: 3px solid #fffbe5; outline-offset: -3px; z-index: 5; }
.lesson-target:focus-visible { outline: 4px solid #e79635; outline-offset: 2px; }
.lesson-pointer { position: absolute; right: -5px; bottom: -8px; width: 35px; height: 40px; z-index: 6; color: #fffbe8; filter: drop-shadow(0 2px 1px #59412e88); animation: lesson-tap 1.1s infinite; pointer-events: none; }
.lesson-pointer .icon { width: 100%; height: 100%; fill: #fff1d6; stroke: #8c6247; }
@keyframes lesson-tap { 0%,100% { transform: translate(4px,4px) rotate(-20deg); } 35%,60% { transform: translate(0,0) rotate(-20deg) scale(.9); } }
.lesson-feedback { min-height: 42px; font-size: 13px; color: #426c50; line-height: 1.6; margin: 14px 0 4px; }
.tutorial-dialog .primary { margin-top: 7px; min-height: 48px; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tutorial-dialog .primary:disabled { opacity: 1; background: #e4dfd3; color: #807866; box-shadow: 0 3px #cdc5b6; }
.lesson-alternative { width: auto; height: auto; min-height: 44px; padding: 8px 12px; border-radius: 9px; font-size: 12px; margin: 8px auto 0; color: #74543b; text-decoration: underline; }
.lesson-safe { display: block; margin-top: 10px; font-size: 11px; color: #81725e; }
.lesson-complete>img { width: 160px; height: 160px; object-fit: contain; }
.lesson-complete p { font-size: 14px; line-height: 1.7; margin: 14px 0; }.lesson-tip { padding: 12px; background: #f0e9d8; border-radius: 14px; }
@media(max-width:360px) {
  .rule-card { flex-direction: column; gap: 5px; padding: 7px 2px; text-align: center; }.rule-picture { width: 27px; height: 27px; }.rule-card strong,.rule-card small { font-size: 12px; }
  .rule-picture i { font-size: 9px; }.rule-picture img { width: 11px; height: 11px; }
  .learn-row { font-size: 10px; }.learn-link { font-size: 11px; }
  .game-shell .board-wrap { padding: 8px; }.game-shell .board { gap: 3px; }.game-shell .cell { border-radius: 5px; }
  .tutorial-dialog h2 { font-size: 21px; }.lesson-instruction { font-size: 13px; }
  .tutorial-dialog .modal-content { padding: 12px 14px 16px; }.lesson-feedback { margin-top: 10px; }
}
@media(prefers-reduced-motion:reduce) {
  .panda-love { display: none; }.reacting .panda-rest { opacity: 1; }.reacting .panda-expression { opacity: 0; }
}

/* v0.10 — playful play hierarchy and a tutorial on the play surface. */
.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip-path: inset(50%)!important; white-space: nowrap!important; border: 0!important; }
.reference-game { background: #f7f2ee; color: #99635f; }
.reference-hud { display: grid; grid-template-columns: 48px 1fr 1fr 48px; align-items: center; gap: 10px; padding: calc(12px + var(--safe-top,0px)) 16px 4px; }
.reference-hud .icon-button { background: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; box-shadow: 0 5px 14px #dca37c25; color: #a27670; }
.reference-hud .icon-button>.icon { width: 29px; height: 29px; stroke-width: 3; }
.level-heading,.score-heading { color: #99635f; margin: 0; font-family: inherit; font-size: 21px; font-weight: 500; text-align: center; background: none; padding: 0; }
.level-heading span,.score-heading span { display: block; line-height: 1.2; }
.level-heading b,.score-heading b { display: block; font-size: 27px; line-height: 1.25; font-weight: 650; }
.score-heading .icon { width: 11px; height: 11px; opacity: .65; }
.life-row { display: flex; justify-content: center; padding: 3px 0 9px; }
.life-row .hearts { background: white; padding: 5px 11px; border-radius: 24px; gap: 3px; }
.life-row .heart { width: 24px; height: 25px; }
.reference-game .game-main { padding: 0 14px 18px; }
.reference-game .rule-ribbon { border: 0; border-radius: 15px; padding: 8px; gap: 6px; background: #fff; }
.reference-game .rule-card { background: #f9f2ec; color: #9b635c; border-radius: 9px; min-height: 45px; padding: 5px 3px; }
.reference-game .rule-card strong { font-weight: 500; }
.reference-game .rule-card strong,.reference-game .rule-card small { font-size: 12px; }
.board-stage { margin-top: 8px; }
.progress-tab { display: flex; justify-content: center; }
.reference-game .panda-counter { display: flex; gap: 3px; padding: 7px 12px 5px; border-radius: 24px 24px 0 0; background: #fff; border: 0; min-height: 35px; }
.progress-slot { display: inline-flex; width: 25px; height: 27px; align-items: center; justify-content: center; position: relative; }
.progress-slot img { width: 28px; height: 28px; max-width: none; }
.progress-slot.found::after { content: ''; position: absolute; bottom: 1px; right: 0; width: 6px; height: 6px; background: #bfe2a9; border-radius: 50%; border: 1px solid #fff; }
.panda-silhouette { width: 24px; height: 26px; mask: url('/assets/panda-face.webp') center/contain no-repeat; opacity: .65; }
.reference-game .board-wrap { padding: 14px; background: #fff; border: 0; border-radius: 16px; box-shadow: none; }
.reference-game .board { gap: 6px; border-radius: 5px; }
.reference-game .cell { border-radius: 5px; box-shadow: none; }
.reference-game .tools { justify-content: space-around; padding: 23px 10px 9px; }
.reference-game .tool { gap: 9px; font-weight: 500; font-size: 12px; color: #92615c; min-width: 76px; }
.reference-game .tool .tool-disc { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 5px 12px #d7a98726; }
.reference-game .tool-disc .item-icon { width: 37px; height: 39px; }
.reference-game .tool .ad-badge { position: absolute; top: -5px; right: -7px; background: #bf7768; color: #fff; border: 2px solid #f7f2ee; border-radius: 12px; padding: 5px 6px; font-size: 10px; }
.reference-game .tool:disabled .tool-disc { background: #fdfaf7; box-shadow: 0 3px 9px #d7a98718; }
.reference-game .tool:disabled .ad-badge { background: #bdb0a7; color: #fff; }
.reference-game .tool:disabled .item-icon { opacity: .5; }
.game-footer { text-align: center; margin-top: 3px; }
.game-footer .learn-link { color: #9a7770; font-size: 11px; font-weight: 400; min-height: 36px; }
.mode-settings { margin-top: 20px; text-align: left; }.mode-settings h3 { font-size: 14px; margin-bottom: 9px; }.mode-settings .mode-help { font-size: 12px; }
.settings-shortcuts { display: flex; gap: 12px; margin-top: 16px; }.settings-shortcuts button { flex: 1; min-height: 44px; }
.lesson-screen { position: relative; isolation: isolate; }
.lesson-shade { position: absolute; inset: 0; background: #272727cc; z-index: 5; pointer-events: none; }
.lesson-instruction-card { position: relative; z-index: 6; background: #fff; border-radius: 15px; padding: 9px 15px 15px; margin: 0 0 15px; text-align: center; }
.lesson-instruction-card h2 { font-size: 20px; font-weight: 550; color: #a1645e; margin: 4px 0 9px; outline: none; }
.lesson-instruction-card #lesson-instruction { margin: 0; font-size: 15px; line-height: 1.55; color: #955f59; }
.lesson-instruction-card .lesson-head { font-size: 11px; color: #ac8e83; }
.lesson-instruction-card .text-button { background: transparent; color: #a17d71; width: 32px; height: 32px; }
.lesson-stage { position: relative; z-index: 6; }
.lesson-stage .progress-tab { opacity: .2; }
.lesson-screen .board-wrap { background: #ffffff08; }
.lesson-screen .lesson-board { padding: 0; background: none; }
.lesson-screen .lesson-cell { border-radius: 5px; }
.lesson-screen .lesson-cell:not(.lesson-lit)::after { background: #252626d1; }
.lesson-screen .lesson-target { outline: 3px solid #fff; outline-offset: -3px; }
.lesson-screen .lesson-pointer { width: 47px; height: 52px; right: -10px; bottom: -16px; }
.lesson-actions { position: relative; z-index: 6; padding: 2px 10px 12px; text-align: center; }
.lesson-actions .lesson-feedback { color: #f5e5d9; min-height: 36px; margin: 12px 0 8px; }
.lesson-actions .primary { width: 100%; min-height: 47px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.lesson-actions .primary:disabled { opacity: .35; }
.lesson-actions .lesson-alternative { color: #fff2dc; background: transparent; }
.lesson-actions .lesson-safe { color: #c8bcb3; }
@media(max-width:360px) {
  .reference-hud { grid-template-columns: 42px 1fr 1fr 42px; gap: 6px; padding-left: 14px; padding-right: 14px; }.reference-hud .icon-button { width: 40px; height: 40px; }
  .level-heading,.score-heading { font-size: 18px; }.level-heading b,.score-heading b { font-size: 24px; }
  .reference-game .rule-card { flex-direction: row; text-align: left; gap: 3px; padding: 4px 1px; }.reference-game .rule-card strong,.reference-game .rule-card small { font-size: 10px; }
  .reference-game .rule-picture { width: 24px; height: 26px; }.reference-game .rule-ribbon { padding: 7px 5px; gap: 4px; }
  .reference-game .board-wrap { padding: 12px; }.reference-game .board { gap: 5px; }.reference-game .progress-slot { width: 23px; height: 25px; }
  .reference-game .tools { padding-top: 22px; }.lesson-instruction-card #lesson-instruction { font-size: 14px; }.lesson-instruction-card h2 { font-size: 18px; }
}
/* v0.10.1 — finger tip lands on the target center; one or two taps match the lesson. */
.lesson-gesture { position: absolute; inset: 0; pointer-events: none; z-index: 8; --gesture-duration: 2s; }
.lesson-hand { position: absolute; width: 48px; height: 54px; left: calc(50% - 15px); top: calc(50% - 5px); overflow: visible; filter: drop-shadow(0 3px 2px #3b271e65); transform-origin: 15px 5px; animation: finger-double var(--gesture-duration) infinite; }
.lesson-tap-ring { position: absolute; left: calc(50% - 15px); top: calc(50% - 15px); width: 30px; height: 30px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 3px #e8b64c70; opacity: 0; animation: finger-ripple var(--gesture-duration) infinite; }
.lesson-tap-ring.second-ring { animation-delay: .36s; }
.lesson-tap-label { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: max-content; padding: 5px 8px; border-radius: 20px; background: #fff8e7; color: #805142; font-size: 11px; font-weight: 800; box-shadow: 0 2px 7px #39231b33; white-space: nowrap; }
.single-tap .lesson-hand { animation-name: finger-single; }
.single-tap .second-ring { display: none; }
@keyframes finger-double { 0%,9%,70%,100% { transform: translate(8px,13px) rotate(-12deg); } 22%,40% { transform: translate(0,0) scale(.91); } 31%,53% { transform: translate(5px,9px) rotate(-6deg); } }
@keyframes finger-single { 0%,9%,65%,100% { transform: translate(8px,13px) rotate(-12deg); } 22%,30% { transform: translate(0,0) scale(.91); } 48% { transform: translate(5px,9px) rotate(-6deg); } }
@keyframes finger-ripple { 0%,17% { opacity: 0; transform: scale(.4); } 23% { opacity: 1; transform: scale(.65); } 43%,100% { opacity: 0; transform: scale(1.55); } }
.panda-love-small { left: 4%; right: auto; top: 19%; font-size: clamp(10px,3vw,17px); }
.reacting .panda-love-small { animation-duration: 1.1s; animation-delay: .12s; }
.panda-found { position: absolute; left: 50%; top: -7%; transform: translateX(-50%); background: #fff8de; color: #956044; border-radius: 14px; padding: 4px 7px; font-size: clamp(9px,2.8vw,12px); font-weight: 800; white-space: nowrap; opacity: 0; box-shadow: 0 2px 6px #80533320; }
.discovered .panda-found { animation: panda-found 1.25s both; }
@keyframes panda-found { 0%,12% { opacity: 0; transform: translate(-50%,6px) scale(.65); } 30%,72% { opacity: 1; transform: translate(-50%,-6px) scale(1); } 100% { opacity: 0; transform: translate(-50%,-12px); } }
@media(prefers-reduced-motion:reduce) { .lesson-hand { transform: none; }.lesson-tap-ring { opacity: .8; }.lesson-tap-ring.second-ring { display: none; }.panda-found { display: none; } }
/* v0.11 — one small puzzle, from the first clue to a complete board. */
.full-lesson .lesson-instruction-card { min-height: 156px; padding: 8px 15px 12px; margin-bottom: 16px; }
.full-lesson .lesson-head { gap: 7px; }
.lesson-count { margin-left: auto; background: #f5eee3; color: #937356; border-radius: 20px; padding: 4px 9px; font-weight: 700; }
.full-lesson .lesson-instruction-card h2 { margin-top: 6px; font-size: 19px; }
.full-lesson .lesson-instruction-card #lesson-instruction { font-size: 14px; min-height: 44px; }
.lesson-rule-track { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.lesson-rule-track>span { display: inline-flex; align-items: center; gap: 3px; padding: 4px 7px; border-radius: 20px; font-size: 10px; color: #aa9c93; background: #f5f1ed; }
.lesson-rule-track .icon { width: 12px; height: 12px; }
.lesson-rule-track .current { color: #426b50; background: #e3efdb; font-weight: 700; }
.full-lesson .lesson-stage .progress-tab { opacity: 1; background: transparent; }
.full-lesson .lesson-stage .panda-counter { background: #f4eee1; }
.full-lesson .lesson-stage .progress-slot:not(.found) { opacity: .4; }
.full-lesson .lesson-stage .progress-slot.found { opacity: 1; }
.full-lesson .lesson-actions { min-height: 112px; }
.full-lesson .lesson-feedback { font-size: 13px; margin: 13px 0 5px; min-height: 38px; }
.full-lesson .lesson-praise { color: #d9efb9; font-weight: 700; }
.lesson-assist { min-height: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; }
.full-lesson .lesson-alternative { font-size: 11px; margin: 0; min-height: 36px; padding: 4px 0; }
.lesson-hint { width: auto; height: auto; flex-shrink: 0; border-radius: 14px; white-space: nowrap; background: transparent; color: #ffdfa4; display: inline-flex; align-items: center; gap: 5px; padding: 5px 4px; font-size: 12px; min-height: 36px; }
.lesson-hint .icon { width: 17px; height: 17px; }
.lesson-hint:disabled { opacity: .45; }
.lesson-continuing { position: relative; margin: 10px auto 16px; width: 150px; height: 26px; color: #c6bbb0; font-size: 11px; text-align: center; }
.lesson-continuing::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: #ffffff17; border-radius: 6px; }
.lesson-continuing i { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: #c9dba4; border-radius: 6px; transform-origin: left; animation: lesson-progress 1.3s linear both; }
.lesson-departing i { animation-duration: 2.6s; }
.lesson-entry { animation: lesson-enter .4s ease-out both; }
.full-lesson .lesson-next { margin: 6px 0 4px; animation: lesson-ready .3s ease-out both; }
@keyframes lesson-ready { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes lesson-enter { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lesson-mark-in { animation: lesson-mark .35s var(--mark-delay,0s) both; }
@keyframes lesson-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lesson-mark { from { opacity: 0; transform: scale(.3); } 65% { opacity: 1; transform: scale(1.17); } to { opacity: 1; transform: scale(1); } }
.lesson-won .lesson-shade { background: #3e5144bf; }
.lesson-winner { display: block; width: 68px; height: 68px; object-fit: contain; margin: -3px auto -2px; animation: winner-sway 2.5s ease-in-out infinite; }
.lesson-won .lesson-instruction-card h2 { color: #487553; }
.lesson-won .lesson-stage .board-wrap { background: #fff8ec; }
.lesson-won .lesson-cell.marked .cross { opacity: .28; }
@media(max-width:360px) { .full-lesson .lesson-instruction-card { padding: 6px 12px 10px; min-height: 156px; }.full-lesson .lesson-instruction-card h2 { font-size: 17px; }.full-lesson .lesson-instruction-card #lesson-instruction { font-size: 13px; }.lesson-rule-track { gap: 4px; }.lesson-rule-track>span { padding: 4px 6px; } }

/* A non-interactive outgoing frame keeps scroll/layout changes out of sight. */
.lesson-transition-snapshot { overflow: hidden; }
.lesson-transition-snapshot * { animation-play-state: paused!important; }
/* v0.12 — warm paper, clear actions, and one quiet button family. */
:root { --ui-paper:#faf7f1; --ui-ink:#674f43; --ui-muted:#8b7567; --ui-line:#e9e0d4; --ui-green:#39765c; --ui-green-deep:#295b47; --ui-mint:#e8f1e6; }
.app-shell { color:var(--ui-ink); background:var(--ui-paper); }
button:focus-visible,summary:focus-visible { outline:3px solid #39765c; outline-offset:3px; }
.button { min-height:50px; border-radius:16px; padding:12px 18px; font-size:15px; gap:9px; }
.button.primary { border:1px solid #39765c; background:linear-gradient(180deg,#408066,#39765c); color:#fffefa; text-shadow:none; box-shadow:0 3px 0 #295b47,0 5px 10px #39634c12; }
.button.primary:active { transform:translateY(2px); box-shadow:0 1px 0 #295b47; }
.button.primary:disabled { background:#dce5da; border-color:#d5ded2; color:#899586; box-shadow:none; }
.button.subtle { min-height:46px; background:#f3eee6; border:1px solid var(--ui-line); color:var(--ui-ink); box-shadow:none; text-shadow:none; }
.icon-button,.reference-hud .icon-button { width:44px; height:44px; border:1px solid var(--ui-line); border-radius:15px; color:#866a58; background:#fffdf9; box-shadow:0 2px 0 #e7dfd3; flex-shrink:0; }
.icon-button>.icon,.reference-hud .icon-button>.icon { width:23px; height:23px; stroke-width:2; }
.close-app { width:44px; height:44px; border:0; background:transparent; box-shadow:none; color:#957d6c; }
.topbar { gap:10px; }.header-actions { gap:4px; }
.progress-pill { border:1px solid var(--ui-line); background:#fffdf9; box-shadow:none; color:#7d6757; }
.home-shell { background:radial-gradient(ellipse at 50% 34%,#fffdf5 12%,#f8f1df 100%); }
.home-shell::before { opacity:.12; }
.title-logo .royal-wordmark strong { -webkit-text-stroke:3px #fffaf0; filter:drop-shadow(0 2px 0 #d5b88e); }
.title-logo .royal-wordmark small { color:#92734f; }.title-logo .brand-tagline { color:#846d56; }
.stage-label { background:#f1e6cf; border:1px solid #e8d8b8; border-radius:20px; padding:6px 17px; box-shadow:none; color:#806347; }
.stage-label::before,.stage-label::after { display:none; }
.home-shell .play-button { min-height:64px; border-radius:19px; padding:12px 20px; }
.home-shell .play-button strong { font-size:27px; text-shadow:none; }
.play-button::after { display:none; }.play-end { background:#ffffff19; box-shadow:none; width:29px; height:29px; }
.play-note { font-size:11px; color:#8b7565; margin-top:13px; }
.daily-card { min-height:68px; border:1px solid #e5d5b0; background:#f7ebcd; box-shadow:0 2px 0 #e0cfac; border-radius:17px; }
.daily-card::before,.daily-card::after { display:none; }.daily-card>span>strong { color:#795b37; }.daily-card>span>small { color:#896d4f; font-size:11px; }
.calendar-sticker { box-shadow:0 2px #dbc79d; transform:rotate(-5deg); }
.bottom-nav { background:#fffdf8; border-top:1px solid var(--ui-line); box-shadow:none; padding-top:9px; }
.nav-item { color:#947c67; border-radius:15px; font-size:11px; }
.nav-item.selected { background:var(--ui-mint); color:#356b51; box-shadow:none; }
.nav-item.selected .icon { fill:none; stroke-width:2.2; }.nav-item .icon { width:23px; height:23px; }
.reference-game { background:#f8f5f0; color:var(--ui-ink); }
.reference-hud { padding-top:calc(14px + var(--safe-top)); gap:10px; }
.reference-hud .icon-button { border-radius:50%; }
.level-heading,.score-heading { font-size:13px; font-weight:600; color:#876e5f; }
.level-heading b,.score-heading b { font-family:'Jua',sans-serif; font-size:28px; font-weight:400; line-height:1.3; color:#6d5143; }
.score-heading { min-height:48px; border-radius:12px; }.score-heading .icon { width:12px; height:12px; opacity:.8; }
.life-row { padding:5px 0 12px; }.life-row .hearts { padding:5px 12px; background:#fffdf9; border:1px solid #eee5da; }
.life-row .heart { width:22px; height:23px; filter:none; }
.reference-game .rule-ribbon { padding:7px; gap:5px; border:1px solid #eee6db; background:#fffdf9; border-radius:16px; }
.reference-game .rule-card { background:#f5efe5; color:#87634c; padding:6px 3px; border-radius:10px; min-height:47px; }
.reference-game .rule-card strong { font-weight:650; }.reference-game .rule-card small { color:#92745e; }
.reference-game .board-wrap { border-radius:20px; box-shadow:0 2px 0 #eee5d9; }
.reference-game .cell { border-radius:7px; }
.reference-game .tools { gap:12px; justify-content:space-evenly; padding:20px 8px 8px; }
.reference-game .tool { min-width:74px; flex:1; gap:6px; padding:0 2px 4px; font-size:12px; font-weight:650; color:#785b49; }
.reference-game .tool .tool-disc { width:62px; height:62px; border:1px solid #e7ddcd; background:#fffdf8; box-shadow:0 3px 0 #e4d9c8; }
.reference-game .hint-tool:not(:disabled) .tool-disc { background:#f9edc8; border-color:#ebd79b; box-shadow:0 3px 0 #e3cb89; }
.reference-game .tool-disc .item-icon { width:34px; height:36px; filter:none; }
.reference-game .tool .ad-badge { position:static; background:#eee8de; color:#7d6a59; border:0; border-radius:20px; padding:4px 7px; font-size:10px; font-weight:500; gap:3px; }
.reference-game .tool:disabled { color:#9a8b7a; }
.reference-game .tool:disabled .tool-disc { background:#f1ece4; border-color:#e7dfd3; box-shadow:0 2px 0 #e5dccf; }
.reference-game .tool:disabled .ad-badge { background:#eee9e1; color:#9a8b7a; }
.reference-game .tool:disabled .item-icon { opacity:.45; }
.reference-game .tool:active:not(:disabled) .tool-disc { box-shadow:0 1px 0 #d2c4ad; }
.game-footer { margin-top:6px; }
.game-footer .learn-link { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; padding:7px 13px; border:1px solid var(--ui-line); border-radius:20px; background:#fdfaf5; color:#88725e; text-decoration:none; font-size:12px; }
.game-footer .learn-link .icon { width:15px; height:15px; }
.journey-shell { background:var(--ui-paper); }.journey-heading h1 { color:#6d5143; }.journey-heading .muted,.journey-heading .eyebrow { color:#8d7562; }
.stage-pager button { width:44px; height:44px; }.stage-pager strong { color:#786046; font-size:22px; }
.chapter { border:1px solid #e6dac6; background:#fffdf8; box-shadow:0 2px 0 #e6dac6; }
.chapter-body { background-image:none; }
.level-tile { border-width:2px; background:#faf5e9; box-shadow:0 2px #d8c7a9; }
.level-tile::before { border-color:#e4d6c0; border-width:2px; }
.level-tile.locked { background:#f1ece2; color:#b0a18a; border-color:#e7dece; box-shadow:0 2px #e1d6c3; }
.level-tile.current { background:#488569; border-color:#77aa88; box-shadow:0 3px #315f49,0 0 0 3px #e7efdc; }
.level-tile.completed { background:#f4e2b6; border-color:#e6cd95; box-shadow:0 2px #d8bf89; }
.current-flag { background:#e9d9af; color:#785f39; box-shadow:none; }
.stage-search { border-color:var(--ui-line); }.stage-jump input { background:#fffdf9; border:1px solid #e1d6c5; border-radius:12px; padding:10px; }
.stage-jump button { border-radius:12px; background:var(--ui-mint); border:1px solid #d7e4d1; color:#3d6a50; }
dialog { background:#fffdf8; border:1px solid #e6dac9; border-radius:24px; box-shadow:0 16px 60px #493a3429; }
dialog::backdrop { background:#352f2b60; backdrop-filter:blur(3px); }
.modal-content { padding:22px; }.modal-head { gap:12px; }.modal-head h2 { font-size:22px; color:#684e3d; }
.modal-content>.muted { color:#8a7360; font-size:13px; line-height:1.6; }
.setting-row { min-height:68px; padding:14px 0; border-bottom:1px solid #eee6da; color:#6e5543; gap:12px; }
.setting-row strong { font-size:15px; }.setting-row small { color:#8d7765; font-size:12px; line-height:1.5; margin-top:4px; }
.switch { flex-shrink:0; background:#dfd7cb; width:42px; height:25px; }.switch.on { background:#508666; }.switch:before { background:#fffefb; }
.mode-settings .input-modes { background:#f0ece4; border:1px solid #e6ddce; box-shadow:none; border-radius:15px; padding:4px; }
.mode-settings .mode { border-radius:11px; font-size:11px; padding:8px 4px; }
.mode-settings .mode.active { background:#e0ecda; color:#39634a; border-color:#bed4b3; box-shadow:none; }.mode-settings .mode.active::after { color:#39634a; }
.mode-settings .mode-help { color:#8b7562; font-size:12px; }
.settings-shortcuts { gap:8px; }.settings-shortcuts .button { font-size:12px; padding:10px 7px; }
.settings-shortcuts [data-action="exit"] { background:#f6ece5; border-color:#eeddd1; color:#9a6b56; }
.settings-note { color:#9b8b7c; line-height:1.7; margin-top:20px; }
.result-dialog { border:1px solid #e6d3af; box-shadow:0 16px 60px #493a3429; }
.result-dialog .result-stats { background:#f4eee2; }.result-stats small { color:#8a7157; }
.guide-rule p,.guide-intro,.guide-touch p { color:#8b7461; line-height:1.7; }.lesson-start { color:#41694f; background:var(--ui-mint); border:1px solid #d9e7d2; }
.full-lesson .lesson-next { border-radius:16px; }.full-lesson .lesson-instruction-card { box-shadow:0 3px 12px #1c1b1810; }
@media(max-width:360px) {
 .reference-hud { gap:6px; }.level-heading,.score-heading { font-size:12px; }.level-heading b,.score-heading b { font-size:26px; }
 .reference-game .rule-card strong,.reference-game .rule-card small { font-size:10px; }.reference-game .tool { min-width:70px; }.reference-game .tools { gap:7px; padding-left:4px; padding-right:4px; }
 .modal-content { padding:18px; }.settings-shortcuts .button { font-size:11px; }.mode-settings .mode { font-size:10px; }.home-shell .play-button strong { font-size:25px; }
}
/* v0.13 — a single tactile toy console, scoped to the actual puzzle screen. */
.toy-game {
  background-color:#f3f3ee;
  background-image:none;
  color:#655641;
}
.toy-game::before { display:none; }
.toy-game .reference-hud,.toy-game .life-row,.toy-game .game-main { position:relative; }
.toy-game .reference-hud { grid-template-columns:46px 1fr 1fr 46px; gap:14px; padding:calc(13px + var(--safe-top)) 20px 2px; align-items:center; }
.toy-game .reference-hud .icon-button { width:44px; height:44px; border-radius:50%; background:linear-gradient(150deg,#fffdf0,#eee4c9); border:2px solid #fbf8e7; color:#807459; box-shadow:0 3px 0 #b9c3a8,0 5px 7px #718b6222,inset 0 -2px #dbd9be; }
.toy-game .reference-hud .icon-button>.icon { width:22px; height:22px; stroke-width:2.5; filter:drop-shadow(0 1px #fff8); }
.toy-game .reference-hud .icon-button:active { transform:translateY(2px); box-shadow:0 1px #aebd9c; }
.toy-game .level-heading { color:#3e5748; font-size:12px; letter-spacing:.5px; text-shadow:0 1px #fff8; }
.toy-game .level-heading b { font:36px/1.05 'Jua',sans-serif; color:#305d45; text-shadow:0 2px #f7f6e1,0 3px #9db38b55; }
.toy-game .score-heading { min-height:48px; border:1px solid #c1ceb0; border-radius:17px; padding:5px 9px; background:#e5eddd; box-shadow:inset 0 2px 3px #9cab8333,0 1px #ffffdfc0; color:#46573c; }
.toy-game .score-heading span { font-size:12px; letter-spacing:.4px; }
.toy-game .score-heading b { font:25px/1.1 'Jua',sans-serif; color:#36573b; text-shadow:0 1px #eef3d6; }
.toy-game .life-row { padding:7px 0 11px; }
.toy-game .life-row .hearts { gap:5px; background:#fffdf7; border:1px solid #bfd0af; box-shadow:inset 0 2px 3px #83986b30,0 1px #f9f8e7; padding:5px 12px; }
.toy-game .life-row .heart { width:21px; height:22px; filter:drop-shadow(0 1px 0 #b68e6d); }
.toy-game .game-main { padding:0 10px 14px; }
.toy-console { position:relative; border:1px solid #e1dac8; border-radius:27px; padding:10px 6px 14px; background:#fffcf3; box-shadow:0 4px 0 #d7d3c3,0 7px 12px #70634314; }
.toy-console::before,.toy-console::after { content:''; position:absolute; bottom:9px; width:5px; height:5px; background:#c6b99d; border-radius:50%; box-shadow:inset 0 1px 1px #a89d84,0 1px #fff7df; pointer-events:none; }
.toy-console::before { left:14px; }.toy-console::after { right:14px; }
.toy-game .rule-ribbon { padding:2px 0 8px; gap:0; border:0; border-radius:0; background:none; box-shadow:none; }
.toy-game .rule-card { min-height:43px; padding:4px 3px; gap:5px; background:none; border:0; border-radius:10px; color:#806746; }
.toy-game .rule-card+ .rule-card { border-left:1px solid #e1d4b8; border-radius:0 10px 10px 0; }
.toy-game .rule-card strong { color:#51442f; font-weight:700; font-size:13px; text-shadow:none; }
.toy-game .rule-card small { color:#675238; font-size:13px; margin-top:3px; }
.toy-game .rule-picture { width:28px; height:28px; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(3,minmax(0,1fr)); gap:1.5px; transform:none; }
.toy-game .rule-picture i { position:relative; min-width:0; min-height:0; border-radius:2px; background:#e0d2b5; box-shadow:inset 0 1px #fff8,0 1px #c6b08b; font-size:9px; line-height:8px; }
.toy-game .rule-picture .example-blocked { background:#90613f; }.toy-game .rule-picture .example-panda { background:#a6be87; }
.toy-game .rule-picture img { position:absolute; width:12px; height:12px; left:50%; top:50%; margin:0; transform:translate(-50%,-50%); }
.toy-game .board-stage { margin-top:0; }
.toy-game .progress-tab { padding:0 0 6px; }
.toy-game .panda-counter { gap:7px; min-height:32px; padding:4px 10px; border-radius:18px; border:1px solid #dfd1b2; background:#eee7d4; box-shadow:inset 0 2px 3px #b1a27b26,0 1px #fffcf0; }
.toy-game .progress-slot { width:23px; height:24px; border-radius:50%; background:#faf6eb; box-shadow:inset 0 1px 2px #9e8b5b30,0 1px #fff4d2; }
.toy-game .panda-silhouette { width:20px; height:21px; opacity:1; }
.toy-game .progress-slot.found { background:#faf1d3; box-shadow:0 1px 2px #a08a5540; }
.toy-game .progress-slot img { width:29px; height:29px; filter:drop-shadow(0 1px #ac8a5740); }
.toy-game .progress-slot.found::after { width:5px; height:5px; bottom:-1px; right:-1px; background:#8ebd72; }
.toy-game .board-wrap { padding:7px 7px 10px; border:1px solid #e1dccf; border-radius:18px; background:#fff; box-shadow:inset 0 2px 3px #76695018,0 2px #e4ddca; }
.toy-game .board { gap:7px; background:none; border-radius:12px; overflow:visible; }
.toy-game :is(.cell,.lesson-cell) { border-radius:clamp(5px,calc(40px / var(--size)),10px); border:0; background-image:none; box-shadow:inset 0 2px 0 #ffffff55,0 2px 0 #65584440; transition:transform .12s ease,filter .12s ease; }
.toy-game :is(.cell,.lesson-cell):active { transform:translateY(2px) scale(.98); box-shadow:inset 0 1px #fff7,0 1px #666d5566; }
.toy-game :is(.cell,.lesson-cell).marked { background-image:none; box-shadow:inset 0 1px 2px #58433115,0 1px 0 #666d5555; transform:translateY(1px); }
.toy-game :is(.cell,.lesson-cell).has-panda { box-shadow:inset 0 0 0 2px #fff5d590,inset 0 2px #ffffff90,0 3px 0 #666d5555,0 5px 5px #58604920; }
.toy-game .cross { font-size:clamp(28px,calc(200px / var(--size)),50px); color:#fffdf4; text-shadow:0 2px 0 #75624f38; }
.toy-game .tools { position:relative; margin:10px 2px 0; padding:10px 3px 0; gap:10px; border-top:1px solid #dfd0b1; box-shadow:0 -1px #fff8e2; }
.toy-game .tool { min-width:68px; padding-bottom:0; gap:5px; color:#58462d; }
.toy-game .tool-name { font:14px/1.1 'Jua',sans-serif; letter-spacing:.1px; margin-top:2px; }
.toy-game .tool .tool-disc { width:56px; height:56px; border:2px solid #fffbeb; background:linear-gradient(145deg,#e4edd1,#bfcfa4); box-shadow:inset 0 -3px #acbf8d,0 4px 0 #9aab7a,0 6px 5px #8b805d20; }
.toy-game .hint-tool:not(:disabled) .tool-disc { background:linear-gradient(145deg,#fff1ae,#efd078); border-color:#fff9d3; box-shadow:inset 0 -3px #dfb95a,0 4px 0 #c4a34b,0 6px 5px #8b805d20; }
.toy-game .tool[data-action="clear"]:not(:disabled) .tool-disc { background:linear-gradient(145deg,#f6dfc7,#dfb99a); border-color:#fff0d9; box-shadow:inset 0 -3px #cba381,0 4px 0 #b68e6e,0 6px 5px #8b805d20; }
.toy-game .tool-disc .item-icon { width:32px; height:34px; filter:drop-shadow(0 1px 0 #fff7); }
.toy-game .tool .ad-badge { padding:3px 7px; background:#eee5cf; color:#68512f; font-size:11px; border-radius:7px; box-shadow:inset 0 1px #d7c8a7,0 1px #fff6dc; }
.toy-game .tool:disabled { color:#a09275; }.toy-game .tool:disabled .tool-disc { background:linear-gradient(#e9e3d1,#d8d0b9); border-color:#f6efdb; box-shadow:inset 0 -2px #c8c0a6,0 3px #bbb294; }
.toy-game .tool:disabled .ad-badge { background:#e7ddc6; color:#a09175; }.toy-game .tool:disabled .item-icon { opacity:.42; filter:grayscale(.6); }
.toy-game .tool:active:not(:disabled) .tool-disc,.toy-game .tool.is-pressed .tool-disc { transform:translateY(3px); box-shadow:inset 0 -1px #99825330,0 1px #a28c60; }
.toy-game .game-footer { margin-top:19px; }
.toy-game .game-footer .learn-link { min-height:38px; padding:6px 14px; border:0; background:none; color:#4d6550; box-shadow:none; font-size:12px; text-shadow:0 1px #eef1d9; }
@media(max-width:360px) {
 .toy-game .reference-hud { padding-left:16px; padding-right:16px; gap:9px; }.toy-game .level-heading b { font-size:32px; }
 .toy-game .game-main { padding-left:9px; padding-right:9px; }.toy-console { padding:9px 5px 13px; border-radius:24px; }
 .toy-game .rule-card { gap:3px; padding:4px 1px; }.toy-game .rule-card strong,.toy-game .rule-card small { font-size:12px; }.toy-game .rule-picture { width:23px; height:25px; }
 .toy-game .board-wrap { padding:5px 5px 8px; border-radius:16px; }.toy-game .board { gap:5px; }.toy-game .panda-counter { gap:5px; }
 .toy-game .tools { gap:6px; padding-top:10px; }.toy-game .tool .tool-disc { width:52px; height:52px; }.toy-game .tool-name { font-size:13px; }
}

/* Clear region colors sit against white gaps; only the lower edge adds depth. */
.toy-game .color-0 { background-color:#b58add; }
.toy-game .color-1 { background-color:#58b4da; }
.toy-game .color-2 { background-color:#9bcb78; }
.toy-game .color-3 { background-color:#e9bd3f; }
.toy-game .color-4 { background-color:#ec9fbe; }
.toy-game .color-5 { background-color:#efa77b; }
.toy-game .color-6 { background-color:#aaa6d9; }
.toy-game .color-7 { background-color:#6bc7b9; }
.toy-game .region-number { color:#463e32; font-weight:700; line-height:1.2; top:2px; left:3px; }

/* Settings and outcomes are readable parts of the same toy, with distinct moods. */
dialog:is(.settings-dialog,.result-dialog) { background:#fffcf3; color:#514934; width:calc(100% - 28px); max-height:calc(100dvh - 28px); border:1px solid #ded6c3; border-radius:26px; box-shadow:0 5px #c8c1af,0 18px 50px #263c3438; }
dialog:is(.settings-dialog,.result-dialog)::backdrop { background:#263c3466; backdrop-filter:blur(3px); }
.settings-dialog { overflow:hidden; }
.settings-dialog .modal-content { padding:20px; display:flex; flex-direction:column; max-height:calc(100dvh - 32px); }
.settings-dialog .modal-head,.settings-dialog .modal-head+.muted,.settings-dialog .settings-shortcuts,.settings-dialog .settings-note { flex-shrink:0; }
.settings-dialog .settings-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#adbda0 #f0ecdf; padding:0 4px 4px; margin:0 -4px; }
.settings-dialog .modal-head h2 { color:#354d3b; font:26px/1.3 'Jua',sans-serif; }
.settings-dialog .modal-head .icon-button { width:44px; height:44px; border-radius:50%; border-color:#ded6c3; background:#fffefa; color:#65533b; box-shadow:0 2px #d7d3c3; }
.settings-dialog .modal-head+.muted { color:#655a45; font-size:14px; margin-top:5px; margin-bottom:10px; }
.settings-dialog .setting-row { min-height:76px; padding:14px 0; gap:10px; border-color:#e1dac8; color:#514934; }
.settings-dialog .setting-row strong { font-size:16px; line-height:1.4; }
.settings-dialog .setting-row small { font-size:13px; line-height:1.5; color:#6a5d45; margin-top:4px; word-break:keep-all; }
.settings-dialog .setting-toggle { display:flex; flex-direction:column; align-items:center; gap:4px; flex-shrink:0; }
.settings-dialog .setting-toggle small { margin:0; font-size:11px; line-height:1.2; font-weight:600; }
.settings-dialog .setting-row[aria-checked="true"] .setting-toggle small { color:#315d45; }
.settings-dialog .switch { background:#c8c4b8; box-shadow:inset 0 2px 3px #6d655426; }
.settings-dialog .switch.on { background:#3c7054; }
.settings-dialog .switch:before { background:#fffdf3; }
.settings-dialog .mode-settings { margin-top:19px; }
.settings-dialog .mode-settings h3 { color:#514934; font-size:15px; margin-bottom:9px; }
.settings-dialog .input-modes { background:#ece9dc; border-color:#ddd6c3; gap:5px; }
.settings-dialog .mode { flex-direction:column; gap:4px; min-height:66px; font-size:12px; color:#655a45; padding:7px 3px; }
.settings-dialog .mode.active { background:#3c7054; color:#fff; border-color:#315d45; box-shadow:inset 0 1px #76a286,0 2px #294c39; }
.settings-dialog .mode.active::after { color:#fff; right:5px; top:3px; }
.settings-dialog .mode-help { color:#655a45; font-size:13px; line-height:1.6; word-break:keep-all; margin-top:10px; }
.settings-dialog .settings-shortcuts { gap:10px; margin-top:18px; }
.settings-dialog .settings-shortcuts .button { min-height:48px; font-size:13px; border-radius:14px; padding:10px 6px; }
.settings-dialog .settings-shortcuts [data-action="tutorial"] { background:#e5eddd; color:#315d45; border-color:#c6d4bc; box-shadow:0 2px #c6d4bc; }
.settings-dialog .settings-shortcuts [data-action="exit"] { background:#f6e9df; color:#83543c; border-color:#e3cbbb; box-shadow:0 2px #e3cbbb; }
.settings-dialog .settings-note { color:#70654e; font-size:11px; line-height:1.7; margin-top:18px; }
.result-dialog .modal-content { padding:20px; }
.result-dialog .result-eyebrow { color:#65502c; font-size:13px; letter-spacing:.5px; margin-bottom:7px; }
.result-dialog .result-scene { height:180px; margin-bottom:9px; }
.result-dialog .result-character { width:180px; height:180px; }
.result-dialog .result-ribbon { background:#f5dfa0; border:1px solid #e1c67e; color:#71501d; transform:none; border-radius:12px; font-size:13px; line-height:1.4; padding:6px 14px; margin-bottom:12px; box-shadow:0 2px #e5d19a; }
.result-dialog h2 { color:#354d3b; font-size:24px; line-height:1.35; margin-bottom:8px; word-break:keep-all; }
.result-dialog .muted { color:#655a45; font-size:14px; line-height:1.6; word-break:keep-all; }
.result-dialog .result-stats { background:#eeeede; border:1px solid #dcdcc5; border-radius:16px; padding:13px 5px; margin:17px 0 0; }
.result-dialog .result-stats>div { flex:1; min-width:0; }
.result-dialog .result-stats>div+div { border-left:1px solid #d5d7be; }
.result-dialog .result-stats strong { color:#365d46; font:25px/1.2 'Jua',sans-serif; }
.result-dialog .result-stats small { color:#5f5a43; font-size:12px; margin-top:5px; }
.result-dialog .primary { background:#3c7054; border:1px solid #315d45; color:#fff; box-shadow:inset 0 2px #76a286,0 4px #294c39; min-height:52px; font:20px/1.3 'Jua',sans-serif; border-radius:16px; margin-top:19px; padding:12px; }
.result-dialog .primary:active { transform:translateY(3px); box-shadow:0 1px #294c39; }
.result-dialog .button.subtle { background:#f3efe3; border-color:#dfd6c3; color:#65533b; min-height:44px; font-size:14px; border-radius:14px; margin-top:10px; padding:10px; }
.result-loss .result-eyebrow { color:#705085; }
.result-loss .result-ribbon { background:#eee3f5; border-color:#d7c4e4; color:#67467d; box-shadow:0 2px #dccae6; }
.result-loss h2 { color:#5e436f; }
.result-loss .tantrum-cry { color:#705085; font-size:16px; right:2px; }
.result-loss .retry-hearts { background:#f0e9f5; border:1px solid #dfd2e9; border-radius:16px; margin-top:15px; padding:12px 8px; }
.result-loss .retry-hearts small { color:#674f76; font-size:12px; line-height:1.5; }
.result-loss .primary { background:#75558a; border-color:#614473; box-shadow:inset 0 2px #a58ab4,0 4px #533763; }
.result-loss .primary:active { box-shadow:0 1px #533763; }
@media(max-width:360px), (max-height:700px) {
 .settings-dialog .modal-content { padding:17px; }
 .settings-dialog .setting-row { padding:12px 0; }
 .result-dialog .modal-content { padding:16px; }
 .result-dialog .result-scene { height:138px; margin-bottom:6px; }
 .result-dialog .result-character { width:138px; height:138px; }
 .result-dialog .tantrum-cloud,.result-dialog .celebration-halo { width:120px; height:120px; }
 .result-dialog .victory-rays { width:165px; height:165px; }
 .result-dialog h2 { font-size:21px; }
 .result-dialog .muted { font-size:13px; }
 .result-dialog .result-ribbon { margin-bottom:10px; padding:5px 12px; }
 .result-dialog .result-stats { padding:10px 3px; margin-top:13px; }
 .result-dialog .result-stats strong { font-size:23px; }
 .result-dialog .primary { margin-top:15px; min-height:50px; }
 .result-dialog .button.subtle { margin-top:8px; }
}

/* Rules and pause use the same clear board surfaces and action hierarchy. */
dialog:is(.pause-dialog,.guide-dialog) { width:calc(100% - 28px); max-height:calc(100dvh - 28px); background:#fffcf3; color:#514934; border:1px solid #ded6c3; border-radius:26px; box-shadow:0 5px #c8c1af,0 18px 50px #263c3438; }
dialog:is(.pause-dialog,.guide-dialog)::backdrop { background:#263c3466; backdrop-filter:blur(3px); }
:is(.pause-dialog,.guide-dialog) .modal-content { padding:22px; }
:is(.pause-dialog,.guide-dialog,.guide-screen) .button.primary { background:#3c7054; border:1px solid #315d45; color:#fff; box-shadow:inset 0 2px #76a286,0 4px #294c39; font:20px/1.3 'Jua',sans-serif; min-height:52px; border-radius:16px; }
:is(.pause-dialog,.guide-dialog,.guide-screen) .button.primary:active { transform:translateY(3px); box-shadow:0 1px #294c39; }
.pause-dialog .pause-eyebrow { display:block; color:#4e6342; font-size:13px; font-weight:700; margin-bottom:18px; }
.pause-dialog .pause-symbol { width:72px; height:72px; margin:0 auto 18px; border:1px solid #c6d4bc; border-radius:23px; background:#e5eddd; color:#365d46; box-shadow:inset 0 2px #fbfff5,0 3px #c6d4bc; }
.pause-dialog .pause-symbol .icon { width:32px; height:32px; }
.pause-dialog .pause-time { display:flex; align-items:center; justify-content:center; gap:12px; width:max-content; margin:0 auto 20px; padding:8px 17px; border:1px solid #ddd6c3; border-radius:14px; background:#eeeede; }
.pause-dialog .pause-time span { font-size:12px; color:#5f5a43; }
.pause-dialog .pause-time strong { font:27px/1.2 'Jua',sans-serif; color:#365d46; font-variant-numeric:tabular-nums; }
.pause-dialog h2 { font:25px/1.35 'Jua',sans-serif; color:#354d3b; word-break:keep-all; margin-bottom:9px; }
.pause-dialog .muted { color:#655a45; font-size:14px; line-height:1.65; word-break:keep-all; }
.pause-dialog .primary { margin-top:24px; }
.pause-dialog .primary>.icon { width:20px; height:20px; }
.pause-dialog .button.subtle { min-height:46px; font-size:14px; background:#f3efe3; border-color:#dfd6c3; color:#65533b; border-radius:14px; margin-top:11px; }
.guide-screen .guide-main { padding:14px 14px 12px; display:flex; flex-direction:column; justify-content:center; }
.guide-screen .bottom-nav { flex-shrink:0; }
.guide-content { padding:16px 15px; background:#fffcf3; border:1px solid #e1dac8; border-radius:25px; box-shadow:0 4px #d7d3c3; }
.guide-content .guide-heading { display:flex; align-items:center; gap:10px; text-align:left; }
.guide-content .guide-heading>img { width:36px; height:36px; margin:0; flex-shrink:0; }
.guide-content .section-kicker { display:block; color:#655a45; font-size:12px; margin-bottom:4px; }
.guide-content .guide-heading h2 { color:#354d3b; font:23px/1.3 'Jua',sans-serif; }
.guide-content .guide-intro { color:#655a45; font-size:14px; line-height:1.6; word-break:keep-all; margin-top:9px; }
.guide-content .lesson-start { min-height:48px; margin:12px 0 3px; padding:10px; font-size:16px; }
.guide-content .guide-rule { display:flex; align-items:center; gap:12px; margin:9px 0 0; padding:9px 0 0; border-top:1px solid #e1dac8; }
.guide-rule-copy { min-width:0; }
.guide-rule-copy h3 { color:#354d3b; font-size:15px; line-height:1.45; word-break:keep-all; }
.guide-rule-copy p { margin:5px 0 0; color:#514934; font-size:14px; line-height:1.5; word-break:keep-all; }
.guide-rule-title { display:flex; align-items:center; gap:10px; }
.guide-rule-title>b { display:flex; align-items:center; justify-content:center; flex-shrink:0; width:30px; height:30px; border:1px solid #c6d4bc; border-radius:10px; background:#e5eddd; color:#365d46; font:16px 'Jua',sans-serif; box-shadow:0 2px #d3dfc9; }
.guide-rule-title h3 { font-size:16px; line-height:1.45; color:#354d3b; word-break:keep-all; }
.guide-rule-body { display:flex; align-items:center; gap:13px; margin-top:14px; }
.guide-rule-body p { margin:0; font-size:14px; line-height:1.7; color:#514934; word-break:keep-all; flex:1; }
.guide-example { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(3,minmax(0,1fr)); gap:2px; flex-shrink:0; width:64px; height:64px; padding:3px; border:1px solid #ddd6c3; border-radius:10px; background:#fff; box-shadow:0 2px #e0d9c7; }
.guide-example-cell { display:flex; position:relative; min-width:0; min-height:0; align-items:center; justify-content:center; aspect-ratio:1; border-radius:4px; color:#fff; font-size:20px; font-weight:750; line-height:1; font-style:normal; box-shadow:inset 0 1px #ffffff60,0 1px #65584435; }
.guide-example-cell img { width:100%; height:100%; object-fit:contain; }
.guide-content .color-0 { background:#b58add; }.guide-content .color-1 { background:#58b4da; }.guide-content .color-2 { background:#9bcb78; }
.guide-content .guide-touch { margin:9px 0 0; padding:9px 0 0; border-radius:0; background:none; border-top:1px solid #e1dac8; text-align:left; }
.guide-content .guide-touch h3 { color:#354d3b; font-size:17px; }
.guide-tap-options { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0 0 6px; }
.guide-tap-options>span { display:flex; align-items:center; gap:6px; padding:7px 6px; border-radius:13px; background:#e9efdf; border:1px solid #d3ddc6; }
.guide-tap-options b { width:28px; text-align:center; font-size:29px; line-height:1; color:#365d46; }
.guide-tap-options img { width:29px; height:29px; object-fit:contain; }
.guide-tap-options strong { font-size:14px; line-height:1.4; color:#354d3b; }
.guide-tap-options small { display:block; color:#596449; font-size:12px; font-weight:400; margin-top:2px; }
.guide-content .guide-touch p { color:#655a45; font-size:13px; line-height:1.7; word-break:keep-all; }
.guide-screen .guide-main>.primary { margin-top:14px; }
.guide-dialog .guide-content { padding:0; border:0; border-radius:0; box-shadow:none; }
.guide-modal-close { display:flex; justify-content:flex-end; margin-bottom:-8px; }
.guide-modal-close .icon-button { border-radius:50%; background:#fffefa; color:#65533b; border-color:#ded6c3; box-shadow:0 2px #d7d3c3; }
.guide-dialog .primary { margin-top:22px; }
@media(max-width:360px) {
 :is(.pause-dialog,.guide-dialog) .modal-content { padding:18px; }
 .pause-dialog h2 { font-size:23px; }
 .guide-screen .guide-main { padding-left:12px; padding-right:12px; }
 .guide-content { padding:14px 12px; }
 .guide-content .guide-heading h2 { font-size:21px; }
 .guide-content .guide-intro { font-size:13px; }
 .guide-content .lesson-start { font-size:16px; }
 .guide-rule-title { gap:8px; }.guide-rule-title h3 { font-size:15px; }
 .guide-rule-body { gap:10px; }
 .guide-example { width:60px; height:60px; }
 .guide-example-cell { font-size:18px; }
 .guide-rule-body p { font-size:13px; line-height:1.65; }
 .guide-tap-options>span { padding:7px 6px; gap:5px; }
 .guide-tap-options strong { font-size:14px; }
 .guide-tap-options b,.guide-tap-options img { width:25px; }
}

@media(max-height:650px) and (max-width:599px) {
 .guide-screen .guide-main { padding-top:8px; padding-bottom:8px; }
 .guide-screen .guide-content { padding:12px; }
 .guide-screen .guide-content .guide-rule { margin-top:5px; padding-top:5px; }
 .guide-screen .guide-content .lesson-start { margin-top:8px; }
 .guide-screen .bottom-nav { padding:5px 12px 7px; }
 .guide-screen .bottom-nav .nav-item { min-height:48px; gap:3px; }
 .guide-screen .bottom-nav .icon { width:23px; height:23px; }
}

/* Item offers and exit confirmation keep their conditions easy to read. */
dialog:is(.item-dialog,.exit-dialog) { width:calc(100% - 28px); max-height:calc(100dvh - 28px); background:#fffcf3; color:#514934; border:1px solid #ded6c3; border-radius:26px; box-shadow:0 5px #c8c1af,0 18px 50px #263c3438; }
dialog:is(.item-dialog,.exit-dialog)::backdrop { background:#263c3466; backdrop-filter:blur(3px); }
:is(.item-dialog,.exit-dialog) .modal-content { padding:22px; }
:is(.item-dialog,.exit-dialog) h2 { color:#354d3b; font:25px/1.35 'Jua',sans-serif; word-break:keep-all; margin-bottom:10px; }
:is(.item-dialog,.exit-dialog) .muted { color:#655a45; font-size:14px; line-height:1.65; word-break:keep-all; }
.item-dialog .section-kicker,.exit-eyebrow { display:block; font-size:13px; font-weight:600; color:#655a45; margin-bottom:17px; }
.item-emblem,.exit-emblem { width:76px; height:76px; display:flex; align-items:center; justify-content:center; border-radius:24px; margin:0 auto 20px; border:1px solid #e1c67e; background:#f5dfa0; box-shadow:inset 0 2px #fff3cf,0 3px #d9bf7d; }
.item-emblem .item-icon { width:46px; height:46px; }
.offer-undo .item-emblem { background:#e5eddd; border-color:#c6d4bc; box-shadow:inset 0 2px #fbfff5,0 3px #c6d4bc; }
.offer-clear .item-emblem { background:#f5dfc9; border-color:#ddbea1; box-shadow:inset 0 2px #fff1e1,0 3px #d3b496; }
.item-description { color:#514934; font-size:14px; line-height:1.65; word-break:keep-all; }
.item-reward-note,.exit-save-note { display:flex; align-items:center; justify-content:center; gap:8px; padding:12px 10px; margin-top:18px; border:1px solid #d3ddc6; border-radius:14px; background:#e9efdf; color:#365d46; font-size:13px; line-height:1.6; word-break:keep-all; }
.item-reward-note>.icon,.exit-save-note>.icon { width:18px; height:18px; flex-shrink:0; }
.item-dialog .ad-unavailable { color:#66543a; background:#f3eddf; border:1px solid #dfd6c3; border-radius:14px; padding:11px 10px; margin-top:11px; font-size:13px; line-height:1.6; }
.item-dialog .ad-unavailable strong { display:block; font-size:13px; }
.item-dialog .ad-unavailable p { margin-top:3px; }
:is(.item-dialog,.exit-dialog) .button.primary { min-height:52px; margin-top:21px; border-radius:16px; padding:12px; background:#3c7054; border:1px solid #315d45; color:#fff; box-shadow:inset 0 2px #76a286,0 4px #294c39; font:20px/1.3 'Jua',sans-serif; }
:is(.item-dialog,.exit-dialog) .button.primary>.icon { width:20px; height:20px; }
:is(.item-dialog,.exit-dialog) .button.primary:active:not(:disabled) { transform:translateY(3px); box-shadow:0 1px #294c39; }
.item-dialog .button.primary:disabled { opacity:1; background:#e6e3d8; color:#817965; border-color:#d8d3c5; box-shadow:none; }
:is(.item-dialog,.exit-dialog) .button.subtle { min-height:46px; margin-top:11px; padding:11px; border-radius:14px; font-size:14px; color:#65533b; background:#f3efe3; border-color:#dfd6c3; }
.item-dialog .ad-loading { padding:14px 0; }
.item-dialog .ad-loading h2 { font-size:23px; }
.item-dialog .ad-spinner { width:38px; height:38px; border-color:#dce5d2; border-top-color:#3c7054; margin:0 auto 22px; }
.exit-emblem { background:#f3e6cf; border-color:#dfc9a5; box-shadow:inset 0 2px #fff5e5,0 3px #d8c3a0; }
.exit-emblem .icon { width:36px; height:36px; color:#7b5c38; }
.exit-dialog .button.primary { background:#855d3e; border-color:#704b30; box-shadow:inset 0 2px #b99069,0 4px #634127; }
.exit-dialog .button.primary:active { box-shadow:0 1px #634127; }
.exit-dialog .button.subtle { background:#e5eddd; color:#315d45; border-color:#c6d4bc; box-shadow:0 2px #c6d4bc; }
@media(max-width:360px), (max-height:700px) {
 :is(.item-dialog,.exit-dialog) .modal-content { padding:18px; }
 :is(.item-dialog,.exit-dialog) h2 { font-size:23px; }
 .item-emblem,.exit-emblem { width:66px; height:66px; border-radius:21px; margin-bottom:17px; }
 .item-emblem .item-icon { width:40px; height:40px; }
 .item-reward-note,.exit-save-note { margin-top:15px; padding:10px 8px; }
 :is(.item-dialog,.exit-dialog) .button.primary { margin-top:17px; }
}

/* Home and stage selection share the bright puzzle's materials and contrast. */
.toy-menu { background:#f3f3ee; color:#514934; }
.toy-menu::before { display:none; }
.toy-menu .topbar { position:relative; z-index:2; }
.toy-menu .icon-button { background:#fffdf3; color:#65533b; border:1px solid #e1dac8; border-radius:50%; box-shadow:0 3px #d7d3c3; }
.toy-menu .icon-button:active { transform:translateY(2px); box-shadow:0 1px #d7d3c3; }
.toy-menu .close-app { background:none; border:0; box-shadow:none; }
.toy-menu .progress-pill { background:#fffcf3; border-color:#e1dac8; color:#514934; font-size:12px; }
.toy-menu .progress-pill .icon { color:#59794e; }
.toy-menu .bottom-nav { background:#fffcf3; border-top:1px solid #e1dac8; padding-top:8px; }
.toy-menu .nav-item { min-height:56px; font-size:12px; color:#655a45; }
.toy-menu .nav-item.selected { background:#e1ecd9; color:#315d45; box-shadow:inset 0 1px #fbfff5,0 2px #c6d4bc; font-weight:700; }
.toy-menu .home-main { padding-left:24px; padding-right:24px; }
.toy-menu .title-logo .royal-wordmark strong { color:#b47a26; -webkit-text-stroke:2px #fffdf3; filter:drop-shadow(0 2px #d7c9ab); }
.toy-menu .title-logo .royal-wordmark em { color:#365d46; }
.toy-menu .title-logo .royal-wordmark small { color:#665537; font-size:10px; letter-spacing:2.5px; }
.toy-menu .title-logo .brand-tagline { color:#514934; font-size:13px; line-height:1.5; margin-top:10px; }
.toy-menu .scene-garden { border:0; box-shadow:none; background:#e3ecd9; border-radius:50%; transform:none; }
.toy-menu .scene-garden::before,.toy-menu .scene-garden::after,.toy-menu .scene-cloud,.toy-menu .scene-spark,.toy-menu .scene-paw { display:none; }
.toy-menu .demo-puzzle { background:#fffcf3; border:1px solid #d5cfbe; border-radius:20px; padding:8px; transform:rotate(-7deg); box-shadow:0 4px #cec6b1,0 8px 14px #76633920; }
.toy-menu .demo-puzzle .board { gap:4px; background:#fff; border:0; padding:3px; border-radius:12px; }
.toy-menu .demo-puzzle .cell { border:0; border-radius:6px; box-shadow:inset 0 1px #ffffff60,0 2px #65584435; }
.toy-menu .demo-puzzle .cross { color:#fff; font-size:25px; font-weight:700; text-shadow:0 1px #69523f40; }
.toy-menu .color-0 { background:#b58add; }.toy-menu .color-1 { background:#58b4da; }
.toy-menu .color-2 { background:#9bcb78; }.toy-menu .color-3 { background:#e9bd3f; }
.toy-menu .color-4 { background:#ec9fbe; }.toy-menu .color-5 { background:#efa77b; }
.toy-menu .color-6 { background:#aaa6d9; }.toy-menu .color-7 { background:#6bc7b9; }
.toy-menu .panda-greeting { font-size:12px; color:#365d46; background:#fffdf3; border-color:#d5cfbe; box-shadow:0 2px #dfd9c7; }
.toy-menu .stage-label { background:#e5eddd; border-color:#c9d6be; color:#365d46; padding:7px 18px; margin-bottom:12px; }
.toy-menu .stage-label b { font-size:17px; }.toy-menu .stage-label .icon { color:#4d7040; fill:none; }
.toy-menu .play-button { background:#3c7054; border:1px solid #315d45; box-shadow:inset 0 2px #76a286,0 4px #294c39; min-height:66px; }
.toy-menu .play-button:active { transform:translateY(3px); box-shadow:0 1px #294c39; }
.toy-menu .play-note { font-size:12px; line-height:1.6; color:#5d543f; margin-top:13px; word-break:keep-all; }
.toy-menu .daily-card { background:#fffcf3; border:1px solid #ded4bb; border-radius:19px; box-shadow:0 3px #d7d3c3; min-height:76px; padding:12px 14px; gap:13px; }
.toy-menu .daily-card>span>strong { color:#51442f; font-size:20px; }
.toy-menu .daily-card>span>small { color:#65583d; font-size:12px; line-height:1.5; }
.toy-menu .daily-arrow { color:#4d7040; }
.toy-menu .calendar-sticker { transform:rotate(-3deg); }
.toy-menu .journey-heading { gap:12px; }
.toy-menu .journey-heading h1 { color:#354d3b; font-size:32px; }
.toy-menu .journey-heading .eyebrow { color:#655a45; font-size:12px; letter-spacing:0; }
.toy-menu .journey-heading .muted { color:#514934; font-size:13px; line-height:1.6; }
.toy-menu .stage-pager { gap:8px; margin:15px 0; }
.toy-menu .stage-pager small { color:#655a45; font-size:13px; margin-bottom:4px; }
.toy-menu .stage-pager strong { color:#365d46; font-size:24px; }
.toy-menu .stage-pager button:disabled { opacity:1; background:#ebe9df; color:#aba595; border-color:#dfdacd; box-shadow:none; }
.toy-menu .chapter { background:#fffcf3; border:1px solid #e1dac8; border-radius:25px; box-shadow:0 4px #d7d3c3; }
.toy-menu .chapter-body { background:none; padding:30px 14px 20px; }
.toy-menu .level-grid { gap:24px 12px; }
.toy-menu .level-tile { background:#fff; border:1px solid #c8d3bc; border-radius:17px; box-shadow:inset 0 2px #fff,0 3px #bbc9ad; color:#365d46; }
.toy-menu .level-tile::before { display:none; }
.toy-menu .level-tile strong { font-size:27px; }
.toy-menu .level-tile small { display:flex; align-items:center; justify-content:center; gap:3px; color:#526341; font-size:11px; line-height:1.3; margin-top:3px; }
.toy-menu .level-tile small .icon { width:12px; height:12px; color:inherit; }
.toy-menu .level-tile.locked { background:#ebe8de; border-color:#ded8ca; color:#837a69; box-shadow:0 2px #d7d1c3; }
.toy-menu .level-tile.locked small { color:#837a69; }
.toy-menu .level-tile.completed { background:#f5dfa0; border-color:#dfc27a; color:#70501f; box-shadow:inset 0 2px #fff3cf,0 3px #d0b36c; }
.toy-menu .level-tile.completed small { color:#70501f; }
.toy-menu .level-tile.current { background:#3c7054; color:#fff; border-color:#315d45; box-shadow:inset 0 2px #76a286,0 3px #294c39; }
.toy-menu .level-tile.current small { color:#fff; }
.toy-menu .level-tile:not(:disabled):active { transform:translateY(2px); box-shadow:0 1px #a6b697; }
.toy-menu .current-flag { top:-20px; background:#e0ecd5; color:#315d45; border:1px solid #bdcdb1; box-shadow:none; font-size:11px; font-weight:700; padding:3px 10px; }
.toy-menu .page-footer { color:#655a45; font-size:12px; margin:14px 2px 6px; }
.toy-menu .page-footer .text-link { color:#365d46; font-size:13px; min-height:44px; font-weight:600; }
.toy-menu .stage-search { border-color:#d9d3c3; }
.toy-menu .stage-search summary { color:#514934; font-size:14px; min-height:48px; }
.toy-menu .stage-jump label { color:#655a45; font-size:12px; }
.toy-menu .stage-jump input { background:#fffdf7; color:#514934; border-color:#c9c1ae; font-size:16px; }
.toy-menu .stage-jump button { background:#3c7054; color:#fff; border-color:#315d45; box-shadow:0 2px #294c39; font-size:14px; }
@media(max-width:360px) {
 .toy-menu .home-main { padding-left:20px; padding-right:20px; }
 .toy-menu .title-logo .brand-tagline { font-size:12px; }
 .toy-menu .panda-greeting { font-size:11px; right:-2px; }
 .toy-menu .daily-card { gap:10px; padding:11px 12px; }
 .toy-menu .daily-card>span>small { font-size:11px; }
 .toy-menu .journey-heading .muted { font-size:12px; }
 .toy-menu .chapter-body { padding:28px 11px 18px; }
 .toy-menu .level-grid { gap:23px 9px; }
 .toy-menu .level-tile { border-radius:14px; }
 .toy-menu .level-tile strong { font-size:24px; }
 .toy-menu .level-tile .long-number { font-size:17px; }
}

/* Keep the live puzzle width-driven; reclaim chrome height instead of scaling tiles. */
.active-puzzle .reference-hud { padding:8px 14px 6px; gap:9px; }
.active-puzzle .level-heading { min-width:0; }
.active-puzzle .level-heading b { font-size:28px; line-height:1; }
.active-puzzle .score-heading { min-height:44px; padding:2px 8px; }
.active-puzzle .score-heading b { font-size:24px; line-height:1; }
.active-puzzle .board-status { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 2px 7px; }
.active-puzzle .life-row { padding:0; flex-shrink:0; }
.active-puzzle .life-row .hearts { gap:4px; padding:4px; }
.active-puzzle .life-row .heart { width:18px; height:20px; }
.active-puzzle .progress-tab { padding:0; min-width:0; }
.active-puzzle .panda-counter { gap:3px; padding:4px; min-height:30px; }
.active-puzzle .progress-slot { width:18px; height:20px; }
.active-puzzle .panda-silhouette { width:17px; height:18px; }
.active-puzzle .progress-slot img { width:22px; height:22px; }
.active-puzzle .rule-card { min-height:44px; }
.active-puzzle .tools { margin:8px 2px 0; padding:8px 3px 0; }
.active-puzzle .tool { position:relative; gap:5px; }
.active-puzzle .tool .ad-badge { position:absolute; top:-2px; right:0; padding:2px 4px; font-size:11px; background:#fffcf3; border:1px solid #d7c8a7; box-shadow:0 1px #e1d6bf; }
.active-puzzle[data-board-size="7"] .board,.active-puzzle[data-board-size="8"] .board { gap:3px; }
@media(max-height:700px) and (max-width:599px) {
 .active-puzzle .reference-hud { padding-top:5px; padding-bottom:4px; }
 .active-puzzle .game-main { padding-bottom:6px; }
 .active-puzzle .toy-console { padding-top:4px; padding-bottom:8px; }
 .active-puzzle .rule-ribbon { padding-top:0; padding-bottom:2px; }
 .active-puzzle .board-status { padding-top:3px; padding-bottom:3px; }
 .active-puzzle .board-wrap { padding-top:4px; padding-bottom:5px; }
 .active-puzzle .tools { margin-top:6px; padding-top:6px; }
}

/* Practice uses the same board and palette, with a readable inline guide. */
.toy-lesson .lesson-shade { display:none; }
.toy-lesson .reference-hud { padding-top:8px; }
.toy-lesson .life-row { padding:4px 0 9px; }
.toy-lesson .lesson-instruction-card { min-height:0; padding:0 9px 12px; margin:0 0 12px; border-radius:0; border-bottom:1px solid #e1dac8; background:none; box-shadow:none; text-align:left; }
.toy-lesson .lesson-head { gap:6px; color:#5d563f; font-size:12px; font-weight:600; }
.toy-lesson .lesson-count { background:#e7efdf; color:#36573b; padding:5px 8px; font-size:12px; white-space:nowrap; }
.toy-lesson .lesson-head .text-button { width:44px; height:44px; flex-shrink:0; border:1px solid #e1dac8; border-radius:50%; background:#fffefa; color:#66523a; }
.toy-lesson .lesson-instruction-card h2 { font-size:21px; font-weight:750; line-height:1.35; letter-spacing:-.5px; color:#354d3b; margin:10px 0 8px; word-break:keep-all; }
.toy-lesson .lesson-instruction-card #lesson-instruction { min-height:0; font-size:15px; line-height:1.65; color:#514934; word-break:keep-all; }
.toy-lesson .lesson-rule-track { justify-content:flex-start; gap:6px; margin-top:12px; }
.toy-lesson .lesson-rule-track>span { padding:5px 8px; font-size:12px; line-height:1.3; color:#716851; background:#eeeade; border:1px solid transparent; }
.toy-lesson .lesson-rule-track .current { color:#fff; background:#3c7054; border-color:#315d45; font-weight:700; }
.toy-lesson .lesson-rule-track .icon { width:13px; height:13px; }
.toy-lesson .lesson-stage .panda-counter { background:#eee7d4; }
.toy-lesson .lesson-stage .progress-slot:not(.found) { opacity:1; }
.toy-lesson .lesson-cell:not(.lesson-lit)::after { background:#ffffff8c; }
.toy-lesson .lesson-target { outline:3px solid #315d45; outline-offset:-3px; }
.toy-lesson .lesson-target:focus-visible { outline:3px solid #315d45; outline-offset:2px; }
.toy-lesson .lesson-cell:disabled:active { transform:none; }
.toy-lesson .lesson-tap-label { background:#315d45; color:#fff; font-size:12px; padding:5px 9px; box-shadow:0 2px 4px #30483526; }
.toy-lesson .lesson-tap-ring { border-color:#fff; box-shadow:0 0 0 3px #315d4590; }
.toy-lesson .lesson-actions { min-height:0; padding:3px 9px 1px; }
.toy-lesson .lesson-feedback { color:#514934; font-size:15px; font-weight:600; line-height:1.6; min-height:24px; margin:12px 0 7px; word-break:keep-all; }
.toy-lesson .lesson-praise { color:#315d45; }
.toy-lesson .lesson-next { min-height:50px; font-size:15px; border-radius:14px; }
.toy-lesson .lesson-alternative,.toy-lesson .lesson-hint { color:#365d46; font-size:13px; min-height:44px; }
.toy-lesson .lesson-hint { padding:8px 12px; background:#e7efdf; border:1px solid #c6d6bd; }
.toy-lesson .lesson-safe { color:#70654e; font-size:12px; line-height:1.5; margin-top:8px; }
.toy-lesson .lesson-continuing { color:#4e6545; font-size:12px; width:168px; }
.toy-lesson .lesson-continuing::after { background:#dfdfcd; }
.toy-lesson .lesson-continuing i { background:#4d8058; }
.toy-lesson.lesson-won .lesson-instruction-card { text-align:center; }
.toy-lesson.lesson-won .lesson-rule-track { justify-content:center; }
.toy-lesson.lesson-won .lesson-cell.marked .cross { opacity:.55; }
@media(max-width:360px) {
 .toy-lesson .lesson-instruction-card { padding:0 6px 11px; }
 .toy-lesson .lesson-head { font-size:11px; gap:4px; }
 .toy-lesson .lesson-count { padding:5px 6px; }
 .toy-lesson .lesson-instruction-card h2 { font-size:19px; margin-top:9px; }
 .toy-lesson .lesson-instruction-card #lesson-instruction { font-size:14px; }
 .toy-lesson .lesson-rule-track { gap:4px; }
 .toy-lesson .lesson-rule-track>span { padding:5px 6px; }
 .toy-lesson .lesson-actions { padding-left:6px; padding-right:6px; }
 .toy-lesson .lesson-feedback { font-size:14px; }
}
/* A full practice round on a phone: one instruction, full-width board, one action row. */
.toy-lesson .game-main { padding-top:6px; padding-bottom:6px; }
.toy-lesson .toy-console { padding-top:4px; padding-bottom:6px; }
.toy-lesson .lesson-instruction-card { padding:0 6px 6px; margin:0; border:0; }
.toy-lesson .lesson-head { gap:6px; font-size:12px; }
.toy-lesson .lesson-heading-label { flex:1; text-align:left; white-space:nowrap; }
.toy-lesson .lesson-count { padding:0; background:none; }
.toy-lesson .lesson-count .panda-counter { padding:4px; gap:3px; min-height:30px; background:#eee7d4; }
.toy-lesson .lesson-count .progress-slot { width:18px; height:20px; }
.toy-lesson .lesson-count .panda-silhouette { width:17px; height:18px; }
.toy-lesson .lesson-count .progress-slot img { width:22px; height:22px; }
.toy-lesson .lesson-instruction-card h2 { margin:5px 0; font-size:21px; line-height:1.3; }
.toy-lesson .lesson-instruction-card #lesson-instruction { margin:0; min-height:67.5px; font-size:15px; line-height:1.5; font-weight:500; }
.toy-lesson .lesson-mark-count { white-space:nowrap; color:#315d45; font-weight:750; }
.toy-lesson .lesson-actions { padding:6px 6px 0; }
.toy-lesson .lesson-next { min-height:48px; margin:0; }
.toy-lesson .lesson-assist { min-height:44px; flex-wrap:nowrap; gap:8px; }
.toy-lesson .lesson-assist:empty { min-height:0; }
.toy-lesson .lesson-alternative,.toy-lesson .lesson-hint { min-height:44px; margin:0; padding:7px 12px; font-size:14px; border:1px solid #c6d6bd; border-radius:12px; background:#eef2e6; }
.toy-lesson .lesson-winner { width:44px; height:44px; margin:0; }
.toy-lesson .lesson-continuing { margin:6px auto; }
.toy-lesson.lesson-won .lesson-instruction-card { text-align:left; }
@media(max-width:360px) {
 .toy-lesson .lesson-instruction-card h2 { font-size:19px; }

 .toy-lesson .lesson-head { font-size:11px; }
}
/* Keep the teaching hand inside the board near the bottom/right edges. */
.toy-lesson .lesson-cell:nth-child(4n) .lesson-hand { rotate:90deg; }
.toy-lesson .lesson-cell:nth-child(n+13) .lesson-hand { rotate:180deg; }
/* v0.24 — generated toy artwork, live labels and unchanged hit targets. */
.toy-menu .title-logo { width:100%; max-width:340px; }
.toy-menu .royal-logo-art { display:block; width:100%; height:auto; aspect-ratio:3/1; object-fit:contain; margin:0 auto; }
.toy-menu .title-logo .brand-tagline { margin-top:7px; }
.toy-menu .play-button { background:transparent url('/assets/play-button-v27.webp') center/100% 100% no-repeat; border:0; box-shadow:none; padding:12px 24px 16px; overflow:visible; transition:transform .12s ease,filter .12s ease; }
.toy-menu .play-button strong { color:#fffdf3; text-shadow:0 1px 1px #263f31; }
.toy-menu .play-button > .icon,.toy-menu .play-button .play-end { color:#fffdf3; }
.toy-menu .play-button .play-end { background:transparent; }
.toy-menu .play-button:active,.toy-menu .play-button.is-pressed { transform:translateY(3px); filter:brightness(.95); box-shadow:none; }
.toy-menu .play-button:focus-visible { outline:3px solid #315d45; outline-offset:3px; }
.toy-game .tool .tool-disc { background:linear-gradient(145deg,#fffdf3,#eee5ce); border-color:#fffaf0; box-shadow:inset 0 -2px #d6c7a5,0 3px #b8a681,0 5px 5px #8b805d18; }
.toy-game .hint-tool:not(:disabled) .tool-disc,.toy-game .tool[data-action="clear"]:not(:disabled) .tool-disc { background:linear-gradient(145deg,#fffdf3,#eee5ce); border-color:#fffaf0; box-shadow:inset 0 -2px #d6c7a5,0 3px #b8a681,0 5px 5px #8b805d18; }
.toy-game .tool-disc .item-image { width:46px; height:46px; object-fit:contain; filter:none; }
.toy-game .tool:disabled .item-image { opacity:.45; filter:grayscale(.85); }
.item-emblem .item-image { width:58px; height:58px; object-fit:contain; }
@media(max-width:360px) {
 .toy-menu .play-button { padding-left:20px; padding-right:20px; }
 .toy-game .tool-disc .item-image { width:42px; height:42px; }
 .item-emblem .item-image { width:50px; height:50px; }
}
@media(prefers-reduced-motion:reduce) { .toy-menu .play-button { transition:none; } }
/* v0.25 — one royal toy visual language across menus and overlays. */
.bottom-nav { background:linear-gradient(#fffdf4,#f3e8d2); border-top-color:#d8be89; box-shadow:0 -2px 0 #fffdf7; }
.bottom-nav .nav-item { border:1px solid transparent; gap:3px; color:#675235; }
.bottom-nav .nav-art { width:30px; height:30px; object-fit:contain; flex-shrink:0; filter:saturate(.8); transition:transform .15s; }
.bottom-nav .nav-item.selected { background:linear-gradient(#f5e7be,#ecd59d); border-color:#d7b76e; box-shadow:inset 0 2px #fff8df,0 2px #c8aa70; color:#344e38; }
.bottom-nav .nav-item.selected .nav-art { filter:none; transform:translateY(-1px); }
.toy-menu .bottom-nav { background:linear-gradient(#fffdf4,#f3e8d2); border-top-color:#d8be89; }
.toy-menu .nav-item.selected { background:linear-gradient(#f5e7be,#ecd59d); color:#344e38; box-shadow:inset 0 2px #fff8df,0 2px #c8aa70; }
.toy-menu .daily-card { background:linear-gradient(120deg,#fffdf4,#f7ebcc); border-color:#d5b777; box-shadow:inset 0 2px #fffef7,0 3px #d5bb83,0 5px 8px #8b693912; padding-top:8px; padding-bottom:8px; }
.toy-menu .calendar-sticker small { position:absolute; top:13px; left:0; width:100%; padding:0; background:none; font-size:10px; line-height:12px; font-weight:750; color:#66330e; }
.toy-menu .calendar-sticker b { position:absolute; top:29px; left:0; width:100%; font:25px/1 'Jua',sans-serif; color:#365b42; }
.toy-menu .daily-card>span:nth-child(2) { min-width:0; }
.toy-menu .daily-card>span>strong { color:#36543b; }
.toy-menu .daily-arrow { width:30px; height:30px; border-radius:50%; background:linear-gradient(#fffdf0,#ecd49d); border:1px solid #d0b372; box-shadow:inset 0 1px #fff,0 2px #ccb583; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
/* Repeat the existing image skin on the game's primary actions, keeping live text. */
:where(.guide-screen,.toy-lesson,dialog) .button.primary:not(:disabled) { background:transparent url('/assets/play-button-v27.webp') center/100% 100% no-repeat; border:0; box-shadow:none; color:#fffdf3; text-shadow:0 1px 1px #263f31; padding-left:20px; padding-right:20px; }
:where(.guide-screen,.toy-lesson,dialog) .button.primary:not(:disabled):active { transform:translateY(2px); filter:brightness(.95); box-shadow:none; }
dialog .button.subtle { background:linear-gradient(#fffaf0,#efe1c3); border-color:#d6bc85; box-shadow:inset 0 1px #fff,0 2px #cdbb97; color:#615039; }
dialog:is(.settings-dialog,.result-dialog,.pause-dialog,.guide-dialog,.item-dialog,.exit-dialog) { border-color:#d5bd8a; box-shadow:inset 0 0 0 3px #fff9e8,0 5px #c5ac7b,0 18px 50px #263c3438; }
.toy-menu .stage-pager { background:linear-gradient(#fffdf3,#f3e5c3); border-color:#d9bf83; box-shadow:inset 0 2px #fff,0 3px #d7c49c; }
.toy-menu .level-tile { background:linear-gradient(145deg,#fffef8,#f5e6c7); border-color:#d5bd8a; box-shadow:inset 0 2px #fff,0 3px #c7ae7e; }
.toy-menu .level-tile.completed { background:linear-gradient(145deg,#ffedab,#ebc86a); border-color:#d3a749; box-shadow:inset 0 2px #fff8dc,0 3px #bb963f; }
.toy-menu .level-tile.current { background:linear-gradient(145deg,#4b8965,#194e38); border:2px solid #e5be60; box-shadow:inset 0 2px #8dbb8b,0 3px #ab8a41; }
.toy-menu .level-tile.locked { background:linear-gradient(#eeeade,#e4dfd2); border-color:#d9d0bc; box-shadow:inset 0 1px #faf6ed,0 2px #c9c1ae; }
.guide-content { border-color:#d8be87; box-shadow:inset 0 2px #fffef8,0 4px #d0bd96; }
.guide-rule-title>b { background:linear-gradient(#fff2bd,#e9cc79); border-color:#d4b469; color:#655020; box-shadow:inset 0 1px #fff,0 2px #c9af72; }
.settings-dialog .switch.on { background:linear-gradient(#629573,#315d45); border-color:#d4bc7d; }
.result-dialog .result-scene { position:relative; width:220px; max-width:100%; height:220px; margin:0 auto 7px; }
.result-dialog .result-frame-art { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; z-index:1; pointer-events:none; }
.result-dialog .result-character { position:absolute; width:72%; height:72%; left:14%; top:10%; z-index:2; }
.result-dialog .result-ribbon { position:absolute; z-index:3; bottom:11%; left:8%; width:84%; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; background:none; color:#fffdf2; font-size:12px; font-weight:750; line-height:1.4; text-shadow:0 1px 2px #243b35; transform:none; }
.result-loss .result-ribbon { bottom:13%; }
.result-dialog .celebration-halo,.result-dialog .victory-rays,.result-dialog .tantrum-cloud { display:none; }
.result-dialog .tantrum-cry { right:4px; top:32%; z-index:4; background:#fff7eb; border:1px solid #d5bb8a; border-radius:10px; padding:3px 6px; font-size:13px; }
.result-dialog .result-stats { background:linear-gradient(#fff9e6,#f2e4bd); border-color:#ddc58c; box-shadow:inset 0 1px #fff; }
.result-loss .retry-hearts { background:linear-gradient(#f4f2fc,#e8e6f5); border-color:#c8c3df; box-shadow:inset 0 1px #fff; }
@media(max-width:360px), (max-height:700px) {
 .result-dialog .result-scene { width:174px; height:174px; margin-bottom:6px; }
 .result-dialog .result-ribbon { font-size:11px; }
 .result-dialog .tantrum-cry { right:-6px; font-size:12px; }
 .guide-screen .bottom-nav .nav-art { width:23px; height:23px; }
}
@media(prefers-reduced-motion:reduce) { .bottom-nav .nav-art { transition:none; } }
.toy-menu .stage-pager { border:1px solid #d9bf83; border-radius:18px; padding-left:7px; padding-right:7px; }
/* Navigation/utility controls share the cream-and-gold material without crowding icons. */
.topbar .icon-button,.reference-hud .icon-button,.stage-pager .icon-button,.modal-head .icon-button,.guide-modal-close .icon-button { background:linear-gradient(145deg,#fffdf4,#f2e5c8); border-color:#d8be87; box-shadow:inset 0 1px #fff,0 2px #c5ae80; color:#655236; }
.settings-dialog .settings-shortcuts [data-action="tutorial"] { background:linear-gradient(#edf4e2,#d8e7c5); border-color:#b8c99f; box-shadow:inset 0 1px #fff,0 2px #b8c99f; }
/* v0.26 — date-free daily badge and a clearly readable current stage. */
.toy-menu .daily-emblem { display:flex; align-items:center; justify-content:center; width:60px; height:60px; flex-shrink:0; }
.toy-menu .daily-emblem img { display:block; width:56px; height:56px; object-fit:contain; }
.toy-menu .play-area { z-index:3; }
.toy-menu .stage-label { display:flex; align-items:center; justify-content:center; gap:8px; max-width:100%; min-width:180px; padding:6px 16px; border:2px solid #d0ad61; border-radius:16px; background:#fffaf0; color:#234b35; box-shadow:inset 0 1px #fff,0 3px #d7bd85; }
.toy-menu .stage-label>img { flex-shrink:0; object-fit:contain; }
.toy-menu .stage-label>span { margin:0; font-size:16px; line-height:1.3; font-weight:700; letter-spacing:0; color:#36543e; }
.toy-menu .stage-label>b { font:29px/1.1 'Jua',sans-serif; letter-spacing:0; color:#193e2c; font-variant-numeric:tabular-nums; white-space:nowrap; }
@media(max-width:360px) { .toy-menu .stage-label { padding-left:12px; padding-right:12px; gap:7px; } }
.toy-menu .stage-label>span { width:auto; height:auto; background:none; border-radius:0; flex-shrink:0; white-space:nowrap; }
/* Guide CTAs preserve the rounded end caps instead of stretching the whole image. */
:is(.guide-screen,.guide-dialog) .button.primary:not(:disabled) { position:relative; isolation:isolate; background:none; border:0; box-shadow:none; width:fit-content; min-width:230px; max-width:100%; min-height:52px; padding:10px 20px 14px; margin-left:auto; margin-right:auto; gap:8px; }
:is(.guide-screen,.guide-dialog) .button.primary:not(:disabled)::before { content:''; position:absolute; inset:0; z-index:-1; pointer-events:none; border-style:solid; border-color:transparent; border-width:0 26px; border-image-source:url('/assets/play-button-v27.webp'); border-image-slice:0 160 fill; border-image-width:0 26px; border-image-repeat:stretch; }
:is(.guide-screen,.guide-dialog) .button.primary:not(:disabled):active { background:none; box-shadow:none; }
@media(max-width:360px) { :is(.guide-screen,.guide-dialog) .button.primary:not(:disabled) { min-width:220px; padding-left:16px; padding-right:16px; } }
/* v0.28 — passive progress text and a single integrated settings button. */
.lobby-progress { display:flex; align-items:center; gap:8px; color:#655a45; cursor:default; }
.lobby-progress>span { font-size:12px; font-weight:500; }
.lobby-progress>strong { font-size:17px; line-height:1.3; color:#36543e; font-variant-numeric:tabular-nums; }
.lobby-progress small { font-size:12px; font-weight:500; margin-left:2px; }
:is(.topbar,.reference-hud) .icon-button[data-action="settings"] { display:flex; align-items:center; justify-content:center; width:44px; height:44px; min-width:44px; min-height:44px; padding:0; border:0; border-radius:50%; background:transparent; box-shadow:none; }
:is(.topbar,.reference-hud) .icon-button[data-action="settings"]>.settings-art { display:block; width:44px; height:44px; max-width:none; flex-shrink:0; object-fit:contain; filter:none; }
:is(.topbar,.reference-hud) .icon-button[data-action="settings"]:active { background:transparent; box-shadow:none; transform:translateY(2px); }
:is(.topbar,.reference-hud) .icon-button[data-action="settings"]:focus-visible { outline:3px solid #365d46; outline-offset:2px; }
/* Release polish: preserve image end caps for every primary action. */
:is(.home-shell,.guide-screen,.toy-lesson,dialog) .button.primary:not(:disabled) { position:relative; isolation:isolate; background:none; border:0; box-shadow:none; --button-cap:26px; }
:is(.home-shell,.guide-screen,.toy-lesson,dialog) .button.primary:not(:disabled)::before { content:''; position:absolute; inset:0; z-index:-1; pointer-events:none; border-style:solid; border-color:transparent; border-width:0 var(--button-cap); border-image-source:url('/assets/play-button-v27.webp'); border-image-slice:0 160 fill; border-image-width:0 var(--button-cap); border-image-repeat:stretch; }
.home-shell .button.primary:not(:disabled) { --button-cap:32px; }
:is(.home-shell,.guide-screen,.toy-lesson,dialog) .button.primary:not(:disabled):active { background:none; box-shadow:none; }
.active-puzzle .board-caption.input-coach { display:block; margin:4px 0 0; min-height:18px; font-size:12px; line-height:18px; color:#36543e; text-align:center; }
.result-dialog .result-eyebrow { display:flex; align-items:center; justify-content:center; gap:6px; }
.result-dialog .daily-result-medal { width:24px; height:24px; object-fit:contain; }
.result-daily h2 { color:#67501f; }
.result-daily .result-stats { background:linear-gradient(#fff9dd,#f4e5b2); }
.settings-dialog .leaderboard-action { margin:12px 0 0; min-height:44px; font-size:14px; }
.settings-dialog .leaderboard-action .icon { width:18px; height:18px; }
.item-dialog [data-ad-status][hidden],.item-dialog .ad-retry[hidden] { display:none; }
.item-dialog .ad-retry { display:block; margin:8px auto 0; min-height:44px; color:#36543e; font-size:14px; padding:6px 14px; }
.active-puzzle .board-status .input-coach { min-width:0; flex:1; color:#36543e; font-size:12px; line-height:14px; text-align:center; }
.active-puzzle .board-status .input-coach[hidden] { display:none; }

/* v0.30 — quiet idle life, distinct touch reactions and a single clear cadence. */
.panda-actor { --reaction-duration:.95s; }
.panda-actor.petted { --reaction-duration:.7s; }
.panda-actor.reacting { animation-duration:var(--reaction-duration); }
.reacting :is(.panda-rest,.panda-expression,.panda-love) { animation-duration:var(--reaction-duration); }
.reacting .panda-love-small { animation-delay:.08s; }
.discovered .panda-found { animation-duration:1s; }
.panda-actor:not(.reacting):not(.arriving):not(.celebrate-panda) .panda-expression { animation:idle-wink 7.6s var(--idle-delay,5s) step-end infinite; }
.panda-actor:not(.reacting):not(.arriving):not(.celebrate-panda) .panda-rest { animation:idle-rest 7.6s var(--idle-delay,5s) step-end infinite; }
.panda-actor.petted .panda-love-small { display:none; }
.active-puzzle:is([data-board-size="7"],[data-board-size="8"]) .panda-found { display:none; }
.active-puzzle:is([data-board-size="7"],[data-board-size="8"]) .panda-love { font-size:13px; }
.active-puzzle .mark-in { display:block; animation:mark-stamp .16s cubic-bezier(.2,.8,.3,1); }
.board-won::after { content:''; position:absolute; inset:0; border:2px solid #e6bf65; border-radius:inherit; pointer-events:none; z-index:5; animation:clear-glow .9s .25s both; }
.board-won .celebrate-panda:not(.reacting) { animation:panda-cheer .64s var(--celebrate-delay,.38s) ease-in-out both; }
.clear-callout { top:var(--clear-top,17%); color:#36543e; background:linear-gradient(#fffdf1,#f5e8bf); border-color:#d3b36c; box-shadow:inset 0 2px #fff,0 3px #bea06b,0 7px 15px #3e4b3229; font-family:'Jua',sans-serif; font-weight:400; }
.clear-callout>span { color:#c39735; }
.stage-enter .board-wrap { animation:board-deal .38s cubic-bezier(.2,.8,.3,1) both; }
.stage-enter :is(.reference-hud,.rule-ribbon,.board-status,.tools) { animation:console-arrive .32s ease-out both; }
.stage-enter .tools { animation-delay:.06s; }
.toy-menu .daily-complete { border-color:#9caf79; background:linear-gradient(#f5f8e8,#e6edd5); box-shadow:inset 0 2px #fff,0 3px #b5c394,0 5px 8px #4b674b12; }
.toy-menu .daily-complete .daily-arrow { background:#426b4d; border-color:#365e42; color:#fff9df; box-shadow:inset 0 1px #87a476,0 2px #adbc8d; }
.result-dialog[open] .result-frame-art { animation:medal-settle .52s cubic-bezier(.2,.8,.3,1) both; }
.result-dialog[open] :is(h2,.result-stats,.retry-hearts) { animation:console-arrive .4s .1s ease-out both; }
@keyframes idle-wink { 0%,3%,100% { opacity:0; } 1% { opacity:1; } }
@keyframes idle-rest { 0%,3%,100% { opacity:1; } 1% { opacity:0; } }
@keyframes mark-stamp { from { opacity:.3; transform:scale(.72); } 65% { transform:scale(1.08); } to { opacity:1; transform:none; } }
@keyframes clear-glow { from { opacity:0; box-shadow:inset 0 0 0 #fff0; } 40% { opacity:1; box-shadow:inset 0 0 22px #fff2be80,0 0 12px #e4c87560; } to { opacity:.6; box-shadow:inset 0 0 0 #fff0; } }
@keyframes board-deal { from { opacity:.45; transform:translateY(7px); } to { opacity:1; transform:none; } }
@keyframes console-arrive { from { opacity:.5; transform:translateY(3px); } to { opacity:1; transform:none; } }
@keyframes medal-settle { from { opacity:.6; transform:translateY(5px) scale(.96); } 65% { opacity:1; transform:translateY(-2px) scale(1.015); } to { opacity:1; transform:none; } }
@media(prefers-reduced-motion:reduce) {
 .panda-actor,.panda-actor *,.stage-enter *,.result-dialog[open] * { animation:none!important; }
 .board-won::after { animation:none!important; opacity:.6; }
 .panda-expression { opacity:0; }
 .panda-rest { opacity:1; }
}
/* A separate floating tab bar keeps the miniapp navigation distinct from Toss. */
.toy-menu .bottom-nav { margin: auto 12px 10px; padding:6px 8px 8px; border:1px solid #d8be89; border-radius:26px; gap:4px; box-shadow:inset 0 2px #fffdf7,0 3px #cdbb96,0 6px 12px #3b493316; flex-shrink:0; }
.toy-menu .bottom-nav .nav-item { min-width:0; }
.toy-menu.journey-shell .bottom-nav { bottom:10px; }
.home-shell,.journey-shell { height:100dvh; min-height:0; }
.home-shell .topbar { flex-shrink:0; }
.home-shell .home-main,.journey-shell .levels-main { min-height:0; overflow-y:auto; overflow-x:hidden; }
.home-shell .home-main>* { flex-shrink:0; }
.toy-menu.journey-shell .bottom-nav { position:relative; bottom:auto; margin-top:8px; }
.guide-screen .bottom-nav { padding:4px 8px 6px; margin-bottom:6px; }
@media(max-height:700px) and (max-width:599px) {
 .home-shell .topbar { min-height:48px; padding:4px 16px 0; }
 .home-shell .home-main { padding:2px 20px 10px; }
 .home-shell .title-logo { max-width:236px; }
 .home-shell .title-logo .brand-tagline { display:none; }
 .home-shell .puzzle-scene { height:clamp(100px,calc(100dvh - 460px - var(--safe-top) - var(--safe-bottom)),200px); margin:4px 0 6px; }
 .home-shell .scene-garden { height:90%; width:220px; top:5%; left:calc(50% - 110px); }
 .home-shell .demo-puzzle { width:clamp(96px,calc(100dvh - 470px - var(--safe-top) - var(--safe-bottom)),165px); top:2px; left:25px; }
 .home-shell .demo-puzzle .cross { font-size:clamp(12px,5vw,24px); }
 .home-shell .scene-panda { width:clamp(104px,calc(100dvh - 460px - var(--safe-top) - var(--safe-bottom)),170px); height:clamp(104px,calc(100dvh - 460px - var(--safe-top) - var(--safe-bottom)),170px); right:22px; bottom:0; }
 .home-shell .panda-greeting { display:none; }
 .home-shell .play-area { margin:0; }
 .home-shell .stage-label { padding:4px 14px; margin-bottom:6px; }
 .home-shell .play-button { min-height:52px; padding:8px 20px 12px; }
 .home-shell .play-button strong { font-size:24px; }
 .home-shell .play-note { margin-top:7px; font-size:12px; }
 .home-shell .daily-card { min-height:58px; padding:6px 10px; margin-top:10px; }
 .home-shell .daily-emblem { width:44px; height:44px; }
 .home-shell .daily-emblem img { width:42px; height:42px; }
 .home-shell .daily-card>span>strong { font-size:18px; }
 .home-shell .daily-card>span>small { font-size:11px; margin-top:2px; }
}
@media(max-height:550px) and (max-width:599px) {
 .active-puzzle .game-main { padding-bottom:0; }
 .guide-screen .guide-content { padding-top:8px; padding-bottom:8px; }
 .guide-screen .guide-heading>img { width:32px; height:32px; }
 .result-dialog .result-scene { width:150px; height:150px; }
}
/* One-time welcome gifts keep the same touch targets as rewarded tools. */
.active-puzzle .tool .free-badge { background:#e8f2dc; border-color:#acc59b; color:#315e3e; font-weight:700; }
.active-puzzle .tool:disabled .free-badge { background:#eeeadd; border-color:#d5cdbb; color:#8b826e; }

/* One responsive phone frame for every route, including desktop previews. */
:root { --phone-width:430px; --phone-height:100dvh; }
.app-shell:is(.home-shell,.journey-shell,.guide-screen,.game-shell,.lesson-screen) {
 width:100%; max-width:var(--phone-width); height:var(--phone-height); min-height:0;
 margin:0 auto; border:0; border-radius:0;
}
.app-shell>main { min-width:0; min-height:0; flex:1; overflow-y:auto; overflow-x:hidden; }
.app-shell>.topbar,.app-shell>.reference-hud,.app-shell>.bottom-nav { flex-shrink:0; }
@media(min-width:600px) {
 :root { --phone-width:390px; --phone-height:min(844px,calc(100dvh - 24px)); }
 .app-shell:is(.home-shell,.journey-shell,.guide-screen,.game-shell,.lesson-screen) {
  margin:12px auto; border-radius:28px; box-shadow:0 12px 40px #35453524;
 }
}
/* Live captions have their own flow space; the ornamental ribbon contains no text. */
dialog:is(.settings-dialog,.result-dialog,.pause-dialog,.guide-dialog,.item-dialog,.exit-dialog) {
 width:calc(100% - 28px); max-width:min(400px,calc(var(--phone-width) - 28px));
 max-height:calc(var(--phone-height) - 28px); overflow-x:hidden; overflow-y:auto;
 scrollbar-gutter:auto; scrollbar-width:thin;
}
dialog .modal-content { min-width:0; }
dialog :is(h2,h3,p,small,.button) { overflow-wrap:anywhere; word-break:keep-all; white-space:normal; }
.result-dialog .modal-content { display:flex; flex-direction:column; align-items:stretch; gap:0; padding:20px; }
.result-dialog .modal-content>* { flex-shrink:0; min-width:0; max-width:100%; }
.result-dialog .result-eyebrow { margin:0 0 4px; line-height:1.5; }
.result-dialog .result-scene { width:196px; height:auto; aspect-ratio:1; margin:0 auto 8px; flex-shrink:0; }
.result-dialog .result-ribbon { position:static; width:auto; margin:0 0 6px; padding:0; background:none; border:0; box-shadow:none; transform:none; color:#466b49; font-size:15px; line-height:1.5; font-weight:700; text-shadow:none; }
.result-loss .result-ribbon { color:#765989; }
.result-dialog h2 { margin:0 0 8px; font-size:24px; line-height:1.4; }
.result-dialog .muted { margin:0; font-size:14px; line-height:1.65; }
.result-dialog .retry-hearts small { display:block; line-height:1.65; }
.result-dialog .result-stats small { display:block; line-height:1.5; }
.result-dialog .button { width:100%; height:auto; min-height:48px; line-height:1.4; }
@media(max-width:360px), (max-height:700px) {
 .result-dialog .modal-content { padding:16px; }
 .result-dialog .result-scene { width:152px; height:auto; }
 .result-dialog h2 { font-size:22px; }
 .result-dialog .result-stats,.result-dialog .retry-hearts { margin-top:12px; }
 .result-dialog .primary { margin-top:14px; }
}

/* Keep all twelve stage tiles visible on short phones; retain their touch area. */
@media(max-height:700px) and (max-width:599px) {
 .journey-shell .topbar { min-height:52px; padding-top:4px; padding-bottom:4px; }
 .journey-shell .journey-heading { min-height:0; }
 .journey-shell .journey-heading .eyebrow { display:none; }
 .journey-shell .journey-heading h1 { margin:0 0 4px; font-size:30px; line-height:1.2; }
 .journey-shell .journey-heading .muted { margin:0; font-size:12px; line-height:1.5; }
 .journey-shell .journey-mascot { width:58px; height:58px; }
 .journey-shell .stage-pager { margin:9px 0 10px; }
 .journey-shell .stage-pager small { margin-bottom:2px; }
 .journey-shell .stage-pager strong { font-size:22px; }
 .journey-shell .chapter-body { padding:24px 11px 12px; }
 .journey-shell .level-grid { gap:16px 9px; }
 .journey-shell .page-footer { margin:10px 2px 4px; }
}

/* One compact guide header and one primary action, without a second close row. */
.guide-dialog .guide-heading { gap:8px; }
.guide-dialog .guide-heading h2 { flex:1; min-width:0; font-size:20px; word-break:keep-all; }
.guide-dialog .guide-heading>img { width:30px; height:30px; }
.guide-dialog .guide-dismiss { width:44px; height:44px; flex-shrink:0; margin:0; border-radius:50%; }
@media(max-width:360px) { .guide-dialog .guide-heading h2 { font-size:19px; } }

@media(max-height:600px) {
 .guide-dialog .modal-content { padding:16px 18px; }
 .guide-dialog .guide-content .lesson-start { margin-bottom:0; }
}

html, body { overscroll-behavior:none; }

/* The host already owns the outer WebView. Keep its corner menu clear once,
   without adding the SDK's outer-window insets to this iframe a second time. */
.onestore-native { --native-menu-row:48px; }
.onestore-native .app-shell {
  padding-top:max(env(safe-area-inset-top,0px),var(--native-menu-row));
}
.onestore-native .home-shell .home-main {
  justify-content:flex-start;
}
.onestore-native .home-shell .title-logo {
  flex:0 0 auto;
}
@media(min-height:701px) and (max-width:599px) {
  .onestore-native .home-shell .puzzle-scene {
    height:clamp(160px,calc(100dvh - 620px),240px);
  }
}
.onestore-native .app-shell>.reference-hud {
  padding-top:8px;
}
.onestore-native dialog {
  max-height:calc(var(--phone-height) - var(--native-menu-row) - 20px);
  margin-top:max(var(--native-menu-row),calc((var(--phone-height) - 660px)/2));
}
