:root {
  --paper: #fffaf0;
  --paper-2: #f3fff5;
  --lavender: #f0eaff;
  --mint: #d9f8df;
  --peach: #ffe0cf;
  --sky: #dff2ff;
  --ink: #2f2840;
  --muted: #7f748b;
  --line: rgba(78, 63, 111, 0.16);
  --line-strong: rgba(78, 63, 111, 0.28);
  --accent: #8157d8;
  --accent-2: #39a977;
  --danger: #d95c5c;
  --warning: #f3a83a;
  --shadow: 0 18px 46px rgba(76, 51, 108, 0.16);
  --soft-shadow: 0 10px 24px rgba(76, 51, 108, 0.12);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 224, 207, 0.8), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(217, 248, 223, 0.8), transparent 28rem),
    linear-gradient(135deg, #fff9ef 0%, #f7f0ff 52%, #eefcff 100%);
}

button {
  border: 0;
  font: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(129, 87, 216, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(240, 234, 255, 0.9)),
    var(--lavender);
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 -8px 16px rgba(129, 87, 216, 0.08);
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
}

.stats {
  display: grid;
  grid-template-columns: 82px 82px minmax(118px, 142px);
  gap: 8px;
}

.stat {
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.stat span,
.stage-label,
.tray-title,
.panel-head span,
.modal-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
  line-height: 1;
}

.stat small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.best-stat strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--accent);
  font-size: 17px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  gap: 8px;
  justify-content: end;
}

.primary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 900;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 18px rgba(129, 87, 216, 0.24);
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.sound-button {
  min-width: 76px;
}

.sound-button.sound-off {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
}

.primary-button:not(:disabled):hover,
.ghost-button:not(:disabled):hover,
.tool-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled,
.tool-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  max-width: 1440px;
  margin: 0 auto;
  align-items: start;
}

.play-section,
.side-panel > section {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.play-section {
  min-width: 0;
  padding: 14px;
}

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.stage-label {
  margin: 0 0 3px;
}

.stage-head h2,
.panel-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.12;
}

.remaining-pill {
  display: flex;
  min-width: 76px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid rgba(57, 169, 119, 0.18);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(229, 255, 235, 0.98), rgba(205, 246, 215, 0.92)),
    var(--mint);
  color: #256b4b;
  font-weight: 900;
  box-shadow:
    inset 0 -6px 12px rgba(57, 169, 119, 0.08),
    0 8px 16px rgba(57, 169, 119, 0.1);
}

.remaining-pill span {
  font-size: 25px;
  line-height: 1;
}

.remaining-pill small {
  font-size: 13px;
  line-height: 1;
  transform: translateY(1px);
}

.board {
  position: relative;
  overflow: visible;
  height: clamp(520px, 46vw, 620px);
  border: 1px solid rgba(110, 88, 140, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.46)),
    linear-gradient(90deg, rgba(129, 87, 216, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(57, 169, 119, 0.07) 1px, transparent 1px),
    linear-gradient(145deg, #fffaf0, #f0fff7 48%, #f4efff);
  background-size: auto, 74px 74px, 74px 74px, auto;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.44);
}

.tile {
  position: absolute;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 240, 0.86)),
    #fff;
  box-shadow:
    0 12px 18px rgba(77, 58, 103, 0.17),
    inset 0 -7px 12px rgba(129, 87, 216, 0.05);
  transform: translate3d(0, 0, 0) rotate(var(--rot));
  transition:
    opacity 160ms ease,
    filter 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
  isolation: isolate;
}

.tile::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  content: "";
  opacity: 0;
  background:
    linear-gradient(145deg, rgba(47, 40, 64, 0.18), rgba(47, 40, 64, 0.1)),
    rgba(47, 40, 64, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(47, 40, 64, 0.1),
    inset 0 -18px 26px rgba(47, 40, 64, 0.08);
  transition: opacity 160ms ease;
}

.tile img,
.tray-tile img,
.unlock-grid img,
.reward-food img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.tile img {
  position: relative;
  z-index: 1;
  transition:
    filter 160ms ease,
    opacity 160ms ease;
}

.tile:not(.locked):hover {
  transform: translateY(-5px) rotate(var(--rot));
  box-shadow:
    0 18px 28px rgba(77, 58, 103, 0.2),
    0 0 0 4px rgba(129, 87, 216, 0.1);
}

