:root {
  --ink: #24143a;
  --cream: #fff6df;
  --paper: #fffdf5;
  --coral: #ff6577;
  --teal: #16b8b0;
  --sky: #87def2;
  --gold: #ffc83d;
  --green: #78cf87;
  --purple: #8c72d9;
  --shadow: 0 9px 0 rgba(36, 20, 58, 0.14), 0 18px 30px rgba(36, 20, 58, 0.13);
  color: var(--ink);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #ffeec8;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 255, 255, 0.78) 0 3px, transparent 4px),
    radial-gradient(circle at 92% 17%, rgba(255, 255, 255, 0.65) 0 4px, transparent 5px),
    linear-gradient(145deg, #fff1c9 0%, #ffe0d9 48%, #dff7f5 100%);
  background-size: 45px 45px, 64px 64px, auto;
}

.runtime-loading {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 24%, rgba(255,255,255,.9) 0 5px, transparent 6px),
    radial-gradient(circle at 78% 68%, rgba(255,255,255,.78) 0 4px, transparent 5px),
    linear-gradient(145deg, #fff2c7, #ffd9d3 56%, #d9fff5);
  background-size: 58px 58px, 72px 72px, auto;
  color: var(--ink);
  text-align: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.runtime-loading__pandas {
  font-size: clamp(2.9rem, 12vw, 5.2rem);
  filter: drop-shadow(0 7px 0 rgba(36,20,58,.14));
  animation: runtime-ready-bounce 820ms ease-in-out infinite alternate;
}

.runtime-loading__pandas span {
  color: var(--gold);
  -webkit-text-stroke: 1px var(--ink);
}

.runtime-loading strong {
  font-size: clamp(1.25rem, 5vw, 2rem);
  font-weight: 1000;
}

.runtime-loading small {
  color: #655071;
  font-size: .92rem;
  font-weight: 900;
}

html[data-game-ready="true"] .runtime-loading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 4px solid #fff;
  box-shadow: 0 0 0 7px var(--purple);
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

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

.brand-lockup {
  position: relative;
  padding-left: 4px;
}

.brand-kicker {
  display: inline-block;
  padding: 4px 10px 3px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 3px 0 rgba(36, 20, 58, 0.15);
  font-size: 0.68rem;
  font-weight: 1000;
  letter-spacing: 0.14em;
}

.brand-lockup h1 {
  margin: 5px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 1000;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.brand-lockup p {
  margin: 3px 0 0;
  color: #654f76;
  font-size: 0.92rem;
  font-weight: 900;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.game-park-link,
.restart-game-button,
.star-bank,
.sound-toggle {
  min-height: 46px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(36, 20, 58, 0.14);
  font-weight: 1000;
}

.restart-game-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.restart-game-button:hover { transform: translateY(-2px); background: #e8fff8; }
.restart-game-button:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(36, 20, 58, 0.14); }
.restart-game-button:focus-visible { outline: 4px solid rgba(20, 188, 171, .35); outline-offset: 3px; }
.restart-game-button:disabled { opacity: .64; cursor: wait; }

.game-park-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 15px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.game-park-link:hover {
  transform: translateY(-2px);
  background: #fff8dc;
  box-shadow: 0 7px 0 rgba(36, 20, 58, 0.14);
}

.game-park-link:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(36, 20, 58, 0.14);
}

.game-park-link:focus-visible {
  outline: 4px solid rgba(255, 200, 61, 0.65);
  outline-offset: 3px;
}

.game-park-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  font-size: 1rem;
}

.star-bank {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 15px;
}

.star-bank span {
  color: var(--gold);
  font-size: 1.45rem;
  -webkit-text-stroke: 1.5px var(--ink);
}

.star-bank.is-popping span {
  animation: star-pop 520ms cubic-bezier(.17, .89, .32, 1.5);
}

.sound-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 15px;
  cursor: pointer;
}

.sound-toggle[aria-pressed="true"] {
  background: #ddfff0;
}

.sound-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: white;
}

.stage-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 13px;
}

