/* The play scene owns the viewport; controls float above the illustrated world. */
.game-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: #b8e5f4;
}
.game-dialog::backdrop {
  background: #b8e5f4;
  backdrop-filter: none;
}
.game-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.game-dialog .playfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.game-header {
  position: absolute;
  top: 23px;
  left: 28px;
  right: 28px;
  height: 62px;
  z-index: 6;
  padding: 0;
  background: none;
  pointer-events: none;
}
.game-header > button,
.game-header-actions,
.game-header-actions button {
  pointer-events: auto;
}
.game-header > div:not(.game-header-actions) {
  background: #fffdf5ed;
  padding: 10px 19px;
  border-radius: 17px;
  box-shadow: 0 4px 0 #709eac20;
}
.game-header h2 {
  font-size: 21px;
  letter-spacing: 0.8px;
}
.game-header h2:focus {
  outline: none;
}
.game-header > div > span {
  color: #9a828c;
}
.game-header-actions {
  gap: 10px;
}
.game-header .icon-button {
  width: 45px;
  height: 45px;
  background: #fffdf5ef;
  box-shadow: 0 4px 0 #709eac20;
}
.game-header .icon-button:hover {
  background: #fff;
}
.game-header-actions .mode-label {
  padding: 9px 14px;
  background: #fffdf5de;
}
.game-status {
  position: absolute;
  z-index: 5;
  top: 104px;
  left: 30px;
  right: 30px;
  background: #fffdf5e6;
  padding: 12px 18px;
  min-height: 60px;
  border-radius: 17px;
  box-shadow: 0 4px 0 #769db415;
}
.game-status > p {
  max-width: 46%;
  color: #5e6574;
  font-size: 13px;
}
.game-status .game-progress {
  width: 100px;
}
.game-bottom {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 23px;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 50px));
  height: 68px;
  border: 2px solid #fffaf0;
  border-radius: 22px;
  background: #fffdf5f0;
  padding: 10px 18px 10px 78px;
  box-shadow: 0 5px 0 #5e8b6530;
}
.game-bottom > p {
  font-size: 13px;
  color: #675575;
  line-height: 1.6;
}
.show-current-hint {
  display: none;
}
.dialogue-avatar {
  position: absolute;
  width: 62px;
  height: 72px;
  left: 9px;
  bottom: 0;
  overflow: hidden;
}
.dialogue-avatar .pig {
  width: 75px;
  height: 87px;
}
.game-overlay {
  background: #5384934a;
  backdrop-filter: blur(5px);
  padding: 26px;
  overflow-y: auto;
}
.overlay-card {
  margin-block: auto;
  flex-shrink: 0;
  background: #fffdf5;
  width: min(570px, 100%);
  max-width: none;
  padding: 32px 38px;
  border: 5px solid white;
  border-radius: 30px;
  box-shadow:
    0 10px 0 #65878b22,
    0 28px 90px #35575c22;
}
.overlay-card h2 {
  font-size: 27px;
}
.overlay-card:focus,
.info-dialog h2:focus {
  outline: none;
}
.overlay-card p {
  color: #837482;
  font-size: 13px;
}
.brief-character {
  width: 105px;
  height: 120px;
  margin: -5px auto 13px;
}
.brief-character svg {
  width: 100%;
  height: 100%;
}
.control-hint {
  padding: 13px;
  background: #edf4e2;
  border-radius: 13px;
  font-size: 13px;
  color: #6a8254;
  margin: 17px 0 13px;
}
.overlay-card .mastery-hint {
  font-size: 11px;
  color: #ad8d58;
}
.overlay-buttons .button {
  min-height: 49px;
}
.result-score {
  font-size: 34px;
  font-weight: 800;
  color: #ca8a4f;
  margin-bottom: 10px;
}
.result-score small {
  font-size: 11px;
  margin-left: 9px;
  font-weight: 500;
}
.reward-sticker {
  width: 93px;
  height: 93px;
  margin: 12px auto 20px;
  padding: 9px;
}
.win-stars {
  font-size: 35px;
  letter-spacing: 7px;
}
.challenge-hud {
  display: flex;
  gap: 19px;
  flex-shrink: 0;
  align-items: center;
  font-size: 12px;
  color: #7b7b70;
}
.challenge-hud b {
  font-size: 17px;
  color: #997659;
  margin-left: 2px;
}
.urgent,
.urgent b {
  color: #cc5369 !important;
}
.personal-best {
  display: block;
  font-size: 10px;
  color: #b09568;
  margin-top: 13px;
}
.sticker-item small {
  display: block;
  color: #bd944f;
  font-size: 10px;
  margin-top: 9px;
}
.is-runner .game-status {
  display: none;
}
.adventure-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}
.runner-hud {
  position: absolute;
  top: 108px;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
  pointer-events: none;
}
.runner-hud > span {
  padding: 9px 15px;
  border-radius: 14px;
  background: #edf8e7db;
  color: #6b8560;
  font-size: 12px;
  letter-spacing: 1px;
}
.runner-hud > div {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.runner-hud b {
  padding: 10px 15px;
  background: #fffdf2f0;
  box-shadow: 0 3px 0 #7aa6a423;
  border-radius: 14px;
  font-size: 15px;
  color: #b68b49;
  font-weight: 600;
}
#run-hearts {
  color: #db789e;
  letter-spacing: 3px;
}
#run-time {
  color: #678d9c;
  min-width: 72px;
  text-align: center;
}
.route-map {
  position: absolute;
  top: 174px;
  right: 32px;
  width: 276px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 10px;
  color: #709779;
  pointer-events: none;
}
.route-map > div {
  flex: 1;
  height: 6px;
  background: #edf5d7c4;
  border-radius: 10px;
  position: relative;
  display: flex;
  justify-content: space-evenly;
}
.route-map b {
  width: 7px;
  height: 7px;
  background: #90b87c;
  border-radius: 50%;
}
#route-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e991b1;
  top: -3px;
  transform: translateX(-50%);
}
.runner-controls {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.runner-controls > div {
  display: flex;
  gap: 11px;
}
.runner-controls button {
  width: 62px;
  height: 61px;
  border-radius: 19px;
  border: 3px solid #fff8;
  background: #fffcdfd9;
  box-shadow: 0 5px 0 #688d5240;
  color: #62653f;
  font-size: 22px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.runner-controls button.held {
  transform: translateY(4px);
  box-shadow: none;
  background: #ffe9a7;
}
.runner-controls > button {
  width: 114px;
  background: #f3a6c4ed;
  color: #633449;
  font-size: 17px;
  border-color: #ffd1e3;
}
.runner-controls b {
  margin-left: 6px;
  font-size: 27px;
}
.runner-controls > span {
  position: absolute;
  left: 0;
  bottom: 82px;
  font-size: 11px;
  color: #56894c;
}
.is-runner .game-bottom {
  width: min(540px, calc(100% - 395px));
}
.runner-combo {
  position: absolute;
  left: 31%;
  top: 41%;
  font-size: 31px;
  color: #ffedb8;
  -webkit-text-stroke: 1px #c59554;
  font-weight: 800;
  transform: rotate(-8deg);
  pointer-events: none;
}
.puzzle-tag {
  color: #a78c6b;
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.puzzle-answers {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 23px 0 15px;
}
.puzzle-answers > button {
  width: 87px;
  height: 76px;
  padding: 8px;
  background: #f7eddd;
  border: 3px solid #ede0ca;
  border-radius: 17px;
  font-size: 25px;
  color: #987654;
  box-shadow: 0 4px 0 #decfb5;
}
.puzzle-answers > button:hover {
  background: #fff2d9;
}
.puzzle-answers > button:disabled {
  opacity: 0.45;
}
.puzzle-answers svg {
  width: 52px;
  height: 52px;
  margin: auto;
}
.memory-code {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin: 25px 0 5px;
}
.memory-code span {
  position: relative;
  width: 67px;
  height: 69px;
  background: #edf3e2;
  border: 2px solid #d5e2bb;
  border-radius: 12px;
  padding: 7px;
}
.memory-code .hidden-code svg {
  visibility: hidden;
}
.memory-code .hidden-code::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 27px;
  color: #a5b287;
}
.memory-code .code-correct::after {
  content: "✓";
  color: #729e68;
}
.puzzle-rewatch,
.puzzle-exit {
  background: none;
  color: #ac939f;
  font-size: 11px;
  padding: 12px;
  text-decoration: underline;
  min-height: 42px;
}
.puzzle-rewatch:disabled {
  opacity: 0.45;
}
.puzzle-time-note {
  display: block;
  color: #aa9b85;
  font-size: 10px;
  margin-top: 5px;
}
.fruit-equations {
  padding: 14px;
  border-radius: 17px;
  background: #f5f0e0;
  margin-top: 22px;
}
.fruit-equations > div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  height: 60px;
  font-size: 23px;
  color: #a28c66;
}
.fruit-equations svg {
  width: 40px;
  height: 44px;
}
.fruit-equations b {
  min-width: 28px;
  color: #997855;
}
.game-picnic .playfield {
  background: #b8e5f4;
  gap: 17px;
  padding-top: 95px;
}
.picnic-blanket {
  position: absolute;
  left: 50%;
  top: calc(50% + 49px);
  width: min(650px, 80%);
  height: min(520px, 63%);
  transform: translate(-50%, -50%) rotate(-3deg);
  border: 8px solid #fff9e9;
  border-radius: 24px;
  box-shadow: 0 6px 0 #649c5140;
  background-color: #f8e6d8;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 42px, #dfa89740 42px 84px),
    repeating-linear-gradient(90deg, transparent 0 42px, #dfa89740 42px 84px);
}
.memory-grid.challenge {
  grid-template-columns: repeat(4, clamp(65px, 9.4vh, 105px));
  gap: 11px;
}
.memory-grid.challenge .memory-card {
  height: clamp(65px, 9.4vh, 105px);
}
.memory-grid.easy {
  grid-template-columns: repeat(3, clamp(90px, 12vh, 135px));
}
.memory-grid.easy .memory-card {
  height: clamp(95px, 13vh, 142px);
}
.picnic-tray {
  position: relative;
}
.picnic-tray span {
  background: #fff8e7c2;
}
.picnic-decor {
  inset: auto 7% 13%;
  opacity: 1;
}
.picnic-decor > .pig {
  width: 155px;
  height: 178px;
}
.picnic-decor > svg:last-child {
  width: 135px;
  height: 135px;
}
.peek-button {
  position: absolute;
  right: 4%;
  top: 46%;
  padding: 12px 17px;
  min-height: 49px;
  border: 2px solid #f6efcf;
  border-radius: 16px;
  background: #fff4d5ed;
  color: #927952;
  font-size: 12px;
  box-shadow: 0 3px 0 #cbb88066;
}
.peek-button small {
  display: block;
  font-size: 9px;
  margin-top: 5px;
}
.peek-button:disabled {
  opacity: 0.5;
  cursor: default;
}
.game-bubbles .bubble-target {
  top: 198px;
  z-index: 3;
  color: #607b8e;
  font-size: 14px;
}
.bubble-grid {
  top: 255px;
  bottom: 145px;
  left: 22%;
  right: 16%;
  gap: 14px;
}
.game-bubble,
.game-bubble:nth-child(3n) {
  width: clamp(60px, 8.5vh, 96px);
  height: clamp(60px, 8.5vh, 96px);
  font-size: 30px;
}
.bubble-george {
  width: 150px;
  height: 173px;
  left: 7%;
  bottom: 16%;
}
.bubble-grid.challenge {
  display: block;
  top: 290px;
  bottom: 145px;
  left: 21%;
  right: 16%;
}
.bubble-grid.challenge .game-bubble {
  position: absolute;
  left: var(--bx);
  top: var(--by);
  transform: translate(-50%, -50%);
  animation: bubble-roam 3.8s var(--delay) infinite ease-in-out;
}
@keyframes bubble-roam {
  0%,
  100% {
    translate: -18px 10px;
  }
  33% {
    translate: var(--drift) -22px;
  }
  65% {
    translate: 8px 19px;
  }
}
.bubble-grid.challenge .game-bubble.popped {
  animation: pop 0.35s both;
}
.color-tag.current {
  outline: 3px solid #a1a6bd;
  outline-offset: 4px;
  background: #fffef4;
  transform: translateY(-5px);
}
.color-tag.done {
  opacity: 0.55;
}
.sequence-label {
  font-size: 12px;
  margin-right: 3px;
}
.bubble-target .color-tag {
  min-width: 54px;
  text-align: center;
  position: relative;
  font-size: 23px;
  padding: 8px 12px;
}
.bubble-target .color-tag small {
  font-size: 8px;
  position: absolute;
  top: -6px;
  right: -2px;
  color: #fff;
  background: #9fa7b4;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  line-height: 15px;
}
.bubble-target i {
  font-size: 13px;
  color: #83a2a8;
  font-style: normal;
}
.game-dialog .puddle-peppa {
  bottom: 29%;
  width: 170px;
  height: 196px;
}
.game-dialog .puddle-row {
  bottom: 22%;
  height: 105px;
}
.game-dialog .puddle-splashes {
  bottom: 26%;
}
.puddle-splashes i {
  width: 12px;
  height: 21px;
  background: #a17350;
  border: 2px solid #d5ae7c;
  animation-duration: 0.85s;
}
.puddle-ripple {
  position: absolute;
  width: 150px;
  height: 30px;
  left: -75px;
  top: -9px;
  border: 4px solid #f1d09a;
  border-radius: 50%;
  animation: puddle-ring 0.8s ease-out both;
}
.puddle-ripple.ripple-echo {
  animation-delay: 0.14s;
}
.puddle-splash-word {
  position: absolute;
  top: -246px;
  left: -50px;
  width: 100px;
  color: #986640;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  text-shadow:
    2px 2px #fff4d4,
    -2px -2px #fff4d4;
  animation: puddle-callout 0.95s ease-out both;
}
@keyframes puddle-ring {
  from {
    transform: scale(0.4);
    opacity: 1;
  }
  to {
    transform: scale(1.3);
    opacity: 0;
  }
}
@keyframes puddle-callout {
  0% {
    transform: translateY(12px) scale(0.8);
    opacity: 0;
  }
  20% {
    transform: translateY(0) scale(1.1);
    opacity: 1;
  }
  65% {
    opacity: 1;
  }
  100% {
    transform: translateY(-15px);
    opacity: 0;
  }
}
.game-dialog .game-ground-note {
  bottom: 14%;
}
@media (min-width: 1450px) {
  .hero {
    height: min(720px, calc(100dvh - 140px));
    min-height: 620px;
  }
}
@media (max-width: 950px) {
  .challenge-hud {
    gap: 10px;
    font-size: 10px;
  }
  .challenge-hud b {
    font-size: 15px;
  }
  .game-status > p {
    max-width: 37%;
    font-size: 12px;
  }
  .is-runner .game-bottom {
    width: calc(100% - 370px);
    padding-left: 17px;
  }
  .is-runner .dialogue-avatar {
    display: none;
  }
  .picnic-decor {
    inset: auto 2% 15%;
  }
  .picnic-decor > .pig {
    width: 100px;
    height: 115px;
  }
  .picnic-decor > svg:last-child {
    width: 95px;
    height: 95px;
  }
  .peek-button {
    right: 15px;
    top: 70%;
    font-size: 10px;
  }
}
@media (max-width: 620px) {
  .game-header {
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    height: 55px;
    gap: 8px;
  }
  .game-header > div:not(.game-header-actions) {
    padding: 9px 12px;
    border-radius: 13px;
  }
  .game-header h2 {
    font-size: 16px;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .game-header > div > span {
    font-size: 7px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
  }
  .game-header-actions {
    gap: 6px;
  }
  .game-header-actions .mode-label,
  .fullscreen-button {
    display: none;
  }
  .game-header .icon-button {
    width: 36px;
    height: 39px;
    border-radius: 12px;
  }
  .game-status {
    top: 84px;
    left: 14px;
    right: 14px;
    min-height: 55px;
    padding: 10px 13px;
    gap: 9px;
    flex-wrap: wrap;
  }
  .game-status > p {
    max-width: none;
    flex: 1;
    font-size: 11px;
  }
  .game-status .game-progress {
    width: 75px;
  }
  .challenge-hud {
    flex-basis: 100%;
    justify-content: space-between;
    border-top: 1px dashed #dfd9bf;
    padding-top: 9px;
    margin-top: 2px;
  }
  .game-bottom {
    bottom: max(15px, env(safe-area-inset-bottom));
    width: calc(100% - 28px);
    height: 67px;
    padding: 9px 13px 9px 61px;
    border-radius: 18px;
  }
  .game-bottom > p {
    font-size: 11px;
  }
  .dialogue-avatar {
    width: 48px;
    height: 59px;
    left: 5px;
  }
  .dialogue-avatar .pig {
    width: 60px;
    height: 69px;
  }
  .game-bottom .read-help {
    font-size: 0;
  }
  .game-bottom .read-help svg {
    width: 22px;
    height: 22px;
  }
  .runner-hud {
    top: 87px;
    left: 14px;
    right: 14px;
    flex-direction: column;
    gap: 11px;
  }
  .runner-hud > span {
    font-size: 10px;
    padding: 7px 11px;
  }
  .runner-hud > div {
    width: 100%;
    justify-content: space-between;
    gap: 5px;
  }
  .runner-hud b {
    font-size: 11px;
    padding: 9px 10px;
    border-radius: 11px;
  }
  #run-time {
    min-width: 53px;
  }
  #run-hearts {
    letter-spacing: 1px;
  }
  .route-map {
    top: 185px;
    right: 20px;
    width: 195px;
    font-size: 9px;
  }
  .runner-controls {
    left: 16px;
    right: 16px;
    bottom: max(23px, env(safe-area-inset-bottom));
  }
  .runner-controls button {
    width: 56px;
    height: 55px;
    border-radius: 17px;
  }
  .runner-controls > button {
    width: 103px;
    font-size: 15px;
  }
  .runner-controls > span {
    display: none;
  }
  .is-runner .game-bottom {
    bottom: 106px;
    width: calc(100% - 30px);
    padding-left: 61px;
    height: 59px;
  }
  .is-runner .dialogue-avatar {
    display: block;
  }
  .runner-combo {
    font-size: 25px;
    top: 43%;
    left: 35%;
  }
  .overlay-card {
    padding: 24px 20px;
    border-radius: 24px;
    border-width: 4px;
  }
  .game-overlay {
    padding: 17px;
  }
  .overlay-card h2 {
    font-size: 22px;
  }
  .overlay-card p {
    font-size: 12px;
  }
  .brief-character {
    width: 90px;
    height: 103px;
  }
  .control-hint {
    font-size: 11px;
  }
  .overlay-buttons {
    gap: 12px;
  }
  .overlay-buttons .button {
    padding: 0 15px;
    font-size: 11px;
  }
  .memory-code {
    gap: 6px;
  }
  .memory-code span {
    width: 47px;
    height: 54px;
    padding: 5px;
  }
  .puzzle-answers > button {
    width: 69px;
    height: 65px;
  }
  .puzzle-answers svg {
    width: 45px;
    height: 45px;
  }
  .fruit-equations > div {
    gap: 8px;
    font-size: 18px;
    height: 52px;
  }
  .fruit-equations svg {
    width: 33px;
    height: 37px;
  }
  .game-picnic .playfield {
    padding-top: 70px;
    gap: 14px;
  }
  .picnic-blanket {
    width: calc(100% - 24px);
    height: min(465px, 57%);
    top: calc(50% + 40px);
    border-width: 5px;
  }
  .memory-grid.challenge {
    grid-template-columns: repeat(4, clamp(54px, 17vw, 75px));
    gap: 9px;
  }
  .memory-grid.challenge .memory-card {
    height: clamp(62px, 9vh, 84px);
  }
  .memory-grid.easy {
    grid-template-columns: repeat(3, clamp(75px, 21vw, 100px));
  }
  .memory-grid.easy .memory-card {
    height: 100px;
  }
  .picnic-tray {
    gap: 5px;
  }
  .picnic-tray span {
    width: 29px;
    height: 29px;
  }
  .picnic-tray svg {
    width: 25px;
    height: 25px;
  }
  .picnic-decor {
    bottom: 14%;
  }
  .picnic-decor > .pig {
    width: 63px;
    height: 72px;
  }
  .picnic-decor > svg:last-child {
    width: 59px;
    height: 59px;
  }
  .peek-button {
    top: auto;
    bottom: 99px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 8px 15px;
    min-height: 39px;
    font-size: 10px;
  }
  .peek-button small {
    display: inline;
    margin-left: 6px;
    font-size: 8px;
  }
  .game-bubbles .bubble-target {
    top: 211px;
    gap: 7px;
  }
  .bubble-target .color-tag {
    min-width: 40px;
    padding: 6px 8px;
    font-size: 20px;
  }
  .sequence-label {
    font-size: 10px;
  }
  .bubble-grid {
    top: 270px;
    left: 12%;
    right: 12%;
    bottom: 175px;
  }
  .bubble-grid.challenge {
    top: 294px;
    left: 12%;
    right: 12%;
    bottom: 171px;
  }
  .game-bubble,
  .game-bubble:nth-child(3n),
  .challenge .game-bubble {
    width: 55px;
    height: 55px;
    font-size: 24px;
  }
  .bubble-george {
    width: 80px;
    height: 92px;
    left: 4%;
    bottom: 11%;
  }
  @keyframes bubble-roam {
    0%,
    100% {
      translate: -8px 5px;
    }
    33% {
      translate: 10px -14px;
    }
    65% {
      translate: -8px 11px;
    }
  }
  .game-dialog .puddle-peppa {
    width: 124px;
    height: 143px;
    bottom: 31%;
  }
  .game-dialog .puddle-row {
    height: 77px;
    bottom: 25%;
  }
  .game-dialog .puddle-splashes {
    bottom: 29%;
  }
  .puddle-splash-word {
    top: -188px;
    font-size: 22px;
  }
  .game-dialog .game-ground-note {
    bottom: 19%;
  }
}
@media (max-height: 700px) and (max-width: 620px) {
  .game-header {
    top: 9px;
  }
  .game-status {
    top: 75px;
  }
  .runner-hud {
    top: 76px;
  }
  .route-map {
    top: 167px;
  }
  .game-picnic .playfield {
    padding-top: 62px;
  }
  .memory-grid.challenge {
    gap: 6px;
  }
  .memory-grid.challenge .memory-card {
    height: 51px;
  }
  .memory-grid.challenge .card-front svg {
    width: 34px;
    height: 34px;
  }
  .memory-grid.challenge small {
    font-size: 8px;
  }
  .memory-grid.challenge .card-back svg {
    width: 23px;
    height: 23px;
  }
  .picnic-tray {
    min-height: 26px;
  }
  .picnic-tray span {
    width: 24px;
    height: 24px;
  }
  .picnic-tray svg {
    width: 20px;
    height: 20px;
  }
  .peek-button {
    bottom: 84px;
    min-height: 34px;
  }
  .game-bottom {
    height: 56px;
  }
  .game-bubbles .bubble-target {
    top: 181px;
  }
  .bubble-grid.challenge {
    top: 247px;
    bottom: 139px;
  }
  .bubble-grid {
    top: 235px;
    bottom: 129px;
  }
  .game-bubble,
  .game-bubble:nth-child(3n),
  .challenge .game-bubble {
    width: 46px;
    height: 46px;
    font-size: 20px;
  }
  .brief-character {
    width: 62px;
    height: 72px;
    margin-bottom: 6px;
  }
  .overlay-card {
    padding: 17px;
  }
  .overlay-card h2 {
    font-size: 20px;
  }
  .overlay-card p {
    font-size: 11px;
  }
  .overlay-buttons {
    margin-top: 17px;
  }
  .control-hint {
    margin: 12px 0;
    padding: 10px;
  }
  .win-stars {
    font-size: 26px;
  }
  .reward-sticker {
    width: 70px;
    height: 70px;
    margin: 7px auto 12px;
  }
}
@media (max-height: 620px) and (orientation: landscape) {
  .game-header {
    top: 9px;
    height: 45px;
  }
  .game-header > div:not(.game-header-actions) {
    padding: 6px 13px;
  }
  .game-header h2 {
    font-size: 17px;
  }
  .game-header > div > span {
    font-size: 8px;
  }
  .game-header .icon-button {
    width: 36px;
    height: 36px;
  }
  .game-status {
    top: 68px;
    min-height: 41px;
    padding: 8px 14px;
  }
  .game-status > p {
    font-size: 10px;
  }
  .game-bottom {
    bottom: 11px;
    height: 49px;
  }
  .game-bottom > p {
    font-size: 11px;
  }
  .game-bottom .dialogue-avatar {
    width: 45px;
    height: 55px;
  }
  .dialogue-avatar .pig {
    width: 60px;
    height: 69px;
  }
  .runner-hud {
    top: 70px;
    flex-direction: row;
    gap: 8px;
  }
  .runner-hud > span {
    flex-shrink: 0;
  }
  .runner-hud > div {
    width: auto;
    flex: 1;
    justify-content: flex-end;
  }
  .runner-hud b {
    font-size: 12px;
    padding: 8px 11px;
  }
  .route-map {
    top: 127px;
  }
  .runner-controls {
    bottom: 12px;
  }
  .runner-controls button {
    width: 51px;
    height: 46px;
  }
  .runner-controls > button {
    width: 99px;
  }
  .runner-controls > span {
    bottom: 62px;
    font-size: 9px;
  }
  .game-picnic .playfield {
    padding-top: 58px;
    gap: 9px;
  }
  .memory-grid.challenge {
    grid-template-columns: repeat(8, clamp(48px, 8vw, 72px));
    gap: 7px;
  }
  .memory-grid.challenge .memory-card {
    height: 65px;
  }
  .memory-grid.challenge .card-front svg {
    width: 38px;
    height: 38px;
  }
  .memory-grid.challenge small {
    font-size: 8px;
  }
  .picnic-blanket {
    width: 77%;
    height: 58%;
    top: 56%;
  }
  .picnic-tray {
    min-height: 28px;
  }
  .picnic-tray span {
    width: 26px;
    height: 26px;
  }
  .picnic-tray svg {
    width: 22px;
    height: 22px;
  }
  .peek-button {
    top: auto;
    bottom: 15px;
    right: 3%;
    padding: 8px 10px;
    min-height: 34px;
  }
  .picnic-decor > .pig {
    width: 76px;
    height: 87px;
  }
  .picnic-decor > svg:last-child {
    width: 68px;
    height: 68px;
  }
  .game-bubbles .bubble-target {
    top: 130px;
  }
  .bubble-target .color-tag {
    font-size: 18px;
    padding: 4px 10px;
    min-width: 40px;
  }
  .bubble-grid.challenge {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 1fr);
    align-items: center;
    justify-items: center;
    gap: 8px;
    top: 180px;
    bottom: 85px;
    left: 18%;
    right: 10%;
  }
  .bubble-grid.challenge .game-bubble {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    animation-name: bubble-drift-short;
  }
  .bubble-grid.challenge .game-bubble.popped {
    animation-name: pop;
  }
  .bubble-grid {
    top: 186px;
    bottom: 92px;
  }
  .game-bubble,
  .game-bubble:nth-child(3n) {
    width: 49px;
    height: 49px;
    font-size: 20px;
  }
  .bubble-george {
    width: 90px;
    height: 104px;
  }
  .overlay-card {
    padding: 17px 30px;
  }
  .brief-character,
  .pause-character {
    display: none;
  }
  .overlay-card h2 {
    font-size: 22px;
    margin: 7px 0 9px;
  }
  .overlay-card p {
    font-size: 11px;
  }
  .control-hint {
    margin: 9px 0;
    padding: 9px;
  }
  .overlay-buttons {
    margin-top: 16px;
  }
  .reward-sticker {
    display: none;
  }
  .win-stars {
    font-size: 25px;
  }
  .result-score {
    font-size: 26px;
  }
  .fruit-equations {
    margin-top: 10px;
    padding: 5px;
  }
  .fruit-equations > div {
    height: 36px;
    font-size: 18px;
  }
  .fruit-equations svg {
    width: 28px;
    height: 28px;
  }
  .puzzle-answers {
    margin: 12px 0 7px;
  }
  .puzzle-answers > button {
    height: 45px;
  }
  .puzzle-answers svg {
    width: 35px;
    height: 35px;
  }
  .memory-code {
    margin-top: 15px;
  }
  .memory-code span {
    width: 50px;
    height: 51px;
  }
  .puzzle-tag {
    margin-bottom: 8px;
  }
}