.tile.locked {
  --cover-opacity: 0.38;
  --locked-img-opacity: 0.72;
  --locked-img-filter: saturate(0.64) brightness(0.72) contrast(0.9);
  opacity: 0.96;
  cursor: not-allowed;
  box-shadow:
    0 7px 13px rgba(47, 40, 64, 0.1),
    inset 0 -8px 14px rgba(47, 40, 64, 0.1);
}

.tile.locked::after {
  opacity: var(--cover-opacity);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(47, 40, 64, 0.18)),
    rgba(47, 40, 64, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(47, 40, 64, 0.16),
    inset 0 -22px 30px rgba(47, 40, 64, 0.12);
}

.tile.locked img {
  filter: var(--locked-img-filter);
  opacity: var(--locked-img-opacity);
}

.tile.locked.depth-1 {
  --cover-opacity: 0.36;
  --locked-img-opacity: 0.72;
  --locked-img-filter: saturate(0.64) brightness(0.72) contrast(0.9);
}

.tile.locked.depth-2 {
  --cover-opacity: 0.56;
  --locked-img-opacity: 0.5;
  --locked-img-filter: saturate(0.44) brightness(0.58) contrast(0.86);
  opacity: 0.88;
  box-shadow:
    0 5px 10px rgba(47, 40, 64, 0.09),
    inset 0 -10px 16px rgba(47, 40, 64, 0.12);
}

.tile.locked.depth-2::after {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(47, 40, 64, 0.28)),
    rgba(47, 40, 64, 0.22);
}

.tile.locked.depth-3 {
  --cover-opacity: 0.72;
  --locked-img-opacity: 0.34;
  --locked-img-filter: saturate(0.3) brightness(0.48) contrast(0.82);
  opacity: 0.78;
  box-shadow:
    0 4px 8px rgba(47, 40, 64, 0.07),
    inset 0 -12px 18px rgba(47, 40, 64, 0.16);
}

.tile.locked.depth-3::after {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(47, 40, 64, 0.38)),
    rgba(47, 40, 64, 0.32);
}

.tile.locked.depth-4 {
  --cover-opacity: 0.82;
  --locked-img-opacity: 0.24;
  --locked-img-filter: saturate(0.22) brightness(0.4) contrast(0.78);
  opacity: 0.68;
  box-shadow:
    0 3px 7px rgba(47, 40, 64, 0.06),
    inset 0 -14px 22px rgba(47, 40, 64, 0.2);
}

.tile.locked.depth-4::after {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(47, 40, 64, 0.48)),
    rgba(47, 40, 64, 0.42);
}

.tile.blocked {
  animation: blockedWiggle 260ms ease;
}

.tile.hint {
  animation: pulse 720ms ease-in-out 3;
  box-shadow:
    0 18px 34px rgba(243, 168, 58, 0.32),
    0 0 0 5px rgba(243, 168, 58, 0.34);
}

.tile.picked {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.86) rotate(var(--rot));
}

