/* ── tokens ──────────────────────────────────────────────────────────────── */
:root {
  --cream:      #fff6e6;
  --cream-2:    #fffbf2;
  --parchment:  #f6e3c4;
  --cocoa:      #4a2a18;
  --cocoa-soft: #6b4429;
  --berry:      #e4453a;
  --berry-dark: #ab2b23;
  --honey:      #ffb627;
  --honey-dark: #d3810c;
  --mint:       #52b95a;
  --mint-dark:  #35803c;
  --plum:       #8b5cf6;
  --ink:        rgba(74, 42, 24, 0.9);

  --shell:      linear-gradient(180deg, #c8453c 0%, #a92f28 100%);
  --shell-sun:  linear-gradient(180deg, #f4a63c 0%, #d97d13 100%);

  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;

  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --glide:  cubic-bezier(.32, .72, 0, 1);

  --lift-1: 0 2px 4px rgba(74,42,24,.10), 0 8px 18px rgba(74,42,24,.14);
  --lift-2: 0 4px 10px rgba(74,42,24,.14), 0 18px 40px rgba(74,42,24,.22);
  --lift-3: 0 10px 24px rgba(46,24,12,.28), 0 40px 80px rgba(46,24,12,.34);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  overflow: hidden;
  font-family: 'Nunito', ui-rounded, system-ui, sans-serif;
  color: var(--cocoa);
  background: #2a1a12;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { max-width: 100%; display: block; }

#app { position: fixed; inset: 0; overflow: hidden; }

/* ── backdrop ────────────────────────────────────────────────────────────── */
#backdrop { position: absolute; inset: 0; z-index: 0; }
#backdrop-img {
  position: absolute; inset: -6%;
  background-size: cover; background-position: center;
  filter: blur(7px) saturate(1.08) brightness(.92);
  transform: scale(1.06);
  transition: opacity .6s var(--glide), background-image .1s;
}
#backdrop-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,240,210,.16), transparent 60%),
    linear-gradient(180deg, rgba(50,26,14,.30), rgba(50,26,14,.52));
}

/* ── screens ─────────────────────────────────────────────────────────────── */
.screen {
  position: absolute; inset: 0; z-index: 1;
  display: none;
  flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
           max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
.screen.active { display: flex; animation: screenIn .42s var(--glide); }
@keyframes screenIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* ── logo ────────────────────────────────────────────────────────────────── */
.logo {
  font-family: 'Baloo 2', cursive; font-weight: 800;
  font-size: clamp(38px, 8vw, 74px); line-height: .95;
  text-align: center; letter-spacing: -.5px;
  filter: drop-shadow(0 6px 0 rgba(120,52,20,.55)) drop-shadow(0 16px 26px rgba(30,14,6,.5));
}
.logo span { display: block; }
.logo-a { color: #fff3d2; -webkit-text-stroke: clamp(4px,1vw,8px) #a4470f; paint-order: stroke fill; }
.logo-b {
  color: #ffd257; -webkit-text-stroke: clamp(4px,1vw,8px) #a4470f; paint-order: stroke fill;
  margin-top: -.12em; transform: rotate(-2deg);
}
.logo.big { font-size: clamp(46px, 11vw, 96px); }

/* ── loading ─────────────────────────────────────────────────────────────── */
#scr-loading { align-items: center; justify-content: center; }
.loader { display: grid; gap: 26px; justify-items: center; width: min(420px, 82vw); }
.bar { width: 100%; height: 16px; border-radius: 99px; background: rgba(40,20,10,.42);
       box-shadow: inset 0 3px 6px rgba(0,0,0,.35); overflow: hidden; padding: 3px; }
.bar i { display: block; height: 100%; width: 4%; border-radius: 99px;
         background: linear-gradient(180deg, #ffd873, #f0a01c);
         box-shadow: inset 0 2px 0 rgba(255,255,255,.6); transition: width .3s var(--glide); }
.loader-note { color: #ffeccb; font-weight: 700; margin: 0; opacity: .85; letter-spacing: .3px; }

/* ── home ────────────────────────────────────────────────────────────────── */
#scr-home { align-items: center; justify-content: center; }
.home-wrap { display: grid; gap: 20px; justify-items: center; position: relative; z-index: 2; }
.tagline { margin: -6px 0 4px; color: #ffeccb; font-weight: 700; text-align: center;
           text-shadow: 0 2px 6px rgba(40,18,8,.7); max-width: 30ch; }
.home-actions { display: grid; gap: 12px; justify-items: center; }
.home-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.home-baker {
  position: absolute; right: min(-190px, -22vw); bottom: -40px; width: clamp(150px, 22vw, 260px);
  filter: drop-shadow(0 20px 30px rgba(30,14,6,.55));
  animation: bob 4.2s ease-in-out infinite; pointer-events: none;
}
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@media (max-width: 820px) { .home-baker { display: none; } }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn {
  position: relative;
  font-family: 'Baloo 2', cursive; font-weight: 800;
  border-radius: 99px; padding: 13px 30px 15px;
  font-size: 19px; letter-spacing: .2px; color: #fff;
  background: linear-gradient(180deg, #66c96d, #46a34d);
  box-shadow: 0 6px 0 var(--mint-dark), var(--lift-1),
              inset 0 2px 0 rgba(255,255,255,.45);
  text-shadow: 0 2px 0 rgba(24,80,28,.45);
  transition: transform .16s var(--spring), box-shadow .16s var(--glide), filter .2s;
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--mint-dark), var(--lift-1), inset 0 2px 0 rgba(255,255,255,.4); }
.btn:disabled { filter: grayscale(.6) brightness(.85); cursor: not-allowed; }
.btn-xl { font-size: clamp(22px, 3vw, 28px); padding: 16px 52px 19px; }
.btn.full { width: 100%; }
.btn-primary { background: linear-gradient(180deg, #6cd074, #45a44c); }
.btn-ghost {
  background: linear-gradient(180deg, #fff9ec, #f4e1c2);
  color: var(--cocoa); text-shadow: 0 1px 0 rgba(255,255,255,.7);
  box-shadow: 0 5px 0 #c9a879, var(--lift-1), inset 0 2px 0 rgba(255,255,255,.8);
  font-size: 17px; padding: 11px 24px 13px;
}
.btn-ghost:active { box-shadow: 0 1px 0 #c9a879, var(--lift-1), inset 0 2px 0 rgba(255,255,255,.8); }
.btn .cost { display: inline-flex; align-items: center; gap: 4px; font-style: normal;
             background: rgba(0,0,0,.20); border-radius: 99px; padding: 3px 12px 4px; font-size: .78em; }
.btn .cost b { color: #ffd75e; }

.icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(180deg, #fff8ea, #f0dcba);
  color: var(--cocoa); font-size: 19px; font-weight: 800;
  box-shadow: 0 4px 0 #c9a879, var(--lift-1), inset 0 2px 0 rgba(255,255,255,.85);
  display: grid; place-items: center;
  transition: transform .16s var(--spring), box-shadow .16s;
}
.icon-btn:active { transform: translateY(4px); box-shadow: 0 0 0 #c9a879, var(--lift-1); }
.icon-btn.small { width: 40px; height: 40px; font-size: 14px; }

/* ── top bar / wallet ────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 10px; justify-content: space-between; z-index: 3; }
.wallet { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, rgba(72,38,20,.86), rgba(52,26,12,.92));
  border: 2px solid rgba(255,214,150,.35);
  border-radius: 99px; padding: 5px 14px 6px 10px;
  color: #ffeccb; font-weight: 800; font-size: 15px;
  box-shadow: var(--lift-1), inset 0 1px 0 rgba(255,255,255,.14);
}
.chip b { font-size: 17px; line-height: 1; }
.chip i { font-style: normal; }
.chip em { font-style: normal; font-size: 12px; opacity: .75; font-weight: 700; }
.chip-coin b { color: var(--honey); }
.chip-life b { color: #ff6b6b; }

/* ── map ─────────────────────────────────────────────────────────────────── */
.map-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; margin-top: 10px;
              -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.map-scroll::-webkit-scrollbar { display: none; }
.map-inner { position: relative; display: flex; flex-direction: column-reverse;
             align-items: center; gap: 5px; padding: 40px 0 70px; min-height: 100%; }

.chapter-band {
  width: min(560px, 92vw); margin: 26px 0 14px; padding: 12px 22px 14px;
  border-radius: var(--r-md); text-align: center;
  background: var(--shell); color: #fff5dd;
  font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 21px;
  border: 3px solid rgba(255,222,170,.4);
  box-shadow: var(--lift-2), inset 0 2px 0 rgba(255,255,255,.22);
  text-shadow: 0 2px 0 rgba(120,30,24,.6);
}
.chapter-band small { display: block; font-family: 'Nunito'; font-size: 13px; font-weight: 700; opacity: .8; }

.node {
  position: relative; width: 74px; height: 74px; margin: 5px 0 9px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff8e8, #ecd4ab);
  color: var(--cocoa);
  font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 25px;
  border: 4px solid #fffdf6;
  box-shadow: 0 6px 0 #b78f5e, var(--lift-2);
  transition: transform .2s var(--spring);
}
.node:active { transform: scale(.94); }
.node[data-side="l"] { transform: translateX(-84px); }
.node[data-side="r"] { transform: translateX(84px); }
.node[data-side="l"]:active { transform: translateX(-84px) scale(.94); }
.node[data-side="r"]:active { transform: translateX(84px) scale(.94); }
.node.locked { background: linear-gradient(180deg, #cdbda6, #a8967d); color: #7d6a55;
               box-shadow: 0 5px 0 #7a6950, var(--lift-1); border-color: #e3d7c3; }
.node.current {
  background: linear-gradient(180deg, #ffd873, #f0a01c); color: #6a3406;
  box-shadow: 0 6px 0 #a4650a, 0 0 0 6px rgba(255,206,90,.28), var(--lift-2);
  animation: nodePulse 1.9s ease-in-out infinite;
}
@keyframes nodePulse { 0%,100% { box-shadow: 0 6px 0 #a4650a, 0 0 0 5px rgba(255,206,90,.22), var(--lift-2); }
                       50%     { box-shadow: 0 6px 0 #a4650a, 0 0 0 15px rgba(255,206,90,0), var(--lift-2); } }
.node .node-stars {
  position: absolute; bottom: -14px; display: flex; gap: 2px;
  padding: 3px 5px; border-radius: 99px;
  background: rgba(58,30,16,.55); box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.node .node-stars i { width: 13px; height: 13px; display: block;
  clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  background: #c3ac8c; }
.node .node-stars i.on { background: linear-gradient(180deg, #ffe06a, #f2ab13); filter: drop-shadow(0 1px 1px rgba(120,60,0,.5)); }
.map-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,244,220,.45);
           box-shadow: 0 1px 2px rgba(0,0,0,.3); }

/* ── game layout ─────────────────────────────────────────────────────────── */
#scr-game { padding: 6px; }
.game-grid {
  flex: 1; display: grid; gap: 8px; min-height: 0;
  grid-template-columns: clamp(126px, 15vw, 186px) minmax(0, 1fr) clamp(66px, 8vw, 92px);
  grid-template-rows: minmax(0, 1fr);
}
.panel {
  background: var(--shell);
  border: 3px solid rgba(255,222,170,.42);
  border-radius: var(--r-lg);
  box-shadow: var(--lift-2), inset 0 2px 0 rgba(255,255,255,.2);
  padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
.goals-panel { align-items: stretch; }
.panel-head { display: flex; justify-content: center; }
.lvl-badge {
  white-space: nowrap;
  font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 15px; color: #fff3d6;
  background: rgba(0,0,0,.2); border-radius: 99px; padding: 3px 14px 4px;
  text-shadow: 0 1px 0 rgba(120,30,24,.6);
}
.goals {
  flex: 0 1 auto; min-height: 0; overflow-y: auto;
  background: linear-gradient(180deg, var(--cream-2), var(--parchment));
  border-radius: var(--r-md); padding: 8px 6px;
  box-shadow: inset 0 3px 8px rgba(120,72,36,.22);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  scrollbar-width: none;
}
.goals::-webkit-scrollbar { display: none; }
.goal { position: relative; display: grid; place-items: center; width: 100%; }
.goal img { width: clamp(34px, 4vw, 46px); height: auto; filter: drop-shadow(0 2px 3px rgba(90,50,20,.35)); }
.goal .swatch { width: clamp(34px,4vw,46px); height: clamp(34px,4vw,46px); border-radius: 12px; }
.goal b {
  position: absolute; right: 8%; bottom: -2px;
  font-family: 'Baloo 2', cursive; font-size: 15px; color: #fff;
  background: var(--cocoa); border-radius: 99px; padding: 0 7px 1px;
  border: 2px solid #fff6e2; box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.goal.done b { background: var(--mint); }
.goal .tick {
  position: absolute; right: 4%; bottom: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--mint); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 900;
  border: 2px solid #fff6e2; box-shadow: 0 2px 4px rgba(0,0,0,.3);
  animation: pop .38s var(--spring);
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.moves-box {
  margin-top: auto;
  background: linear-gradient(180deg, var(--cream-2), var(--parchment));
  border-radius: var(--r-md); padding: 4px 10px 6px; text-align: center;
  box-shadow: inset 0 3px 8px rgba(120,72,36,.2);
}
.moves-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
               text-transform: uppercase; color: var(--cocoa-soft); }
.moves-box strong { font-family: 'Baloo 2', cursive; font-size: clamp(28px, 3.6vw, 40px); line-height: 1; color: var(--cocoa); display: block; }
.moves-box.low strong { color: var(--berry); animation: shakeNum .5s var(--spring); }
@keyframes shakeNum { 0%,100% { transform: none; } 25% { transform: translateX(-3px) scale(1.1); } 75% { transform: translateX(3px) scale(1.1); } }

.fortune-tag {
  border-radius: 99px; padding: 4px 8px 5px; text-align: center;
  font-size: 11px; font-weight: 800; color: #fff; letter-spacing: .4px;
  background: rgba(0,0,0,.25); box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.board-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.rail { align-items: center; padding: 8px 6px; }
.rail-boosters { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; align-items: center; }
.booster {
  position: relative; width: clamp(48px, 5.6vw, 64px); height: clamp(48px, 5.6vw, 64px);
  border-radius: 50%; display: grid; place-items: center; font-size: clamp(21px, 2.6vw, 28px);
  background: linear-gradient(180deg, #7fd0ff, #3d9fe0);
  border: 3px solid #fff6e2;
  box-shadow: 0 5px 0 #2073ab, var(--lift-1), inset 0 2px 0 rgba(255,255,255,.5);
  transition: transform .18s var(--spring), box-shadow .18s;
}
.booster:active { transform: translateY(4px); box-shadow: 0 1px 0 #2073ab, var(--lift-1); }
.booster.armed {
  background: linear-gradient(180deg, #ffd873, #f0a01c);
  box-shadow: 0 5px 0 #a4650a, 0 0 0 5px rgba(255,206,90,.35), var(--lift-1);
  animation: nodePulse 1.4s ease-in-out infinite;
}
.booster .price {
  position: absolute; bottom: -7px; right: -6px;
  background: var(--cocoa); color: #ffd75e; font-size: 11px; font-weight: 800;
  border-radius: 99px; padding: 1px 6px 2px; border: 2px solid #fff6e2;
  display: flex; align-items: center; gap: 2px;
}
.booster.cant .price { color: #ff9a90; }
.rail-score { text-align: center; color: #ffeccb; font-size: 10px; font-weight: 800;
              letter-spacing: 1.2px; text-transform: uppercase; }
.rail-score strong { display: block; font-family: 'Baloo 2', cursive; font-size: clamp(14px, 1.7vw, 19px);
                     letter-spacing: 0; color: #fff; }

/* portrait / narrow */
@media (max-aspect-ratio: 1/1), (max-width: 700px) {
  .game-grid { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; }
  .goals-panel { flex-direction: row; align-items: center; gap: 8px; padding: 7px 10px; }
  .panel-head { order: 0; }
  .goals { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 4px 8px; gap: 14px; order: 2; }
  .goal { width: auto; }
  .goal img, .goal .swatch { width: 38px; height: 38px; }
  .moves-box { order: 1; min-width: 74px; padding: 2px 10px 4px; margin-top: 0; }
  .goals { flex: 1 1 auto; }
  .moves-box strong { font-size: 27px; }
  .fortune-tag { order: 3; max-width: 96px; font-size: 10px; }
  .rail { flex-direction: row; align-items: center; padding: 7px 10px; }
  .rail-boosters { flex-direction: row; }
  .lvl-badge { font-size: 13px; padding: 2px 10px 3px; }
}
@media (max-width: 430px) {
  .fortune-tag { display: none; }
  .goals { gap: 10px; }
}

/* ── banner + toast ──────────────────────────────────────────────────────── */
.banner {
  position: absolute; left: 0; right: 0; top: 38%;
  text-align: center; pointer-events: none; opacity: 0;
  font-family: 'Baloo 2', cursive; font-weight: 800;
  font-size: clamp(34px, 6vw, 62px); color: #fff3d2;
  -webkit-text-stroke: 7px #a4470f; paint-order: stroke fill;
  filter: drop-shadow(0 8px 16px rgba(30,14,6,.6));
}
.banner.show { animation: bannerIn 1.5s var(--glide); }
@keyframes bannerIn {
  0% { opacity: 0; transform: scale(.4) rotate(-6deg); }
  18% { opacity: 1; transform: scale(1.12) rotate(2deg); }
  30% { transform: scale(1) rotate(0); }
  75% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15); }
}
.toast {
  position: absolute; left: 50%; bottom: 12%; transform: translate(-50%, 18px);
  background: rgba(52,26,12,.92); color: #ffeccb; font-weight: 800; font-size: 15px;
  padding: 9px 20px 10px; border-radius: 99px; border: 2px solid rgba(255,214,150,.3);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--spring);
  box-shadow: var(--lift-2); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── dialogs ─────────────────────────────────────────────────────────────── */
.veil {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(28,14,6,.62); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--glide);
}
.veil.show { opacity: 1; pointer-events: auto; }
.dialog {
  position: absolute; inset: 0; z-index: 11;
  display: none; align-items: center; justify-content: center;
  padding: 16px; pointer-events: none;
}
.dialog.show { display: flex; }
.dlg-card {
  position: relative; pointer-events: auto;
  width: min(430px, 94vw); max-height: 92dvh; overflow: visible;
  background: var(--shell);
  border: 4px solid rgba(255,226,178,.5);
  border-radius: var(--r-lg);
  padding: 20px 20px 22px;
  box-shadow: var(--lift-3), inset 0 2px 0 rgba(255,255,255,.22);
  display: grid; gap: 12px;
  animation: dlgIn .45s var(--spring);
}
@keyframes dlgIn { from { transform: translateY(28px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.dlg-card.scroll-card { overflow: visible; }
.dlg-title {
  margin: 0; text-align: center;
  font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 28px;
  color: #fff3d2; -webkit-text-stroke: 5px #9d3a12; paint-order: stroke fill;
}
.dlg-title.big-title { font-size: clamp(34px, 6vw, 46px); }
.dlg-sub { margin: -6px 0 0; text-align: center; color: #ffe6bf; font-weight: 700; font-size: 15px; }
.dlg-x {
  position: absolute; top: -12px; right: -12px; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(180deg, #ff7b6f, #d43a2e); color: #fff; font-weight: 900; font-size: 15px;
  border: 3px solid #fff6e2; box-shadow: 0 4px 0 #9d2a20, var(--lift-1); z-index: 2;
}
.dlg-x:active { transform: translateY(3px); box-shadow: 0 1px 0 #9d2a20; }

/* pre-level */
.pre-goals {
  background: linear-gradient(180deg, var(--cream-2), var(--parchment));
  border-radius: var(--r-md); padding: 12px; display: flex; flex-wrap: wrap;
  gap: 14px; justify-content: center; box-shadow: inset 0 3px 8px rgba(120,72,36,.2);
}
.pre-goals .goal b { position: static; margin-top: 4px; display: inline-block; }
.pre-goals .goal { gap: 2px; width: auto; }

.fortune { display: grid; gap: 7px; }
.fortune-head { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: 1.6px;
                text-transform: uppercase; color: #ffdca8; }
.fortune-window {
  position: relative; height: 52px; border-radius: var(--r-sm); overflow: hidden;
  background: rgba(0,0,0,.28); box-shadow: inset 0 3px 8px rgba(0,0,0,.4);
  border: 2px solid rgba(255,222,170,.3);
}
.fortune-strip { position: absolute; top: 0; left: 0; height: 100%; display: flex; align-items: center; will-change: transform; }
.fortune-cell {
  width: 150px; flex: 0 0 150px; height: 100%;
  display: grid; place-items: center; text-align: center;
  font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 17px; color: #fff;
  border-right: 2px solid rgba(0,0,0,.2);
  text-shadow: 0 2px 3px rgba(0,0,0,.4);
}
.fortune-needle {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px;
  background: linear-gradient(180deg, #fff, #ffcf5e); border-radius: 4px;
  box-shadow: 0 0 12px rgba(255,220,130,.9);
}
.fortune-result { text-align: center; color: #fff3d2; font-weight: 800; font-size: 14px; min-height: 20px; }
.fortune-result em { font-style: normal; color: #ffdca8; font-weight: 700; }

.pre-boosters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pre-b {
  flex: 1 1 110px; min-width: 104px; border-radius: var(--r-sm); padding: 9px 8px 10px;
  background: linear-gradient(180deg, #fff9ec, #f0dcba); color: var(--cocoa);
  box-shadow: 0 4px 0 #c9a879, var(--lift-1), inset 0 2px 0 rgba(255,255,255,.8);
  display: grid; gap: 3px; text-align: center; font-weight: 800; font-size: 13px;
  transition: transform .18s var(--spring), box-shadow .18s;
}
.pre-b:active { transform: translateY(3px); box-shadow: 0 1px 0 #c9a879, var(--lift-1); }
.pre-b.on {
  background: linear-gradient(180deg, #a6e6ac, #6cc274);
  box-shadow: 0 4px 0 #3d8a45, 0 0 0 4px rgba(120,215,130,.35), var(--lift-1);
}
.pre-b small { display: flex; align-items: center; justify-content: center; gap: 3px;
               font-size: 12px; font-weight: 800; opacity: .8; }
.pre-b small b { color: #b4770a; }

/* win */
.win-card { overflow: visible; text-align: center; isolation: isolate; }
.win-level { margin: -8px 0 0; color: #ffdca8; font-weight: 800; font-size: 14px;
             letter-spacing: 1.4px; text-transform: uppercase; }
.burst-bg {
  position: absolute; inset: -34%; z-index: -1; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(255,216,120,.30) 0 5deg, transparent 5deg 18deg);
  animation: spin 26s linear infinite; border-radius: 50%;
  filter: blur(1.5px);
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, rgba(0,0,0,.35) 60%, transparent 78%);
  mask-image: radial-gradient(closest-side, #000 30%, rgba(0,0,0,.35) 60%, transparent 78%);
}
@keyframes spin { to { transform: rotate(360deg); } }
.stars { display: flex; justify-content: center; gap: 10px; margin-top: -2px; }
.stars i {
  width: 52px; height: 52px; display: block; background: rgba(0,0,0,.25);
  clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  transform: scale(.8);
}
.stars i:nth-child(2) { width: 64px; height: 64px; margin-top: -12px; }
.stars i.on {
  background: linear-gradient(180deg, #ffe98a, #f5a80d);
  filter: drop-shadow(0 4px 8px rgba(190,110,0,.6));
  animation: starPop .55s var(--spring) backwards;
}
.stars i.on:nth-child(1) { animation-delay: .1s; }
.stars i.on:nth-child(2) { animation-delay: .35s; }
.stars i.on:nth-child(3) { animation-delay: .6s; }
@keyframes starPop { 0% { transform: scale(2.2) rotate(-25deg); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.dlg-baker { width: 132px; margin: -8px auto 0; filter: drop-shadow(0 10px 16px rgba(40,18,8,.5)); }
.win-score { color: #ffe6bf; font-weight: 800; font-size: 15px; }
.win-score strong { font-family: 'Baloo 2', cursive; font-size: 26px; color: #fff; margin-left: 6px; }
.win-reward { display: flex; justify-content: center; }

.lose-goals { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  background: linear-gradient(180deg, var(--cream-2), var(--parchment));
  border-radius: var(--r-md); padding: 12px; box-shadow: inset 0 3px 8px rgba(120,72,36,.2); }

/* toggles */
.toggles { display: grid; gap: 8px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(180deg, var(--cream-2), var(--parchment));
  border-radius: var(--r-sm); padding: 10px 14px; font-weight: 800; color: var(--cocoa);
  box-shadow: inset 0 2px 5px rgba(120,72,36,.18); cursor: pointer;
}
.toggle input { display: none; }
.toggle i {
  width: 52px; height: 30px; border-radius: 99px; background: #c9b394; position: relative;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.25); transition: background .25s var(--glide);
}
.toggle i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(180deg, #fff, #eadcc4); box-shadow: 0 2px 4px rgba(0,0,0,.3);
  transition: transform .28s var(--spring);
}
.toggle input:checked + i { background: var(--mint); }
.toggle input:checked + i::after { transform: translateX(22px); }

/* how to play */
.how { max-height: 66dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
       background: linear-gradient(180deg, var(--cream-2), var(--parchment));
       border-radius: var(--r-md); padding: 14px 16px; color: var(--cocoa);
       box-shadow: inset 0 3px 8px rgba(120,72,36,.2); font-size: 14.5px; line-height: 1.55; }
.how h3 { font-family: 'Baloo 2', cursive; font-size: 18px; margin: 16px 0 6px; color: var(--berry-dark); }
.how p { margin: 0 0 4px; }
.how-note { font-style: italic; opacity: .85; }
.how-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.how-list li { display: flex; gap: 10px; align-items: center; }
.how-list img { width: 40px; height: 40px; flex: 0 0 40px; filter: drop-shadow(0 2px 3px rgba(90,50,20,.3)); }

.lives-timer-big { text-align: center; font-family: 'Baloo 2', cursive; font-size: 40px; color: #fff3d2;
                   -webkit-text-stroke: 4px #9d3a12; paint-order: stroke fill; }

.score-fly { position: absolute; inset: 0; pointer-events: none; }
