@font-face {
  font-family: Manrope;
  src: url("/assets/fonts/manrope-cyrillic.woff2") format("woff2");
  font-display: swap;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #edf2e8;
  color: #17201b;
  font:
    16px Manrope,
    system-ui,
    sans-serif;
}
.booster-flight {position:absolute;display:block;z-index:6;pointer-events:none;filter:drop-shadow(0 0 7px #fff4b5);}
.install-area {margin:16px 0;padding:14px;border:1px solid #b9c7a8;border-radius:18px;background:#f7f8f2;}
.install-area button,.save-actions button {padding:12px 16px;min-height:44px;border:1px solid #9bad88;border-radius:12px;background:#e5f0d5;color:#25462e;font-weight:700;}
.install-area button:focus-visible,.save-actions button:focus-visible {outline:3px solid #325b40;outline-offset:3px;}
.install-area p {font-size:13px;line-height:1.4;}
.game-mode-nav {display:flex;gap:8px;justify-content:center;margin:14px 0;}
.game-mode-nav a {padding:10px 16px;background:#f7f8f2;border-radius:14px;color:#294a2f;text-decoration:none;}
.game-mode-nav [aria-current] {background:#325b40;color:#fff;}
.memory-stats {display:flex;justify-content:space-around;text-align:center;gap:10px;}
.memory-stats b {display:block;font-size:24px;}
.memory-intro {text-align:center;font-size:14px;}
.memory-board {display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding:12px;background:#416748;border-radius:22px;}
.memory-orb {position:relative;aspect-ratio:1;border:0;border-radius:50%;background:radial-gradient(circle at 32% 25%,#f1ffc7,#b4d578 40%,#739b44 73%,#466634);box-shadow:inset -3px -5px 8px #25492070,0 4px 0 #25492d;}
.orb-back,.orb-front {position:absolute;inset:0;display:grid;place-items:center;border-radius:50%;}
.orb-back {color:#fff4bb;font-size:32px;text-shadow:0 2px 2px #426829;}
.orb-front {opacity:0;background:radial-gradient(circle at 35% 25%,white,#e9f2d4 65%,#b4c994);}
.orb-front .piece {width:85%;height:85%;}
.revealed .orb-front {opacity:1;animation:orb-reveal .28s ease-out;}
.revealed .orb-back {opacity:0;}
.memory-orb.found {opacity:.75;box-shadow:0 0 0 2px #d5fa65;}
.memory-orb:focus-visible {outline:3px solid white;outline-offset:3px;}
@keyframes orb-reveal {from{transform:rotateY(80deg) scale(.8)}to{transform:rotateY(0) scale(1)}}
@media(prefers-reduced-motion:reduce){.revealed .orb-front{animation:none}}
.save-actions {display:flex;flex-wrap:wrap;justify-content:center;gap:8px;}
.game-card {background:#f7f8f2;border-radius:24px;padding:24px;margin:18px 0;border:1px solid #b9c7a8;}
.game-card h2 {margin-top:0;}.game-card p{line-height:1.6;}.game-card a {display:inline-block;min-height:44px;padding:10px 18px;border-radius:14px;background:#d5fa65;color:#17201b;font-weight:700;}
.booster-flight .piece {width:100%;height:100%;display:block;}
.spinner-flight .piece {animation:spinner-rotor .16s linear infinite;}
.seal-break {position:absolute;inset:0;display:grid;place-items:center;font-size:38px;color:#fff4ac;z-index:4;pointer-events:none;animation:seal-shatter .4s ease-out forwards;}
@keyframes spinner-rotor {to{transform:rotate(360deg)}}
@keyframes seal-shatter {from{transform:scale(.6);opacity:1}to{transform:scale(2.1) rotate(55deg);opacity:0}}
@media(prefers-reduced-motion:reduce){.spinner-flight .piece,.seal-break{animation:none;}.seal-break{display:none}}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a,
a:visited {
  color: #294a2f;
}
a:hover {
  color: #172f1b;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #7752ac;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.flower-app {
  width: 100%;
  max-width: 540px;
  min-height: 100svh;
  margin: auto;
  padding: 14px 18px 24px;
  background:
    linear-gradient(180deg, #eff6e60d 0%, #eff6e600 32%, #edf2e8dd 90%),
    url("/assets/game/flower-garden.webp") center top / 100% auto no-repeat;
  box-shadow: 0 0 80px #284a2c18;
}
.flower-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.flower-header > a {
  font-weight: 900;
  text-decoration: none;
  letter-spacing: 0.06em;
  background: #f4f8e8ed;
  padding: 8px 12px;
  border-radius: 12px;
}
.flower-header > span {
  margin-right: auto;
  background: #f4f8e8dd;
  padding: 5px;
  border-radius: 6px;
  color: #294a2f;
}
.flower-header button {
  border: 2px solid #f5ffe8;
  background: #325b40;
  color: white;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-weight: 800;
  box-shadow: 0 3px 0 #1e3c29;
}
.flower-title {
  text-align: center;
  padding: 18px 0 20px;
  min-height: 170px;
}
.flower-title p {
  font-size: 10px;
  letter-spacing: 0.13em;
  color: #25452a;
  font-weight: 800;
  margin: 0;
  text-shadow: 0 1px 5px white;
}
.flower-title h1 {
  font-size: 38px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 9px 0;
  color: #faffea;
  text-shadow:
    0 3px 0 #325b40,
    2px 0 0 #325b40,
    -2px 0 0 #325b40,
    0 -2px 0 #325b40,
    0 5px 12px #183a2c99;
}
.garden-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #fff9;
  background: #f5f9e8f2;
  border-radius: 14px;
  padding: 10px 13px;
  margin-bottom: 10px;
  box-shadow: 0 3px 0 #8eaa7599;
  font-size: 12px;
}
.garden-strip > div {
  flex: 1;
}
.garden-strip b {
  font-size: 12px;
}
.star {
  color: #b17408;
  font-size: 25px;
  text-shadow: 0 1px #ffe99f;
}
.garden-track {
  height: 5px;
  border-radius: 10px;
  background: #d4dfc7;
  margin-top: 7px;
  overflow: hidden;
}
.garden-track i {
  display: block;
  height: 100%;
  background: #537c36;
  border-radius: 10px;
  transition: width 0.4s;
}
.game-shell {
  position: relative;
  padding: 12px;
  background: linear-gradient(#fbfdf1, #e9f0df);
  border: 2px solid #fbffed;
  border-radius: 24px;
  box-shadow:
    0 6px 0 #648052,
    0 12px 24px #243e3230;
}
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 3px 10px;
}
.level-badge {
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #43613d;
}
.level-badge b {
  display: block;
  font-size: 29px;
  color: #24452b;
  letter-spacing: 0;
}
.move-badge {
  display: flex;
  align-items: center;
  flex-direction: column;
  background: linear-gradient(#527d56, #2c553c);
  color: white;
  min-width: 70px;
  padding: 5px 16px;
  border: 2px solid #c0d39f;
  border-radius: 15px;
  box-shadow: 0 3px 0 #23452e;
}
.move-badge b {
  font-size: 28px;
  line-height: 1.05;
}
.move-badge span {
  font-size: 11px;
}
.task-label {
  font-size: 12px;
  text-align: right;
  color: #36533a;
  font-weight: 700;
}
.targets {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}
.target-guide { margin: 0 14px 12px; font-size: 13px; line-height: 1.4; color: #325b40; text-align: center; }
button.grass-target { font: inherit; cursor: pointer; color: #17201b; }
button.grass-target:focus-visible { outline: 3px solid #325b40; outline-offset: 2px; }
.target {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #fffdf2;
  border: 1px solid #d8dfc4;
  border-radius: 14px;
  padding: 4px 9px;
  min-width: 100px;
}
.target svg {
  width: 39px;
  height: 39px;
}
.target b {
  font-size: 14px;
  white-space: nowrap;
}
.target small {
  display: block;
  font-size: 10px;
  color: #4c6248;
}
.target i {
  font-style: normal;
  color: #325b40;
}
.grass-target > span:first-child {
  font-size: 30px;
  color: #48762c;
}
.board-frame {
  padding: 7px;
  background: linear-gradient(#608369, #2d5840);
  border-radius: 18px;
  border: 2px solid #dbe8c5;
  box-shadow:
    inset 0 2px 5px #12352466,
    0 3px 0 #a5b98d;
}
.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  touch-action: none;
  user-select: none;
}
.tile {
  aspect-ratio: 1;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(145deg, #f9fbe8, #dceac9);
  box-shadow:
    inset 0 1px 1px #ffffffdd,
    0 2px 1px #1b422a66;
  padding: 0;
  position: relative;
  min-width: 0;
}
.tile:nth-child(even) {
  background: linear-gradient(145deg, #e7f1d8, #c5dbb3);
}
.tile svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 1px #27432c33);
  pointer-events: none;
}
.tile.grass {
  background: repeating-linear-gradient(135deg, #80ae55 0 5px, #8bbd60 5px 9px);
  box-shadow: inset 0 0 0 2px #527d37;
}
.board[data-theme="magic"] .tile.grass {
  background: radial-gradient(circle at 35% 25%, #d1b4f1, #9967c4 60%, #68408e);
  box-shadow: inset 0 0 0 2px #e6ceff, inset 0 0 0 4px #795397;
}
.board[data-theme="magic"] .tile.grass::after {
  content: "✧"; position: absolute; right: 3px; bottom: 1px; color: #fff3bd;
  font-size: 17px; font-weight: bold; text-shadow: 0 1px 2px #492063;
  pointer-events: none;
}
.tile.selected {
  outline: 3px solid #fff6a2;
  outline-offset: -2px;
  z-index: 1;
  filter: brightness(1.1);
}
.tile.hinted {
  outline: 3px solid #fff6a2;
  outline-offset: -2px;
}
.flower-message {
  font-size: 12px;
  line-height: 1.5;
  min-height: 36px;
  text-align: center;
  margin: 13px 3px 8px;
  color: #35513b;
}
.play-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.play-actions button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #b7cb9b;
  background: linear-gradient(#faffef, #dcecc7);
  border-radius: 12px;
  padding: 10px 13px;
  color: #294a2f;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 3px 0 #aec392;
}
.play-actions button > span {
  font-size: 22px;
  line-height: 1;
}
.primary {
  background: linear-gradient(#e2ff8e, #c4ed59);
  color: #20391f;
  border: 1px solid #a6c74d;
  border-radius: 12px;
  padding: 13px 20px;
  font-weight: 800;
  box-shadow: 0 3px 0 #8da83c;
}
.result {
  text-align: center;
  padding: 8px 4px 15px;
}
.result h2 {
  font-size: 24px;
  margin: 7px 0;
}
.result p {
  font-size: 14px;
  line-height: 1.5;
}
.flower-footer {
  text-align: center;
  font-size: 11px;
  margin-top: 22px;
  color: #294a2f;
}
.flower-footer p {
  margin: 6px;
}
.flower-footer > a {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}
.text-button {
  border: 0;
  background: none;
  text-decoration: underline;
  color: #294a2f;
  font-size: 11px;
  padding: 8px;
}
dialog {
  max-width: min(480px, 92vw);
  border: 2px solid #e0ebc6;
  border-radius: 22px;
  background: #f7faef;
  color: #17201b;
  padding: 24px;
  box-shadow: 0 12px 40px #17201b55;
}
dialog::backdrop {
  background: #172b20aa;
}
dialog p {
  font-size: 15px;
  line-height: 1.6;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dialog-actions button {
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #9caf84;
}
@media (min-width: 700px) {
  .flower-app {
    margin: 20px auto;
    border-radius: 30px;
    min-height: 0;
  }
  .flower-title {
    min-height: 200px;
  }
  .flower-title h1 {
    font-size: 44px;
  }
}
@media (max-width: 370px) {
  .flower-app {
    padding: 10px;
  }
  .flower-header > span {
    font-size: 10px;
  }
  .flower-title {
    min-height: 145px;
    padding: 14px 0;
  }
  .flower-title h1 {
    font-size: 33px;
  }
  .game-shell {
    padding: 9px;
  }
  .target {
    padding: 3px 5px;
    min-width: 85px;
  }
  .target svg {
    width: 30px;
  }
  .targets {
    gap: 4px;
  }
  .board {
    gap: 2px;
  }
  .board-frame {
    padding: 5px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .tile.bloom {
    animation: bloom 0.22s ease-in forwards;
  }
  .tile.hinted svg {
    animation: hint 1s ease-in-out infinite;
  }
  @keyframes bloom {
    50% {
      transform: scale(1.2);
      filter: brightness(1.4);
    }
    100% {
      transform: scale(0.2);
      opacity: 0;
    }
  }
  @keyframes hint {
    50% {
      transform: scale(0.88) rotate(-8deg);
    }
  }
}
/* Persistent power-ups, selectable themes and visible movement. */
.theme-picker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #f4f9e9f0;
  border: 1px solid #d1dfbd;
  border-radius: 12px;
  margin: 12px 0;
  padding: 8px 12px;
  color: #294a2f;
  font-size: 13px;
  font-weight: 700;
}
.theme-picker select {
  appearance: none;
  font: inherit;
  color: #294a2f;
  background: #fffdf2;
  border: 1px solid #a6bc92;
  border-radius: 8px;
  padding: 8px 26px 8px 10px;
  max-width: 75%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23294a2f' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.theme-picker select:focus-visible {
  outline: 3px solid #7752ac;
  outline-offset: 3px;
}
.piece {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  will-change: transform;
}
.sprite {
  background-image: url("/assets/game/flower-pieces-v3.webp");
  background-size: 300% 300%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 3px 1px #173e3255);
}
.magic-sprite {
  background-image: url("/assets/game/magic-pieces-v3.webp");
}
.sprite-0 {
  background-position: 0% 0%;
}
.sprite-1 {
  background-position: 50% 0%;
}
.sprite-2 {
  background-position: 100% 0%;
}
.sprite-3 {
  background-position: 0% 50%;
}
.sprite-4 {
  background-position: 50% 50%;
}
.sprite-5 {
  background-position: 100% 50%;
}
.sprite-6 {
  background-position: 0% 100%;
}
.sprite-7 {
  background-position: 50% 100%;
}
.sprite-8 {
  background-position: 100% 100%;
}
.piece.vertical {
  rotate: 90deg;
}
.target > .piece {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.board-frame {
  position: relative;
  overflow: hidden;
}
.tile {
  overflow: visible;
  isolation: auto;
}
.tile .piece {
  position: relative;
  z-index: 2;
  transform-origin: center;
}
.tile.selected .piece {
  filter: drop-shadow(0 3px 3px #eabf38) brightness(1.12);
}
.tile.power-tile {
  background: radial-gradient(ellipse at 35% 20%, #fffbd2, #deecb5 65%, #b4cd8e);
}
.tile.matching {
  box-shadow:
    inset 0 0 0 2px #fff8a8,
    0 0 12px #fff29e;
  z-index: 3;
}
.effects {
  position: absolute;
  inset: 7px;
  pointer-events: none;
  z-index: 10;
  overflow: visible;
}
.petal-particle {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 70% 30% 70% 30%;
  box-shadow: 0 0 5px #fff;
  pointer-events: none;
}
.power-wave {
  position: absolute;
  pointer-events: none;
}
.line-wave {
  width: 800px;
  height: 16px;
  border-radius: 100%;
  background: linear-gradient(transparent, #f5ffb6, white, #f5ffb6, transparent);
  box-shadow: 0 0 15px #e8ff81;
}
.circle-wave {
  width: 230px;
  height: 230px;
  border: 12px solid #fff0a1;
  border-radius: 50%;
  box-shadow:
    0 0 25px #fff6af,
    inset 0 0 25px #fff6af;
}
.collect-flight {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
}
.result {
  max-width: min(420px, 90vw);
  text-align: center;
  padding: 26px;
  border: 3px solid #edf8ce;
  background: radial-gradient(ellipse at top, #fffde7, #edf5df);
  box-shadow:
    0 10px 0 #567744,
    0 30px 70px #172b2088;
}
.result::backdrop {
  background: #153222b3;
  backdrop-filter: blur(3px);
}
.result h2 {
  font-size: 28px;
  color: #2b5033;
  margin: 12px 0;
}
.result p {
  font-size: 16px;
  line-height: 1.6;
}
.result .primary {
  width: 100%;
  margin-top: 10px;
}
.victory-star {
  font-size: 68px;
  line-height: 1;
  color: #e8b02a;
  text-shadow:
    0 3px 0 #9b720e,
    0 0 25px #fff39f;
}
.flower-message {
  min-height: 48px;
  font-size: 13px;
}
.tile.bloom {
  animation: none !important;
}
@media (prefers-reduced-motion: no-preference) {
  .tile.bloom .piece {
    animation: piece-pop 0.3s ease-in forwards;
  }
  .tile.born-power .piece {
    animation: power-birth 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.5);
  }
  .tile.hinted .piece {
    animation: hint 1s ease-in-out infinite;
  }
  @keyframes piece-pop {
    0% {
      transform: scale(1);
      filter: brightness(1);
    }
    35% {
      transform: scale(1.23);
      filter: brightness(1.5);
    }
    100% {
      transform: scale(0.05);
      opacity: 0;
      filter: brightness(2);
    }
  }
  @keyframes power-birth {
    0% {
      transform: scale(0.15);
      filter: brightness(2);
    }
    65% {
      transform: scale(1.25);
      filter: brightness(1.4);
    }
    100% {
      transform: scale(1);
    }
  }
}

.welding-piece{background-position:center;background-size:contain;background-repeat:no-repeat;filter:drop-shadow(0 3px 2px #183e4055)}
.welding-0{background-image:url(/assets/game/welding-3d-0.webp)}
.welding-1{background-image:url(/assets/game/welding-3d-1.webp)}
.welding-2{background-image:url(/assets/game/welding-3d-2.webp)}
.welding-3{background-image:url(/assets/game/welding-electrodes-v1.webp)}
.welding-4{background-image:url(/assets/game/welding-3d-4.webp)}

.difficulty-badge{display:inline-block;font-size:11px;font-weight:800;padding:5px 8px;border-radius:12px;color:#234735;background:#e0f2c7;max-width:110px;text-align:center}
.difficulty-badge.normal{background:#e6edf1;color:#304b5c}.difficulty-badge.hard{background:#ffdfa8;color:#643800}.difficulty-badge.expert{background:#eedcfb;color:#5b247d}
.game-top{flex-wrap:wrap}

.shop-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:12px 0;padding:10px 16px;border-radius:18px;background:#fff7dc;color:#513917;box-shadow:0 3px 0 #31593222}.shop-bar button{min-height:44px;border:1px solid #889b65;border-radius:14px;background:#e5f2ce;color:#28432b;padding:8px 18px;font-weight:800}
#game-shop{max-width:440px;width:calc(100% - 24px);max-height:85dvh;overflow:auto;border:2px solid #93ab76;border-radius:24px;background:#fbfff0;color:#24452b;padding:22px}#game-shop::backdrop{background:#142c27aa}.shop-guide{font-size:13px;line-height:1.5}.shop-item{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;padding:14px 0;border-top:1px solid #d0ddbd}.shop-item small{display:block;font-size:12px;line-height:1.4;margin-top:5px}.shop-item button,#result-shop{min-height:44px;padding:10px;border:1px solid #93ab76;border-radius:12px;background:#e5f2ce;color:#24452b;font-weight:700}.shop-item button:disabled{opacity:.55}#result-shop{margin-top:12px}

.targets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch;gap:7px}.target{min-width:0;max-width:100%;padding:6px;justify-content:flex-start}.target>span:not(.piece){min-width:0}.target small{overflow-wrap:anywhere}.target>.piece{width:36px;height:36px}.target-guide{margin:0 2px 10px;font-size:12px}
.world-button{display:block;width:100%;min-height:44px;border:1px solid #93ab76;border-radius:14px;background:#f5f9e9;color:#25462e;font-weight:800;margin:8px 0;padding:10px}.world-mission{font-size:12px;line-height:1.45;background:#f0f5e4;border-radius:12px;padding:10px;margin:8px 0;color:#345037}
#world-dialog{width:calc(100% - 24px);max-width:480px;max-height:85dvh;overflow:auto;border:2px solid #93ab76;border-radius:24px;background:#fbfff0;color:#24452b;padding:20px}#world-dialog::backdrop{background:#142c27aa}#world-dialog>p{font-size:13px;line-height:1.5}.world-project{display:flex;gap:12px;padding:14px 0;border-top:1px solid #d1dfc0}.world-object{font-size:40px;filter:grayscale(1);opacity:.5}.world-project.built .world-object{filter:none;opacity:1}.world-project small{display:block;font-size:12px;line-height:1.4;margin:6px 0}.world-project button{min-height:44px;border:1px solid #93ab76;border-radius:12px;background:#e6f3d2;color:#25462e;padding:8px;font-weight:700}.world-project button:disabled{opacity:.6}

.spinner-controls{margin:12px 0;padding:12px;background:#fff3cc;color:#493814;border:1px solid #d7b75a;border-radius:14px}.spinner-controls[hidden]{display:none}.spinner-controls p{font-size:12px;line-height:1.5;margin:0 0 8px}.spinner-controls button{min-height:44px;border:1px solid #8b9c61;border-radius:12px;background:#e1f3c9;color:#25452b;padding:8px;margin:3px;font-weight:700}.spinner-target{outline:3px solid #ffb832!important;outline-offset:-3px;z-index:3}.spinner-target::after{content:'⌖';position:absolute;inset:0;display:grid;place-items:center;font-size:36px;color:#713e00;text-shadow:0 1px white;pointer-events:none;z-index:4}.aim-route{position:absolute;height:0;border-top:3px dashed #ffce47;transform-origin:0 0;filter:drop-shadow(0 1px 1px #4d381e);pointer-events:none;z-index:8}.bomb-shock{position:absolute;border:7px solid #ffcb53;border-radius:50%;background:radial-gradient(circle,#fff4ba99,transparent 65%);box-shadow:0 0 18px #ffbd49;pointer-events:none}.rocket-flight::after{content:'';position:absolute;z-index:-1;width:150%;height:30%;top:35%;right:40%;background:linear-gradient(90deg,transparent,#ffe17d,#fffbd7);border-radius:50%;filter:blur(2px)}.rocket-flight[data-direction="-1"]::after{right:auto;left:40%;transform:rotate(180deg)}.rocket-vertical::after{transform:rotate(90deg);transform-origin:right center}.spinner-flight{filter:drop-shadow(0 0 9px #ffec91)}

.cake-piece{background-position:center;background-size:contain;background-repeat:no-repeat;filter:drop-shadow(0 2px 2px #28402c44)}
.has-game-tabs{padding-bottom:calc(80px + env(safe-area-inset-bottom))}.game-bottom-tabs{position:fixed;bottom:0;left:50%;transform:translateX(-50%);z-index:90;width:100%;max-width:520px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:8px 6px calc(8px + env(safe-area-inset-bottom));background:#fbfff4f7;border-top:1px solid #b3c49d;box-shadow:0 -4px 20px #24482c22;backdrop-filter:blur(10px)}.game-bottom-tabs a{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:48px;gap:2px;color:#345237;font-size:11px;text-decoration:none;border-radius:12px;font-weight:800}.game-bottom-tabs a span{font-size:22px}.game-bottom-tabs a[aria-current]{background:#d7edb8;color:#203e24}.game-bottom-tabs a:focus-visible{outline:3px solid #325b40}
.sudoku-app .flower-title{min-height:130px}.sudoku-grid{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));border:2px solid #325b40;border-radius:5px;overflow:hidden}.sudoku-cell{aspect-ratio:1;border:0;border-right:1px solid #c5d2bd;border-bottom:1px solid #c5d2bd;border-radius:0;padding:0;background:#fffef5;color:#1f62a3;font-size:clamp(16px,5vw,25px);min-width:0;min-height:0}.sudoku-cell.given{font-weight:800;color:#263e2c;background:#edf3e5}.sudoku-cell.selected{background:#d8edb5;box-shadow:inset 0 0 0 2px #497943}.sudoku-cell.conflict{color:#a62b22;background:#ffe7dd}.sudoku-cell.block-right{border-right:2px solid #325b40}.sudoku-cell.block-bottom{border-bottom:2px solid #325b40}.sudoku-numbers{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:3px;margin:14px 0}.sudoku-numbers button{padding:0;min-width:0;min-height:44px;border:1px solid #9caf83;border-radius:8px;background:#e8f5d6;color:#25462d;font-size:21px;font-weight:700}.sudoku-actions{display:flex;flex-wrap:wrap;gap:8px}.sudoku-actions button{min-height:44px;border:1px solid #9caf83;border-radius:10px;background:#edf5df;color:#25462d;padding:8px}.sudoku-app .game-shell>p{font-size:13px;line-height:1.5}#sudoku-status{min-height:40px}
.cake-0{background-image:url(/assets/game/cake-0.webp)}
.cake-1{background-image:url(/assets/game/cake-1.webp)}
.cake-2{background-image:url(/assets/game/cake-2.webp)}
.cake-3{background-image:url(/assets/game/cake-3.webp)}
.cake-4{background-image:url(/assets/game/cake-4.webp)}

.game-bottom-tabs button{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:48px;gap:2px;color:#345237;font-size:11px;border:0;background:transparent;border-radius:12px;font-weight:800}.game-bottom-tabs button span{font-size:22px}.game-bottom-tabs button[aria-current]{background:#d7edb8;color:#203e24}
.immersive-play{height:100dvh;overflow:hidden;padding:0}.immersive-play .flower-app{height:calc(100dvh - 66px - env(safe-area-inset-bottom));min-height:0;padding:8px 10px;display:flex;flex-direction:column;gap:6px}.immersive-play .flower-header{min-height:36px;flex-shrink:0;gap:8px}.immersive-play .flower-header>a,.immersive-play .flower-header>span{display:none}.compact-game-name{font-size:17px;line-height:1.1;color:#23462d;background:#f8ffebeb;padding:7px 10px;border-radius:12px}.immersive-play .flower-header #help{order:2;margin-left:auto}.immersive-play .flower-title,.immersive-play .garden-strip,.immersive-play #open-world,.immersive-play .game-mode-nav,.immersive-play .shop-bar{display:none}.immersive-play .game-shell{flex:1;min-height:0;margin:0;padding:8px 10px;display:flex;flex-direction:column;align-items:stretch;border-radius:18px;box-shadow:none}.immersive-play .game-top{gap:6px;margin:0 0 4px;flex-wrap:nowrap}.immersive-play .level-badge b{font-size:22px}.immersive-play .move-badge{min-width:50px;padding:3px 9px}.immersive-play .move-badge b{font-size:25px}.immersive-play .task-label{font-size:11px}.immersive-play #world-mission{display:none}.immersive-play .targets{margin:4px 0;gap:4px}.immersive-play .target{padding:3px 5px;border-radius:10px}.immersive-play .target>.piece{width:27px;height:27px}.immersive-play .target small{font-size:9px}.immersive-play .target b{font-size:12px}.immersive-play #grass-guide{font-size:10px;line-height:1.2;margin:3px 0 5px;max-height:36px;overflow:hidden}.immersive-play .board-frame{align-self:center;flex-shrink:0;padding:5px;border-radius:14px;max-width:100%}.immersive-play .flower-message{font-size:11px;line-height:1.2;min-height:0;max-height:28px;overflow:hidden;margin:5px 0}.immersive-play .play-actions{margin:3px 0;gap:6px}.immersive-play .play-actions button{min-height:36px;padding:5px;font-size:12px}.immersive-play .play-actions button>span{font-size:17px}.immersive-play .spinner-controls{padding:5px;margin:4px 0}.immersive-play .spinner-controls p{font-size:10px;line-height:1.15;margin:0 0 3px}.immersive-play .spinner-controls button{min-height:32px;font-size:11px;padding:5px;margin:1px}.immersive-play.panel-open .game-shell{visibility:hidden}
.immersive-play .tab-panel{position:fixed;inset:52px 0 calc(72px + env(safe-area-inset-bottom));width:calc(100% - 20px);max-width:500px;height:auto;max-height:none;margin:0 auto;overflow:auto;border:1px solid #a4b78e;border-radius:18px;background:#fbfff0;color:#24452b;padding:18px;z-index:80}.immersive-play .tab-panel:not([open]){display:none}.immersive-play .tab-panel h2{margin:0 0 12px}.immersive-play .tab-panel .flower-footer{display:block;margin:0;padding:0}.more-games{display:grid;gap:8px}.more-games a{min-height:44px;padding:12px;border-radius:12px;background:#e6f2d7;color:#28482f;text-decoration:none}.immersive-play .tab-panel .theme-picker{display:flex;margin:0}.immersive-play .tab-panel .install-area{margin:10px 0}
/* Compact goals reserve the phone viewport for large, readable game pieces. */
.immersive-play .flower-app{padding:6px;gap:4px}
.immersive-play .game-shell{padding:6px;justify-content:flex-start}
.immersive-play .task-label{display:none}
.immersive-play .game-top{min-height:46px;align-items:center}
.immersive-play .targets{display:flex;gap:4px;margin:3px 0 6px}
.immersive-play .target{flex:1;position:relative;display:flex;flex-direction:column;justify-content:center;gap:1px;padding:3px 2px;min-height:57px}
.immersive-play .target>.piece{width:30px;height:30px;flex-shrink:0}
.immersive-play .target b{font-size:13px;white-space:nowrap;line-height:1.2}
.immersive-play .target small,.immersive-play #grass-guide{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.immersive-play .grass-target>span:first-child{font-size:27px;line-height:30px}
.immersive-play .target>i{position:absolute;right:2px;top:1px;font-size:13px}
.immersive-play .board-frame{margin:auto 0;padding:4px}
.immersive-play .board{gap:2px}
.immersive-play .tile .piece{width:100%;height:100%}
.immersive-play .flower-message{flex-shrink:0;height:28px;max-height:28px;margin:4px 0;font-size:11px}
.immersive-play .play-actions{flex-shrink:0}
.immersive-play .spinner-controls{flex-shrink:0}
/* Storybook screens: the same green world, with sculpted frames and a separate lobby. */
.storybook-game .game-bottom-tabs{grid-template-columns:repeat(5,minmax(0,1fr));background:linear-gradient(#63864b,#244b36);border-top:3px solid #d8bb65;box-shadow:0 -3px 0 #315537}
.storybook-game .game-bottom-tabs button{color:#fff7d4;text-shadow:0 1px #183a27;font-size:10px;border-radius:13px}
.storybook-game .game-bottom-tabs button[aria-current]{color:#fffde4;background:linear-gradient(#a8c553,#467d36);box-shadow:inset 0 2px #eff5a5,0 3px #193f27;border:1px solid #e4cd73}
.storybook-game .game-shell{background:linear-gradient(#eaf5dbe8,#b9d4aa90);border:0;box-shadow:none}
.storybook-hud{flex-shrink:0;display:grid;grid-template-columns:43px minmax(0,1fr) 51px;align-items:center;gap:5px;min-height:83px;padding:5px;border:2px solid #dfc573;border-radius:21px;background:linear-gradient(#5d8451,#254c39);box-shadow:inset 0 2px #c6d7a1,0 4px #163d2d,0 6px 8px #213d2933}
.storybook-hud .game-top{display:contents}.storybook-hud .level-badge,.storybook-hud .difficulty-badge{display:none}
.storybook-hud .difficulty-badge{display:block;grid-column:1/-1;grid-row:2;justify-self:center;max-width:none;padding:3px 12px;font-size:12px;line-height:16px}
.storybook-hud .level-medal{grid-column:1;grid-row:1;text-align:center;color:#fff7cf;font-size:22px;line-height:1;text-shadow:0 2px #24432c}
.level-medal .piece{width:36px;height:36px;margin:auto}
.storybook-hud .targets{grid-column:2;grid-row:1;align-items:center;position:relative;background:#fff9e4;border:2px solid #c9bb90;border-radius:14px;padding:12px 2px 2px;margin:0;gap:0;min-height:65px}
.storybook-hud .targets:before{content:'Цели';position:absolute;left:50%;top:-9px;transform:translateX(-50%);padding:1px 12px;border-radius:7px;background:#426943;border:1px solid #e1c66c;color:#fff7d2;font-size:11px;font-weight:800;line-height:16px}
.storybook-hud .target{border:0;background:none;box-shadow:none;padding:0;min-height:47px;gap:0}
.storybook-hud .target>.piece{width:29px;height:29px}.storybook-hud .target b{font-size:11px;letter-spacing:-.5px}
.storybook-hud .move-badge{grid-column:3;grid-row:1;min-width:0;padding:5px 1px;background:#fff9e4;color:#294a32;border:2px solid #d2bb75;border-radius:14px;box-shadow:0 2px #183d29;text-align:center;display:flex;flex-direction:column-reverse}
.storybook-hud .move-badge b{font-size:29px;text-shadow:0 1px #c3b57e}.storybook-hud .move-badge span{font-size:10px}
.storybook-game .board-frame{border:2px solid #d9c478;background:linear-gradient(#72936d,#325b42);box-shadow:inset 0 2px #e3f4cc,0 4px #274b33,0 7px 10px #24402f44;border-radius:12px;padding:3px}
.storybook-game .tile{border-radius:6px;background:linear-gradient(135deg,#ecf4d5,#c6dbaf);box-shadow:inset 0 1px #fcffe8,0 1px #54724a}
.storybook-game .tile:nth-child(even){background:linear-gradient(135deg,#cddfb4,#b3cd9c)}
.storybook-game .play-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:3px 0 5px}
.storybook-game .play-actions button{display:flex;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:44px;padding:4px 2px;border:2px solid #cfba70;border-radius:14px;background:linear-gradient(#b9d977,#6c9e46);color:#173d2a;font-size:10px;font-weight:800;box-shadow:inset 0 2px #effbc0,0 3px #335c32}
.storybook-game .play-actions button>.piece{width:31px;height:31px;flex-shrink:0}.storybook-game .play-actions button>span:not(.piece){font-size:25px}
.storybook-game .valley-home{position:fixed;inset:0 0 calc(67px + env(safe-area-inset-bottom));width:100%;max-width:520px;height:auto;max-height:none;margin:0 auto;padding:16px;border:0;background:linear-gradient(#26472e22,transparent 45%,#163c2ab3),url('/assets/game/flower-garden.webp') center/cover;color:#fff9dc;z-index:85;overflow:hidden;flex-direction:column}
.storybook-game .valley-home[open]{display:flex}.valley-wallet{display:flex;align-items:center;gap:10px;padding:8px;border:2px solid #d3ba61;border-radius:18px;background:linear-gradient(#63864b,#2d543b);box-shadow:0 4px #23432c}
.valley-wallet>span{flex:1;background:#fff7d9;color:#4a4125;padding:7px;border-radius:12px;font-size:18px;font-weight:800;text-align:center;box-shadow:inset 0 2px #b2a782}.valley-wallet button{width:40px;height:40px;border:2px solid #d9be65;border-radius:50%;background:#eff6cb;color:#285039;font-size:24px}
.valley-home h1{font-size:clamp(30px,9vw,43px);line-height:1.05;text-align:center;margin:25px 0 6px;color:#fff9d9;text-shadow:0 3px #264b32,2px 0 #264b32,-2px 0 #264b32,0 -1px #264b32}
.valley-subtitle{text-align:center;font-size:13px;font-weight:800;text-shadow:0 2px 3px #173c24;margin:4px 0}
.valley-destinations{display:flex;justify-content:space-between;margin-top:25px}.valley-destinations button{display:flex;flex-direction:column;align-items:center;gap:2px;width:82px;min-height:80px;border:2px solid #dfc56e;border-radius:20px;background:linear-gradient(#ecf7c7,#79a052);color:#24432d;font-size:11px;font-weight:800;box-shadow:inset 0 2px white,0 4px #315c32}.valley-destinations button>span{width:49px;height:49px;font-size:40px}
.valley-start{margin-top:auto;text-align:center;padding-bottom:14px}.valley-start>p{font-size:13px;font-weight:800;text-shadow:0 2px 3px #193a27}
.storybook-primary{display:block;width:min(100%,280px);margin:0 auto;min-height:74px;padding:10px 18px;border:4px solid #e5cc71;border-radius:23px;background:linear-gradient(#d4f38a 0%,#9dd24c 12%,#5c9e32 85%,#376d2a);box-shadow:inset 0 3px #f2ffc5,0 5px #264f2b,0 7px #d1b25b;color:#fffbe0;text-shadow:0 2px #315c2b;font:800 30px/1.1 Manrope,sans-serif;cursor:pointer}.storybook-primary small{display:block;font-size:16px;margin-top:4px}
#level-preview{width:calc(100% - 30px);max-width:390px;max-height:90dvh;overflow:auto;padding:20px 14px 24px;border:5px solid #dbc16a;border-radius:30px;background:linear-gradient(#64844c,#294e39);box-shadow:inset 0 0 0 3px #92a865,0 8px #6e7136;color:#fff7dc;text-align:center}
#level-preview::backdrop{background:#112b25c7}#level-preview h2{font-size:34px;color:#fff9dc;text-shadow:0 3px #244331;margin:8px 0 20px}.preview-close{position:absolute;right:7px;top:6px;width:38px;height:38px;border:2px solid #e2cb79;border-radius:50%;background:#426c42;color:#fff7d2;font-size:27px}
.preview-paper{padding:12px;background:#fff8e1;color:#2a4a32;border:3px solid #c3b582;border-radius:21px;margin-bottom:18px}.preview-paper h3{margin:9px 0;font-size:18px}.preview-paper>p{margin:4px 0;font-size:12px}.preview-paper .targets{justify-content:center}.preview-paper .target{background:none;border:0}.preview-paper .target small{position:static;clip-path:none;width:auto;height:auto;margin:0;white-space:normal;font-size:9px}.preview-paper .target b{font-size:13px}.preview-boosters{display:grid;grid-template-columns:repeat(3,1fr);width:100%;padding:8px;border:2px solid #a6bc7b;border-radius:15px;background:#dcefc0;color:#2b4b30;margin-top:10px}.preview-boosters .piece{width:48px;height:48px;margin:auto}.preview-boosters b{grid-column:1/-1;font-size:12px;margin-top:5px}
@media(max-height:620px){.valley-home h1{margin-top:15px;font-size:30px}.valley-destinations{margin-top:12px}.valley-start{padding-bottom:6px}.storybook-game .flower-message{height:24px;font-size:10px}.storybook-hud{min-height:73px}.storybook-hud .targets{min-height:59px}.storybook-game .compact-game-name{font-size:15px}.storybook-game .flower-header{min-height:32px}}
.storybook-game #result{width:calc(100% - 28px);max-width:390px;max-height:92dvh;overflow:auto;padding:18px 15px 23px;border:5px solid #dfc46b;border-radius:30px;background:linear-gradient(#60834c,#294e38);color:#fff7dd;box-shadow:inset 0 0 0 3px #92a765,0 7px #7f783b;text-align:center}
.storybook-game #result::backdrop{background:#071c24df}.storybook-game #result .victory-star{display:none}
.storybook-game #result .result-level{margin:-2px 0 14px;padding:10px;border:2px solid #e8d181;border-radius:16px;background:linear-gradient(#466e43,#244d37);color:#fff6d5;font-size:28px;font-weight:800;text-shadow:0 2px #203d2b;line-height:1.1}
.storybook-game #result h2{font-size:32px;line-height:1.1;color:#fff4c5;text-shadow:0 3px #274531;margin:12px 0}
.storybook-game .result-rewards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0;padding:12px 5px;background:radial-gradient(ellipse,#d5ef8d55,transparent 70%)}
.storybook-game .result-rewards[hidden]{display:none}.result-rewards>div{display:flex;flex-direction:column;align-items:center}.result-rewards .piece{width:85px;height:85px;filter:drop-shadow(0 5px 5px #193b2855)}.result-rewards b{font-size:36px;line-height:1.1;color:#fff7db;text-shadow:0 2px #26462c}.result-rewards small{font-size:11px;margin-top:4px;color:#fff3c5}.reward-coin{display:grid;place-items:center;width:76px;height:76px;margin:4px;border:5px solid #e5a620;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff3a1,#f5c039 60%,#d98d1e);box-shadow:inset 0 0 0 3px #ffdf73,0 5px #947225,0 0 25px #ffe88f66;color:#a76c1d;font-size:42px;text-shadow:0 2px #fff1a8}
.storybook-game #result-copy{font-size:12px;line-height:1.45;color:#fff9df;margin:10px 0 14px}
.storybook-game #result #next{min-height:59px;border:3px solid #e4c769;border-radius:18px;background:linear-gradient(#c5eb72,#629e35);box-shadow:inset 0 2px #f3ffbf,0 4px #224e2c;color:#fffbe0;text-shadow:0 2px #35592b;font-size:21px;font-weight:800;margin:4px 0 10px}
.storybook-game #result-world,.storybook-game #result-shop{background:#f6efcc;border:2px solid #d4bd70;color:#2b4b32;border-radius:13px;font-size:12px;margin:8px 0 0;min-height:40px}
@media(max-height:620px){.storybook-game #result{padding:12px;max-height:95dvh}.storybook-game #result h2{font-size:26px;margin:8px 0}.storybook-game #result .result-level{font-size:23px;padding:6px;margin-bottom:8px}.storybook-game .result-rewards{margin:5px 0;padding:3px}.result-rewards .piece{width:64px;height:64px}.reward-coin{width:56px;height:56px;font-size:30px}.result-rewards b{font-size:28px}.storybook-game #result-copy{font-size:11px;margin:7px 0}.storybook-game #result #next{min-height:46px;font-size:18px}}
/* The shop is a scrollable collection of real gifts and playable boosters. */
.storybook-game #game-shop{padding:14px 12px;background:linear-gradient(#244e3b,#5d7e48 52%,#294d38);border:3px solid #d5bc6b;color:#fff8de;box-shadow:inset 0 0 0 2px #8da268}
.shop-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:16px}.shop-heading small{font-size:10px;color:#e9edc5}.storybook-game .shop-heading #shop-title{font-size:25px;line-height:1.1;margin:3px 0;color:#fff6d0;text-shadow:0 2px #203f2e}.shop-wallet{background:#fff4d2;color:#5b4420;border:2px solid #d6b967;border-radius:13px;padding:8px;font-size:18px;white-space:nowrap;box-shadow:0 3px #193c2b}
.daily-present{display:grid;grid-template-columns:100px minmax(0,1fr);align-items:center;gap:10px;padding:14px 10px;border:3px solid #e4c976;border-radius:22px;background:radial-gradient(circle at 20% 45%,#e0efa466,transparent 55%),linear-gradient(#76954f,#385f3c);box-shadow:inset 0 2px #cbdba1,0 4px #203f2a;margin-bottom:20px}.daily-present h3{font-size:19px;line-height:1.15;margin:4px 0;color:#fff8d9}.daily-present p{font-size:12px;margin:6px 0}.daily-present small{display:block;font-size:10px;color:#f3efc8;line-height:1.35}.daily-present button{width:100%;min-height:43px;border:2px solid #f0d179;border-radius:12px;background:linear-gradient(#c9ed75,#6fa941);color:#23412b;font-weight:800;font-size:12px;margin:4px 0 6px;box-shadow:0 3px #2a4c2c}.daily-present button:disabled{background:#d8deb5;color:#3c5437;opacity:.9}
.gift-chest{position:relative;width:96px;height:80px;margin-top:24px;border:5px solid #e2b74e;border-radius:9px 9px 15px 15px;background:linear-gradient(90deg,#78502b,#bb8344 45%,#74502c);box-shadow:inset 0 5px #553720,inset 0 -4px #49341d,0 8px 10px #16352666;transform:rotate(-7deg)}.gift-chest:before{content:'';position:absolute;left:-7px;right:-7px;top:-29px;height:34px;border:5px solid #f0cb64;border-radius:26px 26px 7px 7px;background:linear-gradient(#d6a45d,#8b592d);box-shadow:inset 0 4px #f1cb7d,0 4px #49381c}.gift-chest:after{content:'';position:absolute;inset:0 32px;background:linear-gradient(90deg,#c28f28,#f9d778,#cb9c35);border-left:2px solid #edc869;border-right:2px solid #b18326}.gift-chest b{position:absolute;z-index:2;left:28px;top:21px;width:31px;height:31px;display:grid;place-items:center;background:#ffe694;border:3px solid #b58524;border-radius:10px;color:#8a5d1b;font-size:22px;box-shadow:0 3px #77521c}.gift-chest i:before,.gift-chest i:after{content:'✦';position:absolute;color:#fff4af;font-size:25px;top:-48px;left:4px;text-shadow:0 0 12px #fff2a1}.gift-chest i:after{left:72px;top:-35px;font-size:17px}
.shop-section-title,.prize-section>h3{background:linear-gradient(#739351,#365b38);border:2px solid #d5bd6d;border-radius:11px;padding:8px;text-align:center;color:#fff7d3;font-size:18px;text-shadow:0 2px #25452c;margin:14px 0 12px}
#shop-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.storybook-game .shop-item{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0;padding:10px 8px;border:2px solid #d8c57e;border-radius:18px;background:linear-gradient(#fff9df,#e4edc4);color:#2b4b32;box-shadow:0 4px #24472d;text-align:center}.shop-item-art{height:73px;width:100%;display:grid;place-items:center;background:radial-gradient(ellipse,#e2ef96,transparent 70%)}.shop-item-art .piece{width:69px;height:69px}.moves-gift{display:grid;place-items:center;width:66px;height:66px;border:4px solid #e6cb70;border-radius:21px;background:linear-gradient(#bade70,#548e36);color:#fffad9;text-shadow:0 2px #305a29;font-size:34px;font-weight:800;box-shadow:inset 0 2px #ecfac1,0 4px #375d31}.storybook-game .shop-item strong{font-size:14px}.storybook-game .shop-item small{font-size:10px;line-height:1.35;margin:0 0 3px;flex:1}.storybook-game .shop-item button{width:100%;min-height:42px;padding:5px;border:2px solid #c3ac5d;border-radius:11px;background:linear-gradient(#d1ed8c,#8cbb59);color:#27472e;font-size:12px;box-shadow:inset 0 1px #f5ffd2,0 2px #66863d}.storybook-game .shop-item button:disabled{opacity:.65;box-shadow:none;background:#dbe3c3}
.prize-section>p{font-size:12px;text-align:center;color:#fff6d6}.prize-card{display:grid;grid-template-columns:33px minmax(0,1fr) 77px;gap:8px;align-items:center;margin:9px 0;padding:10px 7px;border:2px solid #cbb96d;border-radius:15px;background:linear-gradient(#fff7db,#e5edc9);color:#2d4a31;box-shadow:0 3px #25472d}.prize-medal{display:grid;place-items:center;width:33px;height:40px;background:linear-gradient(#f4d980,#cc9a34);border:2px solid #b68c36;border-radius:50% 50% 9px 9px;color:#7a541f;font-size:24px;text-shadow:0 1px #fff0ad}.prize-card strong{font-size:12px;line-height:1.2;display:block}.prize-card small{display:block;font-size:10px;margin:4px 0}.prize-card progress{width:100%;height:9px;accent-color:#57893d;display:block}.prize-card button{min-height:43px;padding:4px;border:2px solid #b2a15b;border-radius:11px;background:linear-gradient(#c5e882,#86b453);color:#26452b;font-size:11px;font-weight:800}.prize-card button:disabled{background:#dee5c8;color:#4a6042;opacity:.85}.prize-card.claimed{border-color:#9ab979}.storybook-game #shop-status{padding:8px 0;font-size:13px;line-height:1.4;color:#fff6cf}.storybook-game .shop-guide{font-size:11px;color:#fff8de;padding:10px;border-top:1px solid #b9c38d}.shop-guide summary{min-height:30px;cursor:pointer}.storybook-game #close-shop{width:100%;min-height:44px;margin-top:12px;background:linear-gradient(#c7e77e,#80ad4d);border:2px solid #e1ca76;color:#27472d;border-radius:13px;font-weight:800}
@media(max-width:350px){.daily-present{grid-template-columns:80px minmax(0,1fr);padding:12px 7px;gap:7px}.gift-chest{transform:rotate(-7deg) scale(.8);transform-origin:left center}.daily-present h3{font-size:17px}.shop-heading{gap:5px}.storybook-game .shop-heading #shop-title{font-size:21px}.prize-card{grid-template-columns:27px minmax(0,1fr) 66px;gap:5px}.prize-medal{width:27px}}
/* Illustrated chapter cards for the valley restoration screen. */
.storybook-game #world-dialog{padding:12px;background:linear-gradient(#294f3b,#607d49 50%,#2c513a);border:3px solid #d6bf70;color:#fff6dc;box-shadow:inset 0 0 0 2px #8c9f60}
.world-hero{padding:16px 12px 12px;border:2px solid #e0ca80;border-radius:19px;background:linear-gradient(#234d37b0,#234d37d9),url('/assets/game/flower-garden.webp') center 30%/cover;text-align:center;box-shadow:0 4px #25432b}.world-hero>span{display:block;font-size:11px;color:#fff0b1;text-transform:uppercase;letter-spacing:1.5px}.storybook-game #world-title{font-size:28px;line-height:1.1;color:#fff6d3;text-shadow:0 2px #1b3b29;margin:7px 0}.world-hero>p{font-size:12px;line-height:1.4;margin:5px 0 15px}.world-chapter{padding:8px 10px;background:#fff6d7;border:2px solid #cdb86d;border-radius:12px;color:#345033}.world-chapter label{display:flex;justify-content:space-between;font-size:11px;font-weight:800;margin-bottom:6px}.world-chapter progress{display:block;width:100%;height:12px;accent-color:#81aa3f}
.storybook-game #world-budget{margin:13px 0;padding:10px;border:2px solid #d4c37b;border-radius:13px;background:#fff4d0;color:#3f502e;font-size:12px;font-weight:800;line-height:1.5;text-align:center;box-shadow:0 3px #28482d}
#world-projects{display:grid;gap:15px}.storybook-game .world-project{display:block;border:2px solid #dac67d;border-radius:20px;margin:0;padding:0;overflow:hidden;background:linear-gradient(#fff9e3,#e7edc7);color:#2c4930;box-shadow:0 4px #28482e}.world-art{position:relative;background:#dbe9ba;border-bottom:2px solid #bfbb7d}.storybook-game .world-object{display:block;width:100%;height:auto;max-height:180px;object-fit:contain;filter:none;opacity:1}.world-state{position:absolute;top:8px;left:8px;border:1px solid #d4bb65;border-radius:10px;padding:5px 9px;background:#fff8def2;color:#3a5134;font-size:10px;font-weight:800;box-shadow:0 2px #45663c33}.built .world-state{background:#416f44;color:#fff8d7}.ready .world-state{background:#d3ed8b;color:#284b2b}.world-card-copy{padding:12px}.world-card-copy strong{display:block;font-size:18px;line-height:1.2}.storybook-game .world-project small{font-size:12px;line-height:1.45;margin:6px 0 11px}.storybook-game .world-project button{display:block;width:100%;min-height:45px;padding:7px;border:2px solid #bfab5d;border-radius:12px;background:linear-gradient(#d2ed8b,#84b451);color:#28462e;font-size:14px;font-weight:800;box-shadow:inset 0 2px #f3fccc,0 3px #7f904b}.storybook-game .world-project button:disabled{background:#dce5bf;border-color:#b5bc8c;color:#56684a;box-shadow:none;opacity:1}.storybook-game .world-project.built{border-color:#a4bd6d}.storybook-game .world-project.built button{background:#d6e9bd;color:#385b35}
.storybook-game #world-status{font-size:13px;line-height:1.45;color:#fff2b9;margin:14px 0}.world-rules{font-size:12px;line-height:1.5;padding:10px 0;color:#fff8d9}.world-rules summary{min-height:32px;cursor:pointer}.storybook-game #close-world{width:100%;min-height:45px;margin-top:10px;border:2px solid #dcc474;border-radius:13px;background:linear-gradient(#cbe886,#81ad4a);color:#28472e;font-weight:800}
.storybook-game .valley-mystery{display:flex;align-items:center;gap:10px;margin-top:15px;padding:10px;border:2px solid #e0c678;border-radius:16px;background:linear-gradient(100deg,#234c3ee8,#648449ed);box-shadow:0 4px #24452c;color:#fff5d7;text-decoration:none}.valley-mystery>span{font-size:35px;color:#ffe59b}.valley-mystery strong{font-size:14px;line-height:1.25;display:block}.valley-mystery small{font-size:9px;display:block;line-height:1.6;color:#fff1bf}.valley-mystery:visited{color:#fff5d7}.valley-mystery:hover,.valley-mystery:focus-visible{color:white;border-color:#fff0b3}@media(max-height:620px){.storybook-game .valley-mystery{margin-top:8px;padding:6px}.valley-mystery strong{font-size:12px}.valley-mystery small{font-size:8px}}
.sports-piece{background-position:center;background-size:contain;background-repeat:no-repeat;filter:drop-shadow(0 2px 2px #263c2a44)}
.sports-0{background-image:url('/assets/game/sports-0.webp')}.sports-1{background-image:url('/assets/game/sports-1.webp')}.sports-2{background-image:url('/assets/game/sports-2.webp')}.sports-3{background-image:url('/assets/game/sports-3.webp')}.sports-4{background-image:url('/assets/game/sports-4.webp')}

/* Obstacle badge remains visible above large pieces in every theme. */
.board .tile.grass { box-shadow: inset 0 0 0 3px #1e6b32, inset 0 0 0 5px #d8ff92; }
.board .tile.grass::before { content: "▧"; position:absolute; left:2px; bottom:2px; z-index:5; width:20px; height:20px; display:grid; place-items:center; border:1px solid #efffd2; border-radius:6px; background:#18562b; color:#fffbd8; font:bold 17px/1 sans-serif; box-shadow:0 1px 3px #102f29; pointer-events:none; }
.board[data-theme="magic"] .tile.grass::before {content:"✧";background:#633a8c;}
.board[data-theme="magic"] .tile.grass::after {content:none;}
.immersive-play .grass-target small {position:static;width:auto;height:auto;margin:0;clip-path:none;white-space:normal;font-size:9px;line-height:1.1;}
.grass-target > span:first-child {color:#18562b;}

/* Sports obstacles use a visible strip of turf around each object. */
.storybook-game .board[data-theme="sports"] .tile.grass {
 background:repeating-linear-gradient(0deg,#267631 0 7px,#35913f 7px 14px);
 box-shadow:inset 0 0 0 3px #145224,inset 0 0 0 5px #d9ff9e;
}
.immersive-play .board[data-theme="sports"] .tile.grass .piece {width:76%;height:76%;}
.board[data-theme="sports"] .tile.grass::before {background:#0d4721;border:2px solid #efffd2;left:1px;bottom:1px;}

/* Plain green objective icon, without diagonal hatching. */
.grass-target > span:first-child:empty {display:block;width:22px;height:22px;min-height:22px;margin:3px auto;border:2px solid #18562b;border-radius:5px;background:#35913f;box-shadow:inset 0 0 0 2px #d9ff9e;}

/* Sports turf stays visible without a badge covering the object. */
.board[data-theme="sports"] .tile.grass::before {content:none;}

.world-close-bar{position:sticky;top:0;z-index:12;display:flex;justify-content:flex-end;pointer-events:none;margin-bottom:4px}.world-close-bar #close-world-top{pointer-events:auto;width:44px;min-height:44px;padding:0;font-size:32px;line-height:1;border-radius:50%;}

.world-close-bar #close-result{pointer-events:auto;width:44px;min-height:44px;padding:0;font-size:32px;line-height:1;border-radius:50%;}#continue-level{min-height:40px;margin:5px 0;}

#home-level-chest{display:flex;align-items:center;gap:10px;flex-shrink:0;width:100%;min-height:65px;margin:10px 0 0;padding:7px 12px;border:2px solid #d4bd70;border-radius:15px;background:#f6efcc;color:#2b4b32;text-align:left;cursor:pointer;font:inherit}
#home-level-chest strong{display:block;font-size:14px}#home-level-chest small{display:block;font-size:11px;margin-top:3px}.home-chest-art{position:relative;width:54px;height:48px;flex-shrink:0}.home-chest-art .gift-chest{display:block;position:absolute;margin:0;top:10px;left:4px;transform:scale(.46);transform-origin:top left}
#level-chest-dialog{max-width:360px;width:calc(100% - 30px);text-align:center;padding:45px 20px 24px;border:3px solid #dfc46b;border-radius:24px;background:#294e38;color:#fff7dd}#level-chest-dialog>.gift-chest{margin:30px auto 20px}#level-chest-dialog h2{color:inherit;font-size:24px}#level-chest-dialog p{font-size:15px;line-height:1.5}.chest-opened>.gift-chest:before{transform:translateY(-12px) rotate(-12deg);transition:transform .3s}#result-level-chest[hidden]{display:none}#result-level-chest{font-size:14px;margin:4px 0 8px;min-height:40px}
.storybook-game .valley-home{overflow-y:auto}.storybook-game .valley-mystery{flex-shrink:0}.valley-mystery strong{font-size:17px}
@media(max-height:760px){.storybook-game .valley-home{padding:10px}.valley-home h1{font-size:28px;margin:9px 0 3px}.valley-subtitle{font-size:11px;margin:3px 0}.valley-destinations{margin-top:6px}.valley-destinations button{padding:5px;min-height:62px;font-size:11px}.valley-destinations button>span{font-size:28px}.valley-destinations .piece{width:35px;height:35px}.storybook-game .valley-mystery{margin-top:8px;padding:6px}.valley-mystery strong{font-size:14px}#home-level-chest{min-height:56px;margin-top:7px;padding:4px 8px}#home-level-chest strong{font-size:12px}#home-level-chest small{font-size:10px}.valley-start{padding-bottom:2px}.valley-start>p{font-size:10px;margin:5px 0}.valley-start .storybook-primary{min-height:64px;padding:8px;font-size:25px}.valley-start .storybook-primary small{font-size:15px}}

/* Lightweight shaded vehicle pieces and friendly level reactions. */
.car-piece{background-position:center;background-size:contain;background-repeat:no-repeat;filter:drop-shadow(0 2px 2px #263c2a44)}
.car-0{background-image:url("/assets/game/car-0.svg")}.car-1{background-image:url("/assets/game/car-1.svg")}.car-2{background-image:url("/assets/game/car-2.svg")}.car-3{background-image:url("/assets/game/car-3.svg")}.car-4{background-image:url("/assets/game/car-4.svg")}
.result-joke{font-size:1rem;font-weight:700;line-height:1.45;margin:12px 0}

.orb-rays{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}.orb-rays line{stroke:#fff5ad;stroke-width:3;stroke-linecap:round;filter:drop-shadow(0 0 3px #9b52d8)}.tile.orb-selected{box-shadow:inset 0 0 0 3px #fff4a5,0 0 12px #ecb54e}.cascade-caption{position:absolute;left:50%;top:8%;transform:translateX(-50%);max-width:95%;width:max-content;padding:8px 16px;border-radius:20px;background:#fff5cf;color:#493219;box-shadow:0 3px 12px #20332545;font-weight:800;font-size:1.2rem;pointer-events:none;z-index:10}
.sound-toggle{width:100%;min-height:46px;font:inherit;font-weight:700;margin:0 0 6px}.sound-note{font-size:14px;line-height:1.5;margin:0 0 18px}.victory-confetti{position:absolute;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none;z-index:8}.victory-confetti i{position:absolute;top:0;width:7px;height:12px;border-radius:3px}.tile .piece{transform-origin:50% 85%}

/* Sculpted board: recessed sockets, rounded enamel rim and grounded pieces. */
.storybook-game .board-frame{padding:5px;border:3px solid #d9c478;border-radius:18px;background:linear-gradient(145deg,#b4c58a 0%,#65885c 22%,#274c38 100%);box-shadow:inset 0 2px 1px #fff3c6,inset 0 -3px 2px #183d2c,0 5px 0 #193e2d,0 10px 15px #102d3159}
.storybook-game .board{gap:3px;padding:2px;border-radius:11px;background:#41664c;box-shadow:inset 0 2px 5px #143d35aa}
.storybook-game .tile:not(.grass){border-radius:9px;background:radial-gradient(ellipse at 50% 75%,#e4efc9 0%,#c2d8a9 67%,#a0bd8b 100%);box-shadow:inset 0 2px 3px #294c374d,inset 0 -1px 0 #f3f7d6,0 1px 0 #244b364d}
.storybook-game .tile:not(.grass):nth-child(even){background:radial-gradient(ellipse at 50% 75%,#d5e8bb,#b2cea0 70%,#8da879)}
.storybook-game .tile:not(.grass)::after{content:"";position:absolute;left:17%;right:17%;bottom:9%;height:13%;border-radius:50%;background:radial-gradient(ellipse,#24433250,transparent 72%);pointer-events:none;z-index:0}
.storybook-game .tile .piece{filter:drop-shadow(0 3px 1px #203d3059) saturate(1.08) contrast(1.035)}
.storybook-game .tile.power-tile:not(.grass){background:radial-gradient(ellipse at 50% 65%,#fff6b5,#dce6a2 57%,#a7bf75);box-shadow:inset 0 0 0 1px #fff0b8,inset 0 2px 4px #75834477}
.storybook-game .tile.selected{outline:3px solid #fff6a2;outline-offset:-2px}
.storybook-game .tile.selected .piece{filter:drop-shadow(0 4px 3px #c3a236) brightness(1.15)}
.storybook-game .tile.matching,.storybook-game .tile.orb-selected{box-shadow:inset 0 0 0 3px #fff4a5,0 0 12px #ecb54e}
@media(max-width:350px){.storybook-game .board-frame{padding:3px;border-width:2px}.storybook-game .board{gap:2px}}

/* Individually cropped 3D collections; centred booster rotation stays inside its cell. */
.collection-piece,.rocket-piece{display:block;background-position:center;background-repeat:no-repeat;background-size:contain}
.rocket-piece{background-image:url("/assets/game/rocket-3d-v1.webp");transform-origin:50% 50%!important}.rocket-piece.rocket-up{rotate:-90deg}
.storybook-game .tile .rocket-piece{width:82%;height:82%;margin:9%}
.car-0{background-image:url("/assets/game/car-3d-0.webp")}
.car-1{background-image:url("/assets/game/car-3d-1.webp")}
.car-2{background-image:url("/assets/game/car-3d-2.webp")}
.car-3{background-image:url("/assets/game/car-3d-3.webp")}
.car-4{background-image:url("/assets/game/car-3d-4.webp")}
.space-0{background-image:url("/assets/game/space-0.webp")}
.space-1{background-image:url("/assets/game/space-1.webp")}
.space-2{background-image:url("/assets/game/space-2.webp")}
.space-3{background-image:url("/assets/game/space-3.webp")}
.space-4{background-image:url("/assets/game/space-4.webp")}
.ocean-0{background-image:url("/assets/game/ocean-0.webp")}
.ocean-1{background-image:url("/assets/game/ocean-1.webp")}
.ocean-2{background-image:url("/assets/game/ocean-2.webp")}
.ocean-3{background-image:url("/assets/game/ocean-3.webp")}
.ocean-4{background-image:url("/assets/game/ocean-4.webp")}
.candy-0{background-image:url("/assets/game/candy-0.webp")}
.candy-1{background-image:url("/assets/game/candy-1.webp")}
.candy-2{background-image:url("/assets/game/candy-2.webp")}
.candy-3{background-image:url("/assets/game/candy-3.webp")}
.candy-4{background-image:url("/assets/game/candy-4.webp")}

#wish-dialog{width:calc(100% - 32px);max-width:380px;max-height:90dvh;overflow:auto;border:3px solid #d7bd6e;border-radius:24px;background:#fff5d7;color:#294b35;text-align:center;padding:38px 18px 18px}#wish-dialog h2{font-size:24px}#wish-dialog p{font-size:14px;line-height:1.5}.wish-stage{position:relative;width:220px;height:220px;margin:22px auto}.wish-pointer{position:absolute;top:-18px;left:calc(50% - 12px);font-size:30px;color:#284a35;z-index:2}.wish-wheel{width:100%;height:100%;border-radius:50%;border:6px solid #c9a74d;box-sizing:border-box;box-shadow:0 5px #826d37,inset 0 0 0 3px #fff6c9;background:conic-gradient(#d2e78d 0deg 45deg,#f6d39b 45deg 90deg,#abd5c2 90deg 135deg,#e9c4d1 135deg 180deg,#d2e78d 180deg 225deg,#f6d39b 225deg 270deg,#abd5c2 270deg 315deg,#e9c4d1 315deg);position:relative}.wish-wheel span{position:absolute;left:calc(50% - 15px);top:calc(50% - 15px);width:30px;height:30px;font-size:25px;transform:rotate(calc(var(--sector)*45deg + 22.5deg)) translateY(-70px)}#wish-result{min-height:64px;font-weight:800}#wish-spin,#open-wishes{width:100%;min-height:46px}#open-wishes{margin:12px 0}#wish-dialog .wish-note{font-size:12px}

/* Compact result sheet: all actions remain reachable in the phone viewport. */
.storybook-game #result{padding:14px 14px 16px;border-width:3px;border-radius:24px;max-height:calc(100dvh - 20px)}
.storybook-game #result>.world-close-bar{position:absolute;top:8px;right:8px;margin:0}
.storybook-game #result .result-level{font-size:17px;border:0;background:none;box-shadow:none;margin:0 42px 8px;padding:5px;text-shadow:none}
.storybook-game #result h2{font-size:26px;margin:7px 0;line-height:1.12}
.storybook-game #result .result-joke{font-size:14px;margin:6px 0;line-height:1.35}
.storybook-game #result .result-rewards{margin:8px 0;padding:8px;gap:8px;border:1px solid #b8ce7c66;border-radius:16px;background:#183f2d55}
.storybook-game #result .result-rewards>div{display:grid;grid-template-columns:48px auto;column-gap:5px;text-align:left;justify-content:center}
.storybook-game #result .result-rewards .piece,.storybook-game #result .reward-coin{grid-row:1/3;width:44px;height:44px;margin:0;font-size:25px;border-width:3px}
.storybook-game #result .result-rewards b{font-size:25px}.storybook-game #result .result-rewards small{font-size:10px;max-width:85px;line-height:1.2}
.storybook-game #result-copy{font-size:12px;line-height:1.35;margin:8px 0}
.storybook-game #result #next{min-height:46px;margin:5px 0 8px;font-size:20px}
.storybook-game #result-world,.storybook-game #result-shop{display:inline-block;width:48%;vertical-align:top;min-height:42px;margin:4px 0;padding:5px;font-size:11px}
.storybook-game #result-level-chest{min-height:38px;font-size:12px;margin:3px 0}
/* Home cards share the game's illustrated garden palette. */
.storybook-game .valley-home{padding:12px;background-image:linear-gradient(#173b2f22,transparent 30%,#163c2a99),url('/assets/game/flower-garden.webp')}
.valley-home h1{font-size:clamp(29px,8vw,40px);margin:18px 0 4px;letter-spacing:-.6px}
.valley-home .valley-subtitle{margin:4px 0 12px;font-size:12px;text-shadow:0 1px 3px #123b28}
.valley-home .valley-destinations{gap:12px;margin:10px 0 4px}
.valley-home .valley-destinations button{flex:1;flex-direction:row;justify-content:center;gap:8px;min-height:70px;border-radius:18px;font-size:13px;background:linear-gradient(145deg,#fff8d9,#d1df9c 55%,#88ad60);box-shadow:inset 0 2px #fffce4,0 3px #36552f}
.home-valley-art{width:62px;height:52px;object-fit:contain;filter:drop-shadow(0 2px 2px #23482d55)}
.valley-home .valley-destinations .piece{width:48px;height:48px;flex-shrink:0}
.storybook-game .valley-mystery{padding:10px 12px;border-radius:18px;background:linear-gradient(100deg,#214b3bf5,#66854be8);margin-top:12px}
.storybook-game .valley-mystery>span{width:48px;height:48px;display:grid;place-items:center;border-radius:12px;background:#e9d899;color:#31543b;font-size:38px;flex-shrink:0}
.storybook-game .valley-mystery strong{font-size:17px}.storybook-game .valley-mystery small{font-size:10px}
#home-level-chest{border-radius:18px;background:linear-gradient(120deg,#fff7da,#e5ebbb);min-height:64px;box-shadow:0 3px #23442c66}
.valley-start .storybook-primary{min-height:68px;font-size:27px;border-radius:23px}.valley-start .storybook-primary small{font-size:15px}
@media(max-height:650px){.valley-home h1{font-size:27px;margin:9px 0 3px}.valley-home .valley-subtitle{margin:2px 0 5px;font-size:10px}.valley-home .valley-destinations{margin-top:5px}.valley-home .valley-destinations button{min-height:55px;padding:4px;font-size:12px}.home-valley-art{height:40px;width:48px}.valley-home .valley-destinations .piece{width:38px;height:38px}.storybook-game .valley-mystery{padding:6px 8px;margin-top:8px}.storybook-game .valley-mystery strong{font-size:14px}#home-level-chest{min-height:54px;margin-top:8px}.valley-start .storybook-primary{min-height:58px;font-size:23px}}

/* Edge-to-edge wish screen, sized to the visible browser viewport. */
#wish-dialog{position:fixed;inset:0;width:100%;max-width:none;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;box-shadow:none;padding:calc(14px + env(safe-area-inset-top)) 20px calc(14px + env(safe-area-inset-bottom));box-sizing:border-box}
#wish-dialog[open]{display:flex;flex-direction:column;align-items:center;gap:8px}
#wish-dialog>*{flex-shrink:0;max-width:430px}#wish-dialog h2{font-size:clamp(22px,5vw,28px);margin:28px 0 4px}#wish-dialog p{margin:4px 0}
#wish-dialog .wish-stage{width:min(55vw,30dvh,240px);height:min(55vw,30dvh,240px);margin:18px auto 10px}
#wish-dialog .wish-wheel span{transform:rotate(calc(var(--sector)*45deg + 22.5deg)) translateY(calc(-1 * min(18vw,10dvh,78px)))}
#wish-dialog #wish-result{min-height:42px;margin:8px 0;font-size:16px}#wish-dialog #wish-wallet{margin-top:auto}#wish-dialog #wish-spin{width:100%;min-height:48px}#wish-dialog .wish-note{font-size:11px;line-height:1.3}#wish-dialog #wish-close{position:absolute;top:10px;right:10px}
@media(max-height:600px){#wish-dialog{padding:10px 16px}#wish-dialog[open]{gap:4px}#wish-dialog h2{margin:26px 0 2px;font-size:22px}#wish-dialog>p{font-size:13px}#wish-dialog .wish-stage{margin:14px auto 6px}#wish-dialog #wish-result{font-size:14px;margin:4px 0}}

/* Power-ups keep a steady outline and a slow sheen, without flashing. */
.board .tile.power-tile .piece{filter:drop-shadow(0 2px 2px #214634aa) drop-shadow(0 0 3px #fff4a2) drop-shadow(0 0 6px #ffd45e)}
.board .tile.power-tile .piece::after{content:"";position:absolute;inset:4%;border-radius:35%;background:linear-gradient(115deg,transparent 35%,#fff9 47%,#fffdf0d9 50%,transparent 63%);background-size:300% 100%;background-position:100% 0;pointer-events:none;mix-blend-mode:screen;opacity:.65}
.board .tile.power-tile .piece::before{content:"✦";position:absolute;right:-1%;top:-6%;font-size:clamp(13px,3vw,20px);line-height:1;color:#fffce6;text-shadow:0 0 3px #b77814,0 0 7px #ffd446;pointer-events:none}
@media(prefers-reduced-motion:no-preference){
 .board .tile.power-tile:not(.matching):not(.born-power) .piece::after{animation:booster-sheen 3.6s ease-in-out infinite}
 .board .tile.power-tile:not(.matching):not(.born-power) .piece::before{animation:booster-sparkle 2.8s ease-in-out infinite}
 .board .tile.power-tile:nth-child(2n) .piece::after{animation-delay:-1.8s}
 @keyframes booster-sheen{0%,20%{background-position:100% 0;opacity:.15}55%{opacity:.75}80%,100%{background-position:0 0;opacity:.15}}
 @keyframes booster-sparkle{0%,100%{opacity:.45;scale:.8}50%{opacity:1;scale:1.15}}
}

/* Keep result-button focus within its existing border. */
#next:focus-visible { outline: none; border-color: #fff6a2; }

/* Manual spinner aiming and its flight only; other boosters retain their effects. */
.spinner-trail{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:5;filter:drop-shadow(0 0 5px #ffdd67)}
.spinner-trail path{fill:none;stroke:#fff3b0;stroke-width:5;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1}
.spinner-impact{position:absolute;pointer-events:none;z-index:7;border-radius:50%;background:radial-gradient(circle,#fff 5%,#fff3b0 25%,#ffda6380 50%,transparent 72%);box-shadow:0 0 20px #ffe796}

.game-shell{position:relative}
.spinner-aim-overlay{position:absolute;inset:0;z-index:20;pointer-events:none}
.spinner-aim-overlay[hidden]{display:none}
.spinner-tip{position:absolute;transform:translateX(-50%);white-space:nowrap;border:1px solid #dfc77b;border-radius:20px;background:#254b38ed;color:#fff6ce;font-size:12px;line-height:20px;padding:2px 10px;box-shadow:0 2px 7px #152e3340;pointer-events:none}
.spinner-reticle{position:absolute;pointer-events:none;z-index:8;border:2px solid #ffe4a0;border-radius:50%;box-shadow:inset 0 0 5px #ffdd6570,0 0 7px #ffdd6580;animation:spinner-aim-glow 1.3s ease-in-out infinite}
.spinner-reticle b{position:absolute;width:22%;height:22%;border:2px solid #fff0b4;border-radius:2px}
.spinner-reticle b:nth-child(1){left:0;top:0;border-right:0;border-bottom:0}
.spinner-reticle b:nth-child(2){right:0;top:0;border-left:0;border-bottom:0}
.spinner-reticle b:nth-child(3){left:0;bottom:0;border-right:0;border-top:0}
.spinner-reticle b:nth-child(4){right:0;bottom:0;border-left:0;border-top:0}
.spinner-reticle span{position:absolute;color:#fff6ce;font-size:10px;text-shadow:0 0 5px #ffcc48;top:-5px;left:18%;animation:spinner-aim-spark 1.4s ease-in-out infinite}
.spinner-reticle span:last-child{top:auto;left:auto;bottom:-5px;right:10%;animation-delay:.6s}
.spinner-reticle-hit{animation:spinner-aim-glow .25s ease-in-out 2}
@keyframes spinner-aim-glow{50%{box-shadow:inset 0 0 8px #ffdd6580,0 0 13px #ffe49ac0}}
@keyframes spinner-aim-spark{50%{opacity:.2;transform:translateY(-3px) scale(.6)}}
@media(prefers-reduced-motion:reduce){.spinner-reticle,.spinner-reticle span{animation:none}}

/* Mobile boards are sized by width, never shrunk to fit the available height. */
@media(max-width:600px){
 body.immersive-play{height:auto;min-height:100dvh;overflow-x:clip;overflow-y:auto;padding:0 0 calc(78px + env(safe-area-inset-bottom));}
 .immersive-play .flower-app{width:100%;max-width:none;height:auto;min-height:calc(100dvh - 78px - env(safe-area-inset-bottom));padding:calc(4px + env(safe-area-inset-top)) max(4px,env(safe-area-inset-right)) 4px max(4px,env(safe-area-inset-left));gap:4px;}
 .immersive-play .flower-header{min-height:32px;}
 .immersive-play .compact-game-name{font-size:clamp(13px,4vw,17px);padding:6px 8px;}
 .storybook-game .game-shell{flex:1 0 auto;min-height:0;padding:26px 0 4px;border-radius:12px;}
 .storybook-game .board-frame{width:100%;max-width:none;flex:none;margin:4px 0 8px;padding:1px;border-width:1px;border-radius:11px;}
 .storybook-game .board{gap:1px;}
 .storybook-game .tile{padding:0;min-height:0;border-radius:7px;}
 .storybook-game .tile .piece{width:100%;height:100%;}
 .storybook-game .tile .rocket-piece{width:90%;height:90%;margin:5%;}
 .storybook-game .storybook-hud{grid-template-columns:34px minmax(0,1fr) 45px;min-height:70px;padding:4px;gap:3px;border-radius:16px;}
 .storybook-hud .targets{min-height:51px;padding-top:7px;}
 .storybook-hud .target{min-height:42px;}
 .storybook-hud .target>.piece{width:27px;height:27px;}
 .storybook-hud .difficulty-badge{padding:1px 8px;font-size:10px;line-height:13px;}
 .storybook-hud .level-medal{font-size:20px;}
 .storybook-hud .level-medal .piece{width:29px;height:29px;}
 .storybook-hud .move-badge b{font-size:27px;}
 .storybook-game .flower-message{height:auto;min-height:22px;max-height:28px;margin:3px 4px;font-size:10px;}
 .storybook-game .play-actions{gap:4px;margin:4px 2px 6px;}
 .storybook-game .play-actions button{min-height:44px;border-radius:11px;}
 .storybook-game .play-actions button>.piece{width:27px;height:27px;}
}