.tray-panel {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(110, 88, 140, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.tray-title,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tray-title strong {
  color: var(--accent);
}

.tray {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.tray-slot {
  position: relative;
  display: grid;
  min-height: 102px;
  place-items: center;
  border: 1px dashed rgba(127, 116, 139, 0.35);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(243, 255, 245, 0.78), rgba(255, 255, 255, 0.72)),
    #fff;
}

.tray-tile {
  width: 94%;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 9px 16px rgba(77, 58, 103, 0.14);
  animation: pop 180ms ease-out;
}

.tray-tile.matching {
  animation: trayMatch 420ms ease forwards;
}

.side-panel {
  display: grid;
  gap: 12px;
}

.cat-card {
  overflow: hidden;
  padding: 14px;
  order: 1;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.tool-panel {
  order: 2;
}

.rank-panel {
  order: 3;
}

.reward-panel {
  order: 4;
}

.unlock-panel {
  order: 5;
}

.speech {
  position: relative;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(129, 87, 216, 0.18);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(77, 58, 103, 0.08);
}

.speech::after {
  position: absolute;
  bottom: -9px;
  left: 42px;
  width: 16px;
  height: 16px;
  content: "";
  background: #fff;
  border-right: 1px solid rgba(129, 87, 216, 0.18);
  border-bottom: 1px solid rgba(129, 87, 216, 0.18);
  transform: rotate(45deg);
}

.cat-stage {
  position: relative;
  display: grid;
  min-height: 260px;
  place-items: center;
  margin-top: 8px;
  border-radius: 18px;
  background: transparent;
}

.cat-stage img {
  position: relative;
  z-index: 1;
  width: min(78%, 236px);
  max-height: 238px;
  object-fit: contain;
  transform-origin: 50% 100%;
  transition: transform 180ms ease;
}

.cat-outfit {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  pointer-events: none;
}

.cat-outfit::before,
.cat-outfit::after {
  position: absolute;
  content: "";
}

.cat-outfit.skin-bib::before,
.cat-outfit.skin-bell::before {
  left: 50%;
  bottom: 19%;
  width: 34%;
  height: 20%;
  border: 2px solid rgba(160, 29, 60, 0.2);
  border-radius: 42% 42% 48% 48%;
  background:
    radial-gradient(circle at 70% 22%, rgba(255, 255, 255, 0.82) 0 9%, transparent 10%),
    linear-gradient(145deg, #ff6f8f, #e6335f 58%, #bd2047);
  box-shadow:
    0 8px 16px rgba(189, 32, 71, 0.22),
    inset 0 -8px 12px rgba(95, 0, 35, 0.14);
  transform: translateX(-50%) rotate(1deg);
}

.cat-outfit.skin-bib::after,
.cat-outfit.skin-bell::after {
  left: 50%;
  bottom: 27%;
  width: 38%;
  height: 13%;
  border-radius: 999px;
  border-top: 4px solid #7d4a31;
  transform: translateX(-50%);
}

.cat-outfit.skin-chef::before {
  left: 50%;
  top: 14%;
  width: 42%;
  height: 18%;
  border-radius: 45% 45% 30% 30%;
  background:
    radial-gradient(circle at 18% 40%, #fff 0 19%, transparent 20%),
    radial-gradient(circle at 45% 28%, #fff 0 23%, transparent 24%),
    radial-gradient(circle at 72% 42%, #fff 0 20%, transparent 21%),
    linear-gradient(#ffffff, #f4f1ff);
  box-shadow:
    0 8px 15px rgba(77, 58, 103, 0.15),
    inset 0 -8px 12px rgba(129, 87, 216, 0.08);
  transform: translateX(-50%) rotate(-2deg);
}

.cat-outfit.skin-chef::after {
  left: 50%;
  top: 29%;
  width: 36%;
  height: 7%;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(180deg, #f6f3ff, #e8e0ff);
  box-shadow: 0 6px 10px rgba(77, 58, 103, 0.1);
  transform: translateX(-50%) rotate(-2deg);
}

.cat-outfit.skin-bell::before {
  bottom: 18%;
}

.cat-outfit.skin-bell::after {
  bottom: 23%;
  width: 12%;
  height: 12%;
  border: 2px solid rgba(158, 102, 0, 0.25);
  border-radius: 999px 999px 45% 45%;
  background:
    radial-gradient(circle at 66% 28%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    linear-gradient(145deg, #ffd45b, #f5a623 60%, #d67a00);
  box-shadow:
    0 7px 14px rgba(214, 122, 0, 0.22),
    inset 0 -7px 9px rgba(117, 55, 0, 0.14);
  transform: translateX(-50%);
}

.cat-stage img.eating {
  animation: catBounce 920ms ease;
}

.cat-stage img.happy {
  animation: catHappy 920ms ease;
}

.cat-stage img.sad-shake {
  animation: catSad 580ms ease;
}

.snack-fly {
  position: fixed;
  z-index: 1000;
  width: 68px;
  height: 68px;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 12px 20px rgba(77, 58, 103, 0.24));
  animation: snackFly 940ms cubic-bezier(0.16, 0.86, 0.2, 1) forwards;
}

.match-spark {
  position: fixed;
  z-index: 1001;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--spark-color, #f7c948);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.72);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: matchSpark 740ms ease-out forwards;
}

.tool-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  border-color: rgba(129, 87, 216, 0.14) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(240, 234, 255, 0.6)) !important;
}

.tool-button {
  position: relative;
  display: grid;
  min-height: 74px;
  place-items: center;
  padding: 10px 6px 8px;
  border: 1px solid rgba(129, 87, 216, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), transparent 38%),
    linear-gradient(145deg, #ffffff, #f3efff);
  color: var(--ink);
  font-weight: 900;
  box-shadow:
    0 10px 18px rgba(77, 58, 103, 0.12),
    inset 0 -8px 14px rgba(129, 87, 216, 0.08);
  overflow: hidden;
}

.tool-button::before {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(223, 242, 255, 0.9));
  box-shadow:
    0 6px 12px rgba(77, 58, 103, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  font-size: 21px;
  line-height: 1;
  content: "?";
}

#hintBtn::before {
  content: "\1f4a1";
}

#shuffleBtn::before {
  content: "\1f500";
}

#undoBtn::before {
  content: "\21a9";
}

.tool-button::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 28%, rgba(255, 255, 255, 0.52) 42%, transparent 56% 100%);
  content: "";
  opacity: 0;
  transform: translateX(-70%);
  transition: opacity 160ms ease, transform 420ms ease;
}

.tool-button:not(:disabled):hover::after {
  opacity: 1;
  transform: translateX(70%);
}

.tool-button span {
  font-size: 13px;
  line-height: 1;
}

.tool-button strong {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #ffbf4d, #f05b61);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 6px 10px rgba(240, 91, 97, 0.2);
}

.reward-panel {
  padding: 12px;
  position: relative;
  overflow: hidden;
  border-color: rgba(229, 77, 88, 0.2) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 247, 230, 0.78) 42%, rgba(255, 236, 238, 0.72)),
    #fffaf0 !important;
  box-shadow:
    0 18px 34px rgba(181, 48, 58, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72) !important;
}

.reward-panel::before {
  position: absolute;
  top: -18px;
  right: -8px;
  color: rgba(229, 77, 88, 0.1);
  content: "\00a5";
  font-size: 112px;
  font-weight: 1000;
  line-height: 1;
  pointer-events: none;
}

.reward-panel > * {
  position: relative;
  z-index: 1;
}

.reward-panel .panel-head h2 {
  color: #a9343e;
}

.reward-panel .panel-head span {
  padding: 4px 8px;
  border: 1px solid rgba(229, 77, 88, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: #a9343e;
}

.reward-balance {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 184, 77, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 246, 219, 0.78));
  box-shadow: inset 0 -10px 18px rgba(255, 184, 77, 0.1);
}

