:root {
  --cream: #fff6e9;
  --peach: #f5a67a;
  --peach-dark: #dc754f;
  --mint: #83c9af;
  --lav: #a98ed2;
  --ink: #3e2c35;
  --wood: #b86e45;
  --shadow: 0 12px 28px #6f463128;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: #ead7c2;
  font-family: Nunito, "Trebuchet MS", Arial, sans-serif;
  color: var(--ink);
  user-select: none;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
}
.app-shell {
  position: relative;
  width: 100%;
  max-width: 540px;
  height: 100%;
  height: 100dvh;
  margin: auto;
  overflow: hidden;
  background: linear-gradient(155deg, #fff7e9, #f7d8bd 48%, #cfe6dc);
  box-shadow: 0 0 60px #38291f50;
}
.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}
.screen.active {
  display: flex;
}
.game-screen.active,
.home-screen.active,
.shop-screen.active {
  animation: screenIn 0.28s ease both;
}
.game-screen.active {
  animation: none;
}
@keyframes screenIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.home-screen {
  flex-direction: column;
  align-items: center;
  padding: calc(22px + var(--safe-top)) 24px calc(18px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 35%, #fffdf6 0 18%, transparent 45%),
    linear-gradient(160deg, #ffe6cc, #f6c7aa 55%, #b9ddd0);
}
.home-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.coin-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 80px;
  justify-content: center;
  background: #fff8;
  border: 2px solid #fff9;
  border-radius: 30px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
}
.coin-mark {
  color: #f4b83d;
  text-shadow: 0 2px #b86f27;
}
.icon-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(#fff, #eadfd8);
  box-shadow:
    0 6px 0 #c8aaa0,
    0 11px 20px #5b3b2b25;
  font-weight: 1000;
  font-size: 25px;
}
.icon-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #c8aaa0;
}
.icon-btn.small {
  width: 44px;
  height: 44px;
  font-size: 14px;
}
.brand {
  text-align: center;
  margin-top: 5vh;
  filter: drop-shadow(0 9px 0 #fff8);
}
.brand-kicker {
  font-weight: 1000;
  letter-spacing: 0.25em;
  font-size: 11px;
  color: #8b6b72;
}
.brand h1 {
  font-size: clamp(58px, 17vw, 92px);
  line-height: 0.72;
  margin: 15px 0 12px;
  letter-spacing: -0.07em;
  color: #61404a;
  transform: rotate(-2deg);
}
.brand h1 em {
  font-style: normal;
  color: #f07e5e;
  text-shadow: 0 5px 0 #c85843;
}
.brand p {
  font-weight: 1000;
  letter-spacing: 0.32em;
  color: #6e5660;
  margin: 0;
}
.hero-shelf {
  width: 92%;
  height: 145px;
  margin: 6vh 0 3vh;
  padding: 22px 20px 15px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  border-radius: 26px 26px 12px 12px;
  background: linear-gradient(#d18b5c, #9b5938);
  box-shadow:
    inset 0 12px #e7ad7a,
    0 15px 0 #79472f,
    0 25px 35px #70442938;
}
.hero-shelf span {
  font-size: 47px;
  filter: drop-shadow(0 8px 5px #43281855);
  animation: idleFloat 3.6s ease-in-out infinite;
}
.hero-shelf span:nth-child(2n) {
  animation-delay: -1.5s;
}
@keyframes idleFloat {
  50% {
    transform: translateY(-5px);
  }
}
.home-actions {
  width: min(88%, 380px);
  display: grid;
  gap: 14px;
}
.game-btn {
  min-height: 58px;
  border-radius: 24px;
  font-weight: 1000;
  letter-spacing: 0.04em;
  font-size: 21px;
  box-shadow:
    0 8px 0 #a65a40,
    0 14px 20px #6e3f3030;
  transition:
    0.15s transform,
    0.15s filter;
}
.game-btn:active {
  transform: translateY(5px) scale(0.98);
  box-shadow: 0 3px 0 #a65a40;
}
.game-btn.primary {
  background: linear-gradient(#ffb083, #ef7c59);
  color: white;
}
.game-btn.secondary {
  background: linear-gradient(#a9dfc9, #70b89f);
  box-shadow:
    0 8px 0 #4e8f79,
    0 14px 20px #315d5030;
  color: #244d42;
}
.game-btn.tertiary {
  background: linear-gradient(#c9b6ea, #a387d0);
  box-shadow:
    0 8px 0 #735ba0,
    0 14px 20px #47366530;
  color: white;
}
.level-status {
  font-weight: 900;
  margin: auto 0 0;
  color: #654f56;
}
.game-screen {
  flex-direction: column;
  padding: calc(6px + var(--safe-top)) 6px 0;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 36%, #fffdf8 0 17%, transparent 45%),
    linear-gradient(155deg, #ffe9d5, #f6c6a7 56%, #b9dfd1);
  touch-action: manipulation;
}
.game-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #fff6 1px, transparent 1px),
    linear-gradient(#fff4 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.13;
  z-index: 0;
  pointer-events: none;
}
.game-screen::after {
  display: none;
}
.game-hud {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  height: 62px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  padding: 0 8px;
  color: #61404a;
  text-shadow: 0 1px #fff8;
}
.game-hud > div {
  display: flex;
  flex-direction: column;
}
.game-hud small {
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.13em;
  color: #8b6b72;
}
.game-hud b {
  font-size: 25px;
}
.timer-wrap {
  text-align: center;
}
.timer-wrap b {
  font-size: 31px;
}
.game-hud .icon-btn {
  justify-self: end;
  width: 47px;
  height: 47px;
  background: transparent;
  box-shadow: none;
}
.game-hud .icon-btn:active {
  transform: scale(0.94);
  box-shadow: none;
}
.game-hud .nav-icon-btn img {
  filter: drop-shadow(0 1px 0 #fff8) drop-shadow(0 2px 2px #61404a44);
}
.progress-track {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  height: 8px;
  margin: 0 12px 8px;
  background: #c9a09055;
  border: 2px solid #fff8;
  border-radius: 9px;
  overflow: hidden;
}
.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ffe373, #ffad45);
  border-radius: inherit;
  transition: width 0.35s;
}
.shelf-board {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 2px 4px 8px;
  touch-action: none;
}
.shelf-unit {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 4px;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 5px 4px 6px;
  border-radius: var(--unit-radius, 16px);
  --wood-top: #e8a65c;
  --wood-mid: #c47838;
  --wood-bot: #a85d2c;
  --wood-edge: #7a3c1c;
  --wood-hi: #f6d09a;
  --wood-in: #8f4a22;
  --cubby: #4e220f;
  --cubby-hi: #8b4a24;
  --cubby-in: #6e3518;
  --cubby-deep: #4a1c0c;
  --cubby-rim: #f0b56a;
  --lip-a: #d0894c;
  --lip-b: #a45a2c;
  --box-radius: 10px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 17px,
      #00000014 17px 18px
    ),
    linear-gradient(var(--wood-top), var(--wood-mid) 55%, var(--wood-bot));
  box-shadow:
    0 8px 0 var(--wood-edge),
    inset 0 3px var(--wood-hi),
    inset 0 -5px var(--wood-in);
}
.shelf-unit.shape-soft {
  --unit-radius: 22px;
  --box-radius: 16px;
}
.shelf-unit.shape-square {
  --unit-radius: 8px;
  --box-radius: 4px;
}
.shelf-unit.skin-honey {
  --wood-top: #f0b45a;
  --wood-mid: #e09038;
  --wood-bot: #c46a22;
  --cubby-rim: #ffd27a;
}
.shelf-unit.skin-oak {
  --wood-top: #e8a65c;
  --wood-mid: #c47838;
  --wood-bot: #a85d2c;
}
.shelf-unit.skin-cherry {
  --wood-top: #e08a6a;
  --wood-mid: #c45a42;
  --wood-bot: #9a3c30;
  --wood-edge: #6e241c;
  --wood-hi: #f4c4b0;
  --cubby: #4a1814;
  --cubby-hi: #8a3a30;
  --cubby-rim: #f0a090;
}
.shelf-unit.skin-pine {
  --wood-top: #c4b06a;
  --wood-mid: #9a8a48;
  --wood-bot: #6e6430;
  --wood-edge: #4a4420;
  --wood-hi: #e8dc9a;
  --cubby: #3a3818;
  --cubby-hi: #6a6430;
  --cubby-rim: #d8cc7a;
}
.shelf-unit.skin-walnut {
  --wood-top: #b87a4a;
  --wood-mid: #8a4e2c;
  --wood-bot: #5c3018;
  --wood-edge: #3a1c0c;
  --wood-hi: #d4a07a;
  --cubby: #2e1408;
  --cubby-hi: #6a3418;
  --cubby-rim: #d49a62;
}
.shelf-unit.skin-rose {
  --wood-top: #e8a0b0;
  --wood-mid: #d07088;
  --wood-bot: #b04a66;
  --wood-edge: #7a2844;
  --wood-hi: #f8c8d4;
  --cubby: #4a1828;
  --cubby-hi: #8a3850;
  --cubby-rim: #f0b0c0;
}
.shelf-unit.skin-amber {
  --wood-top: #f0c060;
  --wood-mid: #d49430;
  --wood-bot: #b06a18;
  --wood-edge: #7a480c;
  --wood-hi: #ffe08a;
  --cubby: #4a2808;
  --cubby-rim: #ffd070;
}
.shelf-unit.skin-cocoa {
  --wood-top: #a06a48;
  --wood-mid: #6e4228;
  --wood-bot: #4a2814;
  --wood-edge: #2a1408;
  --wood-hi: #c49470;
  --cubby: #221008;
  --cubby-rim: #c48858;
}
.shelf-unit.skin-berry {
  --wood-top: #c070c0;
  --wood-mid: #8a4898;
  --wood-bot: #5c2870;
  --wood-edge: #3a1850;
  --wood-hi: #e0a8e0;
  --cubby: #2a1038;
  --cubby-hi: #6a3878;
  --cubby-rim: #d090d8;
}
.shelf-unit.skin-slate {
  --wood-top: #8aa0b8;
  --wood-mid: #5a7088;
  --wood-bot: #3a4c60;
  --wood-edge: #243040;
  --wood-hi: #c0d0e0;
  --wood-in: #2a3848;
  --cubby: #182028;
  --cubby-hi: #405060;
  --cubby-in: #2a3844;
  --cubby-deep: #101820;
  --cubby-rim: #a8c0d4;
  --lip-a: #7a90a4;
  --lip-b: #4a6074;
}
.shelf-unit.skin-mint {
  --wood-top: #7ed0b0;
  --wood-mid: #48a888;
  --wood-bot: #2e7a62;
  --wood-edge: #1c5040;
  --wood-hi: #c0f0dc;
  --cubby: #14382c;
  --cubby-hi: #2e6a54;
  --cubby-rim: #9ae0c4;
}
.shelf-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  flex: 1 1 0;
  min-height: 0;
}
.shelf-spacer {
  pointer-events: none;
}
.shelf-box {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  --fit: 1;
  border-radius: var(--box-radius, 10px);
  background:
    radial-gradient(ellipse at 50% 12%, var(--cubby-hi) 0 28%, var(--cubby) 78%);
  border: 4px solid var(--cubby-rim);
  box-shadow:
    inset 0 12px 16px #2a1008bb,
    0 1px 0 #ffe0a8;
}
.shelf-box::before {
  content: "";
  position: absolute;
  inset: 5px 5px 11px;
  border-radius: calc(var(--box-radius, 10px) - 4px);
  background: linear-gradient(var(--cubby-in), var(--cubby-deep));
  box-shadow: inset 0 10px 16px #2a0e0899;
  pointer-events: none;
}
.shelf-box::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 7px;
  right: 7px;
  bottom: 5px;
  height: 8px;
  border-radius: 3px;
  background: linear-gradient(var(--lip-a), var(--lip-b));
  box-shadow: 0 -2px 0 #f0b56a55;
  pointer-events: none;
}
.slot-row {
  position: absolute;
  z-index: 2;
  inset: 6px 4px 10px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  overflow: visible;
}
.item {
  position: relative;
  flex: 0 0 33.333%;
  width: 33.333%;
  max-width: 33.333%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}
.item .product {
  transform-origin: bottom center;
  transform: scale(var(--fit, 1));
  transition: none;
}
.item[data-slot="0"] {
  z-index: 1;
}
.item[data-slot="1"] {
  z-index: 2;
}
.item[data-slot="2"] {
  z-index: 3;
}
.item.dragging {
  opacity: 0;
  pointer-events: none;
}
.item.popping {
  animation: matchClear 0.45s ease forwards;
  pointer-events: none;
}
.item.hint {
  z-index: 8;
  animation: hintPulse 0.55s ease 3;
}
.item.hint .product {
  filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 14px #ffdc42);
}
.item.swap-target {
  filter: drop-shadow(0 0 8px #fff59a);
  z-index: 6;
}
.shelf-box.drop-ok {
  box-shadow:
    0 5px 0 #8a4a26,
    0 0 0 4px #fff59a,
    0 0 18px #ffe566aa;
}
.shelf-box.drop-no {
  filter: brightness(0.82);
}
.shelf-box.hint-shelf {
  z-index: 3;
  overflow: visible;
  animation: hintShelf 0.55s ease 3;
  box-shadow:
    0 5px 0 #8a4a26,
    0 0 0 4px #ffe566,
    0 0 18px #ffdc42cc;
}
.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  pointer-events: none;
  transform: translate(-50%, -80%) scale(1.18);
  will-change: transform;
}
.product,
.product i {
  display: block;
  pointer-events: none;
}
.product {
  position: relative;
  width: 40px;
  height: 72px;
}
.product .cap,
.product .neck,
.product .body,
.product .label,
.product .straw,
.product .wedge,
.product .fruit {
  position: absolute;
}
.product .cap {
  z-index: 3;
  top: 0;
  left: 13px;
  width: 14px;
  height: 8px;
  border-radius: 4px 4px 2px 2px;
  background-color: var(--c2, var(--c, #d4a24e));
  background-image: linear-gradient(#ffffff55, #0000 65%);
  box-shadow: inset 0 1px #fff8;
}
.product .neck {
  z-index: 2;
  top: 6px;
  left: 15px;
  width: 10px;
  height: 14px;
  border-radius: 3px 3px 0 0;
  background-color: var(--c, #cc7744);
  background-image: linear-gradient(90deg, #0003, transparent 35%, #fff5 55%, #0001);
}
.product .body {
  left: 4px;
  right: 4px;
  top: 18px;
  bottom: 0;
  border-radius: 10px 10px 8px 8px;
  background-color: var(--c, var(--product, #e07a30));
  background-image: linear-gradient(
    90deg,
    #00000024 0%,
    transparent 24%,
    #ffffff40 50%,
    transparent 76%,
    #00000018 100%
  );
  box-shadow:
    inset 0 -3px #0002,
    0 1px 0 #fff5;
}
.product .label {
  z-index: 6;
  left: 4px;
  right: 4px;
  top: auto;
  bottom: 6px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: #fffaf0;
  color: #3d241c;
  font-size: 6.5px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 1px;
  box-shadow: 0 1px 0 #0002;
}
.product .fruit {
  width: 11px;
  height: 11px;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  border-radius: 50%;
  z-index: 4;
}
.product .fruit.orange,
.product .fruit.citrus {
  background: conic-gradient(#ff9a2a, #ffe27a, #ff9a2a, #fff1c4, #ff9a2a);
  box-shadow: 0 0 0 2px #fff8;
}
.product .fruit.lime {
  background: conic-gradient(#8fd42a, #f3ff9a, #6aaf14, #fffbe0, #8fd42a);
}
.product .fruit.grape {
  background: radial-gradient(circle at 30% 30%, #f0b, #c44ec8 55%, #7a2080);
  box-shadow:
    4px 3px 0 -3px #a83ab0,
    -3px 4px 0 -3px #d070d4;
}
.product .fruit.coconut {
  background: radial-gradient(circle at 35% 30%, #fff, #f3e2c4 45%, #c9a078);
  box-shadow: inset 0 0 0 2px #e8d2aa;
}
.product.can {
  width: 40px;
  height: 72px;
}
.product.can .cap {
  left: 4px;
  right: 4px;
  width: auto;
  height: 12px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(#f4f4f4, #c8c8c8 55%, #9a9a9a);
}
.product.can .body {
  top: 10px;
  left: 4px;
  right: 4px;
  border-radius: 4px 4px 6px 6px;
}
.product.can .label {
  color: #3d241c;
  background: #fffaf0;
}
.product.bottle .body {
  top: 18px;
}
.product.bottle .cap {
  left: 14px;
  width: 12px;
  height: 7px;
}
.product.cola,
.product.wine,
.product.water,
.product.carton,
.product.box,
.product.cup,
.product.mini,
.product.mini.can,
.product.mini.cup,
.product.mini.wine,
.product.mini.cola,
.product.mini.water {
  width: 40px;
  height: 72px;
}
.product.cola .neck,
.product.wine .neck {
  left: 14px;
  width: 10px;
  height: 16px;
  top: 6px;
}
.product.cola .body,
.product.wine .body {
  top: 20px;
  left: 4px;
  right: 4px;
  border-radius: 12px 12px 8px 8px;
  clip-path: none;
}
.product.carton,
.product.box {
  width: 40px;
  height: 72px;
}
.product.carton .cap,
.product.box .cap {
  left: 50%;
  top: 2px;
  width: 12px;
  height: 8px;
  margin-left: -6px;
  transform: none;
  border-radius: 3px 3px 1px 1px;
  background-color: var(--c2, var(--c));
}
.product.carton .neck,
.product.box .neck {
  display: none;
}
.product.carton .body,
.product.box .body {
  top: 8px;
  left: 3px;
  right: 3px;
  border-radius: 4px 4px 6px 6px;
  clip-path: none;
}
.product.carton .fruit,
.product.box .fruit {
  top: 8px;
}
.product.cup {
  width: 40px;
  height: 72px;
}
.product.cup .cap {
  left: 6px;
  width: 28px;
  height: 7px;
  border-radius: 3px;
  background: #fff7de;
}
.product.cup .neck {
  display: none;
}
.product.cup .body {
  top: 6px;
  left: 6px;
  right: 6px;
  border-radius: 3px 3px 12px 12px;
}
.product.cup .straw {
  z-index: 4;
  top: 2px;
  left: 24px;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff, #ff8aa0);
  transform: rotate(12deg);
}
.product.cup .wedge {
  z-index: 4;
  top: 6px;
  left: 7px;
  width: 10px;
  height: 8px;
  border-radius: 0 0 10px 10px;
  background: conic-gradient(#b6e04a, #efffb0, #7cbc22);
  transform: rotate(-28deg);
}
.product.water .neck {
  background: linear-gradient(90deg, #c5e6f2, #eef8fc, #b5dcec);
}
.product.water .cap {
  background: linear-gradient(#5aa7e0, #2b6db8);
  left: 14px;
  width: 10px;
}
.product.water .body {
  background-color: #e7f5fb;
  border: 2px solid #fff;
}
.product.water .label {
  background: #fffaf0;
  color: #3d241c;
}
.product.mini .cap {
  left: 13px;
  width: 14px;
  height: 8px;
}
.product.mini .neck {
  left: 15px;
  width: 10px;
  height: 12px;
  top: 6px;
}
.product.mini .body {
  top: 16px;
  left: 4px;
  right: 4px;
  border-radius: 10px 10px 8px 8px;
}
.product.mini .label {
  bottom: 7px;
  height: 12px;
  font-size: 6px;
}
.combo-bar {
  display: none;
}
.combo-text {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: 8;
  width: max-content;
  min-width: 132px;
  padding: 10px 22px 12px;
  border-radius: 22px;
  background: linear-gradient(#ffb24a, #ef7a22);
  box-shadow:
    0 6px 0 #c45e16,
    0 12px 22px #c45e1648;
  color: #fff;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -40%) scale(0.55);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px #c45432;
}
.combo-text.show {
  animation: comboBurst 0.7s cubic-bezier(0.2, 1.4, 0.35, 1) both;
}
.combo-text span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0.9;
}
.combo-text b {
  display: block;
  margin: 4px 0 2px;
  font-size: 34px;
}
.combo-text em {
  display: block;
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #fff6c4;
}
@keyframes matchClear {
  40% {
    transform: translateY(-16px) scale(1.15);
    filter: drop-shadow(0 0 10px white);
  }
  to {
    transform: scale(0);
    opacity: 0;
  }
}
@keyframes hintPulse {
  50% {
    transform: scale(1.12);
    filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 15px #ffdc42);
  }
}
@keyframes hintShelf {
  50% {
    box-shadow:
      0 5px 0 #8a4a26,
      0 0 0 6px #fff59a,
      0 0 24px #ffdc42;
  }
}
@keyframes comboBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.4);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -58%) scale(1.12);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.power-row {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  height: 64px;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 7px 4px;
}
.power-btn {
  position: relative;
  width: 92px;
  border-radius: 18px;
  background: linear-gradient(#fff, #ede5df);
  box-shadow: 0 5px 0 #c8aaa0;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  padding: 4px 8px;
}
.power-btn span {
  font-size: 24px;
  color: #9371c0;
}
.power-btn b {
  font-size: 12px;
}
.power-btn i {
  position: absolute;
  right: -5px;
  top: -5px;
  background: #ee7f5c;
  color: white;
  border-radius: 50%;
  font-style: normal;
  font-size: 11px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid white;
}
.power-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #c8aaa0;
}
.power-btn:disabled {
  filter: grayscale(1);
  opacity: 0.55;
}
.shop-screen {
  flex-direction: column;
  padding: calc(18px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));
  background: linear-gradient(#d8eee5, #fff0d9);
}
.shop-head {
  height: 65px;
  display: grid;
  grid-template-columns: 60px 1fr 100px;
  align-items: center;
}
.shop-head h2 {
  text-align: center;
  margin: 0;
  font-size: 27px;
}
.shop-scene {
  position: relative;
  flex: 1;
  margin: 18px 0;
  border: 8px solid #bd734b;
  border-radius: 30px;
  background: linear-gradient(#ffe4c7 0 64%, #d8aa7c 64%);
  overflow: hidden;
  box-shadow:
    inset 0 0 35px #6c3d2025,
    var(--shadow);
}
.awning {
  height: 75px;
  background: repeating-linear-gradient(
    90deg,
    #ef9477 0 50px,
    #fff3df 50px 100px
  );
  clip-path: polygon(
    0 0,
    100% 0,
    100% 70%,
    95% 100%,
    90% 70%,
    85% 100%,
    80% 70%,
    75% 100%,
    70% 70%,
    65% 100%,
    60% 70%,
    55% 100%,
    50% 70%,
    45% 100%,
    40% 70%,
    35% 100%,
    30% 70%,
    25% 100%,
    20% 70%,
    15% 100%,
    10% 70%,
    5% 100%,
    0 70%
  );
}
.shop-sign {
  margin: 30px auto 12px;
  width: 70%;
  padding: 13px;
  border-radius: 15px;
  background: #68414a;
  color: white;
  text-align: center;
  font-weight: 1000;
  font-size: 24px;
  box-shadow: 0 7px 0 #442831;
}
.shop-window {
  height: 170px;
  margin: 35px 42px 0;
  border: 9px solid #8a563d;
  background: linear-gradient(#c9e9ed, #fff);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 18px;
  font-size: 45px;
}
.shop-counter {
  height: 60px;
  margin: 0 25px;
  background: #ac6846;
  border-radius: 10px;
  box-shadow: inset 0 8px #d99a71;
}
.shop-decor {
  position: absolute;
  right: 30px;
  bottom: 60px;
  font-size: 62px;
  z-index: 2;
}
.upgrade-card {
  min-height: 92px;
  padding: 13px 15px;
  border-radius: 24px;
  background: #fff9;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.upgrade-card small {
  font-size: 10px;
  font-weight: 1000;
  color: #93777c;
  letter-spacing: 0.12em;
}
.upgrade-card h3 {
  margin: 4px 0;
}
.game-btn.buy {
  min-width: 120px;
  min-height: 52px;
  background: linear-gradient(#ffbd71, #ec9141);
  color: white;
  font-size: 17px;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 28px;
  background: #3c28358a;
  backdrop-filter: blur(5px);
}
.modal.open {
  display: grid;
  animation: fadeIn 0.2s;
}
.modal-card {
  width: min(100%, 390px);
  padding: 34px 24px 24px;
  border: 5px solid #fff8;
  border-radius: 34px;
  background: linear-gradient(#fffaf1, #f5dac3);
  box-shadow: 0 20px 60px #27172265;
  text-align: center;
}
.modal-badge {
  width: 72px;
  height: 72px;
  margin: -70px auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(#ffd96c, #f2a63d);
  border: 5px solid white;
  font-size: 35px;
  box-shadow: 0 8px 0 #ba6f31;
}
.modal h2 {
  margin: 16px 0 8px;
  font-size: 32px;
}
.modal p {
  margin: 0 0 14px;
  color: #735c63;
}
.modal-stats {
  font-weight: 900;
  margin: 12px 0;
}
.modal-actions {
  display: grid;
  gap: 12px;
}
.modal-actions .game-btn {
  min-height: 54px;
}
.modal-close {
  display: none;
}
.modal.sheet-theme {
  background: #3a243099;
  backdrop-filter: blur(7px);
}
.modal.sheet-theme .modal-card {
  position: relative;
  width: min(100%, 300px);
  padding: 28px 20px 18px;
  border: 3px solid #5a3d36;
  border-radius: 36px;
  background: #fff8f0;
  box-shadow: 0 18px 40px #2a181866;
}
.modal.sheet-theme .modal-badge {
  position: relative;
  width: 72px;
  height: 72px;
  margin: -62px auto 8px;
  border: 5px solid #fff;
  background: linear-gradient(#ffe56a, #f0b43a);
  box-shadow: 0 8px 0 #5a3d36;
}
.modal.sheet-theme h2 {
  margin: 10px 0 6px;
  font-size: 28px;
  color: #4a352f;
  letter-spacing: 0.06em;
}
.modal.sheet-theme #modalBody {
  margin: 0 8px 16px;
  color: #8b6b72;
  font-size: 13px;
  font-weight: 800;
}
.modal.sheet-theme .modal-stats {
  display: none;
}
.modal.sheet-theme .modal-actions {
  gap: 10px;
}
.modal.sheet-theme .modal-actions .game-btn {
  min-height: 54px;
  border-radius: 999px;
}
.modal.sheet-theme .modal-actions .game-btn.primary {
  background: linear-gradient(#ff9b7a, #ef6b52);
  color: #fff;
  box-shadow: 0 7px 0 #c24a38, 0 12px 16px #6e3f3030;
}
.modal.sheet-theme .modal-actions .game-btn.primary:active {
  box-shadow: 0 3px 0 #c24a38;
}
.modal.sheet-theme .modal-actions .game-btn.secondary {
  background: linear-gradient(#9ee0cc, #6fc4ac);
  color: #244d42;
  box-shadow: 0 7px 0 #4e8f79, 0 12px 16px #315d5030;
}
.modal.sheet-theme .modal-actions .game-btn.secondary:active {
  box-shadow: 0 3px 0 #4e8f79;
}
.modal.sheet-theme .modal-actions .game-btn.tertiary {
  background: linear-gradient(#c9b6ea, #a387d0);
  color: #fff;
  box-shadow: 0 7px 0 #735ba0, 0 12px 16px #47366530;
}
.modal.sheet-theme .modal-actions .game-btn.tertiary:active {
  box-shadow: 0 3px 0 #735ba0;
}
.modal.pause-theme .modal-close {
  display: grid;
  place-items: center;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 2px solid #4a352f;
  border-radius: 50%;
  background: #fff;
  color: #4a352f;
  font-size: 20px;
  line-height: 1;
  box-shadow: none;
}
.modal.pause-theme .modal-close:active {
  transform: translateY(2px);
}
.modal.pause-theme .modal-badge {
  font-size: 0;
  color: transparent;
}
.modal.pause-theme .modal-badge::before,
.modal.pause-theme .modal-badge::after {
  content: "";
  position: absolute;
  top: 22px;
  width: 8px;
  height: 24px;
  border-radius: 4px;
  background: #4a352f;
}
.modal.pause-theme .modal-badge::before {
  left: 23px;
}
.modal.pause-theme .modal-badge::after {
  right: 23px;
}
.modal.lose-theme .modal-badge {
  font-size: 32px;
  color: #4a352f;
  border-color: #e2c08a;
}
.modal.lose-theme .modal-close {
  display: none;
}
.modal.lose-theme .modal-actions .game-btn.secondary {
  color: #fff;
}
.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 11px 20px;
  border-radius: 25px;
  background: #3e2c35;
  color: white;
  font-weight: 900;
  pointer-events: none;
  transition: 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* Refined home: one clear action, collectible showcase, compact progression. */
.home-screen {
  padding: calc(18px + var(--safe-top)) 24px calc(14px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 36%, #fffdf8 0 17%, transparent 45%),
    linear-gradient(155deg, #ffe9d5, #f6c6a7 56%, #b9dfd1);
  isolation: isolate;
}
.home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #fff6 1px, transparent 1px),
    linear-gradient(#fff4 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.13;
  z-index: -2;
}
.home-glow {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  z-index: -1;
}
.glow-one {
  width: 220px;
  height: 220px;
  left: -105px;
  top: 27%;
  background: #ffb98866;
}
.glow-two {
  width: 270px;
  height: 270px;
  right: -160px;
  bottom: 6%;
  background: #72c8b977;
}
.home-top {
  z-index: 2;
}
.home-tools {
  position: relative;
  display: flex;
  align-items: center;
}
.settings-btn img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 1px #315f8c55);
}
.settings-btn.open {
  transform: scale(0.94);
}
.settings-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 8px;
  border: 3px solid #fff8;
  border-radius: 22px;
  background: linear-gradient(#fffef9, #f4d7c0);
  box-shadow: 0 8px 0 #d7b4a4, 0 14px 20px #3a243033;
}
.settings-menu[hidden] {
  display: none !important;
}
.coin-pill {
  min-width: 90px;
  gap: 8px;
  padding: 9px 15px;
  background: linear-gradient(#fffefb, #fff3e8);
  border: 2px solid white;
  box-shadow:
    0 6px 0 #d9b8a9,
    0 12px 22px #5b3b2b22;
}
.coin-mark {
  position: relative;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-size: 0;
  background: linear-gradient(145deg, #ffe676, #eaa42f);
  border: 2px solid #fff0a3;
  box-shadow:
    inset 0 -3px #bf7922,
    0 2px 2px #9c642250;
}
.coin-mark::after {
  content: "S";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 1000;
  color: #a96620;
}
.home-screen .language-btn,
.home-screen .icon-btn.small,
.shop-screen .icon-btn {
  background: transparent;
  box-shadow: none;
}
.home-screen .icon-btn.small:active,
.shop-screen .icon-btn:active {
  transform: scale(0.94);
  box-shadow: none;
}
.home-screen .coin-pill,
.shop-screen .coin-pill {
  min-width: 0;
  padding: 4px 2px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.brand {
  margin-top: 3.3vh;
  z-index: 1;
}
.brand-kicker {
  letter-spacing: 0.3em;
  font-size: 10px;
}
.brand h1 {
  font-size: clamp(58px, 17vw, 88px);
  line-height: 0.7;
  margin: 14px 0 12px;
}
.brand p {
  font-size: 13px;
  letter-spacing: 0.34em;
}
.hero-display {
  position: relative;
  width: min(94%, 420px);
  margin: 4.3vh 0 14px;
  padding-top: 19px;
  border-radius: 28px 28px 16px 16px;
  background: linear-gradient(#efb16f, #c17346);
  box-shadow:
    inset 0 7px #ffd09d,
    0 13px 0 #743f2d,
    0 22px 36px #70442932;
}
.display-title {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 0;
  transform: translate(-50%, -15px);
  width: 190px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 18px;
  background: #fff7e9;
  border: 3px solid #eeb476;
  color: #8b5b4f;
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: 0.16em;
  box-shadow: 0 5px 0 #b8754e;
}
.display-title i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f18a5f;
}
.hero-shelf {
  width: auto;
  height: 112px;
  margin: 0;
  padding: 18px 24px 12px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(#ae6036, #c97a47 18%, #a95933);
  box-shadow:
    inset 0 7px 12px #69351f88,
    none;
}
.hero-shelf .product {
  font-size: initial;
  transform: scale(0.84);
  transform-origin: bottom center;
  animation: homeFloat 3.6s ease-in-out infinite;
}
.hero-shelf .product:nth-child(2n) {
  animation-delay: -1.5s;
}
.hero-shelf .hero-main {
  transform: scale(1.02);
  filter: drop-shadow(3px 8px 3px #4d2c2166);
}
@keyframes homeFloat {
  50% {
    translate: 0 -5px;
  }
}
.level-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  margin: 0 0 12px;
  padding: 4px 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #684f58;
  font-size: 13px;
  font-weight: 1000;
  box-shadow: none;
}
.level-status i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #bd8c7b;
}
.level-status strong {
  color: #ecaa36;
}
.home-actions {
  gap: 12px;
}
.home-actions .game-btn {
  position: relative;
  overflow: hidden;
}
.home-actions .game-btn::after {
  content: "";
  position: absolute;
  inset: 4px 9px auto;
  height: 35%;
  border-radius: 18px;
  background: linear-gradient(#fff5, transparent);
  pointer-events: none;
}
.home-actions .game-btn.primary {
  min-height: 64px;
  font-size: 23px;
  box-shadow:
    0 9px 0 #b95742,
    0 16px 25px #7e3c2c35;
}
.home-handle {
  width: 68px;
  height: 5px;
  border-radius: 5px;
  margin: auto 0 0;
  background: #59414a55;
}
@media (max-height: 700px) {
  .brand {
    margin-top: 1vh;
  }
  .brand h1 {
    font-size: 52px;
  }
  .hero-display {
    margin: 1.6vh 0 7px;
  }
  .hero-shelf {
    height: 83px;
  }
  .hero-shelf .product {
    transform: scale(0.66);
  }
  .level-status {
    margin-bottom: 6px;
  }
  .home-actions {
    gap: 8px;
  }
  .game-btn,
  .home-actions .game-btn.primary {
    min-height: 48px;
  }
  .shelf-board {
    padding: 2px 4px 4px;
  }
  .shelf-row {
    gap: 4px;
  }
  .game-hud {
    height: 50px;
  }
  .game-hud b {
    font-size: 20px;
  }
  .timer-wrap b {
    font-size: 24px;
  }
  .combo-bar {
    display: none;
  }
  .combo-text {
    top: 42%;
  }
  .power-row {
    height: 78px;
    gap: 8px;
    padding-top: 2px;
  }
  .power-btn {
    height: 72px;
    width: 68px;
  }
  .power-btn .power-icon {
    width: 48px;
    height: 48px;
    border-width: 4px;
  }
  .power-btn .power-icon img {
    width: 34px;
    height: 34px;
  }
  .power-btn i {
    top: 32px;
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  .power-btn b {
    line-height: 13px;
    font-size: 11px;
  }
}
.hero-display .hero-shelf {
  box-shadow: inset 0 7px 12px #69351f88;
}
.coin-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 7px;
  height: 7px;
  background: #a96620;
  clip-path: polygon(
    50% 0,
    61% 34%,
    98% 35%,
    68% 57%,
    79% 94%,
    50% 72%,
    21% 94%,
    32% 57%,
    2% 35%,
    39% 34%
  );
  filter: drop-shadow(0 1px #ffe9a0);
}
.coin-mark {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 0;
  background: url("assets/ui/star.webp") center/contain no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 3px 2px #9c642250);
}
.coin-mark::after {
  display: none;
}
.level-status strong {
  display: inline-block;
  width: 19px;
  height: 19px;
  font-size: 0;
  background: url("assets/ui/star.webp") center/contain no-repeat;
  filter: drop-shadow(0 2px 1px #9c642244);
}
.hero-display {
  margin-top: 3.8vh;
  padding: 12px 7px 7px;
  border-radius: 29px 29px 17px 17px;
  background: linear-gradient(#ffc787, #d98550);
  box-shadow:
    inset 0 7px #ffe0b6,
    0 12px 0 #7c4430,
    0 22px 34px #6d412c30;
}
.display-title {
  top: 2px;
  width: 168px;
  height: 28px;
  transform: translate(-50%, -17px);
  border-width: 2px;
  box-shadow: 0 4px 0 #bd7a50;
}
.hero-display .hero-shelf {
  height: 126px;
  padding: 22px 22px 13px;
  border-radius: 20px 20px 11px 11px;
  background: linear-gradient(#a95631 0, #c6723e 15%, #ad5933 100%);
  box-shadow:
    inset 0 8px 15px #66311eaa,
    0 2px #f3a66b;
}
.hero-shelf .product {
  width: 54px;
  height: 87px;
  transform: scale(1);
  filter: drop-shadow(3px 7px 3px #47291f77);
}
.hero-shelf .product.hero-main {
  width: 59px;
  height: 94px;
  transform: scale(1.06);
}
.hero-shelf .product .cap {
  left: 18px;
  width: 20px;
  height: 9px;
}
.hero-shelf .product .body {
  left: 7px;
  right: 7px;
}
.hero-shelf .product.cup .body,
.hero-shelf .product.can .body {
  top: 8px;
}
.hero-shelf .product.carton .body {
  top: 18px;
}
.hero-shelf .product.bottle .body {
  top: 22px;
}
.hero-shelf .product .label {
  top: auto;
  bottom: 10px;
  height: 14px;
  font-size: 8px;
}
.hero-shelf .product.carton .cap {
  left: 50%;
  width: 14px;
  height: 10px;
  margin-left: -7px;
}
.hero-shelf .product.cup .cap {
  left: 9px;
  width: 37px;
}
.hero-shelf .product.cup .body {
  left: 9px;
  right: 9px;
}
.hero-shelf .product.can .cap {
  left: 4px;
  right: 4px;
  width: auto;
  height: 12px;
  border-radius: 8px 8px 2px 2px;
}
.hero-shelf .product:nth-child(1) {
  rotate: -3deg;
}
.hero-shelf .product:nth-child(2) {
  rotate: 2deg;
}
.hero-shelf .product:nth-child(4) {
  rotate: -2deg;
}
.hero-shelf .product:nth-child(5) {
  rotate: 3deg;
}
/* Glossy round power-ups with reusable WebP symbols. */
.power-row {
  height: 72px;
  gap: 40px;
  padding: 2px 7px calc(8px + var(--safe-bottom));
  align-items: flex-start;
  background: transparent;
  border-radius: 0;
  border-top: 0;
}
.power-btn {
  position: relative;
  width: 48px;
  height: 70px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.power-btn .power-icon {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 4px solid #087fbd;
  border-radius: 50%;
  background: radial-gradient(
    circle at 42% 35%,
    #fff 0 44%,
    #d9f4ff 46% 58%,
    #45c5f3 60% 100%
  );
  box-shadow:
    inset 0 0 0 2px #7ce1ff,
    0 4px 0 #075f94,
    0 6px 8px #075f9455;
}
.power-btn .power-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 16px;
  height: 7px;
  border-radius: 50%;
  background: #fff9;
  transform: rotate(-18deg);
}
.power-btn .power-icon img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 2px 1px #72442355);
}
.power-btn b {
  font-size: 10px;
  line-height: 12px;
  font-weight: 800;
  color: #654f56;
  text-shadow: 0 1px #fff8;
}
.power-btn i {
  right: -2px;
  top: 28px;
  width: 20px;
  height: 20px;
  border: 2px solid white;
  background: linear-gradient(#ff6b5e, #ed332f);
  box-shadow: 0 2px 0 #9f2525;
  font-size: 10px;
  font-weight: 800;
  z-index: 4;
}
.power-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}
.power-btn:active .power-icon {
  box-shadow:
    inset 0 0 0 3px #7ce1ff,
    0 2px 0 #075f94;
}
.power-btn:disabled {
  filter: grayscale(0.75);
  opacity: 0.55;
}
@media (max-height: 640px) {
  .brand {
    margin-top: 0;
  }
  .brand h1 {
    font-size: 42px;
    margin: 8px 0 6px;
  }
  .hero-display {
    margin: 8px 0 4px;
  }
  .hero-display .hero-shelf,
  .hero-shelf {
    height: 72px;
  }
  .game-hud {
    height: 44px;
  }
  .progress-track {
    margin-bottom: 4px;
  }
  .power-row {
    height: 70px;
    gap: 10px;
  }
  .power-btn {
    height: 66px;
    width: 62px;
  }
  .power-btn .power-icon {
    width: 42px;
    height: 42px;
  }
  .power-btn .power-icon img {
    width: 30px;
    height: 30px;
  }
  .power-btn i {
    top: 28px;
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  .power-btn b {
    font-size: 11px;
    line-height: 13px;
  }
  .combo-text {
    top: 40%;
  }
}
@media (max-width: 380px) {
  .home-screen {
    padding-left: 14px;
    padding-right: 14px;
  }
  .power-row {
    gap: 8px;
  }
  .combo-bar {
    display: none;
  }
  }
}
/* Full-screen level-complete celebration — mobile first. */
.modal.open.win-theme {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding: max(10px, var(--safe-top)) 10px max(10px, var(--safe-bottom));
  overflow: hidden;
  backdrop-filter: none;
  background: radial-gradient(
    circle at 50% 38%,
    #4fc3f7 0 22%,
    #29b6f6 48%,
    #0288d1 100%
  );
}
.modal.win-theme::before {
  content: "";
  position: absolute;
  width: min(160vw, 640px);
  height: min(160vw, 640px);
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from -8deg,
    #fff0 0 10deg,
    #fff3 10deg 16deg
  );
  mask-image: radial-gradient(circle, transparent 0 12%, #000 13% 56%, transparent 72%);
  animation: winRays 14s linear infinite;
  pointer-events: none;
}
.modal.win-theme::after {
  content: "";
  position: absolute;
  inset: 6% 8% 28%;
  background:
    radial-gradient(circle at 12% 24%, #ffe35f 0 4px, transparent 5px),
    radial-gradient(circle at 88% 18%, #ff7996 0 5px, transparent 6px),
    radial-gradient(circle at 22% 70%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 76% 62%, #ffe35f 0 4px, transparent 5px),
    radial-gradient(circle at 58% 10%, #fff 0 3px, transparent 4px);
  animation: confettiDrift 2.8s ease-in-out infinite alternate;
  pointer-events: none;
}
.modal.win-theme .modal-card {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 4px 6px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.modal.win-theme .modal-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 22%;
  left: 50%;
  width: min(68vw, 260px);
  height: min(68vw, 260px);
  margin-left: calc(min(68vw, 260px) / -2);
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff8 0 22%, #fff3 23% 45%, transparent 46%),
    repeating-conic-gradient(#fff0 0 8deg, #ffe06888 8deg 12deg, #fff0 12deg 24deg);
  animation: rewardPulse 2s ease-in-out infinite;
  pointer-events: none;
}
.modal.win-theme h2 {
  position: relative;
  z-index: 3;
  order: 1;
  flex: 0 0 auto;
  width: calc(100% - 48px);
  max-width: 340px;
  min-height: 58px;
  margin: 8px 24px 10px;
  padding: 12px 14px;
  display: grid;
  place-items: center;
  border: 4px solid #ff8a96;
  border-radius: 20px;
  background: linear-gradient(#ff6571 0 48%, #ef304a 49% 100%);
  box-shadow:
    inset 0 5px #ff9ba3,
    inset 0 -6px #b91837,
    0 8px 0 #94162e,
    0 14px 16px #07598e55;
  color: #fff;
  font-size: clamp(20px, 6.4vw, 32px);
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-shadow: 0 3px 0 #a71e35;
  text-wrap: balance;
}
.modal.win-theme h2::before,
.modal.win-theme h2::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 12px;
  width: 28px;
  height: 46px;
  background: linear-gradient(#f24d5e, #be1d38);
  box-shadow: 0 6px 0 #85152a;
}
.modal.win-theme h2::before {
  left: -18px;
  clip-path: polygon(0 0, 100% 12%, 84% 100%, 0 87%, 22% 50%);
}
.modal.win-theme h2::after {
  right: -18px;
  clip-path: polygon(0 12%, 100% 0, 78% 50%, 100% 87%, 16% 100%);
}
.modal.win-theme .modal-badge {
  order: 2;
  position: relative;
  flex: 0 1 auto;
  width: min(38vw, 148px);
  height: min(38vw, 148px);
  margin: 6px auto 4px;
  border: 0;
  border-radius: 0;
  background: url("assets/ui/star.webp") center / contain no-repeat;
  box-shadow: none;
  font-size: 0;
  color: transparent;
  filter: drop-shadow(0 10px 0 #087cb0aa) drop-shadow(0 14px 10px #075e8b55);
  animation: starLand 0.7s cubic-bezier(0.2, 1.5, 0.35, 1) both;
}
.modal.win-theme .modal-badge::after {
  content: "";
  position: absolute;
  left: 28%;
  top: 22%;
  width: 22%;
  height: 10%;
  border-radius: 50%;
  background: #fff9;
  transform: rotate(-30deg);
}
.modal.win-theme #modalBody {
  order: 3;
  flex: 0 0 auto;
  margin: 0 0 8px;
  min-height: 0;
  color: transparent;
  font-size: 0;
}
.modal.win-theme .win-stars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 44px;
}
.modal.win-theme .win-star {
  display: block;
  width: 34px;
  height: 34px;
  background: url("assets/ui/star.webp") center / contain no-repeat;
  filter: grayscale(1) brightness(1.4);
  opacity: 0.4;
}
.modal.win-theme .win-star.on {
  filter: drop-shadow(0 3px 0 #c47a18aa);
  opacity: 1;
}
.modal.win-theme .win-star:nth-child(2) {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
}
.modal.win-theme .modal-stats {
  order: 4;
  flex: 0 0 auto;
  width: min(86%, 280px);
  min-width: 0;
  margin: 4px 0 12px;
  padding: 10px 16px;
  border: 2px solid #fff8;
  border-radius: 999px;
  background: #ffffff33;
  color: #fff;
  box-shadow: inset 0 1px #fff6, 0 4px 12px #07588733;
  font-size: clamp(14px, 4.2vw, 17px);
  font-weight: 800;
  text-shadow: 0 1px #075887;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal.win-theme .modal-actions {
  order: 5;
  width: min(88%, 320px);
  margin-top: auto;
  gap: 10px;
  padding-bottom: 4px;
}
.modal.win-theme .modal-actions .game-btn {
  min-height: 52px;
  border: 3px solid #f3ffd8;
  border-radius: 999px;
  background: linear-gradient(#8de933, #42bd19);
  box-shadow: inset 0 5px #c7ff8c, 0 6px 0 #25880c, 0 10px 14px #07588744;
  color: white;
  font-size: clamp(16px, 5vw, 22px);
  text-shadow: 0 2px #25730d;
}
.modal.win-theme .modal-actions .game-btn.tertiary {
  min-height: 48px;
  border-color: #eee6ff;
  background: linear-gradient(#bba2ee, #8769cb);
  box-shadow: inset 0 5px #dacaff, 0 6px 0 #6043a3, 0 10px 14px #07588744;
  text-shadow: 0 2px #5b4093;
}
.modal.win-theme .modal-actions .game-btn:active {
  transform: translateY(4px);
  box-shadow: inset 0 3px #c7ff8c, 0 2px 0 #25880c;
}
@keyframes starLand {
  from {
    opacity: 0;
    transform: translateY(-70px) scale(0.25) rotate(-35deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes rewardPulse {
  50% {
    transform: scale(1.08);
    opacity: 0.78;
  }
}
@keyframes winRays {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
@keyframes confettiDrift {
  to {
    transform: translateY(18px) rotate(2deg);
  }
}
@media (max-height: 700px) {
  .modal.win-theme .modal-badge {
    width: min(32vw, 112px);
    height: min(32vw, 112px);
  }
  .modal.win-theme h2 {
    min-height: 50px;
    margin-top: 4px;
    padding: 10px 12px;
    font-size: clamp(18px, 5.8vw, 26px);
  }
  .modal.win-theme .win-stars {
    height: 36px;
  }
  .modal.win-theme .win-star {
    width: 28px;
    height: 28px;
  }
  .modal.win-theme .win-star:nth-child(2) {
    width: 34px;
    height: 34px;
  }
  .modal.win-theme .modal-stats {
    margin-bottom: 8px;
    padding: 8px 14px;
  }
  .modal.win-theme .modal-actions {
    gap: 8px;
  }
  .modal.win-theme .modal-actions .game-btn {
    min-height: 46px;
  }
  .modal.win-theme .modal-actions .game-btn.tertiary {
    min-height: 44px;
  }
}
@media (max-height: 560px) {
  .modal.win-theme .modal-badge {
    width: 72px;
    height: 72px;
    margin: 0;
  }
  .modal.win-theme .modal-card::before {
    top: 18%;
  }
  .modal.win-theme .win-stars {
    height: 28px;
  }
  .modal.win-theme .modal-actions .game-btn {
    min-height: 40px;
  }
}
@media (max-width: 360px) {
  .modal.win-theme h2 {
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
  }
  .modal.win-theme h2::before,
  .modal.win-theme h2::after {
    width: 22px;
    left: auto;
  }
  .modal.win-theme h2::before {
    left: -14px;
  }
  .modal.win-theme h2::after {
    right: -14px;
    left: auto;
  }
}
/* Language icon and expanded decor shop. */
.language-btn,.sound-btn{position:relative;display:grid;place-items:center}.language-btn img,.sound-btn img{width:34px;height:34px;object-fit:contain;filter:drop-shadow(0 2px 1px #315f8c55)}.language-btn::after,.sound-btn::after{content:attr(data-lang);position:absolute;right:-7px;bottom:-4px;min-width:21px;height:17px;padding:0 3px;display:grid;place-items:center;border:2px solid white;border-radius:9px;background:#7656bd;color:white;font-size:8px;font-weight:1000;line-height:1}.sound-btn::after{content:attr(data-sound)}.sound-btn.muted img{opacity:.55;filter:grayscale(.4) drop-shadow(0 2px 1px #315f8c55)}.sound-btn.muted::after{background:#c46a6a}.home-actions{margin-top:4px;gap:15px}.home-actions .game-btn.primary{min-height:70px}.home-actions .game-btn.tertiary{min-height:61px}
.shop-screen{padding-bottom:calc(12px + var(--safe-bottom))}.shop-scene{min-height:0;margin:10px 0 8px;flex:.82}.shop-options{flex:1.18;min-height:265px;padding:11px;border:3px solid #fff9;border-radius:25px;background:linear-gradient(#fffaf0ee,#f3d8c4ee);box-shadow:0 9px 0 #bd8c7a,0 15px 24px #68412e28}.shop-options-head{height:38px;display:flex;align-items:center;justify-content:space-between;padding:0 5px 7px}.shop-options-head small{font-size:11px;font-weight:1000;letter-spacing:.12em;color:#8c6069}.shop-options-head b{font-size:12px;color:#5e424b}.upgrade-grid{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,minmax(92px,1fr));gap:9px}.decor-option{position:relative;min-width:0;padding:7px 4px 6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:3px solid white;border-radius:18px;background:linear-gradient(#fff,#f1e2d9);box-shadow:0 5px 0 #c9a69a,0 8px 10px #6c453124;transition:transform .15s}.decor-option span{font-size:29px;line-height:34px;filter:drop-shadow(0 3px 2px #5d382533)}.decor-option b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:#593e47}.decor-option i{min-width:54px;padding:3px 7px;border-radius:10px;background:#f5af43;color:white;font-size:10px;font-style:normal;font-weight:1000;box-shadow:inset 0 -2px #c97922}.decor-option:active:not(:disabled){transform:translateY(4px);box-shadow:0 1px 0 #c9a69a}.decor-option.owned{border-color:#a6e2cd;background:linear-gradient(#e7fff6,#bde7d8);box-shadow:0 5px 0 #6fb39c}.decor-option.owned::after{content:"✓";position:absolute;right:5px;top:5px;width:19px;height:19px;display:grid;place-items:center;border-radius:50%;background:#4dbb88;color:white;font-size:11px;font-weight:1000}.decor-option.owned i{background:#55b98e;box-shadow:inset 0 -2px #378668}.shop-decor{max-width:80%;display:flex;flex-wrap:wrap;justify-content:flex-end;line-height:1.05}.shop-window span{font-size:36px}
.shop-screen .shop-scene {
  min-height: 176px;
}
.shop-decor {
  position: absolute;
  inset: 0;
  z-index: 4;
  max-width: none;
  pointer-events: none;
  display: block;
  font-size: 0;
  line-height: 1;
}
.shop-sign {
  position: relative;
  z-index: 5;
  margin: 10px auto 8px;
  width: min(58%, 220px);
  padding: 10px 12px;
  font-size: clamp(15px, 4.6vw, 22px);
}
.scene-prop {
  position: absolute;
  display: block;
  line-height: 1;
  filter: drop-shadow(0 4px 2px #4a281866);
}
.scene-flowers {
  left: 7%;
  top: 46%;
  font-size: clamp(28px, 9vw, 42px);
}
.scene-plant {
  right: 6%;
  top: 44%;
  font-size: clamp(30px, 10vw, 46px);
}
.scene-mascot {
  left: 50%;
  bottom: 10%;
  font-size: clamp(34px, 11vw, 48px);
  transform: translateX(-50%);
}
.scene-balloons {
  right: 8%;
  top: 14%;
  font-size: clamp(28px, 9vw, 40px);
}
.shop-scene.has-lights::after {
  content: "✦   ✦   ✦   ✦   ✦";
  position: absolute;
  z-index: 3;
  left: 10%;
  right: 10%;
  top: 58px;
  text-align: center;
  color: #ffe566;
  font-size: 13px;
  letter-spacing: 0.12em;
  pointer-events: none;
  text-shadow: 0 0 8px #fff8cc, 0 2px 0 #c47a18;
}
.shop-scene.has-awning .awning {
  background: repeating-linear-gradient(
    90deg,
    #ef6b7a 0 46px,
    #fff6d8 46px 92px
  );
}
.nav-icon-btn{display:grid;place-items:center}.nav-icon-btn img{width:29px;height:29px;object-fit:contain;pointer-events:none;filter:drop-shadow(0 2px 1px #563c5844)}#pauseBtn{border:3px solid #e9fbff;background:linear-gradient(145deg,#45d1f4,#138acb);box-shadow:inset 0 4px #8be7fb,0 6px 0 #08669d,0 11px 18px #07588744}#pauseBtn img{width:25px;height:25px;filter:drop-shadow(0 2px 1px #07588799)}#pauseBtn:active{transform:translateY(4px);box-shadow:inset 0 3px #8be7fb,0 2px 0 #08669d}#shopBackBtn img{width:27px;height:27px}
.game-screen .power-row {
  height: 72px;
  gap: 40px;
  justify-content: center;
}
.game-screen .power-btn {
  width: 48px;
  min-width: 48px;
  height: 68px;
  gap: 2px;
  overflow: visible;
}
.game-screen .power-btn b {
  font-size: 10px;
  line-height: 12px;
  white-space: nowrap;
}
.game-screen .power-btn .power-icon {
  width: 42px;
  height: 42px;
  border-width: 4px;
}
.game-screen .power-btn .power-icon img {
  width: 28px;
  height: 28px;
}
.game-screen .power-btn b {
  font-size: 10px;
  line-height: 12px;
}
.game-screen .power-btn i {
  top: 26px;
  width: 18px;
  height: 18px;
  font-size: 10px;
}
.intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px calc(96px + var(--safe-bottom));
  background: #3a24308c;
}
.intro-overlay[hidden] {
  display: none !important;
}
.intro-card {
  width: min(100%, 300px);
  padding: 22px 20px 18px;
  border: 4px solid #fff8;
  border-radius: 30px;
  background: linear-gradient(#fffef9, #f4d7c0);
  text-align: center;
  box-shadow: 0 12px 28px #3a243044;
}
.intro-card small {
  display: block;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.14em;
  color: #c07a5a;
}
.intro-visual {
  margin: 10px 0 4px;
  min-height: 108px;
  display: grid;
  place-items: center;
}
.intro-stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 108px;
}
.intro-cubby {
  position: relative;
  width: 78px;
  height: 92px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  padding: 6px 4px 10px;
  overflow: hidden;
  border: 3px solid #f0b56a;
  border-radius: 12px;
  background: linear-gradient(#6e3518, #4a1c0c);
  box-shadow: inset 0 8px 12px #2a0e0899, 0 2px 0 #ffe0a8;
}
.intro-cubby.is-wide {
  width: 118px;
}
.intro-stage.vis-match .product {
  transform: scale(0.62);
}
.intro-cubby.is-empty::after {
  content: "";
  width: 22px;
  height: 4px;
  margin-bottom: 10px;
  border-radius: 4px;
  background: #f0b56a66;
}
.intro-cubby .product,
.intro-fly .product {
  transform: scale(0.72);
  transform-origin: bottom center;
  flex: 0 0 auto;
}
.intro-fly {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 92px;
  display: grid;
  place-items: end center;
  animation: introDrag 1.35s ease-in-out infinite;
}
.intro-hand {
  position: absolute;
  right: -10px;
  bottom: 6px;
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 3px 0 #61404a33);
  transform: rotate(-18deg);
  pointer-events: none;
}
.intro-pop {
  position: absolute;
  top: 6px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(#ffe373, #ffad45);
  color: #7a3c12;
  font-size: 12px;
  font-weight: 1000;
  box-shadow: 0 3px 0 #c47a18;
  animation: introPop 0.9s ease infinite;
}
.intro-stage.vis-powers {
  align-items: center;
  gap: 14px;
}
.intro-power {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.intro-power i {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 4px solid #087fbd;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 35%, #fff 0 44%, #d9f4ff 46% 58%, #45c5f3 60% 100%);
  box-shadow: inset 0 0 0 2px #7ce1ff, 0 4px 0 #075f94;
}
.intro-power img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.intro-power b {
  font-size: 10px;
  font-weight: 800;
  color: #654f56;
}
@keyframes introDrag {
  0%,
  100% {
    transform: translate(-18px, 8px);
  }
  50% {
    transform: translate(18px, -10px);
  }
}
@keyframes introPop {
  0%,
  100% {
    transform: scale(1) rotate(-8deg);
  }
  50% {
    transform: scale(1.12) rotate(6deg);
  }
}
.intro-card h3 {
  margin: 6px 0 4px;
  font-size: 22px;
  color: #61404a;
  letter-spacing: 0.02em;
}
.intro-card p {
  margin: 0 4px 12px;
  color: #8b6b72;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}
.intro-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.intro-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2c4b4;
  transition: 0.2s width, 0.2s background;
}
.intro-dots i.on {
  width: 18px;
  border-radius: 8px;
  background: #ef7c59;
}
.intro-card .game-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  font-size: 18px;
}
.game-screen.intro-powers .power-row {
  position: relative;
  z-index: 21;
}
.game-screen.intro-powers .power-row::before {
  content: "";
  position: absolute;
  inset: -8px -18px calc(2px + var(--safe-bottom));
  border-radius: 28px;
  background: #fff6e9d4;
  border: 3px solid #fff;
  box-shadow: 0 0 0 5px #fff5, 0 8px 18px #3a243033;
  pointer-events: none;
  animation: introHalo 1.2s ease-in-out infinite;
}
@keyframes introHalo {
  0%,
  100% {
    box-shadow: 0 0 0 4px #fff4, 0 8px 18px #3a243033;
  }
  50% {
    box-shadow: 0 0 0 8px #fff7, 0 8px 18px #3a243033;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
