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

.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: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 {
  filter: saturate(0.76) brightness(0.96);
  opacity: 0.72;
  cursor: not-allowed;
}

.tile.locked.depth-2 {
  filter: saturate(0.62) brightness(0.92);
  opacity: 0.52;
}

.tile.locked.depth-3 {
  filter: saturate(0.52) brightness(0.86);
  opacity: 0.36;
}

.tile.locked.depth-4 {
  filter: saturate(0.44) brightness(0.8);
  opacity: 0.24;
}

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

.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 {
  display: grid;
  min-height: 260px;
  place-items: center;
  margin-top: 8px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 72%, rgba(57, 169, 119, 0.2), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(240, 234, 255, 0.68));
}

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

.cat-stage img.eating {
  animation: catBounce 920ms 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;
}

.tool-button {
  display: grid;
  gap: 4px;
  min-height: 66px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(77, 58, 103, 0.08);
}

.tool-button span {
  font-size: 14px;
}

.tool-button strong {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--sky);
  color: #245b79;
  font-size: 14px;
}

.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 {
  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 {
  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 {
  border-color: rgba(129, 87, 216, 0.34);
  background:
    linear-gradient(145deg, rgba(240, 234, 255, 0.86), rgba(255, 255, 255, 0.76)),
    #fff;
  box-shadow: inset 0 0 0 1px rgba(129, 87, 216, 0.08);
}

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

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

.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-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);
}

.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 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 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));
  }
}

@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: 8px;
  }

  .topbar {
    position: relative;
    gap: 9px;
    margin-bottom: 10px;
    padding: 9px 118px 9px 9px;
    border-radius: 16px;
  }

  .brand {
    gap: 9px;
  }

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

  .brand p {
    display: none;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 21px;
  }

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

  .stat {
    min-height: 47px;
    padding: 6px 8px;
    border-radius: 12px;
  }

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

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

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

  .best-stat small {
    margin-top: 3px;
    font-size: 10px;
  }

  .top-actions {
    gap: 6px;
  }

  .primary-button,
  .ghost-button {
    min-height: 39px;
    padding: 0 10px;
    border-radius: 11px;
    font-size: 14px;
  }

  .game-layout {
    gap: 10px;
  }

  .play-section {
    padding: 10px;
    border-radius: 18px;
  }

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

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

  .remaining-pill {
    min-width: 66px;
    min-height: 38px;
    align-items: center;
    padding: 0 10px;
    border-radius: 13px;
  }

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

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

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

  .board {
    height: clamp(350px, 94vw, 420px);
    border-radius: 16px;
  }

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

  .tray-panel {
    margin-top: 9px;
    padding: 8px;
    border-radius: 15px;
  }

  .tray-title {
    margin-bottom: 6px;
  }

  .tray {
    gap: 4px;
  }

  .tray-slot {
    min-height: 58px;
    border-radius: 10px;
  }

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

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

  .cat-card {
    position: fixed;
    top: 24px;
    right: 8px;
    z-index: 60;
    width: 94px;
    height: 124px;
    padding: 4px;
    overflow: visible;
    pointer-events: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow:
      0 14px 26px rgba(77, 58, 103, 0.18),
      inset 0 0 0 1px rgba(129, 87, 216, 0.12);
    backdrop-filter: blur(10px);
  }

  .cat-card .speech {
    position: absolute;
    right: 84px;
    top: 4px;
    display: flex;
    width: max-content;
    max-width: 112px;
    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:
      radial-gradient(circle at 52% 78%, rgba(57, 169, 119, 0.22), transparent 44%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(240, 234, 255, 0.7));
  }

  .cat-stage img {
    width: 100%;
    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 104px 7px 7px;
  }

  .cat-card {
    top: 20px;
    right: 7px;
    width: 86px;
    height: 114px;
    border-radius: 18px;
  }

  .cat-card .speech {
    right: 76px;
    max-width: 98px;
    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(300px, 80vw, 330px);
  }

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