.reward-balance span,
.reward-stats span,
.reward-status,
.reward-setup p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.reward-balance strong {
  color: #d63f45;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 8px 18px rgba(214, 63, 69, 0.12);
}

.reward-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.reward-stats span {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.reward-stats strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 16px;
}

.reward-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 8px;
  margin-top: 8px;
}

.reward-actions button {
  width: 100%;
}

.reward-actions .primary-button {
  background: linear-gradient(135deg, #f05b61, #d83f47 62%, #b82f39);
  box-shadow: 0 12px 20px rgba(216, 63, 71, 0.25);
}

.reward-actions .ghost-button {
  border-color: rgba(229, 77, 88, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: #a9343e;
}

.reward-milestones {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.reward-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 16px rgba(181, 48, 58, 0.06);
}

.reward-row strong {
  display: block;
  color: #4a3340;
  font-size: 14px;
  line-height: 1.15;
}

.reward-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.reward-amount {
  min-width: 92px;
  color: #d63f45 !important;
  font-size: 30px !important;
  font-weight: 1000;
  line-height: 1;
  text-align: right;
  text-shadow: 0 8px 16px rgba(214, 63, 69, 0.14);
  white-space: nowrap;
}

.reward-row button {
  min-width: 68px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffbf4d, #f05b61);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 14px rgba(240, 91, 97, 0.2);
}

.reward-row button:disabled {
  background: rgba(127, 116, 139, 0.14);
  color: rgba(47, 40, 64, 0.54);
  cursor: not-allowed;
}

.reward-row.is-ready {
  border-color: rgba(240, 91, 97, 0.42);
  background:
    linear-gradient(145deg, rgba(255, 191, 77, 0.18), rgba(255, 255, 255, 0.82)),
    #fff;
}

.reward-row.is-claimed {
  border-color: rgba(129, 87, 216, 0.22);
  background: rgba(240, 234, 255, 0.56);
}

.reward-status {
  min-height: 18px;
  margin: 8px 0 0;
}

.reward-status[data-type="ok"] {
  color: #24714e;
}

.reward-status[data-type="warn"] {
  color: #9b5c00;
}

.reward-status[data-type="loading"] {
  color: var(--accent);
}

.reward-setup {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
}

.reward-setup[hidden] {
  display: none;
}

.qr-placeholder {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  justify-self: center;
  border: 1px dashed rgba(47, 40, 64, 0.34);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(47, 40, 64, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(47, 40, 64, 0.08) 1px, transparent 1px),
    rgba(255, 255, 255, 0.72);
  background-size: 16px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.reward-setup a {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.rank-panel,
.unlock-panel {
  padding: 12px;
}

.player-login {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(129, 87, 216, 0.13);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(243, 255, 245, 0.72)),
    #fff;
}

.player-login label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.player-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.player-name-row input,
.player-contact-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  outline: none;
  padding: 0 10px;
}

.player-name-row input:focus,
.player-contact-input:focus {
  border-color: rgba(129, 87, 216, 0.55);
  box-shadow: 0 0 0 3px rgba(129, 87, 216, 0.12);
}

.compact-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 11px;
}

.upload-button {
  width: 100%;
  min-height: 40px;
}

.sync-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.sync-status[data-type="ok"] {
  color: #24714e;
}

.sync-status[data-type="warn"] {
  color: #9b5c00;
}

.sync-status[data-type="loading"] {
  color: var(--accent);
}

.leaderboard {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style-position: inside;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.leaderboard li.current-player {
  position: relative;
  border-color: rgba(240, 91, 97, 0.5);
  background:
    linear-gradient(145deg, rgba(255, 191, 77, 0.28), rgba(255, 255, 255, 0.9)),
    #fff;
  box-shadow:
    0 12px 22px rgba(240, 91, 97, 0.16),
    0 0 0 0 rgba(240, 91, 97, 0.2),
    inset 0 0 0 1px rgba(240, 91, 97, 0.12);
  animation:
    rankSpotlight 820ms ease both,
    rankBreath 1.8s ease-in-out 840ms infinite;
}

.leaderboard li.current-player > strong:first-child {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: linear-gradient(145deg, #ffbf4d, #f05b61);
  color: #fff;
  box-shadow:
    0 8px 14px rgba(240, 91, 97, 0.22),
    inset 0 -4px 8px rgba(126, 35, 43, 0.16);
}

.leaderboard li.top-player > strong:first-child {
  color: #d63f45;
}

.leaderboard li.near-player {
  background: rgba(255, 255, 255, 0.58);
}

.leaderboard li.rank-gap {
  grid-template-columns: 1fr;
  min-height: 26px;
  justify-items: center;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.leaderboard li.empty-rank {
  grid-template-columns: 1fr;
  justify-items: center;
  color: var(--muted);
}

.leaderboard small {
  color: var(--muted);
  font-weight: 700;
}

@keyframes rankSpotlight {
  0% {
    opacity: 0.4;
    transform: translateY(8px) scale(0.96);
  }
  55% {
    opacity: 1;
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rankBreath {
  0%,
  100% {
    box-shadow:
      0 12px 22px rgba(240, 91, 97, 0.14),
      0 0 0 0 rgba(240, 91, 97, 0.18),
      inset 0 0 0 1px rgba(240, 91, 97, 0.12);
  }
  50% {
    box-shadow:
      0 16px 28px rgba(240, 91, 97, 0.24),
      0 0 0 5px rgba(255, 191, 77, 0.16),
      inset 0 0 0 1px rgba(240, 91, 97, 0.18);
  }
}

.unlock-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-height: 154px;
  overflow: hidden;
}

.unlock-grid button {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 3px;
}

.unlock-grid button.locked-food {
  filter: grayscale(1);
  opacity: 0.32;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(47, 40, 64, 0.34);
  backdrop-filter: blur(10px);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(440px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #f4fff7);
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-card > img {
  height: 180px;
  max-width: 86%;
  object-fit: contain;
}

.modal.skin-celebration .modal-card > img {
  height: 220px;
  max-width: 92%;
  filter: drop-shadow(0 18px 24px rgba(129, 87, 216, 0.18));
}

.modal-card h2 {
  margin: 4px 0 8px;
  font-size: 26px;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.modal-reward {
  min-height: 92px;
  margin: 14px 0;
}

.reward-food {
  display: inline-grid;
  width: 92px;
  height: 92px;
  place-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.skin-combo {
  display: inline-grid;
  grid-template-columns: 72px 22px 72px;
  grid-template-rows: 72px auto;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  min-width: 224px;
  padding: 12px 14px 10px;
  border: 1px solid rgba(129, 87, 216, 0.2);
  border-radius: 22px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.95), transparent 30%),
    linear-gradient(145deg, #fff9ef, #f4fff7 58%, #f5f0ff);
  box-shadow:
    0 18px 34px rgba(129, 87, 216, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  animation: skinPrizePop 980ms ease both;
}

.combo-icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid rgba(255, 203, 95, 0.42);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 18px rgba(91, 57, 16, 0.1);
}

.combo-icon img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.combo-plus {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 1000;
  line-height: 1;
}

.combo-skin span {
  position: relative;
  display: block;
  width: 56px;
  height: 48px;
}

.skin-combo strong {
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: 15px;
  line-height: 1.2;
}

.skin-combo.skin-chef .combo-skin span::before,
.skin-combo.skin-chef .combo-skin span::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
}

.skin-combo.skin-chef .combo-skin span::before {
  top: 2px;
  width: 56px;
  height: 34px;
  border: 1px solid rgba(152, 132, 106, 0.2);
  border-radius: 45% 45% 30% 30%;
  background:
    radial-gradient(circle at 18% 40%, #fff 0 19%, transparent 20%),
    radial-gradient(circle at 45% 28%, #fff 0 23%, transparent 24%),
    radial-gradient(circle at 72% 42%, #fff 0 20%, transparent 21%),
    linear-gradient(#ffffff, #eee8dd);
  box-shadow:
    0 6px 10px rgba(91, 57, 16, 0.1),
    inset 0 -7px 10px rgba(129, 87, 216, 0.08);
}

.skin-combo.skin-chef .combo-skin span::after {
  bottom: 7px;
  width: 48px;
  height: 11px;
  border: 1px solid rgba(152, 132, 106, 0.18);
  border-radius: 0 0 999px 999px;
  background: linear-gradient(180deg, #f8f4ec, #ded4c5);
}

.skin-combo.skin-bib .combo-skin span {
  border-radius: 42% 42% 48% 48%;
  background:
    radial-gradient(circle at 68% 24%, rgba(255, 255, 255, 0.82) 0 10%, transparent 11%),
    linear-gradient(145deg, #ff6f8f, #e6335f 58%, #bd2047);
  box-shadow: inset 0 -8px 12px rgba(95, 0, 35, 0.14);
}

.skin-combo.skin-bell .combo-skin span {
  width: 42px;
  height: 42px;
  border-radius: 999px 999px 45% 45%;
  background:
    radial-gradient(circle at 66% 28%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    linear-gradient(145deg, #ffd45b, #f5a623 60%, #d67a00);
  box-shadow: 0 7px 14px rgba(214, 122, 0, 0.22);
}

.skin-reward {
  display: inline-grid;
  width: 112px;
  min-height: 108px;
  place-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 10px;
  border: 1px solid rgba(129, 87, 216, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(145deg, #fff5fb, #f2fff6);
  box-shadow:
    0 16px 30px rgba(129, 87, 216, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  animation: skinPrizePop 980ms ease both;
}

.skin-reward span {
  position: relative;
  display: block;
  width: 72px;
  height: 56px;
}

.skin-reward strong {
  color: var(--accent);
  font-size: 13px;
  line-height: 1.15;
}

.skin-reward.skin-bib span {
  border-radius: 42% 42% 48% 48%;
  background:
    radial-gradient(circle at 68% 24%, rgba(255, 255, 255, 0.82) 0 10%, transparent 11%),
    linear-gradient(145deg, #ff6f8f, #e6335f 58%, #bd2047);
  box-shadow: inset 0 -8px 12px rgba(95, 0, 35, 0.14);
}

.skin-reward.skin-chef span::before,
.skin-reward.skin-chef span::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
}

.skin-reward.skin-chef span::before {
  top: 4px;
  width: 68px;
  height: 38px;
  border-radius: 45% 45% 30% 30%;
  background:
    radial-gradient(circle at 18% 40%, #fff 0 19%, transparent 20%),
    radial-gradient(circle at 45% 28%, #fff 0 23%, transparent 24%),
    radial-gradient(circle at 72% 42%, #fff 0 20%, transparent 21%),
    linear-gradient(#ffffff, #f4f1ff);
}

.skin-reward.skin-chef span::after {
  bottom: 7px;
  width: 58px;
  height: 12px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(180deg, #f6f3ff, #e8e0ff);
}

.skin-reward.skin-bell span {
  border-radius: 42% 42% 48% 48%;
  background:
    radial-gradient(circle at 68% 24%, rgba(255, 255, 255, 0.82) 0 10%, transparent 11%),
    linear-gradient(145deg, #ff6f8f, #e6335f 58%, #bd2047);
}

.skin-reward.skin-bell span::after {
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 24px;
  height: 24px;
  border-radius: 999px 999px 45% 45%;
  background:
    radial-gradient(circle at 66% 28%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    linear-gradient(145deg, #ffd45b, #f5a623 60%, #d67a00);
  box-shadow: 0 7px 14px rgba(214, 122, 0, 0.22);
  content: "";
  transform: translateX(-50%);
}

.wide-button {
  width: 100%;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0) rotate(var(--rot));
  }
  50% {
    transform: translateY(-10px) scale(1.04) rotate(var(--rot));
  }
}

@keyframes blockedWiggle {
  0%,
  100% {
    transform: translateX(0) rotate(var(--rot));
  }
  25% {
    transform: translateX(-4px) rotate(var(--rot));
  }
  50% {
    transform: translateX(4px) rotate(var(--rot));
  }
  75% {
    transform: translateX(-2px) rotate(var(--rot));
  }
}

@keyframes catBounce {
  0% {
    transform: translateY(0) scale(1);
  }
  18% {
    transform: translateY(-16px) scale(1.09) rotate(-3deg);
  }
  36% {
    transform: translateY(4px) scale(0.97) rotate(3deg);
  }
  56% {
    transform: translateY(-9px) scale(1.07) rotate(-2deg);
  }
  74% {
    transform: translateY(2px) scale(0.99) rotate(1deg);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes catHappy {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(0);
  }
  22% {
    transform: translateY(-12px) scale(1.08) rotate(-5deg);
  }
  48% {
    transform: translateY(2px) scale(0.98) rotate(5deg);
  }
  72% {
    transform: translateY(-8px) scale(1.05) rotate(-3deg);
  }
}

@keyframes catSad {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  20% {
    transform: translateX(-7px) rotate(-3deg);
  }
  40% {
    transform: translateX(7px) rotate(3deg);
  }
  60% {
    transform: translateX(-5px) rotate(-2deg);
  }
  80% {
    transform: translateX(4px) rotate(2deg);
  }
}

@keyframes snackFly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.66) rotate(-14deg);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(6deg);
  }
  52% {
    opacity: 1;
    transform: translate(calc(-50% + var(--dx) * 0.48), calc(-50% + var(--dy) * 0.48 - 48px)) scale(0.88) rotate(-18deg);
  }
  78% {
    opacity: 1;
    transform: translate(calc(-50% + var(--dx) * 0.86), calc(-50% + var(--dy) * 0.86 - 28px)) scale(0.58) rotate(16deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.14) rotate(34deg);
  }
}

@keyframes trayMatch {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
  42% {
    opacity: 1;
    transform: scale(1.16) rotate(-5deg);
    box-shadow:
      0 14px 24px rgba(243, 168, 58, 0.24),
      0 0 0 5px rgba(243, 168, 58, 0.18);
  }
  100% {
    opacity: 0;
    transform: scale(0.56) rotate(12deg);
  }
}

@keyframes matchSpark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.1) rotate(var(--spin));
  }
}

@keyframes skinPrizePop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.62) rotate(-8deg);
  }
  42% {
    opacity: 1;
    transform: translateY(-8px) scale(1.1) rotate(4deg);
  }
  70% {
    transform: translateY(2px) scale(0.98) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

.modal.skin-celebration .modal-card {
  animation: skinModalGlow 1180ms ease both;
}

@keyframes skinModalGlow {
  0% {
    box-shadow: var(--shadow);
    transform: scale(0.96);
  }
  42% {
    box-shadow:
      0 22px 56px rgba(129, 87, 216, 0.24),
      0 0 0 8px rgba(255, 212, 91, 0.18);
    transform: scale(1.02);
  }
  100% {
    box-shadow: var(--shadow);
    transform: scale(1);
  }
}

@media (max-width: 1120px) {
  .topbar,
  .game-layout {
    grid-template-columns: 1fr;
  }

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

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

  .top-actions button {
    flex: 1;
  }

  .side-panel {
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  }

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

@media (max-width: 720px) {
  .app-shell {
    padding: 5px;
  }

  .topbar {
    position: relative;
    gap: 6px;
    margin-bottom: 7px;
    padding: 6px 124px 6px 7px;
    border-radius: 14px;
  }

  .brand {
    gap: 7px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 18px;
  }

  .stats {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 0.78fr) minmax(0, 1.24fr);
    gap: 5px;
  }

  .stat {
    min-height: 38px;
    padding: 4px 7px;
    border-radius: 10px;
  }

  .stat span,
  .stage-label,
  .tray-title,
  .panel-head span,
  .modal-kicker {
    font-size: 12px;
  }

  .stat strong {
    font-size: 18px;
  }

  .best-stat strong {
    font-size: 13px;
  }

  .best-stat small {
    margin-top: 1px;
    font-size: 9px;
  }

  .top-actions {
    gap: 5px;
  }

  .primary-button,
  .ghost-button {
    min-height: 32px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 13px;
  }

  .game-layout {
    gap: 7px;
  }

  .play-section {
    padding: 7px;
    border-radius: 16px;
  }

  .stage-head {
    gap: 6px;
    margin-bottom: 5px;
  }

  .stage-head h2,
  .panel-head h2 {
    font-size: 16px;
  }

  .remaining-pill {
    min-width: 58px;
    min-height: 32px;
    align-items: center;
    padding: 0 8px;
    border-radius: 11px;
  }

  .remaining-pill span,
  .remaining-pill small {
    line-height: 1;
    transform: none;
  }

  .remaining-pill span {
    font-size: 19px;
  }

  .remaining-pill small {
    font-size: 12px;
    transform: translateY(1px);
  }

  .board {
    height: clamp(330px, 86vw, 386px);
    border-radius: 14px;
    background-size: auto, 58px 58px, 58px 58px, auto;
  }

  .tile {
    border-radius: 13px;
    padding: 4px;
  }

  .tray-panel {
    margin-top: 5px;
    padding: 5px;
    border-radius: 13px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(243, 255, 245, 0.78)),
      #fff;
  }

  .tray-title {
    display: none;
  }

  .tray {
    gap: 4px;
  }

  .tray-slot {
    min-height: 48px;
    border-radius: 9px;
  }

  .tray-tile {
    width: 94%;
    border-radius: 10px;
  }

  .side-panel {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .tool-panel {
    gap: 6px;
    padding: 7px;
    border-radius: 16px;
  }

  .tool-button {
    min-height: 62px;
    padding: 8px 5px 6px;
    border-radius: 15px;
  }

  .tool-button::before {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    font-size: 18px;
  }

  .tool-button strong {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .cat-card {
    position: fixed;
    top: 18px;
    right: 5px;
    z-index: 60;
    width: 106px;
    height: 130px;
    padding: 4px;
    overflow: visible;
    pointer-events: none;
    border-radius: 20px;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .cat-card .speech {
    position: absolute;
    right: 100px;
    top: 6px;
    display: flex;
    width: max-content;
    max-width: 116px;
    min-height: 27px;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
    box-shadow: 0 8px 16px rgba(77, 58, 103, 0.12);
  }

  .cat-card .speech::after {
    top: 12px;
    right: -6px;
    bottom: auto;
    left: auto;
    width: 10px;
    height: 10px;
  }

  .cat-stage {
    min-height: 0;
    height: 100%;
    margin-top: 0;
    border-radius: 14px;
    background: transparent;
  }

  .cat-stage img {
    width: 106%;
    max-height: 100%;
  }

  .cat-stage img.eating {
    animation: catMobileChomp 980ms ease;
  }

  .unlock-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (max-width: 420px) {
  .top-actions button {
    font-size: 13px;
  }

  .sound-button {
    min-width: 0;
  }
}

@media (max-width: 420px) and (max-height: 720px) {
  .app-shell {
    padding: 7px;
  }

  .topbar {
    gap: 7px;
    margin-bottom: 8px;
    padding: 7px 118px 7px 7px;
  }

  .cat-card {
    top: 22px;
    right: 7px;
    width: 100px;
    height: 126px;
    border-radius: 18px;
  }

  .cat-card .speech {
    right: 90px;
    max-width: 104px;
    min-height: 25px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 19px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .stat {
    min-height: 40px;
    padding: 5px 7px;
  }

  .stat strong {
    font-size: 19px;
  }

  .best-stat strong {
    font-size: 13px;
  }

  .best-stat small {
    font-size: 9px;
  }

  .primary-button,
  .ghost-button {
    min-height: 35px;
    font-size: 13px;
  }

  .play-section {
    padding: 8px;
  }

  .stage-head {
    margin-bottom: 6px;
  }

  .stage-head h2,
  .panel-head h2 {
    font-size: 16px;
  }

  .remaining-pill {
    min-width: 60px;
    min-height: 34px;
    padding: 0 9px;
  }

  .remaining-pill span {
    font-size: 19px;
  }

  .board {
    height: clamp(318px, 86vw, 350px);
  }

  .tray-panel {
    margin-top: 7px;
    padding: 7px;
  }

  .tray-slot {
    min-height: 50px;
  }
}

@keyframes catMobileChomp {
  0% {
    transform: translateY(0) scale(1);
  }
  16% {
    transform: translateY(-10px) scale(1.15) rotate(-6deg);
  }
  32% {
    transform: translateY(3px) scale(0.93) rotate(5deg);
  }
  52% {
    transform: translateY(-7px) scale(1.1) rotate(-3deg);
  }
  74% {
    transform: translateY(1px) scale(0.98) rotate(2deg);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@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;
  }
}