/* On short, narrow screens, let players open the whole hint while play waits. */
@media (max-width: 620px) and (max-height: 500px) and (orientation: landscape) {
  .game-dialog.is-runner .game-bottom {
    left: 48%;
    bottom: 12px;
    width: 82px;
    height: 46px;
    padding: 0;
    border-radius: 14px;
  }
  .game-dialog.is-runner .game-bottom > p,
  .game-dialog.is-runner .game-bottom .dialogue-avatar,
  .game-dialog.is-runner .game-bottom .read-help {
    display: none;
  }
  .game-dialog.is-runner .game-bottom .show-current-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 44px;
    border-radius: 12px;
    background: transparent;
    color: #5d674f;
    font-size: 12px;
    touch-action: manipulation;
  }
}
@keyframes bubble-drift-short {
  0%,
  100% {
    translate: 0 3px;
  }
  50% {
    translate: 8px -3px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .puddle-ripple,
  .puddle-splash-word,
  .puddle-splashes i {
    animation: puddle-fade 0.7s ease-out both;
    animation-duration: 0.7s !important;
  }
  .puddle-splashes i {
    translate: var(--dx) -15px;
  }
  .bubble-grid.challenge .game-bubble {
    animation: none;
  }
  .bubble-grid.challenge .game-bubble.popped {
    opacity: 0;
  }
}
@keyframes puddle-fade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