.stage-tab {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px 13px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: rgba(255, 253, 245, 0.82);
  box-shadow: 0 5px 0 rgba(36, 20, 58, 0.13);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.stage-tab:hover {
  transform: translateY(-2px);
}

.stage-tab > span {
  grid-row: 1 / 3;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #dff7f5;
  font-size: 1.05rem;
  font-weight: 1000;
}

.stage-tab strong {
  align-self: end;
  font-size: 0.94rem;
  line-height: 1;
}

.stage-tab small {
  align-self: start;
  color: #6f5b7e;
  font-size: 0.72rem;
  font-weight: 900;
}

.stage-tab.is-active {
  background: var(--gold);
  transform: translateY(-2px);
}

.stage-tab.is-active > span {
  background: white;
}

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  min-height: 640px;
  border: 4px solid var(--ink);
  border-radius: 30px;
  background: var(--cream);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

.mission-panel {
  position: relative;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 18px 15px 20px;
  border-right: 4px solid var(--ink);
  background:
    radial-gradient(circle at 14px 14px, rgba(255, 255, 255, 0.7) 0 3px, transparent 4px),
    linear-gradient(180deg, #ffe6af, #ffd4bc 55%, #f4c1cb);
  background-size: 34px 34px, auto;
}

.task-panda-wrap {
  position: relative;
  width: 200px;
  height: 245px;
}

.name-ribbon {
  position: absolute;
  z-index: 8;
  top: 0;
  left: 50%;
  min-width: 78px;
  padding: 4px 12px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 4px 0 rgba(36, 20, 58, 0.18);
  color: white;
  font-size: 0.82rem;
  font-weight: 1000;
  text-align: center;
  transform: translateX(-50%) rotate(-2deg);
}

.panda {
  position: absolute;
  width: 154px;
  height: 188px;
  filter: drop-shadow(0 8px 0 rgba(36, 20, 58, 0.12));
  transform-origin: 50% 95%;
}

.panda--task {
  left: 22px;
  bottom: 7px;
}

.panda__ear {
  position: absolute;
  z-index: 0;
  top: 17px;
  width: 49px;
  height: 49px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #30233a;
}

.panda__ear--left { left: 15px; }
.panda__ear--right { right: 15px; }

.panda__body {
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: 29px;
  width: 96px;
  height: 104px;
  border: 4px solid var(--ink);
  border-radius: 48% 48% 38% 38%;
  background: white;
  box-shadow: inset 0 -13px 0 #e8f0f0;
}

.panda__body::before,
.panda__body::after {
  position: absolute;
  bottom: -3px;
  width: 38px;
  height: 43px;
  border: 4px solid var(--ink);
  border-radius: 50% 50% 42% 42%;
  background: #30233a;
  content: "";
}

.panda__body::before { left: -9px; transform: rotate(10deg); }
.panda__body::after { right: -9px; transform: rotate(-10deg); }

.panda__head {
  position: absolute;
  z-index: 3;
  top: 24px;
  left: 14px;
  width: 126px;
  height: 105px;
  border: 4px solid var(--ink);
  border-radius: 49% 49% 46% 46%;
  background: #fff;
  box-shadow: inset 0 -9px 0 #edf3f1;
}

.panda__head::after {
  position: absolute;
  top: 10px;
  left: 24px;
  color: #f9a0ae;
  font-size: 0.74rem;
  content: "✦";
}

.panda__eye {
  position: absolute;
  top: 30px;
  width: 33px;
  height: 42px;
  border: 3px solid var(--ink);
  border-radius: 49%;
  background: #30233a;
}

.panda__eye--left { left: 20px; transform: rotate(17deg); }
.panda__eye--right { right: 20px; transform: rotate(-17deg); }

.panda__eye i {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 9px;
  height: 13px;
  border-radius: 50%;
  background: white;
}

.panda__muzzle {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 14px;
  width: 45px;
  height: 28px;
  border-radius: 50%;
  background: #fff2e6;
  transform: translateX(-50%);
}

.panda__muzzle::before {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 13px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
  transform: translateX(-50%);
}

.panda__muzzle i {
  position: absolute;
  top: 13px;
  left: 50%;
  width: 17px;
  height: 8px;
  border-bottom: 3px solid var(--ink);
  border-radius: 0 0 50% 50%;
  transform: translateX(-50%);
}

.panda__arm {
  position: absolute;
  z-index: 5;
  bottom: 33px;
  width: 35px;
  height: 74px;
  border: 4px solid var(--ink);
  border-radius: 45%;
  background: #30233a;
  transform-origin: 50% 85%;
}

.panda__arm--left { left: 19px; transform: rotate(22deg); }
.panda__arm--right { right: 19px; transform: rotate(-22deg); }

.task-panda-wrap.is-celebrating .panda--task {
  animation: panda-jump 760ms cubic-bezier(.28, .84, .36, 1.24) 2;
}

.task-panda-wrap.is-celebrating .panda__arm--left { animation: arm-wave-left 420ms ease-in-out 3; }
.task-panda-wrap.is-celebrating .panda__arm--right { animation: arm-wave-right 420ms ease-in-out 3; }

.received-item {
  position: absolute;
  z-index: 11;
  right: 2px;
  bottom: 30px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: white;
  box-shadow: 0 5px 0 rgba(36, 20, 58, 0.16);
  font-size: 2rem;
  opacity: 0;
  transform: scale(0);
}

.received-item.is-visible {
  animation: receive-pop 500ms cubic-bezier(.17, .89, .32, 1.5) forwards;
}

.speech-card {
  position: relative;
  width: 100%;
  padding: 14px;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: rgba(255, 253, 245, 0.97);
  box-shadow: 0 7px 0 rgba(36, 20, 58, 0.15);
}

.speech-card::before {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 26px;
  height: 26px;
  border-top: 4px solid var(--ink);
  border-left: 4px solid var(--ink);
  background: var(--paper);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.speech-kicker,
.speech-line {
  text-align: center;
}

.speech-kicker {
  margin: 0 0 4px;
  color: #7a5d82;
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.speech-line {
  margin: 0 0 10px;
  font-size: 1.12rem;
  font-weight: 1000;
}

.target-token {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff4b8;
}

.target-token.is-coaching {
  animation: target-coach-pulse 720ms ease-in-out 2;
}

.table-zone.is-coaching {
  box-shadow: inset 0 -13px 0 rgba(76, 33, 18, 0.15), 0 0 0 6px rgba(255,200,61,.62), 0 9px 0 rgba(36,20,58,.14);
}

.target-picture {
  display: grid;
  width: 65px;
  height: 65px;
  place-items: center;
  border: 2px solid rgba(36, 20, 58, 0.25);
  border-radius: 15px;
  background: white;
  font-size: 2.55rem;
}

.target-copy {
  min-width: 0;
}

.target-copy small {
  display: block;
  color: #8b5274;
  font-size: 0.63rem;
  font-weight: 1000;
  letter-spacing: 0.14em;
}

.target-copy strong {
  display: block;
  font-size: clamp(0.72rem, 1.15vw, 1rem);
  font-weight: 1000;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.mission-progress {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 11px;
}

.progress-dot {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  font-size: 0.95rem;
  filter: grayscale(1);
  opacity: 0.6;
}

.progress-dot.is-current {
  background: #dff8ff;
  filter: none;
  opacity: 1;
  transform: scale(1.13);
}

.progress-dot.is-done {
  background: var(--gold);
  filter: none;
  opacity: 1;
}

.play-room {
  position: relative;
  min-width: 0;
  min-height: 640px;
  overflow: hidden;
  background: linear-gradient(180deg, #a9ebf5 0 42%, #f7d9a5 42% 100%);
}

.play-room.is-hand-active,
.play-room.is-hand-active button {
  cursor: none;
}

.room-sky {
  position: absolute;
  inset: 0 0 58% 0;
  overflow: hidden;
  background: linear-gradient(180deg, #91e1f3, #d7f8f6);
}

.room-sky::after {
  position: absolute;
  right: -20px;
  bottom: -28px;
  left: -20px;
  height: 69px;
  border: 4px solid var(--ink);
  border-radius: 50% 50% 0 0;
  background: #8ad889;
  content: "";
}

.sun {
  position: absolute;
  top: 22px;
  right: 42px;
  width: 70px;
  height: 70px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 9px rgba(255, 200, 61, 0.25);
}

.cloud {
  position: absolute;
  width: 86px;
  height: 28px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: white;
}

.cloud::before,
.cloud::after {
  position: absolute;
  bottom: -3px;
  border: 3px solid var(--ink);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  background: white;
  content: "";
}

.cloud::before { left: 13px; width: 32px; height: 35px; }
.cloud::after { right: 12px; width: 39px; height: 47px; }
.cloud--one { top: 43px; left: 8%; }
.cloud--two { top: 92px; left: 44%; transform: scale(0.72); }

.room-details {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shelf {
  position: absolute;
  z-index: 2;
  width: 112px;
  height: 13px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #a7643e;
  box-shadow: 0 5px 0 rgba(36, 20, 58, 0.13);
}

.shelf::before {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 16px;
  height: 39px;
  border: 3px solid var(--ink);
  border-radius: 5px 5px 0 0;
  background: var(--coral);
  box-shadow: 20px 0 0 #ffd166, 23px 0 0 var(--ink), 43px 6px 0 #63d68c, 46px 6px 0 var(--ink);
  content: "";
}

.shelf--one { top: 137px; left: 7%; }
.shelf--two { top: 188px; right: 10%; transform: scale(0.85); }

.plant {
  position: absolute;
  z-index: 2;
  top: 154px;
  left: 43%;
  color: #1d8c58;
  font-size: 4.4rem;
  font-weight: 1000;
  transform: rotate(-8deg);
}

.toy-box {
  position: absolute;
  z-index: 2;
  top: 205px;
  right: 4%;
  padding: 17px 12px 10px;
  border: 4px solid var(--ink);
  border-radius: 8px 8px 18px 18px;
  background: #ef8a5c;
  box-shadow: inset 0 -7px 0 rgba(36, 20, 58, 0.11);
  font-size: 0.66rem;
  font-weight: 1000;
  transform: rotate(3deg);
}

.search-route {
  position: absolute;
  z-index: 2;
  inset: 34px 40px 292px;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.search-route.is-visible {
  opacity: 1;
}

.search-route span {
  position: absolute;
  height: 5px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.95) 0 11px, transparent 11px 20px);
  filter: drop-shadow(0 2px 0 rgba(36,20,58,.18));
  transform-origin: left center;
}

.search-route span:nth-child(1) { top: 18%; left: 8%; width: 62%; transform: rotate(0deg); }
.search-route span:nth-child(2) { top: 18%; left: 70%; width: 22%; transform: rotate(108deg); }
.search-route span:nth-child(3) { top: 48%; left: 21%; width: 52%; transform: rotate(0deg); }
.search-route span:nth-child(4) { top: 48%; left: 21%; width: 22%; transform: rotate(74deg); }
.search-route span:nth-child(5) { top: 77%; left: 20%; width: 57%; transform: rotate(0deg); }

.helper-panda {
  position: absolute;
  z-index: 3;
  top: 8%;
  left: 4%;
  width: 105px;
  height: 145px;
  opacity: 0;
  transform: scale(0.72);
  transform-origin: 50% 100%;
  pointer-events: none;
}

.helper-panda.is-visible {
  opacity: 1;
}

.helper-panda .panda {
  bottom: 0;
  left: -25px;
  transform: scale(0.68);
}

.helper-panda.is-walking .panda {
  animation: helper-bob 360ms ease-in-out infinite alternate;
}

.helper-panda.is-looking .panda__head {
  animation: look-around 720ms ease-in-out infinite alternate;
}

.helper-panda.is-searching .panda {
  animation: search-squint 500ms ease-in-out infinite alternate;
}

.helper-panda.is-found .panda {
  animation: helper-found 620ms cubic-bezier(.17, .89, .32, 1.5) 2;
}

.carried-item {
  position: absolute;
  z-index: 20;
  right: -6px;
  bottom: 20px;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: white;
  box-shadow: 0 5px 0 rgba(36,20,58,.15), 0 0 14px var(--gold);
  font-size: 2rem;
  animation: receive-pop 360ms cubic-bezier(.17,.89,.32,1.5);
}

.action-bubble {
  position: absolute;
  z-index: 9;
  top: -18px;
  left: 50%;
  min-width: 72px;
  padding: 5px 9px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: white;
  box-shadow: 0 4px 0 rgba(36,20,58,.13);
  font-size: 0.62rem;
  font-weight: 1000;
  text-align: center;
  letter-spacing: 0.07em;
  transform: translateX(-50%);
}

.real-item {
  position: absolute;
  z-index: 4;
  top: 27%;
  left: 73%;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 58%, #fff1a6 59% 100%);
  box-shadow: 0 7px 0 rgba(36,20,58,.16), 0 0 0 10px rgba(255, 232, 92, 0.24);
  font-size: 3.2rem;
  opacity: 0;
  transform: scale(0) rotate(-15deg);
  pointer-events: none;
}

.real-item.is-visible {
  animation: real-item-found 720ms cubic-bezier(.17, .89, .32, 1.5) forwards;
}

.table-zone {
  position: absolute;
  z-index: 5;
  right: 18px;
  bottom: 61px;
  left: 18px;
  height: 334px;
  padding: 43px 20px 16px;
  border: 4px solid var(--ink);
  border-radius: 26px 26px 38px 38px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.13), transparent 20% 80%, rgba(88,36,18,.08)),
    repeating-linear-gradient(90deg, #c97a45 0 32px, #d98c50 32px 64px);
  box-shadow: inset 0 -13px 0 rgba(76, 33, 18, 0.15), 0 9px 0 rgba(36,20,58,.14);
  transition: opacity 300ms ease, transform 400ms ease;
}

.table-zone.is-searching {
  opacity: 0.2;
  transform: translateY(55%) scale(0.94);
  pointer-events: none;
}

.table-title {
  position: absolute;
  top: -18px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: min(360px, 75%);
  justify-content: center;
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(36,20,58,.15);
  font-size: 0.86rem;
  font-weight: 1000;
  transform: translateX(-50%);
}

.table-title__icon {
  color: var(--gold);
  font-size: 1.15rem;
  -webkit-text-stroke: 1px var(--ink);
}

.card-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 15px;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
}

.card-grid.layout-scatter {
  display: block;
}

.search-card {
  position: relative;
  width: clamp(94px, 11vw, 126px);
  height: clamp(126px, 14vw, 158px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  perspective: 800px;
  transform-origin: 50% 100%;
  transition: transform 340ms cubic-bezier(.17,.89,.32,1.25), filter 220ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.layout-scatter .search-card {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: var(--z);
  transform: translate(-50%, -50%) rotate(var(--rotation));
}

/* Stage 4 adds two cards beyond the original eight-slot scatter layout. */
.layout-scatter .search-card:nth-child(9) {
  --x: 24% !important;
  --y: 50% !important;
}

.layout-scatter .search-card:nth-child(10) {
  --x: 76% !important;
  --y: 50% !important;
}

.search-card:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-8px) rotate(-2deg);
}

.layout-scatter .search-card:hover:not(:disabled) {
  transform: translate(-50%, -50%) translateY(-8px) rotate(0);
}

.card-inner {
  position: absolute;
  inset: 0;
  border: 4px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 7px 0 rgba(36,20,58,.18), 0 12px 20px rgba(36,20,58,.12);
  transform-style: preserve-3d;
  transition: transform 420ms cubic-bezier(.2,.7,.2,1);
}

.search-card:not(.is-hidden) .card-inner,
.search-card.is-revealed .card-inner {
  transform: rotateY(180deg);
}

.card-back,
.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 9px;
  border-radius: 15px;
  overflow: hidden;
  backface-visibility: hidden;
}

.card-back {
  background:
    radial-gradient(circle at 14px 14px, rgba(255,255,255,.7) 0 3px, transparent 4px),
    linear-gradient(145deg, #8c72d9, #5f53b8);
  background-size: 28px 28px, auto;
}

.card-back::before {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  color: white;
  font-size: 1.75rem;
  content: "★";
  -webkit-text-stroke: 1.5px var(--ink);
}

.card-back::after {
  color: white;
  font-size: 0.62rem;
  font-weight: 1000;
  letter-spacing: 0.13em;
  content: "MAGIC CARD";
}

.card-face {
  background: linear-gradient(145deg, white 0 65%, var(--card-color) 170%);
  transform: rotateY(180deg);
}

.card-face::before,
.card-face::after {
  position: absolute;
  color: var(--gold);
  font-size: 0.85rem;
  content: "✦";
  -webkit-text-stroke: 0.7px var(--ink);
}

.card-face::before { top: 7px; left: 9px; }
.card-face::after { right: 9px; bottom: 7px; }

.card-picture {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 2px solid rgba(36,20,58,.18);
  border-radius: 17px;
  background: #fffaf0;
  box-shadow: inset 0 -5px 0 rgba(36,20,58,.06);
  font-size: 2.85rem;
}

.card-word {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(0.68rem, 1.45vw, 0.9rem);
  font-weight: 1000;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
}

.search-card.is-lifted {
  z-index: 40 !important;
  transform: translateY(-34px) scale(1.36) rotate(0);
  filter: drop-shadow(0 19px 15px rgba(36,20,58,.23));
}

.layout-scatter .search-card.is-lifted {
  transform: translate(-50%, -50%) translateY(-34px) scale(1.36) rotate(0);
}

.search-card.is-correct .card-inner {
  box-shadow: 0 0 0 7px rgba(255,255,255,.9), 0 0 24px 13px var(--gold), 0 9px 0 rgba(36,20,58,.16);
  animation: correct-bling 520ms ease-in-out 2;
}

.search-card.is-wrong {
  animation: wrong-shake 500ms ease-in-out;
}

.layout-scatter .search-card.is-wrong {
  animation: wrong-shake-scatter 500ms ease-in-out;
}

.search-card.is-collected {
  opacity: 0.43;
  filter: grayscale(.75);
  transform: scale(.92);
}

.layout-scatter .search-card.is-collected {
  transform: translate(-50%, -50%) scale(.92);
}

.magic-particle {
  position: absolute;
  z-index: 50;
  top: 50%;
  left: 50%;
  color: var(--particle-color, var(--gold));
  font-size: var(--particle-size, 1.2rem);
  font-weight: 1000;
  pointer-events: none;
  animation: particle-fly 900ms ease-out forwards;
  -webkit-text-stroke: 1px var(--ink);
}

.card-shred {
  position: absolute;
  z-index: 60;
  top: 8%;
  left: 8%;
  width: 28%;
  height: 24%;
  border: 2px solid var(--ink);
  background: linear-gradient(145deg, #fff, var(--card-color, #ffd6d6));
  clip-path: polygon(0 0, 100% 8%, 78% 100%, 15% 82%);
  pointer-events: none;
  animation: shred-fly 700ms cubic-bezier(.2,.75,.5,1) forwards;
}

.status-pill {
  position: absolute;
  z-index: 12;
  bottom: 10px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(440px, 88%);
  justify-content: center;
  padding: 8px 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: rgba(255,253,245,.96);
  box-shadow: 0 5px 0 rgba(36,20,58,.15);
  font-size: 0.83rem;
  text-align: center;
  transform: translateX(-50%);
}

.status-pill.is-correct { background: #dcffe8; }
.status-pill.is-wrong { background: #ffe4e8; }
.status-pill.is-magic { background: #f1e8ff; }

.status-pill span {
  font-size: 1.15rem;
}

.child-hand {
  position: absolute;
  z-index: 100;
  top: 55%;
  left: 50%;
  width: 72px;
  height: 92px;
  opacity: 0;
  transform: translate(-15px, -16px) rotate(-18deg);
  transform-origin: 30% 15%;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.child-hand.is-visible {
  opacity: 1;
}

.child-hand span {
  position: relative;
  z-index: 2;
  font-size: 3.4rem;
  filter: drop-shadow(0 4px 0 rgba(36,20,58,.2));
}

.child-hand i {
  position: absolute;
  z-index: 1;
  right: 3px;
  bottom: 0;
  width: 43px;
  height: 53px;
  border: 4px solid var(--ink);
  border-radius: 13px 13px 25px 25px;
  background: #62cfe0;
  transform: rotate(-8deg);
}

.child-hand.is-tapping {
  animation: hand-tap 300ms ease-out;
}

.start-curtain,
.finish-curtain,
.high-five-scene {
  position: absolute;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
}

.start-curtain,
.finish-curtain {
  padding: 24px;
  background: rgba(36, 20, 58, 0.26);
  backdrop-filter: blur(5px);
}

.start-curtain.is-leaving {
  animation: curtain-out 430ms ease forwards;
  pointer-events: none;
}

.start-card,
.finish-card {
  width: min(490px, 94%);
  padding: clamp(22px, 4vw, 34px);
  border: 4px solid var(--ink);
  border-radius: 30px;
  background:
    radial-gradient(circle at 18px 18px, rgba(255,255,255,.85) 0 4px, transparent 5px),
    linear-gradient(145deg, #fffdf5, #fff2bd);
  background-size: 40px 40px, auto;
  box-shadow: 0 12px 0 rgba(36,20,58,.18), 0 24px 50px rgba(36,20,58,.28);
  text-align: center;
}

.start-sparkles,
.finish-stars {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 1.4rem;
  letter-spacing: 0.16em;
  -webkit-text-stroke: 1.2px var(--ink);
}

.start-eyebrow,
.finish-card > p:first-of-type {
  margin: 0 0 5px;
  color: #805c87;
  font-size: 0.73rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.start-card h2,
.finish-card h2 {
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 5vw, 2.45rem);
  font-weight: 1000;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.start-card > p:last-of-type,
.finish-card #finishSummary {
  color: #655071;
  font-weight: 800;
}

.start-target {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  justify-content: center;
  padding: 10px 20px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: white;
  box-shadow: 0 5px 0 rgba(36,20,58,.14);
}

.start-target span { font-size: 2.8rem; }
.start-target strong { font-size: 1.25rem; font-weight: 1000; }

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 22px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 6px 0 rgba(36,20,58,.2);
  font-weight: 1000;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  background: var(--coral);
  color: white;
}

.secondary-button { background: white; }

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(36,20,58,.2);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(36,20,58,.2);
}

.primary-button b {
  font-size: 1.25rem;
}

.finish-curtain[hidden] {
  display: none;
}

.finish-curtain.is-arriving .finish-card {
  animation: finish-arrive 600ms cubic-bezier(.17,.89,.32,1.4);
}

.finish-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 21px;
}

.finish-choice {
  position: relative;
  flex: 1 1 205px;
  min-height: 68px;
  flex-direction: column;
  gap: 2px;
  padding-inline: 18px;
  line-height: 1.1;
}

.finish-choice span {
  font-size: 1rem;
  font-weight: 1000;
}

.finish-choice small {
  font-size: .72rem;
  font-weight: 900;
  opacity: .84;
}

.finish-choice--continue { order: 1; }
.finish-choice--replay { order: 2; }

@keyframes runtime-ready-bounce {
  from { transform: translateY(0) rotate(-1deg); }
  to { transform: translateY(-9px) rotate(1deg); }
}

@keyframes target-coach-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 5px 0 rgba(36,20,58,.13); }
  50% { transform: scale(1.06); box-shadow: 0 5px 0 rgba(36,20,58,.13), 0 0 0 8px rgba(255,200,61,.42); }
}

.high-five-scene {
  overflow: hidden;
  background: radial-gradient(circle, rgba(255,255,255,.85), rgba(255,213,92,.62) 38%, rgba(125,104,203,.72));
  opacity: 0;
  pointer-events: none;
}

.high-five-scene.is-active {
  opacity: 1;
  animation: high-five-scene 1550ms ease forwards;
}

.high-five-copy {
  position: absolute;
  top: 20%;
  display: grid;
  color: white;
  text-align: center;
  text-shadow: 0 4px 0 var(--ink);
}

.high-five-copy small {
  font-size: 0.8rem;
  font-weight: 1000;
  letter-spacing: 0.2em;
}

.high-five-copy strong {
  font-size: clamp(2.1rem, 7vw, 4.5rem);
  font-weight: 1000;
}

.high-five-hand {
  position: absolute;
  top: 46%;
  font-size: 6.5rem;
  filter: drop-shadow(0 9px 0 rgba(36,20,58,.18));
}

.high-five-hand--child {
  left: -150px;
}

.high-five-scene.is-active .high-five-hand--child {
  animation: high-five-child 1250ms cubic-bezier(.16,.8,.25,1) forwards;
}

.high-five-hand--panda {
  right: -150px;
  width: 112px;
  height: 136px;
  border: 5px solid var(--ink);
  border-radius: 52% 52% 42% 42%;
  background: #30233a;
  transform: rotate(-28deg);
}

.paw-pad {
  position: absolute;
  top: 43px;
  left: 50%;
  width: 51px;
  height: 59px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #f6a9b2;
  transform: translateX(-50%);
}

.paw-pad::before {
  position: absolute;
  top: -31px;
  left: -10px;
  width: 18px;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #f6a9b2;
  box-shadow: 25px -7px 0 -1px #f6a9b2, 25px -7px 0 2px var(--ink), 49px 3px 0 -1px #f6a9b2, 49px 3px 0 2px var(--ink);
  content: "";
}

.high-five-scene.is-active .high-five-hand--panda {
  animation: high-five-panda 1250ms cubic-bezier(.16,.8,.25,1) forwards;
}

.high-five-burst {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  color: var(--gold);
  font-size: 1rem;
  opacity: 0;
  -webkit-text-stroke: 2px var(--ink);
  transform: translate(-50%,-50%);
}

.high-five-scene.is-active .high-five-burst {
  animation: high-five-burst 1250ms ease-out forwards;
}

.demo-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  color: #614d70;
  font-size: 0.77rem;
  text-align: center;
}

.demo-note span {
  color: var(--gold);
  font-size: 1.1rem;
  -webkit-text-stroke: 1px var(--ink);
}

.demo-note p { margin: 0; }

.flying-item {
  position: fixed;
  z-index: 1000;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: white;
  box-shadow: 0 7px 0 rgba(36,20,58,.18), 0 0 18px var(--gold);
  font-size: 3rem;
  pointer-events: none;
}

@keyframes star-pop {
  0% { transform: scale(1) rotate(0); }
  45% { transform: scale(1.8) rotate(18deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes panda-jump {
  0%, 100% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-36px) rotate(-5deg); }
  65% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes arm-wave-left {
  0%, 100% { transform: rotate(22deg); }
  50% { transform: rotate(70deg) translateY(-15px); }
}

@keyframes arm-wave-right {
  0%, 100% { transform: rotate(-22deg); }
  50% { transform: rotate(-70deg) translateY(-15px); }
}

@keyframes receive-pop {
  0% { opacity: 0; transform: scale(0) rotate(-20deg); }
  70% { opacity: 1; transform: scale(1.22) rotate(8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes helper-bob {
  from { transform: translateY(0) scale(.68) rotate(-2deg); }
  to { transform: translateY(-6px) scale(.68) rotate(2deg); }
}

@keyframes look-around {
  from { transform: translateX(-7px) rotate(-7deg); }
  to { transform: translateX(7px) rotate(7deg); }
}

@keyframes search-squint {
  from { transform: translateY(0) scale(.68) rotate(-4deg); }
  to { transform: translateY(8px) scale(.68) rotate(4deg); }
}

@keyframes helper-found {
  0%,100% { transform: scale(.68) translateY(0); }
  50% { transform: scale(.76) translateY(-25px) rotate(7deg); }
}

@keyframes real-item-found {
  0% { opacity: 0; transform: scale(0) rotate(-20deg); }
  68% { opacity: 1; transform: scale(1.22) rotate(12deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes correct-bling {
  0%,100% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.06); }
}

@keyframes wrong-shake {
  0%,100% { transform: translateY(-34px) scale(1.36) rotate(0); }
  18% { transform: translateY(-34px) scale(1.36) rotate(-8deg); }
  36% { transform: translateY(-34px) scale(1.36) rotate(8deg); }
  54% { transform: translateY(-34px) scale(1.36) rotate(-6deg); }
  72% { transform: translateY(-34px) scale(1.36) rotate(5deg); }
}

@keyframes wrong-shake-scatter {
  0%,100% { transform: translate(-50%,-50%) translateY(-34px) scale(1.36) rotate(0); }
  18% { transform: translate(-50%,-50%) translateY(-34px) scale(1.36) rotate(-8deg); }
  36% { transform: translate(-50%,-50%) translateY(-34px) scale(1.36) rotate(8deg); }
  54% { transform: translate(-50%,-50%) translateY(-34px) scale(1.36) rotate(-6deg); }
  72% { transform: translate(-50%,-50%) translateY(-34px) scale(1.36) rotate(5deg); }
}

@keyframes particle-fly {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.2); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--px)), calc(-50% + var(--py))) scale(1.25) rotate(var(--pr)); }
}

@keyframes shred-fly {
  0% { opacity: 1; transform: translate(0,0) rotate(0) scale(1); }
  100% { opacity: 0; transform: translate(var(--sx), var(--sy)) rotate(var(--sr)) scale(.7); }
}

@keyframes hand-tap {
  0%,100% { transform: translate(-15px,-16px) rotate(-18deg) scale(1); }
  50% { transform: translate(-15px,-8px) rotate(-12deg) scale(.86); }
}

@keyframes curtain-out {
  to { opacity: 0; transform: scale(1.04); }
}

@keyframes finish-arrive {
  0% { opacity: 0; transform: scale(.65) rotate(-4deg); }
  70% { transform: scale(1.04) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes high-five-scene {
  0% { opacity: 0; }
  12%, 82% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes high-five-child {
  0% { left: -150px; transform: rotate(40deg); }
  55%,72% { left: calc(50% - 92px); transform: rotate(20deg) scale(1.08); }
  100% { left: -150px; transform: rotate(40deg); }
}

@keyframes high-five-panda {
  0% { right: -150px; transform: rotate(-50deg); }
  55%,72% { right: calc(50% - 95px); transform: rotate(-28deg) scale(1.08); }
  100% { right: -150px; transform: rotate(-50deg); }
}

@keyframes high-five-burst {
  0%,48% { opacity: 0; transform: translate(-50%,-50%) scale(.1) rotate(0); }
  58% { opacity: 1; transform: translate(-50%,-50%) scale(9) rotate(60deg); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(13) rotate(140deg); }
}

@media (max-width: 860px) {
  .game-card {
    grid-template-columns: 225px minmax(0, 1fr);
  }

  .mission-panel {
    padding-inline: 10px;
  }

  .task-panda-wrap {
    width: 180px;
    transform: scale(.9);
  }

  .speech-line { font-size: .98rem; }
  .target-token { grid-template-columns: 57px 1fr; }
  .target-picture { width: 54px; height: 54px; font-size: 2.2rem; }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
  }

  .search-card {
    width: 92px;
    height: 123px;
  }

  .card-picture {
    width: 58px;
    height: 58px;
    font-size: 2.35rem;
  }
}

@media (max-width: 650px) {
  .app-shell {
    width: min(100% - 14px, 560px);
    padding-top: 9px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand-lockup p,
  .sound-toggle span:last-child {
    display: none;
  }

  .topbar-actions { gap: 6px; }
  .game-park-link span:last-child,
  .restart-game-button span:last-child,
  .sound-toggle span:last-child {
    display: none;
  }

  .game-park-link, .restart-game-button, .star-bank, .sound-toggle { min-height: 42px; padding: 5px 11px; }

  .stage-picker { gap: 6px; }

  .stage-tab {
    display: flex;
    min-height: 52px;
    justify-content: center;
    padding: 6px;
    text-align: center;
  }

  .stage-tab > span {
    width: 31px;
    height: 31px;
  }

  .stage-tab strong,
  .stage-tab small {
    display: none;
  }

  .game-card {
    display: block;
    min-height: 760px;
    border-radius: 23px;
  }

  .mission-panel {
    display: grid;
    grid-template-columns: 116px 1fr;
    min-height: 174px;
    padding: 9px;
    border-right: 0;
    border-bottom: 4px solid var(--ink);
  }

  .task-panda-wrap {
    width: 128px;
    height: 150px;
    transform: scale(.65);
    transform-origin: left center;
  }

  .name-ribbon { top: -14px; }

  .speech-card {
    width: auto;
    padding: 10px;
  }

  .speech-card::before {
    top: 50%;
    left: -14px;
    transform: translateY(-50%) rotate(-45deg);
  }

  .speech-kicker { font-size: .57rem; }
  .speech-line { margin-bottom: 6px; font-size: .85rem; }
  .target-token { grid-template-columns: 48px 1fr; padding: 5px; }
  .target-picture { width: 45px; height: 45px; border-radius: 12px; font-size: 1.8rem; }
  .target-copy strong { font-size: .78rem; }
  .mission-progress { margin-top: 6px; }
  .progress-dot { width: 24px; height: 24px; font-size: .75rem; }

  .play-room { min-height: 582px; }

  .table-zone {
    right: 8px;
    bottom: 58px;
    left: 8px;
    height: 350px;
    padding: 37px 8px 10px;
  }

  .card-grid { gap: 6px; }

  .search-card {
    width: 78px;
    height: 105px;
  }

  .card-inner { border-width: 3px; border-radius: 15px; }
  .card-back, .card-face { border-radius: 11px; padding: 5px; }
  .card-picture { width: 48px; height: 48px; border-radius: 11px; font-size: 1.9rem; }
  .card-word { font-size: .59rem; }
  .card-back::before { width: 42px; height: 42px; font-size: 1.35rem; }
  .card-back::after { font-size: .49rem; }

  .layout-scatter .search-card:nth-child(n+7) {
    margin-top: 8px;
  }

  .status-pill {
    bottom: 9px;
    min-width: 92%;
    padding: 7px 11px;
    font-size: .7rem;
  }

  .child-hand { transform: translate(-12px,-13px) scale(.8) rotate(-18deg); }
  .table-title { min-width: 78%; font-size: .7rem; }
  .start-curtain, .finish-curtain { padding: 12px; }
  .start-card, .finish-card { padding: 22px 16px; }
  .high-five-copy { top: 29%; }
  .high-five-hand { top: 51%; }
}

@media (pointer: coarse) {
  .play-room,
  .play-room button {
    cursor: auto !important;
  }

  .child-hand {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
.start-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 12px 0 16px;
}

.start-steps span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: .76rem;
  font-weight: 900;
}

.start-steps b {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
}

.search-card.is-hinting {
  z-index: 30 !important;
  animation: gentle-hint 760ms ease-in-out 2 !important;
}

.table-zone.is-giving-hint .search-card:not(.is-hinting) {
  opacity: .76;
}

@keyframes gentle-hint {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 200, 61, 0)); transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)); }
  50% { filter: drop-shadow(0 0 14px #fff) drop-shadow(0 0 18px var(--gold)); transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scale(1.08); }
}

.book-showcase {
  margin: 16px auto 0;
  color: var(--ink);
}

.book-showcase[hidden] { display: none !important; }

.book-showcase > details {
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: linear-gradient(135deg, #fff8d8, #e8fff8);
  box-shadow: 0 5px 0 rgba(36,20,58,.14);
}

.book-showcase summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
}

.book-showcase summary::-webkit-details-marker { display: none; }
.book-showcase summary > span:nth-child(2) { display: grid; gap: 1px; }
.book-showcase summary > span:last-child { margin-left: auto; font-size: 1.1rem; }
.book-showcase summary small { color: #6d5a7c; font-weight: 800; }
.book-showcase-sparkle { font-size: 1.45rem; }

.book-showcase-panel {
  padding: 16px;
  border-top: 2px dashed rgba(36,20,58,.2);
}

.book-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.book-product {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 2px solid rgba(36,20,58,.24);
  border-radius: 17px;
  background: rgba(255,255,255,.78);
}

.book-product img {
  width: 100%;
  max-width: 180px;
  height: auto;
  margin-inline: auto;
  border: 3px solid var(--ink);
  border-radius: 15px;
  box-shadow: 0 6px 0 rgba(36,20,58,.14);
}

.book-showcase-kicker { margin: 0; color: #8b507d; font-size: .72rem; font-weight: 1000; letter-spacing: .12em; }
.book-showcase-panel > h2 { margin: 3px 0 4px; font-size: clamp(1.35rem, 4vw, 2rem); }
.book-showcase-intro { margin: 0; line-height: 1.45; }
.book-product h3 { min-height: 2.4em; margin: 3px 0 0; text-align: center; font-size: .95rem; line-height: 1.2; }
.book-showcase-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.book-product .book-showcase-actions { display: grid; gap: 6px; }
.book-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(36,20,58,.14);
  color: var(--ink);
  font-weight: 1000;
  font-size: .78rem;
  text-decoration: none;
}
.book-link--read { background: #fff; }
.book-link--buy { background: var(--gold); }
.book-link:focus-visible { outline: 4px solid rgba(255,200,61,.55); outline-offset: 3px; }
.book-collection-link { display: inline-block; margin-top: 14px; color: var(--ink); font-weight: 1000; }

.bug-hunter {
  margin: 16px auto 0;
  color: var(--ink);
}

.bug-hunter > details {
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: rgba(255, 253, 245, .94);
  box-shadow: 0 5px 0 rgba(36,20,58,.14);
}

.bug-hunter > details > summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  cursor: pointer;
  list-style: none;
}

.bug-hunter > details > summary::-webkit-details-marker { display: none; }
.bug-hunter > details > summary strong { font-size: 1rem; }
.bug-hunter > details > summary small { margin-left: auto; color: #6d5a7c; font-weight: 800; }
.bug-hunter-panel { padding: 4px 16px 18px; border-top: 2px dashed rgba(36,20,58,.2); }
.bug-hunter-panel h2 { margin: 12px 0 2px; font-size: 1.18rem; }
.bug-hunter-panel > p { margin: 0 0 13px; }
.bug-hunter form { display: grid; gap: 8px; }
.bug-hunter label { font-size: .84rem; font-weight: 900; }
.bug-hunter label span { font-weight: 700; }
.bug-hunter textarea,
.bug-hunter input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.bug-hunter textarea { resize: vertical; }
.adult-confirm { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; }
.adult-confirm input { width: 22px; height: 22px; flex: 0 0 auto; }
.bug-hunter-honeypot { position: absolute !important; left: -10000px !important; }
.diagnostic-preview { padding: 8px 10px; border-radius: 12px; background: #f4efff; font-size: .75rem; }
.diagnostic-preview summary { cursor: pointer; font-weight: 900; }
.diagnostic-preview pre { max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.bug-form-status { min-height: 1.2em; margin: 2px 0; font-size: .83rem; font-weight: 900; }
.bug-form-status.is-error { color: #a4273c; }
.bug-form-status.is-success { color: #087a61; }
.bug-submit {
  min-height: 48px;
  padding: 8px 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 5px 0 rgba(36,20,58,.16);
  color: #fff;
  font-weight: 1000;
  cursor: pointer;
}

@media (max-width: 650px) {
  html, body { max-width: 100%; overflow-x: clip; }
  .topbar { gap: 8px; }
  .brand-lockup { min-width: 0; }
  .brand-lockup h1 { font-size: clamp(1.45rem, 8vw, 2rem); }
  .start-steps { gap: 4px; }
  .start-steps span { min-height: 32px; padding: 4px 7px; font-size: .68rem; }
  .book-showcase-panel { padding: 12px; }
  .book-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .book-link { min-height: 44px; padding-inline: 10px; font-size: .82rem; }
  .bug-hunter-panel { padding-inline: 12px; }
}

@media (max-width: 390px) {
  .book-product-grid { grid-template-columns: 1fr; }
  .book-product img { width: min(150px, 60vw); }
}

/* Shared Bug Hunter + Amazon bookshelf UI, matched to Bubble Game / Typing Monster. */
.ci-bug-hunter {
  margin-top: 12px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: linear-gradient(145deg, #e9fff1, #fff8df 58%, #ffe8f1);
  box-shadow: 0 6px 0 rgba(36, 20, 58, .14);
}

.ci-bug-hunter h2 {
  margin: 8px 0 5px;
  font-size: 1.3rem;
}

.ci-bug-hunter > p {
  margin: 0;
  font-weight: 800;
  line-height: 1.5;
}

.ci-bug-badge {
  display: inline-flex;
  padding: 5px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--gold);
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .04em;
}

.ci-feedback-panel {
  margin-top: 12px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: rgba(255, 255, 255, .88);
  overflow: hidden;
}

.ci-feedback-panel > summary {
  padding: 11px 13px;
  cursor: pointer;
  background: #7a3b8f;
  color: #fff;
  font-weight: 1000;
  text-align: center;
}

.ci-feedback-form {
  display: grid;
  gap: 11px;
  padding: 13px;
}

.ci-feedback-form label {
  display: grid;
  gap: 5px;
}

.ci-feedback-form label > span {
  color: #6c347e;
  font-size: .8rem;
  font-weight: 1000;
}

.ci-feedback-form select,
.ci-feedback-form textarea,
.ci-feedback-form input[type="email"] {
  width: 100%;
  min-height: 46px;
  padding: 10px;
  border: 2px solid rgba(36, 20, 58, .4);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.ci-feedback-form textarea { resize: vertical; }
.ci-feedback-email-link {
  justify-self: start;
  color: #6d2f81;
  font-size: .78rem;
  font-weight: 900;
  text-underline-offset: .16em;
}

.ci-feedback-auto-data {
  display: grid;
  gap: 6px;
  padding-top: 2px;
  color: #6d6276;
  font-size: .7rem;
  line-height: 1.3;
}

.ci-feedback-auto-data > span { font-weight: 850; }
.ci-feedback-consent {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.ci-feedback-consent input {
  width: 22px;
  height: 22px;
  margin-top: 3px;
}

.ci-feedback-trap {
  position: absolute;
  left: -9999px;
}

.ci-feedback-actions {
  display: grid;
  gap: 7px;
}

.ci-feedback-actions button { width: 100%; }
.ci-feedback-actions p {
  min-height: 1.4em;
  margin: 0;
  font-weight: 900;
}

.ci-book-reward {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 9px;
  color: #5b4668;
  text-align: center;
}

.ci-book-reward-icon {
  font-size: 1.25rem;
  filter: drop-shadow(0 2px 0 rgba(36, 20, 58, .14));
}

.ci-book-reward small {
  max-width: 410px;
  font-weight: 850;
  line-height: 1.35;
}

.ci-book-showcase {
  margin-top: 10px;
  padding: 10px;
  border: 2px solid rgba(36, 20, 58, .24);
  border-radius: 14px;
  background: rgba(255, 255, 255, .62);
}

.ci-book-showcase-heading h3,
.ci-book-showcase-heading p { margin: 0; }
.ci-book-showcase-heading h3 { font-size: .9rem; }
.ci-book-showcase-heading p {
  margin-top: 2px;
  color: #695c72;
  font-size: .7rem;
  font-weight: 800;
}

.ci-book-shelf {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding: 2px 2px 6px;
}

.ci-book-shelf a {
  display: block;
  min-width: 0;
  aspect-ratio: 3 / 4;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(36, 20, 58, .14);
  overflow: hidden;
  transform: rotate(-1deg);
  transition: transform 140ms ease;
}

.ci-book-shelf a:nth-child(even) { transform: rotate(1deg); }
.ci-book-shelf a:hover,
.ci-book-shelf a:focus-visible { transform: translateY(-3px) rotate(0); }
.ci-book-shelf img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ci-book-cta {
  display: block;
  margin-top: 5px;
  color: #6d2f81;
  font-size: .72rem;
  font-weight: 950;
  text-align: center;
  text-decoration: none;
}

.ci-book-cta:hover,
.ci-book-cta:focus-visible { text-decoration: underline; }

@media (max-width: 1100px) {
  .ci-book-shelf {
    grid-template-columns: none;
    grid-template-rows: 82px;
    grid-auto-flow: column;
    grid-auto-columns: 58px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .ci-book-shelf a {
    height: 100%;
    scroll-snap-align: start;
  }
}

@media (max-width: 650px) {
  .ci-bug-hunter { padding: 11px; }
  .ci-feedback-form { padding: 12px; }
}
