:root {
  color-scheme: light;
  --ink: #52233a;
  --muted: #8b5b72;
  --line: rgba(159, 73, 111, 0.22);
  --panel: rgba(255, 248, 252, 0.88);
  --cream: #fff4bf;
  --pink: #ff6f9f;
  --blue: #56cfff;
  --green: #7ade74;
  --yellow: #ffe071;
  --plum: #5b2843;
  --rose: #ff9fbc;
  --mint: #a8f2cc;
  --peach: #ffb383;
}

* {
  box-sizing: border-box;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-group(*) {
  animation-duration: 560ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(*),
::view-transition-new(*) {
  height: 100%;
  object-fit: contain;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.9), transparent 16%),
    radial-gradient(circle at 78% 16%, rgba(255, 224, 113, 0.5), transparent 18%),
    linear-gradient(rgba(255, 246, 251, 0.76), rgba(255, 217, 230, 0.72)),
    url("https://images.unsplash.com/photo-1486427944299-d1955d23e34d?auto=format&fit=crop&w=1800&q=80") center / cover fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
}

body::before {
  left: -70px;
  bottom: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 10%, #fff 0 8%, transparent 9%),
    radial-gradient(circle at 10% 50%, #ff9fbc 0 10%, transparent 11%),
    radial-gradient(circle at 90% 50%, #ff9fbc 0 10%, transparent 11%),
    radial-gradient(circle at 50% 90%, #ffd1df 0 10%, transparent 11%),
    radial-gradient(circle at 50% 50%, #ffe071 0 16%, transparent 17%);
  opacity: 0.7;
}

body::after {
  right: -86px;
  top: -72px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 10%, #fff 0 8%, transparent 9%),
    radial-gradient(circle at 10% 50%, #a8f2cc 0 10%, transparent 11%),
    radial-gradient(circle at 90% 50%, #a8f2cc 0 10%, transparent 11%),
    radial-gradient(circle at 50% 90%, #56cfff 0 10%, transparent 11%),
    radial-gradient(circle at 50% 50%, #ff9fbc 0 16%, transparent 17%);
  opacity: 0.62;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.72rem 0.9rem;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 220, 233, 0.78)),
    rgba(255, 248, 252, 0.9);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  border-color: var(--pink);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary {
  color: #5d1732;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 48%),
    linear-gradient(135deg, var(--pink), var(--yellow));
  box-shadow: 0 10px 24px rgba(255, 111, 159, 0.22);
}

.sweetApp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 14px;
  position: relative;
  z-index: 1;
}

.bakeryStage {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
}

.momBanner {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 111, 159, 0.34);
  border-radius: 8px;
  padding: 10px 14px;
  color: #6a1f3f;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 241, 185, 0.82), rgba(255, 215, 229, 0.78)),
    var(--panel);
  box-shadow: 0 18px 44px rgba(159, 73, 111, 0.18);
}

.momBanner p,
.momBanner strong {
  margin: 0;
}

.momBanner p {
  color: #b23662;
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.momBanner strong {
  display: block;
  font-size: clamp(1.08rem, 2vw, 1.55rem);
  line-height: 1.05;
}

.flowerBurst {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 8%, #ff9fbc 0 18%, transparent 19%),
    radial-gradient(circle at 8% 50%, #ff9fbc 0 18%, transparent 19%),
    radial-gradient(circle at 92% 50%, #ff9fbc 0 18%, transparent 19%),
    radial-gradient(circle at 50% 92%, #ffcfdd 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, #ffe071 0 22%, transparent 23%);
  filter: drop-shadow(0 8px 12px rgba(255, 111, 159, 0.24));
}

.flowerBurst.second {
  background:
    radial-gradient(circle at 50% 8%, #a8f2cc 0 18%, transparent 19%),
    radial-gradient(circle at 8% 50%, #a8f2cc 0 18%, transparent 19%),
    radial-gradient(circle at 92% 50%, #a8f2cc 0 18%, transparent 19%),
    radial-gradient(circle at 50% 92%, #56cfff 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, #ff9fbc 0 22%, transparent 23%);
}

.topHud,
.bottomHud,
.sideHeader,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(159, 73, 111, 0.18);
  backdrop-filter: blur(16px);
}

.topHud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 150px;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
}

.orderBox,
.movesBox,
.levelBadge,
.bottomHud span {
  border: 1px solid rgba(159, 73, 111, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.orderBox,
.movesBox,
.levelBadge {
  padding: 10px 12px;
}

.orderBox p,
.movesBox p,
.levelBadge span,
.kicker {
  margin: 0;
  color: #d33f79;
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.movesBox strong,
.levelBadge strong {
  display: block;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.movesBox {
  position: relative;
}

.movesBox.movesWarning {
  border-color: rgba(255, 178, 43, 0.75);
  background:
    linear-gradient(180deg, #fff, #fff0c5);
  box-shadow:
    0 0 0 3px rgba(255, 224, 113, 0.32),
    0 8px 20px rgba(197, 126, 16, 0.16);
}

.movesBox.movesWarning::after,
.movesBox.movesDanger::after {
  content: "!";
  position: absolute;
  right: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #5d1732;
  background: var(--yellow);
  font-weight: 1000;
}

.movesBox.movesDanger {
  border-color: rgba(255, 67, 111, 0.9);
  background:
    linear-gradient(180deg, #fff, #ffd9e5);
  animation: movesFlash 760ms ease-in-out infinite;
}

.movesBox.movesDanger strong {
  color: #c51f55;
}

.orderList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.orderItem {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid rgba(159, 73, 111, 0.18);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #ffe9f1);
  font-weight: 950;
}

.miniPiece {
  position: relative;
  inset: auto;
  display: inline-block;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-width: 2px;
  border-radius: 8px;
}

.boardShell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  justify-items: center;
  align-items: start;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.72), transparent 12%),
    radial-gradient(circle at 90% 16%, rgba(255, 224, 113, 0.42), transparent 14%),
    linear-gradient(90deg, rgba(255, 111, 159, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 111, 159, 0.08) 1px, transparent 1px),
    linear-gradient(150deg, rgba(255, 222, 232, 0.74), rgba(217, 247, 255, 0.54) 44%, rgba(255, 244, 190, 0.72)),
    rgba(255, 248, 252, 0.9);
  background-size: 42px 42px, 42px 42px, auto, auto;
  box-shadow: 0 22px 62px rgba(159, 73, 111, 0.2);
  padding: 12px;
}

.boardShell::before,
.boardShell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.boardShell::before {
  left: clamp(14px, 7vw, 86px);
  bottom: clamp(18px, 8vh, 82px);
  width: clamp(92px, 14vw, 170px);
  height: clamp(78px, 12vw, 138px);
  border-radius: 8px 8px 22px 22px;
  background:
    radial-gradient(circle at 22% 34%, #ff6f9f 0 8%, transparent 9%),
    radial-gradient(circle at 50% 26%, #56cfff 0 8%, transparent 9%),
    radial-gradient(circle at 77% 34%, #7ade74 0 8%, transparent 9%),
    linear-gradient(90deg, transparent 45%, rgba(255, 255, 255, 0.72) 45% 55%, transparent 55%),
    linear-gradient(180deg, #ffe071 0 26%, #ff9fbc 26% 100%);
  box-shadow: 0 18px 34px rgba(159, 73, 111, 0.2);
  opacity: 0.9;
  transform: rotate(-5deg);
}

.boardShell::after {
  right: clamp(14px, 6vw, 76px);
  top: clamp(56px, 11vh, 118px);
  width: clamp(82px, 12vw, 150px);
  height: clamp(82px, 12vw, 150px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 7%, #ff9fbc 0 12%, transparent 13%),
    radial-gradient(circle at 13% 50%, #ff9fbc 0 12%, transparent 13%),
    radial-gradient(circle at 87% 50%, #ffcfdd 0 12%, transparent 13%),
    radial-gradient(circle at 50% 93%, #a8f2cc 0 12%, transparent 13%),
    radial-gradient(circle at 50% 50%, #ffe071 0 18%, transparent 19%);
  filter: drop-shadow(0 15px 18px rgba(159, 73, 111, 0.18));
  opacity: 0.86;
  transform: rotate(9deg);
}

.levelTrail {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: min(560px, 100%);
  position: relative;
  z-index: 1;
}

.trailNode {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(159, 73, 111, 0.2);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 1000;
  cursor: pointer;
}

.trailNode.active {
  color: #5d1732;
  border-color: var(--yellow);
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  box-shadow: 0 0 18px rgba(255, 111, 159, 0.32);
}

.trailNode.unlocked:not(.active):hover,
.trailNode.unlocked:not(.active):focus-visible {
  border-color: var(--pink);
  color: #5d1732;
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 111, 159, 0.18);
  transform: translateY(-1px);
}

.trailNode.locked {
  cursor: not-allowed;
  opacity: 0.45;
}

.matchBoard {
  --size: min(calc(100vh - 346px), calc(100vw - 420px), 680px);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: clamp(5px, 0.9vmin, 8px);
  width: var(--size);
  height: var(--size);
  max-width: calc(100% - 24px);
  border: 6px solid #ff78ad;
  border-radius: 8px;
  padding: clamp(8px, 1.15vmin, 12px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 236, 244, 0.96)),
    #fff7fb;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.86),
    0 0 0 10px rgba(255, 196, 216, 0.72),
    0 18px 36px rgba(159, 73, 111, 0.24);
  touch-action: none;
  position: relative;
  z-index: 1;
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(206, 88, 139, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff, #ffeaf2);
  cursor: pointer;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.82),
    inset 0 -2px 0 rgba(255, 183, 211, 0.38),
    0 2px 6px rgba(159, 73, 111, 0.1);
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), filter 280ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.tile:hover,
.tile.selected {
  border-color: var(--pink);
  transform: scale(1.04);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.86),
    0 0 0 3px rgba(255, 111, 159, 0.3),
    0 8px 16px rgba(159, 73, 111, 0.18);
  z-index: 2;
}

.tile.hint {
  border-color: #159fe8;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.98), rgba(194, 239, 255, 0.92)),
    linear-gradient(180deg, #ffffff, #dff7ff);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    0 0 0 4px rgba(21, 159, 232, 0.48),
    0 0 0 8px rgba(255, 224, 113, 0.5),
    0 0 26px rgba(21, 159, 232, 0.58);
  animation: hintPulse 980ms ease-in-out infinite;
  z-index: 4;
}

.tile.hint .piece {
  filter: brightness(1.18) saturate(1.25);
  transform: scale(1.1);
  animation: hintPieceBounce 980ms ease-in-out infinite;
}

.tile.preview {
  border-color: #ff6f9f;
  background:
    linear-gradient(180deg, #fff7fb, #ffd7e6);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.88),
    0 0 0 3px rgba(255, 111, 159, 0.28),
    0 0 18px rgba(255, 111, 159, 0.28);
}

.tile.preview .piece {
  filter: brightness(1.08) saturate(1.14);
  transform: scale(1.04);
}

.piece {
  position: absolute;
  inset: 7%;
  border: 3px solid rgba(82, 35, 58, 0.32);
  border-radius: 8px;
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.52),
    inset 0 -8px 12px rgba(82, 35, 58, 0.16),
    0 3px 0 rgba(82, 35, 58, 0.18),
    0 8px 13px rgba(159, 73, 111, 0.18);
  transition: filter 320ms ease, opacity 320ms ease, transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.piece.blue {
  border-radius: 50%;
  background:
    linear-gradient(0deg, transparent 43%, rgba(255, 255, 255, 0.74) 44% 56%, transparent 57%),
    radial-gradient(circle at 34% 24%, #f7feff, #37c9ff 45%, #0876bf 78%);
}

.piece.blue::before,
.piece.blue::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  height: 12%;
  border-radius: 999px;
  background: rgba(6, 100, 170, 0.32);
}

.piece.blue::before {
  top: 22%;
}

.piece.blue::after {
  bottom: 22%;
}

.piece.pink {
  inset: 13% 16% 10%;
  border-radius: 8px 8px 12px 12px;
  background:
    radial-gradient(circle at 31% 28%, #fff3f8 0 12%, transparent 13%),
    linear-gradient(135deg, #ff8cb1, #ff276d 58%, #a91549);
  transform: rotate(-45deg);
}

.piece.pink::before,
.piece.pink::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}

.piece.pink::before {
  top: -50%;
  left: 0;
}

.piece.pink::after {
  top: 0;
  right: -50%;
}

.piece.green {
  border-radius: 52% 8px 52% 8px;
  background:
    radial-gradient(circle at 31% 25%, #f6ffe9 0 16%, transparent 17%),
    linear-gradient(135deg, #d8ffb9, #42d94c 52%, #13852f);
  transform: rotate(-12deg);
}

.piece.green::after {
  content: "";
  position: absolute;
  left: 45%;
  top: 10%;
  width: 9%;
  height: 78%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  transform: rotate(18deg);
}

.piece.yellow {
  border-radius: 10px 10px 14px 14px;
  background:
    linear-gradient(90deg, transparent 29%, rgba(255, 255, 255, 0.65) 30% 40%, transparent 41% 59%, rgba(255, 255, 255, 0.58) 60% 70%, transparent 71%),
    radial-gradient(circle at 28% 24%, #fffdeb, #ffd842 46%, #c77f05);
}

.piece.purple {
  border-radius: 48%;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.62) 0 6px, transparent 6px 13px),
    radial-gradient(circle at 35% 24%, #faf0ff, #966cff 52%, #5628c8);
}

.piece.purple::before,
.piece.purple::after {
  content: "";
  position: absolute;
  top: 28%;
  width: 28%;
  height: 44%;
  background: inherit;
  border: 2px solid rgba(255, 255, 255, 0.65);
}

.piece.purple::before {
  left: -22%;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.piece.purple::after {
  right: -22%;
  clip-path: polygon(100% 50%, 0 0, 0 100%);
}

.piece.cookie {
  border-color: rgba(105, 62, 28, 0.5);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 38%, #5d321c 0 8%, transparent 9%),
    radial-gradient(circle at 60% 58%, #5d321c 0 7%, transparent 8%),
    radial-gradient(circle at 60% 28%, #5d321c 0 6%, transparent 7%),
    radial-gradient(circle at 29% 64%, #5d321c 0 5%, transparent 6%),
    radial-gradient(circle at 30% 25%, #fff0c0, #d99235 60%, #7d3f1e);
}

.piece.coin {
  border-color: rgba(142, 92, 6, 0.58);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 25%, #fffbe8 0 15%, transparent 16%),
    radial-gradient(circle at 50% 50%, #fff09a 0 28%, #ffc928 29% 58%, #b96e05 59% 100%);
}

.piece.coin::after {
  content: "";
  position: absolute;
  inset: 26%;
  border: 2px solid rgba(139, 89, 12, 0.34);
  border-radius: 50%;
}

.orderItem .miniPiece {
  position: relative;
  inset: auto;
  display: inline-block;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-width: 2px;
}

.piece.striped::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: inherit;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0 5px, transparent 5px 12px);
  mix-blend-mode: screen;
}

.piece.bomb {
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, #fff7d4 0 10%, transparent 11%),
    radial-gradient(circle at 58% 60%, rgba(120, 67, 32, 0.48) 0 7%, transparent 8%),
    radial-gradient(circle at 42% 64%, rgba(120, 67, 32, 0.36) 0 6%, transparent 7%),
    conic-gradient(var(--pink), var(--yellow), var(--blue), var(--green), #b48cff, var(--pink));
  box-shadow:
    0 0 18px rgba(255, 224, 112, 0.65),
    inset 0 3px 8px rgba(255, 255, 255, 0.3),
    inset 0 -8px 12px rgba(0, 0, 0, 0.2);
}

.miniCracker {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px dashed rgba(100, 54, 34, 0.75);
  border-radius: 8px;
  background:
    radial-gradient(circle at 35% 35%, rgba(113, 64, 35, 0.34), transparent 16%),
    linear-gradient(135deg, #f5d49a, #c98645);
}

.tile.cracker::before {
  content: "";
  position: absolute;
  inset: 6%;
  border: 2px dashed rgba(100, 54, 34, 0.72);
  border-radius: 8px;
  background:
    radial-gradient(circle at 28% 35%, rgba(113, 64, 35, 0.28), transparent 7%),
    radial-gradient(circle at 70% 60%, rgba(113, 64, 35, 0.25), transparent 6%),
    linear-gradient(135deg, #ffdca3, #ca8746);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    0 4px 8px rgba(159, 73, 111, 0.16);
}

.tile.cracker .piece {
  transform: scale(0.72);
}

.tile.clearing .piece,
.tile.clearing::before {
  animation: popOut 460ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tile.blasted {
  box-shadow: 0 0 0 3px rgba(255, 224, 112, 0.55), 0 0 24px rgba(255, 111, 145, 0.52);
}

.tile.dropping .piece {
  animation: dropIn 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tile.swapping {
  animation: swapTile 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tile.settling .piece {
  animation: settlePiece 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.burst {
  position: fixed;
  left: var(--burst-x);
  top: var(--burst-y);
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 20;
}

.burst::before {
  content: "";
  position: absolute;
  left: -22px;
  top: -22px;
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 111, 159, 0.72);
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgba(255, 224, 113, 0.38),
    0 0 24px rgba(255, 111, 159, 0.44);
  animation: burstRing 620ms ease-out forwards;
}

.spark {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--spark-color, #ffe071);
  box-shadow: 0 0 10px currentColor;
  transform: rotate(var(--spark-angle)) translateX(0);
  animation: sparkFly 620ms cubic-bezier(0.14, 0.9, 0.2, 1) forwards;
}

.boardMessage {
  position: static;
  max-width: min(560px, calc(100% - 28px));
  border: 1px solid rgba(159, 73, 111, 0.24);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  color: #6a1f3f;
  background: linear-gradient(180deg, #ffffff, #ffe2ee);
  font-weight: 950;
  text-align: center;
  position: relative;
  z-index: 1;
}

.bottomHud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.bottomHud span {
  padding: 0.62rem 0.7rem;
  color: var(--muted);
  font-weight: 850;
}

.bottomHud strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
}

.sweetControls {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
}

.sideHeader,
.panel {
  padding: 14px;
}

.panel {
  display: grid;
  gap: 10px;
}

.panel button {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.chefPanel {
  background:
    linear-gradient(145deg, rgba(255, 224, 112, 0.36), rgba(255, 159, 188, 0.28)),
    var(--panel);
}

.chefRow {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.chefFace {
  position: relative;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 248, 242, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 42%, #351728 0 5%, transparent 6%),
    radial-gradient(circle at 66% 42%, #351728 0 5%, transparent 6%),
    radial-gradient(ellipse at 50% 70%, #ff9fba 0 13%, transparent 14%),
    linear-gradient(135deg, #fffdf4, #ffd9e4);
}

.chefFace::before {
  content: "";
  position: absolute;
  left: 6px;
  top: -13px;
  width: 42px;
  height: 24px;
  border-radius: 18px 18px 8px 8px;
  background:
    radial-gradient(circle at 18% 40%, #fffdf4 0 38%, transparent 39%),
    radial-gradient(circle at 50% 25%, #fffdf4 0 40%, transparent 41%),
    radial-gradient(circle at 82% 40%, #fffdf4 0 38%, transparent 39%);
}

.chefPanel button span {
  color: #5d1732;
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  background: var(--yellow);
}

.walletBox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border: 1px solid rgba(159, 73, 111, 0.16);
  border-radius: 8px;
  padding: 0.62rem 0.72rem;
  color: #7c4a08;
  background:
    radial-gradient(circle at 12% 50%, #fff7cb 0 13%, transparent 14%),
    linear-gradient(180deg, #ffffff, #fff0c7);
  font-weight: 1000;
}

.walletBox strong {
  min-width: 42px;
  border-radius: 999px;
  padding: 0.18rem 0.58rem;
  color: #5d1732;
  background: var(--yellow);
  text-align: center;
}

.boosterHelp {
  border: 1px solid rgba(159, 73, 111, 0.14);
  border-radius: 8px;
  padding: 0.58rem 0.68rem;
  background: rgba(255, 255, 255, 0.54);
  font-size: 0.9rem;
  font-weight: 850;
}

.boosterGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.boosterGrid button {
  min-height: 40px;
  background:
    linear-gradient(135deg, rgba(90, 214, 255, 0.1), rgba(255, 224, 112, 0.08)),
    rgba(255, 248, 252, 0.92);
}

.shopShelf {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(159, 73, 111, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.48);
}

.shopShelf h3 {
  margin: 0;
  color: #b23662;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.shopShelf button {
  min-height: 40px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 241, 197, 0.74)),
    rgba(255, 248, 252, 0.92);
}

.shopShelf button:disabled {
  opacity: 0.5;
}

.leaderboardList {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.4rem;
  color: var(--muted);
  font-weight: 900;
}

.leaderboardList li::marker {
  color: var(--yellow);
}

.levelComplete {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(255, 214, 229, 0.62);
  backdrop-filter: blur(4px);
  z-index: 5;
}

.levelComplete[hidden] {
  display: none;
}

.completeCard {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  border: 1px solid rgba(159, 73, 111, 0.22);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 224, 112, 0.45), transparent 42%),
    linear-gradient(180deg, #fff, #ffe4ef);
  box-shadow: 0 26px 70px rgba(159, 73, 111, 0.32);
}

.completeCard h2 {
  font-size: 1.85rem;
}

.completeStars {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.completeStars span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 80% 92%, 50% 70%, 20% 92%, 32% 56%, 2% 35%, 39% 35%);
  color: #5d1732;
  background: #f5c2d3;
}

.completeStars span.earned {
  background: var(--yellow);
  animation: starPop 460ms ease both;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.42rem;
  line-height: 1.05;
}

h2 {
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.42;
}

.meterRow {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.starMeter {
  height: 14px;
  overflow: hidden;
  border: 1px solid rgba(159, 73, 111, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.starMeter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
  transition: width 240ms ease;
}

.statusText {
  border: 1px solid rgba(159, 73, 111, 0.14);
  border-radius: 8px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.64);
}

@keyframes popOut {
  48% {
    opacity: 1;
    transform: scale(1.12) rotate(5deg);
    filter: brightness(1.12);
  }

  to {
    opacity: 0;
    transform: scale(0.42) rotate(14deg);
    filter: brightness(1.25);
  }
}

@keyframes dropIn {
  from {
    transform: translateY(-58px) scale(0.9);
    opacity: 0.35;
    filter: brightness(1.08);
  }

  68% {
    transform: translateY(5px) scale(1.035);
    opacity: 1;
  }

  86% {
    transform: translateY(-2px) scale(0.99);
  }
}

@keyframes swapTile {
  from {
    transform: translate(var(--from-x, 0), var(--from-y, 0)) scale(0.94);
    filter: brightness(1.04);
  }

  62% {
    transform: translate(0, 0) scale(1.045);
  }

  82% {
    transform: translate(0, 0) scale(0.985);
  }
}

@keyframes settlePiece {
  from {
    transform: scale(1.035);
  }

  70% {
    transform: scale(0.985);
  }
}

@keyframes burstRing {
  to {
    opacity: 0;
    transform: scale(2.1);
  }
}

@keyframes sparkFly {
  70% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: rotate(var(--spark-angle)) translateX(var(--spark-distance, 54px)) scale(0.3);
  }
}

@keyframes hintPulse {
  50% {
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.9),
      0 0 0 6px rgba(21, 159, 232, 0.58),
      0 0 0 12px rgba(255, 224, 113, 0.58),
      0 0 36px rgba(21, 159, 232, 0.72);
  }
}

@keyframes hintPieceBounce {
  50% {
    transform: scale(1.16) translateY(-2px);
  }
}

@keyframes starPop {
  from {
    transform: scale(0.35) rotate(-18deg);
  }
  70% {
    transform: scale(1.16) rotate(8deg);
  }
}

@keyframes movesFlash {
  50% {
    box-shadow:
      0 0 0 5px rgba(255, 67, 111, 0.28),
      0 0 24px rgba(255, 67, 111, 0.38);
    transform: scale(1.025);
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
    background-attachment: scroll;
  }

  .sweetApp {
    grid-template-columns: 1fr;
    gap: 10px;
    height: auto;
    min-height: 100dvh;
    padding: 10px;
  }

  .bakeryStage {
    gap: 8px;
  }

  .momBanner {
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    gap: 8px;
    padding: 8px 10px;
  }

  .momBanner p {
    font-size: 0.66rem;
  }

  .momBanner strong {
    font-size: clamp(1rem, 5.6vw, 1.3rem);
  }

  .flowerBurst {
    width: 30px;
    height: 30px;
  }

  .topHud {
    grid-template-columns: 1fr 74px 92px;
    gap: 6px;
    padding: 7px;
  }

  .orderBox,
  .movesBox,
  .levelBadge {
    min-width: 0;
    padding: 7px 8px;
  }

  .orderBox p,
  .movesBox p,
  .levelBadge span,
  .kicker {
    font-size: 0.66rem;
  }

  .movesBox strong,
  .levelBadge strong {
    font-size: 1.45rem;
  }

  .orderList {
    gap: 5px;
    margin-top: 5px;
  }

  .orderItem {
    gap: 5px;
    min-height: 32px;
    padding: 4px 6px;
    font-size: 0.9rem;
  }

  .miniPiece,
  .orderItem .miniPiece,
  .miniCracker {
    width: 22px;
    height: 22px;
  }

  .boardShell {
    gap: 8px;
    min-height: 0;
    padding: 10px;
  }

  .boardShell::before,
  .boardShell::after {
    opacity: 0.28;
    transform: scale(0.7);
  }

  .levelTrail {
    gap: 6px;
  }

  .trailNode {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .matchBoard {
    --size: min(calc(100vw - 20px), calc(100dvh - 282px), 400px);
    max-width: none;
    gap: 3px;
    border-width: 4px;
    padding: 5px;
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.86),
      0 0 0 8px rgba(255, 196, 216, 0.72),
      0 12px 28px rgba(159, 73, 111, 0.22);
  }

  .tile {
    border-radius: 7px;
  }

  .piece {
    border-width: 2px;
  }

  .boardMessage {
    width: min(100%, 340px);
    padding: 0.62rem 0.72rem;
    font-size: 0.94rem;
  }

  .bottomHud {
    gap: 6px;
    padding: 7px;
  }

  .bottomHud span {
    padding: 0.5rem 0.55rem;
    font-size: 0.84rem;
  }

  .bottomHud strong {
    font-size: 1.12rem;
  }

  .sweetControls {
    gap: 10px;
    overflow: visible;
  }

  .sideHeader {
    padding: 12px;
  }

  .sideHeader h1 {
    font-size: 1.18rem;
  }

  .panel {
    padding: 12px;
    gap: 8px;
  }

  .sweetControls > .panel:first-of-type {
    grid-template-columns: 1fr;
  }

  .sweetControls > .panel:first-of-type button {
    min-height: 48px;
  }

  .chefRow {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .chefFace {
    width: 44px;
    height: 44px;
  }

  .chefFace::before {
    left: 4px;
    width: 34px;
  }

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

  .boosterGrid button {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 58px;
    padding: 0.55rem 0.35rem;
    font-size: 0.78rem;
    text-align: center;
  }

  .chefPanel > button {
    min-height: 46px;
  }

  .statusText,
  .panel.compact p {
    font-size: 0.92rem;
  }

  .levelComplete {
    padding: 10px;
  }

  .completeCard {
    width: min(320px, 100%);
    padding: 16px;
  }
}

@media (max-width: 430px) {
  .sweetApp {
    padding: 8px;
  }

  .topHud {
    grid-template-columns: 1fr 62px 78px;
  }

  .orderItem {
    font-size: 0.82rem;
  }

  .matchBoard {
    --size: min(calc(100vw - 16px), calc(100dvh - 270px), 360px);
    gap: 2px;
    padding: 4px;
    border-width: 4px;
  }

  .boardShell {
    padding: 8px;
  }

  .boosterGrid button {
    font-size: 0.72rem;
  }
}
