:root {
  --sky: #51b8ff;
  --sky-deep: #2689e8;
  --cream: #fff9e9;
  --cream-2: #fff3cf;
  --ink: #3f2719;
  --purple: #8d66dd;
  --purple-dark: #6d4fc8;
  --blue: #279bf6;
  --blue-dark: #1470d4;
  --green: #76c938;
  --green-dark: #4fa522;
  --gold: #ffc934;
  --orange: #ff9d2e;
  --pink: #ff7da3;
  --panel-shadow: 0 12px 0 rgb(42 114 190 / 0.18), 0 20px 34px rgb(25 78 133 / 0.2);
  --soft-shadow: 0 10px 24px rgb(52 82 120 / 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  background:
    radial-gradient(circle at 16% 12%, rgb(255 255 255 / 0.45), transparent 28%),
    linear-gradient(145deg, #7bd2ff 0%, #3ba8f7 48%, #2f90ec 100%);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
.findable:focus-visible {
  outline: 5px solid rgb(255 213 62 / 0.85);
  outline-offset: 4px;
}

.game-shell {
  width: min(100vw, 1720px);
  height: 100dvh;
  margin: 0 auto;
  padding: clamp(10px, 1.4vw, 20px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.1vw, 18px);
}

.top-bar {
  display: grid;
  grid-template-columns: auto minmax(104px, 176px) minmax(290px, 650px) auto;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.2vw, 18px);
}

.round-button,
.level-pill,
.prompt-card,
.big-action,
.doggie-card,
.target-tray,
.modal-panel {
  border: 5px solid rgb(255 255 255 / 0.86);
  box-shadow: var(--soft-shadow);
}

.round-button {
  position: relative;
  width: clamp(62px, 6.3vw, 96px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 26%;
  background: linear-gradient(180deg, #ffe45d, #ffae1c);
  box-shadow:
    inset 0 -7px 0 rgb(174 107 0 / 0.18),
    0 7px 0 rgb(43 109 178 / 0.2),
    0 12px 22px rgb(29 70 112 / 0.18);
}

.round-button:active,
.big-action:active,
.target-card:active,
.level-tile:active {
  transform: translateY(3px) scale(0.98);
}

.level-pill {
  min-height: clamp(62px, 6.1vw, 88px);
  padding: 0 clamp(16px, 2vw, 30px);
  display: grid;
  place-items: center;
  border-radius: 32px;
  color: white;
  font-size: clamp(24px, 2.5vw, 42px);
  font-weight: 900;
  text-shadow: 0 3px 0 rgb(0 0 0 / 0.16);
  background: linear-gradient(180deg, #8d75f0, #6c59d8);
  box-shadow:
    inset 0 -8px 0 rgb(35 34 132 / 0.18),
    0 10px 22px rgb(36 83 147 / 0.22);
  white-space: nowrap;
}

.prompt-card {
  min-height: clamp(62px, 6.1vw, 88px);
  padding: 0 clamp(18px, 2.2vw, 34px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.4vw, 22px);
  border-radius: 999px;
  background: linear-gradient(180deg, #fffefa, #fff4d7);
  font-size: clamp(22px, 2.2vw, 42px);
  font-weight: 900;
  text-align: center;
  box-shadow:
    inset 0 -7px 0 rgb(224 164 85 / 0.12),
    0 10px 22px rgb(36 83 147 / 0.2);
}

.top-actions {
  display: flex;
  gap: clamp(10px, 1vw, 16px);
}

.badge {
  position: absolute;
  right: -10px;
  bottom: -8px;
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 4px solid white;
  border-radius: 999px;
  color: white;
  background: #ff6238;
  font-size: 22px;
  font-weight: 900;
}

.play-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 19vw, 330px);
  gap: clamp(12px, 1.2vw, 20px);
}

.scene-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(10px, 1vw, 16px);
}

.scene-card {
  position: relative;
  min-height: 0;
  border: 5px solid rgb(255 255 255 / 0.72);
  border-radius: 34px;
  overflow: hidden;
  background: #bdecff;
  box-shadow: var(--panel-shadow);
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-image: var(--scene-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.16), transparent 28%),
    radial-gradient(circle at 50% 80%, rgb(255 240 178 / 0.16), transparent 40%);
}

.scene.world-bedroom {
  background:
    radial-gradient(circle at 82% 22%, rgb(255 247 160 / 0.55), transparent 12%),
    linear-gradient(180deg, #b8dcff 0 46%, #ffd9e8 47% 48%, #ffeec1 48% 100%);
}

.scene.world-kitchen {
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.48) 0 18%, transparent 18% 100%),
    linear-gradient(180deg, #ffefbf 0 44%, #ffce7c 45% 100%);
}

.scene.world-backyard {
  background:
    radial-gradient(circle at 82% 14%, #ffea63 0 7%, transparent 8%),
    linear-gradient(180deg, #79d8ff 0 48%, #8edd5f 49% 100%);
}

.scene.world-park {
  background:
    radial-gradient(circle at 20% 78%, #4fc868 0 16%, transparent 17%),
    radial-gradient(circle at 78% 76%, #55cd70 0 18%, transparent 19%),
    linear-gradient(180deg, #83d9ff 0 54%, #93de6f 55% 100%);
}

.scene.world-beach {
  background:
    linear-gradient(180deg, #72d5ff 0 34%, #39b9ef 35% 44%, #ffe28c 45% 100%);
}

.scene.world-farm {
  background:
    linear-gradient(180deg, #80dcff 0 45%, #9bdd63 46% 100%);
}

.scene.world-vehicle {
  background:
    linear-gradient(26deg, transparent 0 42%, #6e7480 43% 58%, transparent 59%),
    linear-gradient(180deg, #9ee5ff 0 50%, #a6e47d 51% 100%);
}

.scene.world-zoo {
  background:
    radial-gradient(circle at 13% 24%, #4fbc63 0 12%, transparent 13%),
    radial-gradient(circle at 84% 21%, #5bc16a 0 13%, transparent 14%),
    linear-gradient(180deg, #9fe2ff 0 48%, #a7dc70 49% 100%);
}

.scene.world-dreamland {
  background:
    radial-gradient(circle at 12% 14%, rgb(255 255 255 / 0.85), transparent 8%),
    radial-gradient(circle at 78% 22%, rgb(255 218 90 / 0.75), transparent 9%),
    linear-gradient(180deg, #7fb5ff 0 38%, #baa2ff 39% 78%, #f1d6ff 79% 100%);
}

.backdrop-decor,
.backdrop-decor span {
  position: absolute;
  pointer-events: none;
}

.backdrop-decor {
  inset: 0;
  z-index: 1;
}

.decor-sun {
  right: 9%;
  top: 8%;
  width: 90px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: #ffe86b;
  box-shadow: 0 0 0 18px rgb(255 232 107 / 0.25);
}

.decor-main {
  left: 6%;
  bottom: 16%;
  width: 26%;
  height: 34%;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff1ac, #d99a42);
  box-shadow: inset 0 -18px 0 rgb(130 79 28 / 0.12);
}

.decor-side {
  right: 8%;
  bottom: 17%;
  width: 23%;
  height: 30%;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff, #efb45a);
  box-shadow: inset 0 -18px 0 rgb(130 79 28 / 0.12);
}

.decor-rug {
  left: 32%;
  right: 25%;
  bottom: 8%;
  height: 18%;
  border-radius: 999px;
  background: rgb(111 201 89 / 0.5);
  box-shadow: inset 0 0 0 14px rgb(255 255 255 / 0.2);
}

.findable {
  position: absolute;
  width: var(--asset-size);
  aspect-ratio: var(--asset-ratio, 1);
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  transform: translate(-50%, -50%) rotate(var(--rotation, 0deg));
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 22px;
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 10px 9px rgb(70 47 21 / 0.24));
  z-index: var(--z, 3);
}

.findable img {
  width: calc(100% * var(--visual-scale, 1));
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.toy-box-drop {
  position: absolute;
  right: 4%;
  bottom: 4%;
  width: clamp(126px, 15vw, 214px);
  height: clamp(82px, 10vw, 142px);
  border: 6px solid rgb(220 147 0 / 0.35);
  border-radius: 22px 22px 30px 30px;
  background:
    linear-gradient(180deg, rgb(255 230 73 / 0.9) 0 24%, transparent 25%),
    linear-gradient(180deg, #ffd63e, #f3a318);
  box-shadow:
    inset 0 -14px 0 rgb(160 97 0 / 0.14),
    0 12px 16px rgb(83 55 12 / 0.18);
  z-index: 6;
}

.toy-box-drop::before,
.toy-box-drop::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.toy-box-drop::before {
  left: 11%;
  right: 11%;
  top: -20%;
  height: 36%;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffe96a, #f5b72a);
  transform: rotate(-3deg);
  box-shadow: 0 8px 8px rgb(121 74 0 / 0.16);
}

.toy-box-drop::after {
  left: 38%;
  top: 46%;
  width: 24%;
  height: 14%;
  border-radius: 999px;
  background: rgb(116 82 30 / 0.32);
}

.toy-box-drop span {
  position: absolute;
  bottom: 58%;
  width: 24%;
  aspect-ratio: 1;
  border: 4px solid rgb(255 255 255 / 0.5);
  border-radius: 8px;
  background: var(--block-color, #4fb3ff);
  transform: rotate(var(--tilt, -8deg));
}

.toy-box-drop span:nth-child(1) {
  left: 14%;
  --block-color: #3eb6ff;
}

.toy-box-drop span:nth-child(2) {
  left: 38%;
  --block-color: #ff5d7e;
  --tilt: 7deg;
}

.toy-box-drop span:nth-child(3) {
  left: 63%;
  --block-color: #67c943;
  --tilt: -2deg;
}

.collect-flyer {
  position: fixed;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 100;
  filter: drop-shadow(0 12px 12px rgb(53 51 33 / 0.24));
}

.collect-flyer img,
.collect-flyer .emoji-token {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.reward-pop {
  animation: reward-pop 520ms ease;
}

.emoji-token {
  width: min(100%, 120px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 5px solid rgb(255 255 255 / 0.88);
  border-radius: 28%;
  background:
    radial-gradient(circle at 34% 25%, rgb(255 255 255 / 0.8), transparent 24%),
    linear-gradient(180deg, #fff8d7, #ffd86f);
  box-shadow:
    inset 0 -8px 0 rgb(209 129 35 / 0.14),
    0 8px 14px rgb(73 52 22 / 0.16);
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1;
}

.findable.found {
  pointer-events: none;
  animation: collect-pop 0.9s ease-in-out forwards;
}

.findable.hinted {
  animation: hint-wiggle 0.92s ease-in-out 3;
}

.findable.hinted::before,
.findable.found::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 6px solid rgb(255 233 74 / 0.92);
  border-radius: 35%;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgb(255 228 93 / 0.85));
}

.ambient {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  font-size: var(--ambient-size);
  filter: drop-shadow(0 7px 6px rgb(54 67 97 / 0.2));
}

.ambient.bumped {
  animation: soft-bump 0.55s ease;
}

.sparkle {
  position: absolute;
  width: 20px;
  aspect-ratio: 1;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  background: var(--gold);
  clip-path: polygon(50% 0%, 62% 35%, 100% 50%, 62% 65%, 50% 100%, 38% 65%, 0% 50%, 38% 35%);
  animation: sparkle-out 800ms ease-out forwards;
  z-index: 20;
}

.target-tray {
  min-height: clamp(112px, 15vh, 170px);
  border-radius: 30px;
  padding: clamp(8px, 1vw, 14px);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.97), rgb(255 247 226 / 0.98)),
    repeating-linear-gradient(90deg, transparent 0 120px, rgb(225 170 88 / 0.15) 120px 123px);
}

.target-cards {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--target-count, 2), minmax(0, 1fr));
  gap: clamp(8px, 1vw, 12px);
}

.target-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  border: 4px dashed rgb(151 115 229 / 0.55);
  border-radius: 24px;
  background: rgb(255 249 255 / 0.72);
  padding: 6px;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.target-card img {
  width: min(72%, 96px);
  max-height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 5px 4px rgb(69 45 20 / 0.18));
}

.target-card .emoji-token {
  width: min(72%, 88px);
  max-width: 88px;
  border-width: 3px;
  border-radius: 22%;
  font-size: clamp(34px, 4vw, 62px);
  box-shadow: 0 5px 8px rgb(73 52 22 / 0.12);
}

.target-card span {
  width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(17px, 1.3vw, 25px);
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-card.done {
  border-style: solid;
  border-color: rgb(92 188 49 / 0.75);
  background: rgb(234 255 215 / 0.9);
}

.target-card.done::after {
  content: "✓";
  position: absolute;
  right: 8px;
  bottom: 30px;
  width: clamp(30px, 3vw, 45px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 4px solid white;
  border-radius: 999px;
  color: white;
  background: linear-gradient(180deg, #7dd43d, #4aaf22);
  box-shadow: 0 5px 8px rgb(74 114 41 / 0.3);
  font-size: clamp(25px, 2.6vw, 38px);
  font-weight: 900;
  line-height: 1;
}

.doggie-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto auto;
  gap: clamp(10px, 1vw, 14px);
}

.doggie-card {
  border-radius: 34px;
  background: linear-gradient(180deg, #a87bf1 0%, #e2ceff 52%, #fff7fd 100%);
}

.guide-card {
  min-height: 0;
  padding: clamp(12px, 1.2vw, 18px);
  display: grid;
  grid-template-rows: auto minmax(92px, 1fr) auto;
  place-items: center;
  gap: clamp(6px, 0.8vw, 10px);
  overflow: hidden;
}

.guide-card h1 {
  margin: 0;
  color: white;
  font-size: clamp(26px, 2.2vw, 38px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 3px 0 rgb(64 31 134 / 0.22);
}

.doggie-mascot {
  width: min(76%, 190px);
  height: clamp(104px, 17vh, 220px);
  min-height: 0;
  display: grid;
  place-items: end center;
  background-image: url("assets/generated/doggie.png");
  background-position: center bottom;
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 13px 10px rgb(68 39 8 / 0.2));
}

.doggie-mascot > span {
  display: none;
}

.doggie-mascot.cheer {
  animation: doggie-bounce 0.62s ease-in-out 2;
}

.doggie-bubble {
  width: 100%;
  margin: 0;
  padding: clamp(12px, 1.1vw, 18px);
  border: 4px solid rgb(228 184 119 / 0.34);
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf8, #fff3dc);
  box-shadow: inset 0 -4px 0 rgb(222 172 94 / 0.1);
  font-size: clamp(18px, 1.45vw, 24px);
  font-weight: 800;
  text-align: center;
}

.found-card {
  min-height: 76px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #fffdf9, #fff3df);
  font-size: clamp(19px, 1.45vw, 25px);
  font-weight: 900;
}

.found-card strong {
  color: var(--green-dark);
  font-size: clamp(34px, 3vw, 52px);
}

.sticker-card {
  min-height: 112px;
  padding: 12px;
  display: grid;
  place-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #fff6ff, #f8e6ff);
}

.mini-label {
  color: var(--purple-dark);
  font-size: clamp(20px, 1.4vw, 26px);
  font-weight: 900;
}

.big-sticker {
  width: clamp(68px, 6vw, 96px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #fff176;
  font-size: clamp(58px, 5vw, 86px);
  text-shadow:
    0 4px 0 #f3a31e,
    0 8px 14px rgb(202 107 7 / 0.25);
}

.side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1vw, 14px);
}

.big-action {
  min-height: clamp(76px, 7.8vw, 112px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1vw, 14px);
  border-radius: 28px;
  color: white;
  font-size: clamp(25px, 2.2vw, 38px);
  font-weight: 900;
  text-shadow: 0 3px 0 rgb(0 0 0 / 0.13);
}

.hint-action {
  background: linear-gradient(180deg, #60c0ff, #248ee8);
  box-shadow:
    inset 0 -8px 0 rgb(15 98 184 / 0.22),
    0 11px 20px rgb(44 94 143 / 0.22);
}

.next-action {
  background: linear-gradient(180deg, #98dc4a, #61bd25);
  box-shadow:
    inset 0 -8px 0 rgb(55 137 24 / 0.22),
    0 11px 20px rgb(44 94 143 / 0.22);
}

.next-action.locked {
  filter: saturate(0.35);
  opacity: 0.65;
}

.icon,
.speaker-icon {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
}

.icon {
  width: clamp(28px, 3.2vw, 48px);
  aspect-ratio: 1;
}

.arrow-left::before,
.arrow-right::before {
  content: "";
  position: absolute;
  inset: 12% 4% 12% 18%;
  background: white;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 50% 66%, 0 66%, 0 34%, 50% 34%);
}

.arrow-left::before {
  transform: scaleX(-1);
}

.bulb::before {
  content: "";
  position: absolute;
  inset: 12% 24% 36%;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.32);
}

.bulb::after {
  content: "";
  position: absolute;
  left: 35%;
  right: 35%;
  bottom: 16%;
  height: 25%;
  border-radius: 0 0 8px 8px;
  background: white;
}

.gear::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 10px solid white;
  border-radius: 999px;
  box-shadow: inset 0 0 0 10px transparent;
}

.gear::after {
  content: "";
  position: absolute;
  inset: 39%;
  border-radius: 999px;
  background: white;
  box-shadow:
    0 -30px 0 -7px white,
    0 30px 0 -7px white,
    -30px 0 0 -7px white,
    30px 0 0 -7px white;
}

.search::before {
  content: "";
  position: absolute;
  inset: 6% 24% 24% 6%;
  border: 8px solid white;
  border-radius: 999px;
}

.search::after {
  content: "";
  position: absolute;
  right: 5%;
  bottom: 10%;
  width: 42%;
  height: 9px;
  border-radius: 99px;
  background: white;
  transform: rotate(45deg);
  transform-origin: center;
}

.close::before,
.close::after {
  content: "";
  position: absolute;
  left: 13%;
  top: 44%;
  width: 74%;
  height: 10px;
  border-radius: 99px;
  background: white;
}

.close::before {
  transform: rotate(45deg);
}

.close::after {
  transform: rotate(-45deg);
}

.reset::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 8px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
}

.reset::after {
  content: "";
  position: absolute;
  right: 5%;
  top: 7%;
  width: 28%;
  aspect-ratio: 1;
  background: currentColor;
  clip-path: polygon(0 0, 100% 40%, 18% 100%);
}

.speaker-icon {
  width: clamp(38px, 4vw, 60px);
  height: clamp(32px, 3.4vw, 52px);
}

.speaker-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14%;
  width: 54%;
  height: 72%;
  background: var(--blue);
  clip-path: polygon(0 30%, 34% 30%, 80% 0, 80% 100%, 34% 70%, 0 70%);
}

.speaker-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 13%;
  width: 36%;
  height: 74%;
  border: 7px solid var(--blue);
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.speaker-icon.small {
  width: 38px;
  height: 32px;
}

.modal {
  width: min(940px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgb(31 79 136 / 0.38);
  backdrop-filter: blur(3px);
}

.modal-panel {
  max-height: calc(100dvh - 28px);
  margin: 0;
  overflow: hidden;
  border-radius: 34px;
  background: linear-gradient(180deg, #fffdf5, #fff1d1);
  padding: clamp(14px, 2vw, 24px);
  box-shadow: 0 22px 50px rgb(35 60 95 / 0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
}

.small-close {
  width: 56px;
  background: linear-gradient(180deg, #ff9ab2, #ff5f7a);
}

.world-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.world-tab,
.level-tile,
.setting-row {
  border: 4px solid rgb(255 255 255 / 0.86);
  box-shadow: 0 6px 12px rgb(42 94 146 / 0.14);
}

.world-tab {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: 19px;
  font-weight: 900;
}

.world-tab.active {
  color: white;
  background: linear-gradient(180deg, #8b74ef, #6f55d9);
}

.level-grid {
  max-height: min(520px, 58dvh);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  overflow: auto;
  padding: 2px 2px 8px;
}

.level-tile {
  min-height: 82px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fff4de);
  font-size: 24px;
  font-weight: 900;
}

.level-tile.active {
  color: white;
  background: linear-gradient(180deg, #72bfef, #258ee8);
}

.level-tile.completed::after {
  content: "★";
  color: #ffc928;
  font-size: 24px;
  text-shadow: 0 2px 0 #e98b16;
}

.sticker-pages {
  max-height: min(590px, 64dvh);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  overflow: auto;
}

.sticker-page {
  min-height: 210px;
  border: 4px dashed rgb(147 109 219 / 0.35);
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 22%, rgb(255 202 75 / 0.26), transparent 24%),
    linear-gradient(180deg, #fff, #f8f4ff);
  padding: 12px;
}

.sticker-page h3 {
  margin: 0 0 8px;
  color: var(--purple-dark);
  font-size: 22px;
}

.sticker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sticker-chip {
  min-width: 58px;
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 3px solid rgb(255 255 255 / 0.9);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8c6, #ffd968);
  font-size: 32px;
  box-shadow: 0 5px 10px rgb(96 73 29 / 0.18);
}

.settings-panel {
  max-width: 620px;
}

.setting-row {
  width: 100%;
  min-height: 72px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  border-radius: 22px;
  background: #fff;
  padding: 0 18px;
  font-size: 23px;
  font-weight: 900;
  text-align: left;
}

.setting-row strong {
  color: var(--green-dark);
}

.danger-soft {
  color: #b23a4c;
}

.celebration {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgb(36 88 151 / 0.34);
  z-index: 60;
}

.celebration.show {
  display: grid;
}

.celebration-card {
  width: min(560px, calc(100vw - 28px));
  border: 7px solid white;
  border-radius: 40px;
  background: linear-gradient(180deg, #fffef7, #ffe7f0);
  padding: clamp(24px, 4vw, 42px);
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
  box-shadow: 0 24px 56px rgb(42 70 112 / 0.32);
  animation: celebration-in 360ms ease-out;
}

.celebration-burst {
  color: #ffd633;
  font-size: 106px;
  line-height: 0.9;
  text-shadow: 0 6px 0 #f0a324;
}

.celebration-card h2 {
  margin: 0;
  color: var(--purple-dark);
  font-size: clamp(40px, 6vw, 70px);
  line-height: 1;
}

.celebration-card p {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 800;
}

@keyframes hint-wiggle {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scale(1);
  }
  25% {
    transform: translate(-50%, -50%) rotate(calc(var(--rotation, 0deg) - 7deg)) scale(1.08);
  }
  75% {
    transform: translate(-50%, -50%) rotate(calc(var(--rotation, 0deg) + 7deg)) scale(1.08);
  }
}

@keyframes collect-pop {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -66%) scale(1.2) rotate(-5deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -110%) scale(0.32) rotate(10deg);
  }
}

@keyframes sparkle-out {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(0);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5) rotate(25deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -92%) scale(0.3) rotate(80deg);
  }
}

@keyframes soft-bump {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -58%) scale(1.16) rotate(-5deg);
  }
}

@keyframes doggie-bounce {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-14px) rotate(-3deg);
  }
}

@keyframes reward-pop {
  0%,
  100% {
    transform: scale(1);
  }
  48% {
    transform: scale(1.08) rotate(-2deg);
  }
}

@keyframes celebration-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .game-shell {
    height: auto;
    min-height: 100dvh;
  }

  .top-bar {
    grid-template-columns: auto minmax(98px, 1fr) auto auto;
  }

  .prompt-card {
    grid-column: 1 / -1;
    order: 5;
  }

  .top-actions {
    justify-content: end;
  }

  .play-layout {
    grid-template-columns: 1fr;
  }

  .scene-card {
    aspect-ratio: 16 / 10;
  }

  .doggie-panel {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .guide-card {
    grid-row: span 2;
  }

  .side-actions {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .game-shell {
    padding: 8px;
    gap: 8px;
  }

  .top-bar {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .top-actions {
    grid-column: 3;
  }

  .round-button {
    width: 58px;
    border-width: 4px;
  }

  .level-pill {
    min-height: 58px;
  }

  .prompt-card {
    min-height: 58px;
    padding: 0 12px;
  }

  .scene-card {
    aspect-ratio: 4 / 3;
    border-radius: 24px;
  }

  .target-tray {
    min-height: 106px;
    border-radius: 22px;
  }

  .target-cards {
    overflow-x: auto;
    grid-template-columns: repeat(var(--target-count, 2), minmax(106px, 1fr));
  }

  .target-card span {
    font-size: 16px;
  }

  .doggie-panel {
    grid-template-columns: 1fr;
  }

  .guide-card {
    min-height: 260px;
    grid-row: auto;
  }

  .doggie-mascot {
    width: 180px;
    min-height: 150px;
  }

  .side-actions {
    grid-column: auto;
  }

  .level-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .sticker-pages {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Portrait-first app frame: the whole game stays inside one screen. */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
}

.game-shell {
  width: min(100vw, 680px, calc(100dvh * 0.72));
  height: 100dvh;
  min-height: 0;
  padding:
    max(6px, env(safe-area-inset-top))
    max(6px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom))
    max(6px, env(safe-area-inset-left));
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(6px, 1dvh, 10px);
  overflow: hidden;
}

.top-bar {
  grid-template-columns: clamp(44px, 10vw, 58px) minmax(0, 1fr) auto;
  grid-template-areas:
    "back level actions"
    "prompt prompt prompt";
  justify-content: stretch;
  gap: clamp(5px, 0.9dvh, 8px);
}

.back-button {
  grid-area: back;
}

.level-pill {
  grid-area: level;
  min-height: clamp(44px, 6.5dvh, 58px);
  padding: 0 clamp(10px, 3vw, 18px);
  border-width: 4px;
  border-radius: 20px;
  font-size: clamp(20px, 5.3vw, 30px);
}

.prompt-card {
  grid-area: prompt;
  min-height: clamp(44px, 6.6dvh, 60px);
  max-height: clamp(50px, 7.4dvh, 68px);
  padding: 0 clamp(10px, 3vw, 16px);
  gap: clamp(8px, 2.2vw, 12px);
  border-width: 4px;
  font-size: clamp(16px, 4.4vw, 24px);
  line-height: 1.05;
  overflow: hidden;
}

#promptText {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.top-actions {
  grid-area: actions;
  gap: clamp(5px, 1.5vw, 8px);
}

.round-button {
  width: clamp(44px, 10vw, 58px);
  border-width: 4px;
  border-radius: 20px;
}

.badge {
  right: -7px;
  bottom: -6px;
  min-width: clamp(24px, 6vw, 32px);
  height: clamp(24px, 6vw, 32px);
  border-width: 3px;
  font-size: clamp(14px, 3.8vw, 20px);
}

.speaker-icon {
  width: clamp(27px, 7vw, 38px);
  height: clamp(23px, 6vw, 32px);
}

.speaker-icon::after {
  border-width: clamp(4px, 1.25vw, 6px);
}

.icon {
  width: clamp(24px, 6.5vw, 38px);
}

.gear::before,
.search::before,
.reset::before {
  border-width: clamp(5px, 1.6vw, 8px);
}

.gear::after {
  box-shadow:
    0 -22px 0 -6px white,
    0 22px 0 -6px white,
    -22px 0 0 -6px white,
    22px 0 0 -6px white;
}

.search::after {
  height: clamp(6px, 1.7vw, 9px);
}

.play-layout {
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) clamp(126px, 21dvh, 176px);
  gap: clamp(6px, 1dvh, 10px);
  overflow: hidden;
}

.scene-wrap {
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) clamp(72px, 12dvh, 112px);
  gap: clamp(5px, 0.9dvh, 8px);
  overflow: hidden;
}

.scene-card {
  min-height: 0;
  border-width: 4px;
  border-radius: clamp(18px, 5vw, 28px);
}

.scene {
  background-size: 100% 100%;
}

.findable {
  border-radius: clamp(12px, 3.5vw, 18px);
  filter: drop-shadow(0 7px 7px rgb(70 47 21 / 0.23));
}

.target-tray {
  min-height: 0;
  height: 100%;
  padding: clamp(4px, 1.3vw, 8px);
  border-width: 4px;
  border-radius: clamp(16px, 5vw, 24px);
}

.target-cards {
  grid-template-columns: repeat(var(--target-count, 2), minmax(0, 1fr));
  gap: clamp(4px, 1.2vw, 8px);
  overflow: hidden;
}

.target-card {
  border-width: 3px;
  border-radius: clamp(12px, 3.7vw, 18px);
  padding: clamp(3px, 1vw, 6px);
}

.target-card img {
  width: min(82%, 72px);
  max-height: clamp(34px, 7dvh, 62px);
}

.target-card .emoji-token {
  width: min(78%, 62px);
  max-width: 62px;
  border-width: 2px;
  border-radius: 18%;
  font-size: clamp(24px, 7vw, 42px);
}

.target-card span {
  font-size: clamp(11px, 3.2vw, 16px);
  line-height: 1;
}

.target-card.done::after {
  right: 3px;
  bottom: clamp(16px, 3.8dvh, 28px);
  width: clamp(22px, 6vw, 32px);
  border-width: 3px;
  font-size: clamp(17px, 4.8vw, 25px);
}

.doggie-panel {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(78px, 0.48fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(5px, 1vw, 8px);
  overflow: hidden;
}

.doggie-card,
.big-action {
  border-width: 4px;
  border-radius: clamp(16px, 4.8vw, 24px);
}

.guide-card {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  padding: clamp(5px, 1.4vw, 8px);
  grid-template-columns: clamp(48px, 12vw, 70px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(5px, 1.4vw, 8px);
}

.guide-card h1 {
  display: none;
}

.doggie-mascot {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 78px;
}

.doggie-bubble {
  align-self: center;
  padding: clamp(7px, 1.8vw, 10px);
  border-width: 3px;
  border-radius: 18px;
  font-size: clamp(12px, 3.3vw, 16px);
  line-height: 1.08;
  max-height: 100%;
  overflow: hidden;
}

.found-card {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  padding: clamp(5px, 1.4vw, 8px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
  font-size: clamp(12px, 3.2vw, 16px);
  line-height: 1;
  text-align: center;
}

.found-card strong {
  font-size: clamp(24px, 7vw, 38px);
  line-height: 1;
}

.sticker-card {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  padding: clamp(5px, 1.3vw, 8px);
  gap: 0;
}

.mini-label {
  font-size: clamp(10px, 2.7vw, 14px);
  line-height: 1;
}

.big-sticker {
  width: clamp(34px, 10vw, 52px);
  font-size: clamp(32px, 9vw, 50px);
  line-height: 1;
}

.side-actions {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  grid-template-columns: 1fr 1fr;
  gap: clamp(5px, 1.4vw, 8px);
}

.big-action {
  min-height: 0;
  height: 100%;
  padding: 0 clamp(6px, 1.8vw, 10px);
  gap: clamp(5px, 1.6vw, 8px);
  font-size: clamp(17px, 5vw, 26px);
}

.toy-box-drop {
  width: clamp(92px, 26vw, 150px);
  height: clamp(62px, 17vw, 98px);
  border-width: 4px;
  border-radius: 16px 16px 22px 22px;
}

.toy-box-drop span {
  border-width: 3px;
}

@media (max-height: 680px) {
  .game-shell {
    gap: 5px;
  }

  .top-bar,
  .play-layout,
  .scene-wrap,
  .doggie-panel,
  .side-actions {
    gap: 5px;
  }

  .play-layout {
    grid-template-rows: minmax(0, 1fr) 120px;
  }

  .scene-wrap {
    grid-template-rows: minmax(0, 1fr) 68px;
  }

  .prompt-card {
    min-height: 40px;
    max-height: 46px;
  }

  .level-pill,
  .round-button {
    min-height: 0;
  }
}

.is-hidden {
  display: none !important;
}

.home-screen {
  width: min(100vw, 680px, calc(100dvh * 0.72));
  height: 100dvh;
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.home-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(104px, 26dvh) auto minmax(0, 1fr);
  gap: clamp(8px, 1.5dvh, 14px);
  align-items: center;
  justify-items: center;
  padding: clamp(12px, 3vw, 20px);
  border: 5px solid rgb(255 255 255 / 0.84);
  border-radius: clamp(24px, 7vw, 38px);
  background:
    radial-gradient(circle at 22% 18%, rgb(255 231 83 / 0.5), transparent 24%),
    linear-gradient(180deg, #9adfff 0%, #fff4d3 46%, #fff8ef 100%);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}

.home-doggie {
  width: min(58%, 230px);
  height: 100%;
  min-height: 94px;
  background-image: url("assets/generated/doggie.png");
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 12px 10px rgb(90 58 20 / 0.18));
}

.title-lockup {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.title-kicker {
  margin: 0 0 4px;
  color: var(--purple-dark);
  font-size: clamp(13px, 3.4vw, 18px);
  font-weight: 900;
  letter-spacing: 0;
}

.title-lockup h1 {
  margin: 0;
  color: #3f2719;
  font-size: clamp(34px, 9.4vw, 60px);
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
}

.mode-grid {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(7px, 1.2dvh, 10px);
}

.mode-button {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(42px, 11vw, 58px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(8px, 2.2vw, 12px);
  padding: clamp(7px, 1.8vw, 11px) clamp(10px, 2.6vw, 16px);
  border: 4px solid rgb(255 255 255 / 0.88);
  border-radius: clamp(16px, 4.5vw, 24px);
  color: var(--ink);
  background: linear-gradient(180deg, #fffdfa, #fff0ca);
  box-shadow:
    inset 0 -5px 0 rgb(208 145 43 / 0.11),
    0 8px 15px rgb(54 98 149 / 0.18);
  text-align: left;
  overflow: hidden;
}

.mode-button.primary-mode {
  color: white;
  background: linear-gradient(180deg, #96df4c, #58b92c);
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.14);
}

.mode-button > span:last-child {
  min-width: 0;
  display: grid;
  align-content: center;
}

.mode-button strong {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(20px, 5.4vw, 32px);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-button small {
  display: none;
}

.mode-icon {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px solid rgb(255 255 255 / 0.82);
  border-radius: 18px;
  color: #8d58db;
  background: linear-gradient(180deg, #fff9bc, #ffd24b);
  box-shadow: inset 0 -4px 0 rgb(211 123 28 / 0.12);
  font-size: clamp(24px, 7vw, 38px);
  line-height: 1;
}

.primary-mode .mode-icon {
  color: #f39a16;
  background: white;
}

.game-shell {
  width: min(100vw, 620px, calc(100dvh * 0.72));
  padding:
    max(5px, env(safe-area-inset-top))
    max(5px, env(safe-area-inset-right))
    max(5px, env(safe-area-inset-bottom))
    max(5px, env(safe-area-inset-left));
}

.top-bar {
  grid-template-columns: clamp(40px, 9.2vw, 52px) minmax(0, 1fr) auto;
  align-items: stretch;
}

.top-actions {
  display: grid;
  grid-template-columns: repeat(2, clamp(40px, 9.2vw, 52px));
  align-items: stretch;
}

.round-button {
  width: clamp(40px, 9.2vw, 52px);
  min-width: 0;
  border-radius: 18px;
}

.level-pill {
  min-width: 0;
  min-height: clamp(40px, 5.8dvh, 52px);
  border-radius: 18px;
  overflow: hidden;
}

#levelLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-card {
  min-width: 0;
  min-height: clamp(42px, 6.2dvh, 54px);
  max-height: clamp(44px, 6.9dvh, 60px);
  display: grid;
  grid-template-columns: clamp(30px, 7.2vw, 40px) minmax(0, 1fr);
  justify-items: center;
  border-radius: 22px;
}

.speaker-icon {
  width: clamp(30px, 7.2vw, 40px);
  height: clamp(30px, 7.2vw, 40px);
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #eff9ff, #d9efff);
  box-shadow: inset 0 -3px 0 rgb(37 126 209 / 0.1);
}

.speaker-icon::before {
  content: "🔊";
  position: static;
  width: auto;
  height: auto;
  background: none;
  clip-path: none;
  font-size: clamp(18px, 5.2vw, 27px);
  line-height: 1;
}

.speaker-icon::after {
  content: none;
}

.speaker-icon.small {
  width: 38px;
  height: 38px;
}

.speaker-icon.small::before {
  font-size: 23px;
}

.scene-wrap {
  align-items: center;
  justify-items: stretch;
  grid-template-rows: minmax(0, 1fr) clamp(80px, 12.5dvh, 108px);
}

.scene-card {
  width: 100%;
  aspect-ratio: 1640 / 921;
  align-self: center;
  justify-self: center;
}

.scene {
  background-size: 100% 100%;
}

.target-card {
  grid-template-rows: minmax(0, 1fr) clamp(12px, 3.2vw, 17px);
  align-items: center;
  justify-items: center;
  overflow: hidden;
}

.target-card img {
  width: min(82%, 66px);
  max-height: clamp(34px, 7dvh, 58px);
}

.target-card span {
  align-self: end;
  min-width: 0;
  max-width: 100%;
}

.target-card.done::after {
  top: 4px;
  right: 4px;
  bottom: auto;
}

.doggie-panel {
  grid-template-columns: minmax(0, 1fr) clamp(72px, 18vw, 96px);
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.guide-card {
  overflow: hidden;
}

.doggie-mascot {
  max-height: 68px;
}

.found-card,
.sticker-card {
  overflow: hidden;
}

.mini-label {
  display: none;
}

.big-action {
  display: grid;
  grid-template-columns: clamp(24px, 6.5vw, 34px) auto;
  place-content: center;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.big-action > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toybox-mode .scene-wrap {
  grid-template-rows: minmax(0, 1fr);
}

.toybox-mode .target-tray {
  display: none;
}

.findable.playing {
  animation: reward-pop 460ms ease;
}

@media (max-height: 700px) {
  .home-card {
    grid-template-rows: minmax(82px, 20dvh) auto minmax(0, 1fr);
    gap: 7px;
  }

  .mode-grid {
    gap: 6px;
  }

  .title-lockup h1 {
    font-size: clamp(30px, 8vw, 48px);
  }

  .game-shell {
    gap: 5px;
  }

  .play-layout {
    grid-template-rows: minmax(0, 1fr) 116px;
  }

  .scene-wrap {
    grid-template-rows: minmax(0, 1fr) 76px;
  }
}

/* Mock-flow implementation: kid-first home, world doors, simple gameplay, reward. */
:root {
  --app-w: min(100vw, 560px, calc(100dvh * 0.58));
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
}

.app-screen {
  position: relative;
  width: var(--app-w);
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding:
    max(7px, env(safe-area-inset-top))
    max(7px, env(safe-area-inset-right))
    max(7px, env(safe-area-inset-bottom))
    max(7px, env(safe-area-inset-left));
  overflow: hidden;
}

.is-hidden {
  display: none !important;
}

button {
  touch-action: manipulation;
}

.home-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(178px, 34dvh) minmax(96px, 15dvh) minmax(116px, 22dvh);
  align-content: center;
  gap: clamp(10px, 1.5dvh, 16px);
  padding: clamp(12px, 3vw, 18px);
  border: 5px solid rgb(255 255 255 / 0.88);
  border-radius: clamp(26px, 7vw, 42px);
  background:
    radial-gradient(circle at 24% 12%, rgb(255 233 101 / 0.72), transparent 24%),
    radial-gradient(circle at 88% 80%, rgb(165 117 239 / 0.16), transparent 24%),
    linear-gradient(180deg, #82d6ff 0%, #fff1b8 55%, #ffd982 100%);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}

.home-hero {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  justify-items: center;
}

.home-doggie {
  width: min(66%, 250px);
  height: 100%;
  min-height: 112px;
  background-image: url("assets/generated/doggie.png");
  background-position: center bottom;
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 14px 12px rgb(73 42 13 / 0.2));
}

.title-lockup {
  min-width: 0;
  width: 100%;
  text-align: center;
}

.title-kicker {
  margin: 0 0 3px;
  color: var(--purple-dark);
  font-size: clamp(13px, 3.3vw, 18px);
  font-weight: 900;
  line-height: 1;
}

.title-lockup h1 {
  margin: 0;
  color: #1763bb;
  font-size: clamp(34px, 9vw, 56px);
  line-height: 0.95;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow:
    0 3px 0 white,
    0 8px 16px rgb(28 81 143 / 0.18);
}

.play-button {
  position: relative;
  align-self: stretch;
  justify-self: stretch;
  display: grid;
  place-items: center;
  border: 7px solid white;
  border-radius: 999px;
  color: white;
  background: linear-gradient(180deg, #97ea42 0%, #42b915 100%);
  box-shadow:
    inset 0 -12px 0 rgb(36 127 10 / 0.2),
    0 12px 0 rgb(46 112 29 / 0.18),
    0 20px 28px rgb(50 88 91 / 0.18);
  font-size: clamp(54px, 15vw, 90px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 5px 0 rgb(22 110 16 / 0.24);
  overflow: hidden;
}

.play-button:active,
.shortcut-card:active,
.world-card:active,
.corner-button:active {
  transform: translateY(3px) scale(0.98);
}

.play-shine {
  position: absolute;
  inset: 12% 12% auto 18%;
  height: 16%;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.4);
}

.home-shortcuts {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 1.7vw, 11px);
}

.shortcut-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  gap: 2px;
  padding: clamp(6px, 1.5vw, 9px);
  border: 4px solid white;
  border-radius: clamp(18px, 5vw, 28px);
  color: white;
  box-shadow:
    inset 0 -8px 0 rgb(0 0 0 / 0.08),
    0 8px 16px rgb(46 82 120 / 0.18);
  overflow: hidden;
}

.continue-card {
  background: linear-gradient(180deg, #58c4ff, #158ce6);
}

.pick-card {
  color: var(--ink);
  background: linear-gradient(180deg, #ffe765, #ffbd24);
}

.sticker-shortcut {
  background: linear-gradient(180deg, #b884ff, #7d4cd9);
}

.shortcut-card strong,
.shortcut-card small {
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut-card strong {
  font-size: clamp(15px, 4vw, 24px);
  line-height: 1;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.14);
}

.shortcut-card small {
  font-size: clamp(10px, 2.7vw, 14px);
  font-weight: 900;
  line-height: 1;
  opacity: 0.92;
}

.shortcut-art {
  width: min(82%, 78px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: clamp(32px, 9vw, 54px);
  line-height: 1;
}

.doggie-ball {
  background:
    url("assets/generated/doggie.png") left bottom / 68% auto no-repeat,
    radial-gradient(circle at 70% 68%, #ff4b3e 0 20%, #ffd83b 21% 34%, #2e9bf2 35% 48%, transparent 49%);
}

.toy-box-art {
  border: 4px solid rgb(255 255 255 / 0.62);
  border-radius: 22px;
  background:
    radial-gradient(circle at 46% 22%, #ff594f 0 13%, transparent 14%),
    linear-gradient(90deg, #74d64d 0 32%, #2da4f5 33% 65%, #ffd438 66% 100%);
}

.sticker-art {
  color: #fff36b;
  text-shadow:
    0 4px 0 #f39a16,
    0 7px 12px rgb(130 64 8 / 0.2);
}

.corner-button {
  position: absolute;
  bottom: clamp(10px, 2.6vw, 18px);
  width: clamp(48px, 12vw, 66px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 4px solid white;
  border-radius: 22px;
  color: white;
  background: linear-gradient(180deg, #63c2ff, #177ce5);
  box-shadow: 0 8px 14px rgb(45 83 122 / 0.24);
}

.parent-button {
  left: clamp(10px, 2.6vw, 18px);
}

.settings-corner {
  right: clamp(10px, 2.6vw, 18px);
  background: linear-gradient(180deg, #9e75ee, #744ad5);
}

.world-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1.1dvh, 12px);
  background:
    radial-gradient(circle at 24% 12%, rgb(255 236 142 / 0.72), transparent 22%),
    linear-gradient(180deg, #fff4c8 0%, #fff9e9 100%);
}

.world-top {
  min-height: clamp(62px, 10dvh, 86px);
  display: grid;
  grid-template-columns: clamp(48px, 12vw, 62px) minmax(0, 1fr) clamp(58px, 15vw, 80px);
  align-items: center;
  gap: clamp(7px, 1.6vw, 10px);
}

.world-top h1 {
  margin: 0;
  overflow: hidden;
  color: #6a3c22;
  font-size: clamp(33px, 9vw, 54px);
  font-weight: 900;
  line-height: 0.95;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 4px 0 white;
}

.world-doggie-peek {
  width: 100%;
  height: clamp(54px, 9dvh, 78px);
  background-image: url("assets/generated/doggie.png");
  background-position: center bottom;
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 7px 7px rgb(90 58 20 / 0.2));
}

.world-card-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.5dvh, 12px);
}

.world-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  gap: 2px;
  padding: clamp(8px, 2vw, 12px);
  border: 5px solid rgb(255 255 255 / 0.9);
  border-radius: clamp(24px, 6vw, 34px);
  color: white;
  box-shadow:
    inset 0 -11px 0 rgb(0 0 0 / 0.1),
    0 9px 16px rgb(66 83 104 / 0.2);
  overflow: hidden;
}

.world-card-purple {
  background: linear-gradient(180deg, #ba78ff, #814bd7);
}

.world-card-blue {
  background: linear-gradient(180deg, #5fc3ff, #198ce8);
}

.world-card-yellow {
  color: var(--ink);
  background: linear-gradient(180deg, #ffe66b, #f8aa1c);
}

.world-card-green {
  background: linear-gradient(180deg, #98e352, #5fbd2f);
}

.world-card-coral {
  background: linear-gradient(180deg, #ff907b, #f25742);
}

.world-card-teal {
  background: linear-gradient(180deg, #5bdcd9, #18a9b4);
}

.world-picture {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  place-items: center;
  gap: 4px;
  border: 4px solid rgb(255 255 255 / 0.66);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.78), rgb(255 244 214 / 0.82));
  padding: clamp(5px, 1.5vw, 9px);
  overflow: hidden;
}

.world-preview-object {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: clamp(22px, 7vw, 42px);
  line-height: 1;
}

.world-preview-object img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px rgb(80 51 16 / 0.16));
}

.world-card strong {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(20px, 5.2vw, 31px);
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.16);
  white-space: nowrap;
}

.world-card-yellow strong {
  text-shadow: 0 2px 0 rgb(255 255 255 / 0.44);
}

.world-stars {
  color: #ffe237;
  font-size: clamp(19px, 5vw, 30px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 #e08b17,
    0 4px 8px rgb(94 59 11 / 0.14);
}

.next-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 4px 8px;
  border: 3px solid white;
  border-radius: 999px;
  color: white;
  background: linear-gradient(180deg, #ff78b3, #f04a84);
  box-shadow: 0 5px 8px rgb(90 39 67 / 0.24);
  font-size: clamp(12px, 3vw, 16px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.16);
}

.world-bottom {
  display: flex;
  justify-content: space-between;
  min-height: clamp(48px, 8dvh, 64px);
}

.game-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(7px, 1dvh, 10px);
  width: var(--app-w);
  padding:
    max(6px, env(safe-area-inset-top))
    max(6px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom))
    max(6px, env(safe-area-inset-left));
}

.game-top {
  display: grid;
  grid-template-columns: clamp(46px, 11vw, 58px) minmax(92px, 0.52fr) minmax(0, 1fr);
  grid-template-areas:
    "home level level"
    "prompt prompt prompt";
  gap: clamp(6px, 1dvh, 9px);
  align-items: stretch;
}

.game-top .round-button {
  grid-area: home;
}

.round-button {
  width: clamp(46px, 11vw, 60px);
  min-width: 0;
  aspect-ratio: 1;
  border-width: 4px;
  border-radius: 19px;
}

.level-pill {
  grid-area: level;
  min-width: 0;
  min-height: clamp(46px, 6.5dvh, 58px);
  border-width: 4px;
  border-radius: 22px;
  font-size: clamp(21px, 5.2vw, 30px);
}

.prompt-card {
  grid-area: prompt;
  min-width: 0;
  min-height: clamp(58px, 8.2dvh, 74px);
  max-height: clamp(58px, 8.6dvh, 78px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(42px, 10vw, 56px);
  align-items: center;
  justify-items: center;
  gap: clamp(7px, 1.8vw, 10px);
  border-width: 4px;
  border-radius: 999px;
  padding: 0 clamp(9px, 2.8vw, 16px) 0 clamp(18px, 5vw, 30px);
  font-size: clamp(22px, 6vw, 34px);
  line-height: 1;
}

#promptText {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-icon {
  position: relative;
  width: clamp(38px, 9vw, 52px);
  height: clamp(38px, 9vw, 52px);
  display: grid;
  place-items: center;
  border: 4px solid rgb(255 255 255 / 0.82);
  border-radius: 999px;
  background: linear-gradient(180deg, #4db9ff, #157ee1);
  box-shadow:
    inset 0 -5px 0 rgb(18 91 165 / 0.2),
    0 5px 8px rgb(41 92 143 / 0.18);
}

.speaker-icon::before {
  content: "";
  position: absolute;
  left: 22%;
  top: 31%;
  width: 34%;
  height: 38%;
  background: white;
  clip-path: polygon(0 30%, 36% 30%, 88% 0, 88% 100%, 36% 70%, 0 70%);
}

.speaker-icon::after {
  content: "";
  position: absolute;
  right: 22%;
  top: 29%;
  width: 24%;
  height: 42%;
  border: 4px solid white;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.speaker-icon.small {
  width: clamp(42px, 10vw, 56px);
  height: clamp(42px, 10vw, 56px);
}

.gameplay {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(82px, 12dvh, 108px) clamp(96px, 15dvh, 132px);
  gap: clamp(7px, 1dvh, 10px);
}

.scene-card {
  width: 100%;
  min-height: 0;
  align-self: center;
  aspect-ratio: 1640 / 921;
  border-width: 4px;
  border-radius: clamp(22px, 5vw, 32px);
}

.scene {
  background-size: 100% 100%;
}

.findable {
  border-radius: 16px;
  filter: drop-shadow(0 7px 6px rgb(70 47 21 / 0.22));
}

.target-tray {
  height: 100%;
  min-height: 0;
  padding: clamp(5px, 1.5vw, 8px);
  border-width: 4px;
  border-radius: clamp(18px, 5vw, 26px);
}

.target-cards {
  height: 100%;
  grid-template-columns: repeat(var(--target-count, 2), minmax(0, 1fr));
  gap: clamp(5px, 1.4vw, 8px);
  overflow: hidden;
}

.target-card {
  grid-template-rows: minmax(0, 1fr) clamp(14px, 3.5vw, 18px);
  border-width: 3px;
  border-radius: clamp(14px, 4vw, 20px);
  padding: clamp(4px, 1.2vw, 7px);
  overflow: hidden;
}

.target-card img {
  width: min(82%, 70px);
  max-height: clamp(38px, 7dvh, 64px);
}

.target-card .emoji-token {
  width: min(76%, 64px);
  max-width: 64px;
  border-width: 2px;
  font-size: clamp(25px, 7vw, 42px);
}

.target-card span {
  min-width: 0;
  align-self: end;
  font-size: clamp(11px, 3vw, 16px);
  line-height: 1;
}

.target-card.done::after {
  top: auto;
  right: 4px;
  bottom: 4px;
  width: clamp(24px, 6.2vw, 34px);
  border-width: 3px;
  font-size: clamp(19px, 5vw, 27px);
}

.helper-row {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 0.5fr) minmax(94px, 0.58fr);
  gap: clamp(6px, 1.5vw, 9px);
}

.doggie-helper {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(62px, 17vw, 88px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 1.4vw, 8px);
  padding: clamp(5px, 1.3vw, 8px);
  border: 4px solid rgb(255 255 255 / 0.86);
  border-radius: clamp(18px, 5vw, 26px);
  background: linear-gradient(180deg, #fffdf9, #fff0cf);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.doggie-mascot {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  background-image: url("assets/generated/doggie.png");
  background-position: center bottom;
  background-size: contain;
  background-repeat: no-repeat;
}

.doggie-bubble {
  min-width: 0;
  max-height: 100%;
  padding: clamp(7px, 1.8vw, 10px);
  border-width: 3px;
  border-radius: 18px;
  font-size: clamp(12px, 3.2vw, 16px);
  line-height: 1.08;
  overflow: hidden;
  text-align: center;
}

.big-action {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: clamp(25px, 6.8vw, 38px) minmax(0, auto);
  place-content: center;
  align-items: center;
  gap: clamp(5px, 1.5vw, 8px);
  padding: 0 clamp(6px, 1.8vw, 10px);
  border-width: 4px;
  border-radius: clamp(18px, 5vw, 26px);
  font-size: clamp(18px, 5vw, 28px);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.big-action span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-action {
  background: linear-gradient(180deg, #66c5ff, #1682e4);
  box-shadow:
    inset 0 -8px 0 rgb(20 86 165 / 0.2),
    0 9px 16px rgb(44 94 143 / 0.2);
}

.done-action {
  width: 72%;
  justify-self: center;
  grid-template-columns: 1fr;
  color: var(--ink);
  background: linear-gradient(180deg, #ffe568, #ffc22b);
  text-shadow: none;
}

.toy-box-drop {
  width: clamp(90px, 23vw, 132px);
  height: clamp(60px, 15vw, 86px);
  border-width: 4px;
}

.celebration {
  padding:
    max(7px, env(safe-area-inset-top))
    max(7px, env(safe-area-inset-right))
    max(7px, env(safe-area-inset-bottom))
    max(7px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 20%, rgb(255 236 114 / 0.46), transparent 30%),
    rgb(36 88 151 / 0.38);
}

.reward-card {
  width: var(--app-w);
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(94px, 18dvh) auto auto minmax(128px, 23dvh) minmax(68px, 10dvh) minmax(54px, 8dvh) minmax(64px, 10dvh);
  align-items: center;
  justify-items: center;
  gap: clamp(7px, 1dvh, 10px);
  padding: clamp(12px, 3vw, 18px);
  border: 5px solid white;
  border-radius: clamp(28px, 7vw, 42px);
  background:
    radial-gradient(circle at 50% 16%, rgb(255 239 74 / 0.5), transparent 24%),
    linear-gradient(180deg, #9adfff 0%, #fff9e8 47%, #ffd88d 100%);
  box-shadow: 0 24px 56px rgb(42 70 112 / 0.32);
  overflow: hidden;
  animation: celebration-in 360ms ease-out;
}

.reward-doggie {
  width: min(46%, 170px);
  height: 100%;
  min-height: 88px;
  background-image: url("assets/generated/doggie.png");
  background-position: center bottom;
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 12px 10px rgb(73 42 13 / 0.2));
  animation: doggie-bounce 0.78s ease-in-out infinite;
}

.reward-card h2 {
  margin: 0;
  color: #8753dc;
  font-size: clamp(42px, 11vw, 72px);
  line-height: 0.95;
  text-align: center;
  text-shadow: 0 4px 0 white;
}

.reward-card p {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(18px, 4.6vw, 26px);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-sticker-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  padding: clamp(8px, 2vw, 12px);
  border: 4px dashed rgb(151 115 229 / 0.55);
  border-radius: clamp(22px, 5vw, 32px);
  background: linear-gradient(180deg, #fffdfa, #fff1d1);
  box-shadow: inset 0 -8px 0 rgb(208 145 43 / 0.08);
}

.new-sticker-card span {
  padding: 5px 16px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(180deg, #a874ef, #754bd7);
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 900;
  line-height: 1;
}

.new-sticker-card strong {
  display: grid;
  place-items: center;
  color: #fff167;
  font-size: clamp(78px, 21vw, 132px);
  line-height: 1;
  text-shadow:
    0 6px 0 #f0a324,
    0 11px 18px rgb(202 107 7 / 0.22);
}

.reward-next,
.reward-home {
  width: 100%;
}

.reward-next {
  grid-template-columns: minmax(0, auto) clamp(28px, 7vw, 42px);
  font-size: clamp(33px, 8.6vw, 54px);
}

.reward-home {
  width: 72%;
  font-size: clamp(24px, 6vw, 36px);
}

.reward-sticker-strip {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(6px, 1.5vw, 9px);
  padding: clamp(6px, 1.6vw, 9px);
  border: 4px solid rgb(255 255 255 / 0.84);
  border-radius: clamp(20px, 5vw, 28px);
  background: linear-gradient(180deg, #fffdfa, #fff0d5);
  overflow: hidden;
}

.reward-strip-sticker {
  min-width: 0;
  display: grid;
  place-items: center;
  border: 3px dashed rgb(225 170 88 / 0.38);
  border-radius: 18px;
  color: #ffc928;
  font-size: clamp(32px, 8vw, 50px);
  line-height: 1;
  text-shadow: 0 3px 0 #e98b16;
}

.modal {
  width: min(var(--app-w), calc(100vw - 18px));
}

.modal-panel {
  border-width: 5px;
  border-radius: clamp(28px, 7vw, 40px);
}

.settings-panel {
  display: grid;
  gap: clamp(10px, 1.4dvh, 14px);
  overflow: hidden;
}

.setting-row {
  min-height: clamp(72px, 11dvh, 96px);
  display: grid;
  grid-template-columns: clamp(48px, 12vw, 64px) minmax(0, 1fr) clamp(58px, 15vw, 76px);
  gap: clamp(9px, 2vw, 14px);
  align-items: center;
  margin: 0;
  border-width: 4px;
  border-radius: clamp(20px, 5vw, 28px);
  padding: clamp(8px, 2vw, 12px);
  font-size: clamp(24px, 6vw, 36px);
}

.setting-row > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-row strong {
  min-width: 0;
  padding: 8px 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(180deg, #7dd43d, #4aaf22);
  font-size: clamp(15px, 3.8vw, 20px);
  text-align: center;
}

.setting-row[aria-pressed="false"] strong {
  background: linear-gradient(180deg, #d4dce7, #aab7c5);
}

.danger-soft {
  background: linear-gradient(180deg, #fff1eb, #ffd1c7);
}

.icon {
  position: relative;
  width: clamp(26px, 7vw, 42px);
  aspect-ratio: 1;
  display: inline-block;
}

.home::before {
  content: "";
  position: absolute;
  inset: 15% 10% 12%;
  background: white;
  clip-path: polygon(50% 0, 100% 42%, 86% 42%, 86% 100%, 62% 100%, 62% 64%, 38% 64%, 38% 100%, 14% 100%, 14% 42%, 0 42%);
}

.people::before,
.people::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: white;
}

.people::before {
  left: 18%;
  top: 10%;
  width: 32%;
  height: 32%;
  box-shadow: 18px 7px 0 -5px white;
}

.people::after {
  left: 10%;
  right: 10%;
  bottom: 10%;
  height: 45%;
  border-radius: 24px 24px 10px 10px;
  clip-path: polygon(0 100%, 0 50%, 24% 20%, 48% 44%, 68% 24%, 100% 52%, 100% 100%);
}

.star::before {
  content: "";
  position: absolute;
  inset: 5%;
  background: white;
  clip-path: polygon(50% 0%, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0% 38%, 38% 35%);
}

.music::before {
  content: "";
  position: absolute;
  left: 34%;
  top: 12%;
  width: 40%;
  height: 56%;
  border-left: 8px solid currentColor;
  border-top: 8px solid currentColor;
  transform: skewY(-8deg);
}

.music::after {
  content: "";
  position: absolute;
  left: 12%;
  bottom: 11%;
  width: 32%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 28px -4px 0 -4px currentColor;
}

.sound::before {
  content: "";
  position: absolute;
  left: 12%;
  top: 30%;
  width: 42%;
  height: 42%;
  background: currentColor;
  clip-path: polygon(0 28%, 34% 28%, 86% 0, 86% 100%, 34% 72%, 0 72%);
}

.sound::after {
  content: "";
  position: absolute;
  right: 14%;
  top: 30%;
  width: 25%;
  height: 40%;
  border: 5px solid currentColor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

@media (max-height: 720px) {
  .home-card {
    grid-template-rows: minmax(132px, 28dvh) minmax(78px, 13dvh) minmax(104px, 20dvh);
    gap: 8px;
  }

  .title-lockup h1 {
    font-size: clamp(28px, 8vw, 44px);
  }

  .play-button {
    font-size: clamp(42px, 12vw, 68px);
  }

  .world-top {
    min-height: 54px;
  }

  .world-card-grid {
    gap: 7px;
  }

  .world-picture {
    border-width: 3px;
  }

  .gameplay {
    grid-template-rows: minmax(0, 1fr) 76px 92px;
    gap: 6px;
  }

  .prompt-card {
    min-height: 52px;
    max-height: 54px;
  }

  .reward-card {
    grid-template-rows: minmax(74px, 15dvh) auto auto minmax(106px, 21dvh) minmax(58px, 9dvh) minmax(48px, 7dvh) minmax(54px, 9dvh);
    gap: 6px;
  }
}

/* Portrait implementation fit pass. Keep every mode inside one phone screen. */
:root {
  --app-w: min(100vw, 390px);
}

body {
  align-items: center;
  justify-items: start;
  max-width: 100vw;
  max-height: 100dvh;
  overflow: hidden;
}

.app-screen,
.game-shell,
.reward-card {
  width: min(100vw, 390px);
  max-width: 100vw;
  margin: 0;
}

.app-screen {
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
}

.home-card {
  grid-template-rows: minmax(148px, 30dvh) minmax(84px, 12dvh) minmax(112px, 18dvh);
  align-content: center;
  gap: clamp(8px, 1.2dvh, 12px);
  padding: clamp(10px, 2.6vw, 14px);
  padding-bottom: clamp(70px, 11dvh, 90px);
}

.home-doggie {
  width: min(58%, 210px);
  min-height: 96px;
}

.title-lockup h1 {
  max-width: 100%;
  display: grid;
  gap: 2px;
  font-size: clamp(28px, 7.4vw, 42px);
  line-height: 1.02;
  overflow-wrap: anywhere;
  white-space: normal;
}

.title-lockup h1 span {
  display: block;
}

.play-button {
  width: 100%;
  min-width: 0;
  border-width: 6px;
  font-size: clamp(42px, 12vw, 64px);
}

.home-shortcuts {
  width: 100%;
  min-width: 0;
  gap: clamp(5px, 1.4vw, 8px);
}

.shortcut-card {
  width: 100%;
  padding: clamp(5px, 1.3vw, 7px);
  border-width: 3px;
  border-radius: clamp(16px, 4vw, 22px);
}

.shortcut-card strong {
  font-size: clamp(12px, 3.45vw, 17px);
}

.shortcut-card small {
  font-size: clamp(9px, 2.65vw, 12px);
}

.shortcut-art {
  width: min(74%, 64px);
  font-size: clamp(29px, 8vw, 44px);
}

.corner-button {
  width: clamp(42px, 10.5vw, 54px);
  border-width: 3px;
  border-radius: 17px;
}

.world-screen {
  padding: max(7px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
}

.world-top {
  min-height: clamp(54px, 8dvh, 70px);
  grid-template-columns: clamp(44px, 11vw, 54px) minmax(0, 1fr) clamp(50px, 13vw, 64px);
}

.world-top h1 {
  font-size: clamp(29px, 7.7vw, 40px);
}

.world-card-grid {
  gap: clamp(7px, 1.1dvh, 10px);
}

.world-card {
  padding: clamp(6px, 1.6vw, 9px);
  border-width: 4px;
  border-radius: clamp(20px, 5vw, 28px);
}

.world-picture {
  border-width: 3px;
  border-radius: 18px;
}

.world-card strong {
  font-size: clamp(17px, 4.55vw, 24px);
}

.world-stars {
  font-size: clamp(17px, 4.3vw, 24px);
}

.game-shell {
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
}

.game-top {
  grid-template-columns: clamp(42px, 10.5vw, 52px) minmax(0, 1fr);
  grid-template-areas:
    "home level"
    "prompt prompt";
}

.round-button {
  width: clamp(42px, 10.5vw, 54px);
  border-width: 3px;
  border-radius: 16px;
}

.level-pill {
  min-height: clamp(42px, 6dvh, 52px);
  border-width: 3px;
  border-radius: 18px;
  font-size: clamp(20px, 5.1vw, 27px);
}

.prompt-card {
  min-height: clamp(54px, 8dvh, 68px);
  max-height: none;
  grid-template-columns: minmax(0, 1fr) clamp(38px, 9.2vw, 48px);
  padding: 6px clamp(8px, 2.2vw, 12px) 6px clamp(13px, 3.6vw, 20px);
  border-width: 3px;
  font-size: clamp(18px, 4.8vw, 25px);
}

#promptText {
  display: -webkit-box;
  line-height: 1.03;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.speaker-icon {
  width: clamp(36px, 8.9vw, 46px);
  height: clamp(36px, 8.9vw, 46px);
  border-width: 3px;
}

.speaker-icon::before {
  left: 20%;
  top: 31%;
  width: 35%;
  height: 38%;
}

.speaker-icon::after {
  right: 20%;
  top: 30%;
  width: 24%;
  height: 40%;
  border-width: 3px;
}

.gameplay {
  grid-template-rows: minmax(0, 1fr) clamp(78px, 11.2dvh, 98px) clamp(90px, 13.4dvh, 116px);
}

.scene-card {
  align-self: stretch;
  aspect-ratio: 4 / 3;
  max-height: 100%;
  border-width: 3px;
  border-radius: clamp(18px, 4.8vw, 26px);
}

.scene {
  background-size: 100% 100%;
}

.findable {
  min-width: 40px;
  min-height: 40px;
}

.target-tray {
  border-width: 3px;
}

.target-card {
  grid-template-rows: minmax(0, 1fr) clamp(13px, 3.4vw, 17px);
  border-width: 2px;
  border-radius: clamp(12px, 3.5vw, 17px);
  padding: 4px;
}

.target-card img {
  width: min(84%, 58px);
  max-height: clamp(36px, 6.6dvh, 56px);
}

.target-card span {
  font-size: clamp(10px, 2.85vw, 14px);
}

.target-card.done::after {
  width: clamp(22px, 5.7vw, 30px);
  font-size: clamp(17px, 4.5vw, 24px);
}

.helper-row {
  grid-template-columns: minmax(0, 1fr) minmax(74px, 0.45fr) minmax(78px, 0.48fr);
  gap: clamp(5px, 1.25vw, 7px);
}

.doggie-helper {
  grid-template-columns: clamp(48px, 13vw, 66px) minmax(0, 1fr);
  border-width: 3px;
  border-radius: clamp(15px, 4vw, 21px);
}

.doggie-bubble {
  padding: clamp(5px, 1.5vw, 8px);
  border-width: 2px;
  border-radius: 14px;
  font-size: clamp(10px, 2.8vw, 13px);
}

.big-action {
  grid-template-columns: clamp(22px, 5.9vw, 31px) minmax(0, 1fr);
  gap: 4px;
  padding: 0 clamp(5px, 1.3vw, 8px);
  border-width: 3px;
  border-radius: clamp(15px, 4vw, 21px);
  font-size: clamp(15px, 4.1vw, 21px);
}

.big-action .icon {
  width: clamp(22px, 5.9vw, 31px);
}

.helper-row .big-action {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 2px;
  padding: clamp(5px, 1.2vw, 7px);
  font-size: clamp(14px, 3.5vw, 18px);
}

.helper-row .big-action .icon {
  align-self: end;
  justify-self: center;
  width: clamp(24px, 6.2vw, 32px);
}

.helper-row .big-action span:last-child {
  width: 100%;
  overflow: visible;
  text-align: center;
  text-overflow: clip;
}

.reward-card {
  grid-template-rows: minmax(78px, 15dvh) auto auto minmax(114px, 21dvh) minmax(60px, 9dvh) minmax(48px, 7dvh) minmax(58px, 9dvh);
  padding: clamp(10px, 2.6vw, 14px);
}

.reward-card h2 {
  font-size: clamp(35px, 9vw, 48px);
}

.reward-card p {
  font-size: clamp(15px, 4vw, 20px);
  white-space: normal;
}

.new-sticker-card strong {
  font-size: clamp(66px, 17vw, 94px);
}

.reward-next {
  font-size: clamp(26px, 6.9vw, 38px);
}

.reward-home {
  font-size: clamp(20px, 5.1vw, 28px);
}

.modal {
  width: min(100vw - 12px, 378px);
}

.modal-panel {
  max-height: calc(100dvh - 12px);
  padding: clamp(10px, 2.8vw, 14px);
  border-width: 4px;
  border-radius: clamp(22px, 5.8vw, 30px);
}

.settings-panel {
  gap: clamp(7px, 1dvh, 10px);
}

.setting-row {
  min-height: clamp(62px, 9.6dvh, 78px);
  grid-template-columns: clamp(40px, 10vw, 50px) minmax(0, 1fr) clamp(50px, 13vw, 64px);
  gap: clamp(7px, 1.7vw, 10px);
  border-width: 3px;
  border-radius: clamp(16px, 4.2vw, 22px);
  font-size: clamp(20px, 5vw, 27px);
}

.setting-row strong {
  padding: 6px 0;
  font-size: clamp(13px, 3.4vw, 17px);
}

.icon {
  width: clamp(23px, 6vw, 32px);
}

.gear::before {
  inset: 16%;
  border-width: 5px;
}

.gear::after {
  inset: 40%;
  box-shadow:
    0 -20px 0 -6px white,
    0 20px 0 -6px white,
    -20px 0 0 -6px white,
    20px 0 0 -6px white;
}

.bulb::before {
  box-shadow: 0 0 0 3px rgb(255 255 255 / 0.32);
}

.bulb::after {
  border-radius: 0 0 5px 5px;
}

.close::before,
.close::after {
  height: 6px;
}

@media (max-height: 720px) {
  .home-card {
    grid-template-rows: minmax(120px, 25dvh) minmax(70px, 11dvh) minmax(94px, 17dvh);
    padding-bottom: 58px;
  }

  .title-lockup h1 {
    font-size: clamp(25px, 6.9vw, 34px);
  }

  .play-button {
    font-size: clamp(34px, 10vw, 48px);
  }

  .shortcut-art {
    width: min(65%, 48px);
  }

  .gameplay {
    grid-template-rows: minmax(0, 1fr) 70px 80px;
  }

  .scene-card {
    aspect-ratio: 7 / 5;
  }

  .doggie-helper {
    grid-template-columns: 42px minmax(0, 1fr);
  }
}

@media (min-width: 1280px) {
  body {
    justify-items: center;
  }
}

/* Imagegen title-page polish: real splash art with crisp tappable UI. */
.home-card {
  isolation: isolate;
  grid-template-rows: minmax(124px, 22dvh) minmax(0, 1fr) minmax(82px, 12dvh) minmax(100px, 15dvh);
  align-content: stretch;
  justify-items: stretch;
  gap: clamp(8px, 1.2dvh, 12px);
  padding: clamp(10px, 2.6vw, 14px);
  border-color: rgb(255 255 255 / 0.92);
  background: #73d7fb;
}

.home-card::before,
.home-card::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.home-card::before {
  z-index: -2;
  background: url("assets/generated/title-hero.png") center / cover no-repeat;
}

.home-card::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgb(93 203 249 / 0.12) 0%, transparent 34%, rgb(255 244 187 / 0.66) 100%),
    linear-gradient(0deg, rgb(255 245 171 / 0.82) 0%, transparent 27%);
}

.home-hero {
  grid-row: 1;
  width: 100%;
  min-height: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  padding-top: clamp(42px, 6.5dvh, 58px);
}

.home-doggie {
  display: none;
}

.title-lockup {
  width: min(calc(100% - 118px), 284px);
  min-width: 0;
  padding: clamp(6px, 1.4vw, 8px) clamp(10px, 2.6vw, 13px) clamp(8px, 1.8vw, 11px);
  border: 4px solid rgb(255 255 255 / 0.96);
  border-radius: clamp(20px, 5.2vw, 28px);
  background: linear-gradient(180deg, rgb(255 253 245 / 0.97), rgb(255 236 164 / 0.94));
  box-shadow:
    inset 0 -6px 0 rgb(225 161 39 / 0.12),
    0 10px 20px rgb(40 98 148 / 0.18);
}

.title-kicker {
  margin-bottom: 2px;
  color: #7f54dd;
  font-size: clamp(12px, 3.2vw, 16px);
}

.title-lockup h1 {
  display: grid;
  gap: 1px;
  color: #2267c6;
  font-size: clamp(27px, 7.25vw, 40px);
  line-height: 1;
  text-shadow:
    0 2px 0 white,
    0 5px 10px rgb(47 98 143 / 0.18);
}

.title-lockup h1 span {
  display: block;
}

.play-button {
  grid-row: 3;
  align-self: stretch;
  justify-self: center;
  width: min(100%, 294px);
  min-width: 0;
  min-height: 0;
  border-width: 6px;
  font-size: clamp(38px, 10.5vw, 56px);
  z-index: 1;
}

.home-shortcuts {
  grid-row: 4;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  padding: clamp(6px, 1.7vw, 9px);
  border: 3px solid rgb(255 255 255 / 0.78);
  border-radius: clamp(20px, 5.2vw, 26px);
  background: rgb(255 251 238 / 0.82);
  box-shadow: 0 9px 20px rgb(61 91 122 / 0.14);
  backdrop-filter: blur(3px);
}

.shortcut-card {
  border-width: 3px;
  border-radius: clamp(16px, 4.2vw, 22px);
}

.shortcut-art {
  width: min(72%, 58px);
}

.shortcut-card strong {
  font-size: clamp(12px, 3.4vw, 16px);
}

.shortcut-card small {
  font-size: clamp(9px, 2.65vw, 12px);
}

.corner-button {
  top: clamp(12px, 2.4dvh, 18px);
  bottom: auto;
  z-index: 2;
  width: clamp(42px, 10.5vw, 54px);
  border-width: 3px;
  border-radius: 17px;
}

@media (max-height: 720px) {
  .home-card {
    grid-template-rows: minmax(110px, 21dvh) minmax(0, 1fr) minmax(70px, 11dvh) minmax(86px, 14dvh);
    gap: 7px;
    padding: 8px;
  }

  .home-hero {
    padding-top: clamp(38px, 6dvh, 44px);
  }

  .title-lockup {
    width: min(calc(100% - 112px), 260px);
    padding: 5px 9px 7px;
  }

  .title-kicker {
    font-size: clamp(11px, 3vw, 13px);
  }

  .title-lockup h1 {
    font-size: clamp(24px, 6.8vw, 32px);
  }

  .play-button {
    width: min(100%, 260px);
    border-width: 5px;
    font-size: clamp(32px, 9.4vw, 44px);
  }

  .home-shortcuts {
    padding: 5px;
  }

  .shortcut-art {
    width: min(64%, 44px);
  }
}

/* Imagegen title UI kit: full raster controls replace the old CSS icon treatment. */
.home-card {
  grid-template-rows:
    minmax(124px, 22dvh)
    minmax(0, 1fr)
    minmax(92px, 14dvh)
    minmax(108px, 16dvh);
}

.play-button,
.shortcut-card,
.corner-button {
  isolation: isolate;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.play-button {
  width: min(100%, 294px);
  color: #fffdf3;
  font-size: clamp(38px, 10.5vw, 56px);
  text-shadow:
    0 3px 0 rgb(24 118 18 / 0.58),
    0 6px 10px rgb(18 90 21 / 0.24);
}

.play-button::before {
  position: absolute;
  inset: -7% -4%;
  z-index: 0;
  content: "";
  pointer-events: none;
  background: url("assets/generated/title-button-play.png") center / 100% 100% no-repeat;
}

.play-button > span:not(.play-shine) {
  position: relative;
  z-index: 1;
  transform: translateY(-2%);
}

.play-shine {
  display: none;
}

.home-shortcuts {
  width: min(100%, 348px);
  justify-self: center;
  gap: clamp(1px, 0.8vw, 4px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.shortcut-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 0 8px 10%;
  color: #fffdf5;
}

.shortcut-card::before {
  position: absolute;
  inset: -7%;
  z-index: 0;
  content: "";
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.continue-card::before {
  background-image: url("assets/generated/title-button-continue.png");
}

.pick-card::before {
  background-image: url("assets/generated/title-button-places.png");
}

.sticker-shortcut::before {
  background-image: url("assets/generated/title-button-stickers.png");
}

.shortcut-card > strong,
.shortcut-card > small {
  position: relative;
  z-index: 1;
}

.shortcut-card .shortcut-art {
  display: none;
}

.shortcut-card strong {
  margin: 0;
  color: inherit;
  font-size: clamp(12px, 3.4vw, 17px);
  line-height: 1;
  text-shadow:
    0 2px 0 rgb(41 77 126 / 0.42),
    0 3px 6px rgb(34 60 90 / 0.2);
}

.shortcut-card small {
  margin: 0;
  color: inherit;
  font-size: clamp(9px, 2.55vw, 12px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgb(41 77 126 / 0.36);
}

.pick-card {
  color: #70410a;
}

.pick-card strong,
.pick-card small {
  text-shadow:
    0 1px 0 rgb(255 250 204 / 0.9),
    0 2px 5px rgb(128 81 8 / 0.16);
}

.corner-button {
  width: clamp(44px, 11vw, 56px);
  aspect-ratio: 1;
  color: transparent;
}

.corner-button::before {
  position: absolute;
  inset: -14%;
  z-index: 0;
  content: "";
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.parent-button::before {
  background-image: url("assets/generated/title-button-parent.png");
}

.settings-corner::before {
  background-image: url("assets/generated/title-button-settings.png");
}

.corner-button .icon {
  display: none;
}

@media (max-height: 720px) {
  .home-card {
    grid-template-rows:
      minmax(110px, 21dvh)
      minmax(0, 1fr)
      minmax(84px, 13dvh)
      minmax(94px, 15dvh);
  }

  .play-button {
    width: min(100%, 262px);
    font-size: clamp(32px, 9.2vw, 44px);
  }

  .shortcut-card {
    gap: 1px;
    padding: 0 6px 9%;
  }

  .shortcut-card strong {
    font-size: clamp(11px, 3.2vw, 15px);
  }

  .shortcut-card small {
    font-size: clamp(8px, 2.4vw, 11px);
  }

  .corner-button {
    width: clamp(40px, 10.5vw, 50px);
  }
}
