/* Jelly Stars */
@font-face { font-family: "Lilita One"; src: url("../assets/LilitaOne-Regular.ttf") format("truetype"); font-display: block; }
:root {
  --ink: #4b2a80; --ink2: #8a70b8; --paper: #fffaf2; --paper2: #f6ecff; --lav: #b79bea; --lav-d: #8b68d0;
  --pink: #ff6fa5; --pink-d: #cf3d7c; --gold: #ffc42e; --gold-d: #c98200; --mint: #4ad46a; --mint-d: #249650; --sky: #38b6ff; --sky-d: #1b78c9;
  --num: "Lilita One", "PingFang SC", "PingFang TC", "Heiti SC", "Microsoft YaHei", sans-serif;
  --txt: "PingFang SC", "PingFang TC", "Heiti SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b1a55; font-family: var(--txt); color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
img { -webkit-user-drag: none; pointer-events: none; }
b { font-weight: 700; }

#app { position: fixed; top: 0; bottom: 0; left: 50%; width: min(100vw, 62vh, 540px); transform: translateX(-50%); overflow: hidden; background: #8fd6f5; }
@supports (height: 100dvh) { #app { width: min(100vw, 62dvh, 540px); } }
@media (max-aspect-ratio: 62/100) { #app { width: 100vw; } }

/* ---------- background ---------- */
#bg { position: absolute; inset: 0; background: linear-gradient(180deg, #6fc8f3 0%, #9fdcf6 26%, #c9d2f8 52%, #dcc3f4 76%, #f3bfe0 100%); transition: filter .6s; }
.bg-world { position: absolute; left: 0; right: 0; top: 0; height: 44%; background: url("../assets/world.webp") 62% 0 / auto 100% no-repeat;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
.bg-fade { position: absolute; inset: 0; background: radial-gradient(120% 60% at 50% 105%, rgba(255,255,255,.55), transparent 60%); }
#bgFloat { position: absolute; inset: 0; overflow: hidden; }
#bgFloat img { position: absolute; bottom: -90px; opacity: .55; animation: floatUp linear infinite; filter: drop-shadow(0 6px 8px rgba(80,40,140,.25)); }
@keyframes floatUp { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(-125vh) rotate(360deg); } }
body[data-screen="play"] #bgFloat, body[data-screen="map"] #bgFloat { display: none; }
body[data-screen="play"] .bg-world { opacity: .9; }

/* ---------- shared pieces ---------- */
.screen { position: absolute; inset: 0; display: none; }
body[data-screen="home"] #home, body[data-screen="map"] #map, body[data-screen="play"] #play { display: block; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
body:not([data-screen="play"]) #cv { z-index: 60; }

.card { background: var(--paper); border: 3px solid #fff; border-radius: 24px; box-shadow: 0 5px 0 #cdb6f2, 0 14px 26px rgba(70,30,130,.22); }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; padding: 0 26px; border-radius: 22px;
  font-family: var(--num); font-size: 24px; font-weight: 700; color: #fff; letter-spacing: 1px; text-shadow: 0 2px 0 var(--pink-d);
  background: linear-gradient(180deg, #ff9cc2 0%, #ff6fa5 55%, #f8558f 100%); border: 3px solid #fff;
  box-shadow: 0 6px 0 var(--pink-d), 0 12px 20px rgba(150,30,100,.32), inset 0 3px 0 rgba(255,255,255,.55);
  transition: transform .06s, box-shadow .06s; }
.btn::before { content: ""; position: absolute; left: 12px; right: 12px; top: 5px; height: 36%; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0)); pointer-events: none; }
.btn:active, .btn.down { transform: translateY(5px); box-shadow: 0 1px 0 var(--pink-d), 0 4px 8px rgba(150,30,100,.3), inset 0 3px 0 rgba(255,255,255,.55); }
.btn.green { background: linear-gradient(180deg, #8cf09e, #4ad46a 55%, #34c158); text-shadow: 0 2px 0 var(--mint-d); box-shadow: 0 6px 0 var(--mint-d), 0 12px 20px rgba(20,110,60,.3), inset 0 3px 0 rgba(255,255,255,.55); }
.btn.green:active { box-shadow: 0 1px 0 var(--mint-d), 0 4px 8px rgba(20,110,60,.3), inset 0 3px 0 rgba(255,255,255,.55); }
.btn.blue { background: linear-gradient(180deg, #8ed8ff, #38b6ff 55%, #249fee); text-shadow: 0 2px 0 var(--sky-d); box-shadow: 0 6px 0 var(--sky-d), 0 12px 20px rgba(20,80,150,.3), inset 0 3px 0 rgba(255,255,255,.55); }
.btn.blue:active { box-shadow: 0 1px 0 var(--sky-d), 0 4px 8px rgba(20,80,150,.3), inset 0 3px 0 rgba(255,255,255,.55); }
.btn.gold { background: linear-gradient(180deg, #ffe58a, #ffc42e 55%, #f7ae12); text-shadow: 0 2px 0 var(--gold-d); box-shadow: 0 6px 0 var(--gold-d), 0 12px 20px rgba(150,90,0,.3), inset 0 3px 0 rgba(255,255,255,.55); }
.btn.gold:active { box-shadow: 0 1px 0 var(--gold-d), 0 4px 8px rgba(150,90,0,.3), inset 0 3px 0 rgba(255,255,255,.55); }
.btn.ghost { background: linear-gradient(180deg, #fff, #f3e8ff); color: var(--ink); text-shadow: none; box-shadow: 0 6px 0 #b79bea, 0 12px 20px rgba(70,30,130,.22); }
.btn.ghost:active { box-shadow: 0 1px 0 #b79bea, 0 4px 8px rgba(70,30,130,.22); }
.btn.small { min-height: 46px; font-size: 18px; padding: 0 18px; border-radius: 18px; }
.btn.wide { width: 100%; }
.btn[disabled] { filter: grayscale(.8) brightness(1.05); opacity: .7; }
.btn .price { display: inline-flex; align-items: center; gap: 4px; font-size: .8em; background: rgba(0,0,0,.16); padding: 3px 10px 3px 6px; border-radius: 99px; text-shadow: none; }

.ibtn { width: 46px; height: 46px; border-radius: 16px; background: linear-gradient(180deg, #fff, #f1e6ff); border: 3px solid #fff; box-shadow: 0 4px 0 #b79bea, 0 8px 14px rgba(70,30,130,.22);
  display: inline-flex; align-items: center; justify-content: center; color: var(--lav-d); transition: transform .06s, box-shadow .06s; flex: none; }
.ibtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b79bea, 0 3px 6px rgba(70,30,130,.22); }
.ibtn svg { width: 24px; height: 24px; }
.ibtn.off { color: #c9bfdc; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 6px; border-radius: 99px; background: rgba(75,42,128,.55); color: #fff; font-family: var(--num); font-size: 19px;
  border: 2px solid rgba(255,255,255,.7); box-shadow: 0 4px 10px rgba(50,20,100,.25); }
.coin-ico { display: inline-block; width: 26px; height: 26px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #fff6c2, #ffcf3f 45%, #f09f0c 100%); border: 2px solid #b26a00; position: relative; box-shadow: inset 0 -2px 0 rgba(160,90,0,.45); }
.coin-ico::after { content: ""; position: absolute; inset: 4px; background: #fff3b0; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 35%); }
.coin-ico.sm { width: 20px; height: 20px; border-width: 1.5px; }
.coin-ico.sm::after { inset: 3px; }
.ribbon { font-family: var(--num); font-size: 21px; color: #fff; text-shadow: 0 2px 0 #6b45b9; background: linear-gradient(180deg, #b594f1, #946fe0); padding: 7px 22px 8px; border-radius: 16px; border: 3px solid #fff;
  box-shadow: 0 4px 0 #6b45b9, 0 8px 14px rgba(70,30,130,.25); white-space: nowrap; letter-spacing: 1px; }

/* ---------- home ---------- */
#home { display: none; flex-direction: column; align-items: center; padding: calc(var(--sat) + 14px) 18px calc(var(--sab) + 16px); }
body[data-screen="home"] #home { display: flex; }
.home-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-top .sp { flex: 1; }
.logo { margin-top: 4vh; text-align: center; position: relative; animation: logoIn .7s cubic-bezier(.2,1.5,.4,1) both; }
.logo h1 { margin: 0; font-family: var(--txt); font-weight: 900; font-size: min(19vw, 84px); line-height: 1.02; letter-spacing: 4px; color: #fff8dc;
  -webkit-text-stroke: 10px #8a4fd8; paint-order: stroke fill; text-shadow: 0 7px 0 #5b2aa8, 0 14px 18px rgba(60,20,110,.35); }
.logo h1 span { display: inline-block; animation: bob 2.6s ease-in-out infinite; }
.logo h1 span:nth-child(2) { animation-delay: .15s; color: #ffe27a; } .logo h1 span:nth-child(3) { animation-delay: .3s; } .logo h1 span:nth-child(4) { animation-delay: .45s; color: #ffe27a; }
.logo.en h1 { font-family: var(--num); font-weight: 400; font-size: min(17vw, 76px); letter-spacing: 2px; -webkit-text-stroke-width: 9px; }
.logo .tag { display: inline-block; margin-top: 12px; font-family: var(--num); letter-spacing: 5px; font-size: 15px; color: #fff; background: linear-gradient(180deg, #ff9cc2, #ff6fa5); border: 3px solid #fff; border-radius: 99px; padding: 5px 18px 6px;
  box-shadow: 0 4px 0 var(--pink-d), 0 8px 14px rgba(150,30,100,.3); transform: rotate(-3deg); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes logoIn { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.hero { flex: 1; min-height: 110px; width: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.hero img { height: min(100%, 230px); animation: heroFloat 3s ease-in-out infinite; filter: drop-shadow(0 16px 14px rgba(70,30,130,.3)); }
@keyframes heroFloat { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }
.home-main { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.btn.hero-btn { min-height: 76px; font-size: 30px; flex-direction: column; gap: 0; line-height: 1.1; }
.btn.hero-btn small { font-family: var(--txt); font-weight: 700; font-size: 13px; letter-spacing: 2px; opacity: .95; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode { position: relative; text-align: left; padding: 12px 12px 12px 62px; border-radius: 22px; background: var(--paper); border: 3px solid #fff; box-shadow: 0 5px 0 #cdb6f2, 0 12px 20px rgba(70,30,130,.22); transition: transform .06s, box-shadow .06s; min-height: 68px; }
.mode:active { transform: translateY(4px); box-shadow: 0 1px 0 #cdb6f2, 0 4px 8px rgba(70,30,130,.22); }
.mode img { position: absolute; left: 8px; top: 50%; width: 50px; height: 50px; transform: translateY(-50%); }
.mode b { display: block; font-size: 17px; font-weight: 800; color: var(--ink); }
.mode small { display: block; font-size: 12px; color: var(--ink2); margin-top: 2px; font-family: var(--num); letter-spacing: .5px; }
.home-foot { margin-top: 14px; display: flex; gap: 12px; justify-content: center; width: 100%; }
.pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border-radius: 99px; background: rgba(255,255,255,.82); color: var(--ink); font-weight: 700; font-size: 14px; border: 2px solid #fff; box-shadow: 0 4px 10px rgba(70,30,130,.18); }
.pill svg { width: 20px; height: 20px; color: var(--lav-d); }
.pill:active { transform: translateY(2px); }
.pill .dot { position: absolute; right: -2px; top: -4px; width: 14px; height: 14px; border-radius: 50%; background: #ff4d6d; border: 2px solid #fff; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* ---------- map ---------- */
#map { background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.25)); }
.map-head { position: absolute; left: 0; right: 0; top: 0; z-index: 3; padding: calc(var(--sat) + 12px) 14px 26px; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(120,90,200,.75), rgba(120,90,200,0)); }
.map-head .sp { flex: 1; text-align: center; }
.chip.star { padding-left: 10px; }
.chip.star svg { width: 22px; height: 22px; color: #ffd84a; }
#mapScroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#mapScroll::-webkit-scrollbar { display: none; }
#mapInner { position: relative; width: 100%; }
.zone { position: absolute; left: 0; right: 0; }
.zone::before { content: ""; position: absolute; inset: 0; background: var(--zc); opacity: .5; }
.zone-name { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2; font-weight: 900; font-size: 17px; color: #fff; letter-spacing: 3px; white-space: nowrap;
  background: var(--zb); padding: 7px 22px; border-radius: 99px; border: 3px solid #fff; box-shadow: 0 4px 0 rgba(60,30,110,.35), 0 8px 14px rgba(60,30,110,.25); text-shadow: 0 2px 0 rgba(60,30,110,.4); }
#mapPath { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.node { position: absolute; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; font-family: var(--num); font-size: 24px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25);
  background: radial-gradient(circle at 35% 28%, #ffd0e2, #ff7fb0 45%, #f0508c); border: 4px solid #fff; box-shadow: 0 6px 0 #c13a78, 0 12px 16px rgba(80,30,120,.3); z-index: 1; transition: transform .06s; }
.node:active { transform: translateY(4px); }
.node.done { background: radial-gradient(circle at 35% 28%, #d9ffe0, #5fdc7c 45%, #36bd58); box-shadow: 0 6px 0 #23904a, 0 12px 16px rgba(80,30,120,.3); }
.node.hard:not(.locked) { background: radial-gradient(circle at 35% 28%, #e5d0ff, #a569f5 45%, #8444df); box-shadow: 0 6px 0 #5b28ae, 0 12px 16px rgba(80,30,120,.3); }
.node.locked { background: radial-gradient(circle at 35% 28%, #f4eefc, #cfc3e6 45%, #b8a9d6); box-shadow: 0 6px 0 #9383b8, 0 12px 16px rgba(80,30,120,.2); color: rgba(255,255,255,.9); }
.node.locked svg { width: 24px; height: 24px; }
.node.cur { animation: nodePulse 1.2s ease-in-out infinite; z-index: 2; }
@keyframes nodePulse { 0%, 100% { box-shadow: 0 6px 0 #c13a78, 0 0 0 0 rgba(255,255,255,.9); } 50% { box-shadow: 0 6px 0 #c13a78, 0 0 0 12px rgba(255,255,255,0); } }
.node .stars { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%); display: flex; gap: 0; }
.node .stars svg { width: 17px; height: 17px; color: #d8cdea; filter: drop-shadow(0 1px 0 rgba(60,30,110,.35)); }
.node .stars svg.on { color: #ffd23f; }
.node .me { position: absolute; left: 50%; top: -58px; width: 62px; height: 62px; margin-left: -31px; animation: bob 1.1s ease-in-out infinite; filter: drop-shadow(0 6px 5px rgba(70,30,130,.35)); }

/* ---------- play ---------- */
#hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(var(--sat) + 10px) 12px 0; z-index: 2; }
.hud-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hud-panel { margin-top: 10px; padding: 10px 14px 10px 10px; display: grid; grid-template-columns: 70px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 7px; align-items: center; }
.count { grid-row: 1 / 3; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #c9aeff, #9a72ea 55%, #7e55d6); border: 4px solid #fff; box-shadow: 0 4px 0 #6b45b9, 0 8px 12px rgba(70,30,130,.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; line-height: 1; }
.count small { font-size: 11px; font-weight: 700; opacity: .92; letter-spacing: 1px; }
.count b { font-family: var(--num); font-weight: 400; font-size: 32px; margin-top: 2px; text-shadow: 0 2px 0 #5b36a8; }
.count.low { background: radial-gradient(circle at 35% 25%, #ffb3c0, #ff5e7e 55%, #e33b62); box-shadow: 0 4px 0 #b3224a, 0 8px 12px rgba(150,30,60,.3); animation: pulse .6s ease-in-out infinite; }
.count.low b { text-shadow: 0 2px 0 #b3224a; }
.bump { animation: bump .32s cubic-bezier(.2,1.6,.4,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
.hud-mid { min-width: 0; min-height: 40px; display: flex; align-items: center; }
#hudGoals { display: flex; gap: 14px; align-items: center; }
.goal { display: flex; align-items: center; gap: 5px; position: relative; }
.goal img, .goal canvas { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 2px 2px rgba(70,30,130,.25)); }
.goal b { font-family: var(--num); font-weight: 400; font-size: 23px; color: var(--ink); min-width: 20px; }
.goal.done b { display: inline-block; width: 22px; height: 22px; min-width: 22px; border-radius: 50%; background: var(--mint); border: 2px solid #fff; box-shadow: 0 2px 0 var(--mint-d); position: relative; }
.goal.done b::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(42deg); }
#hudGoals.g3 { gap: 8px; } #hudGoals.g3 .goal { gap: 3px; } #hudGoals.g3 .goal img, #hudGoals.g3 .goal canvas { width: 29px; height: 29px; } #hudGoals.g3 .goal b { font-size: 19px; min-width: 14px; }
#hudSub { font-size: 14px; font-weight: 700; color: var(--ink2); display: none; }
#hudSub b { font-family: var(--num); font-weight: 400; font-size: 24px; color: var(--ink); margin-left: 6px; }
body[data-mode="classic"] #hudGoals, body[data-mode="blitz"] #hudGoals { display: none; }
body[data-mode="classic"] #hudSub, body[data-mode="blitz"] #hudSub { display: block; }
.hud-score { text-align: right; line-height: 1; }
.hud-score small { display: block; font-size: 11px; font-weight: 700; color: var(--ink2); letter-spacing: 1px; }
.hud-score b { font-family: var(--num); font-weight: 400; font-size: 28px; color: var(--pink-d); display: block; margin-top: 3px; min-width: 48px; }
#hudBar { grid-column: 2 / 4; position: relative; height: 14px; border-radius: 99px; background: #e7dbf8; box-shadow: inset 0 2px 3px rgba(70,30,130,.22); }
#hudBarFill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: linear-gradient(180deg, #ffe58a, #ffb72e); box-shadow: inset 0 2px 0 rgba(255,255,255,.6); transition: width .15s linear; min-width: 0; }
body[data-mode="blitz"] #hudBarFill { background: linear-gradient(180deg, #9be3ff, #38b6ff); }
.st { position: absolute; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; background: #cbbbe6; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 35%); transition: background .2s, transform .3s cubic-bezier(.2,1.8,.4,1); }
.st.on { background: #ffb400; transform: scale(1.35); }
body:not([data-mode="adv"]) .st { display: none; }

#boardHit { position: absolute; z-index: 3; touch-action: none; }
#mascot { position: absolute; width: 74px; height: 74px; z-index: 4; transform-origin: 50% 90%; animation: heroFloat 3.2s ease-in-out infinite; filter: drop-shadow(0 5px 5px rgba(70,30,130,.3)); }
#mascot.cheer { animation: cheer .7s cubic-bezier(.3,1.4,.5,1); }
@keyframes cheer { 0% { transform: scale(1) translateY(0); } 30% { transform: scale(1.3, .8) translateY(4px); } 55% { transform: scale(.9, 1.25) translateY(-30px) rotate(-12deg); } 80% { transform: scale(1.1, .92) translateY(0) rotate(6deg); } 100% { transform: none; } }
#armHint { position: absolute; left: 50%; bottom: calc(var(--sab) + 112px); transform: translate(-50%, 12px); z-index: 6; background: rgba(75,42,128,.92); color: #fff; font-weight: 700; font-size: 14px; padding: 8px 18px; border-radius: 99px; border: 2px solid #fff;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; white-space: nowrap; }
#armHint.on { opacity: 1; transform: translate(-50%, 0); }
#tray { position: absolute; left: 10px; right: 10px; bottom: calc(var(--sab) + 10px); z-index: 2; padding: 8px 6px 7px; display: flex; justify-content: space-around; gap: 4px; }
.tool { position: relative; flex: 1; max-width: 72px; height: 76px; border-radius: 18px; background: linear-gradient(180deg, #fff, #f3e8ff); border: 2px solid #fff; box-shadow: 0 4px 0 #cdb6f2, 0 6px 10px rgba(70,30,130,.15);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 5px; transition: transform .06s, box-shadow .06s; }
.tool:active { transform: translateY(3px); box-shadow: 0 1px 0 #cdb6f2; }
.tool img { position: absolute; left: 50%; top: -5px; width: 56px; height: 56px; transform: translateX(-50%); filter: drop-shadow(0 4px 3px rgba(70,30,130,.28)); transition: transform .15s cubic-bezier(.2,1.6,.4,1); }
.tool .lab { font-size: 11px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.tool .cnt { position: absolute; right: -4px; top: -6px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 99px; background: linear-gradient(180deg, #ff8fb5, #ff5e96); color: #fff; font-family: var(--num); font-size: 15px; line-height: 20px; border: 2px solid #fff; box-shadow: 0 2px 0 var(--pink-d); }
.tool .cnt.plus { background: linear-gradient(180deg, #8cf09e, #4ad46a); box-shadow: 0 2px 0 var(--mint-d); }
.tool.armed { background: linear-gradient(180deg, #fff6c9, #ffe27a); box-shadow: 0 4px 0 #e0a81e, 0 0 0 3px #ffd23f; transform: translateY(-6px); }
.tool.armed img { transform: translateX(-50%) scale(1.2) rotate(-10deg); animation: wig .5s ease-in-out infinite alternate; }
@keyframes wig { from { transform: translateX(-50%) scale(1.2) rotate(-12deg); } to { transform: translateX(-50%) scale(1.2) rotate(8deg); } }

/* ---------- praise / toast ---------- */
#praise { position: absolute; left: 0; right: 0; top: 38%; z-index: 30; text-align: center; pointer-events: none; font-family: var(--txt); font-weight: 900; font-size: min(15vw, 66px); letter-spacing: 4px; color: #fff8dc;
  -webkit-text-stroke: 9px #8a4fd8; paint-order: stroke fill; text-shadow: 0 6px 0 #5b2aa8, 0 12px 16px rgba(60,20,110,.4); opacity: 0; }
#praise.en { font-family: var(--num); font-weight: 400; }
#edge { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; box-shadow: inset 0 0 60px 10px var(--ec, #fff); }
#edge.go { animation: edge .75s ease-out both; }
@keyframes edge { 0% { opacity: 0; } 14% { opacity: var(--ea, .6); } 100% { opacity: 0; } }
#praise.go { animation: praise 1.3s cubic-bezier(.2,1.4,.4,1) both; }
#praise[data-tier="1"] { font-size: min(11vw, 46px); -webkit-text-stroke-color: #2b9ad6; text-shadow: 0 5px 0 #17669a, 0 10px 14px rgba(20,60,110,.35); }
#praise[data-tier="2"] { font-size: min(12.5vw, 54px); -webkit-text-stroke-color: #2fae58; text-shadow: 0 5px 0 #1b7a3a, 0 10px 14px rgba(20,90,50,.35); }
#praise[data-tier="3"] { -webkit-text-stroke-color: #f08a1c; text-shadow: 0 6px 0 #b25a00, 0 12px 16px rgba(120,60,0,.4); }
#praise[data-tier="4"] { -webkit-text-stroke-color: #ee4f8b; text-shadow: 0 6px 0 #b3225c, 0 12px 16px rgba(120,20,70,.4); color: #fff; }
#praise[data-tier="5"] { color: #fff3a8; }
@keyframes praise { 0% { opacity: 0; transform: scale(.2) rotate(-10deg); } 22% { opacity: 1; transform: scale(1.18) rotate(-4deg); } 36% { transform: scale(.96) rotate(-3deg); } 46%, 74% { opacity: 1; transform: scale(1) rotate(-3deg); } 100% { opacity: 0; transform: scale(1.12) translateY(-34px) rotate(-3deg); } }
#toast { position: absolute; left: 50%; bottom: calc(var(--sab) + 118px); z-index: 31; transform: translate(-50%, -8px); background: rgba(75,42,128,.92); color: #fff; font-weight: 700; font-size: 15px; line-height: 1.4; padding: 10px 20px; border-radius: 18px; border: 2px solid rgba(255,255,255,.9);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; max-width: 84%; text-align: center; box-shadow: 0 8px 18px rgba(50,20,100,.3); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- modal ---------- */
#modal { position: absolute; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(52,24,100,.55); }
#modal.on { display: flex; animation: fade .18s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { position: relative; width: 100%; max-width: 350px; background: var(--paper); border: 4px solid #fff; border-radius: 30px; box-shadow: 0 8px 0 #b79bea, 0 24px 44px rgba(40,10,90,.45); padding: 46px 20px 22px; text-align: center; animation: sheetIn .38s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes sheetIn { from { transform: scale(.6) translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet { max-height: calc(100% - 56px); }
.sheet .scroll { overflow-y: auto; }
.btn { white-space: nowrap; }
.sheet .head { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); }
.sheet .x { position: absolute; right: -8px; top: -14px; width: 40px; height: 40px; border-radius: 50%; }
.sheet .x svg { width: 20px; height: 20px; }
.sheet h2 { margin: 0 0 4px; font-size: 22px; font-weight: 900; color: var(--ink); }
.sheet p { margin: 6px 0; font-size: 14px; line-height: 1.55; color: var(--ink2); font-weight: 600; }
.sheet .sub { font-size: 13px; color: var(--ink2); font-weight: 700; letter-spacing: 1px; }
.sheet .acts { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.sheet .acts.row { flex-direction: row; } .sheet .acts.row .btn { flex: 1; padding: 0 10px; }
.well { background: var(--paper2); border-radius: 18px; padding: 12px; margin-top: 12px; box-shadow: inset 0 2px 4px rgba(70,30,130,.12); }
.goals-row { display: flex; justify-content: center; gap: 18px; }
.goals-row .goal { flex-direction: column; gap: 2px; }
.goals-row .goal img, .goals-row .goal canvas { width: 50px; height: 50px; }
.goals-row .goal b { font-size: 22px; }
.kv { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; color: var(--ink2); padding: 5px 4px; }
.kv b { font-family: var(--num); font-weight: 400; font-size: 22px; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; color: #fff; background: #8f55e6; border-radius: 99px; padding: 3px 10px; margin-left: 6px; vertical-align: 2px; }
.tip { display: flex; gap: 10px; align-items: center; text-align: left; }
.tip canvas, .tip img { width: 54px; height: 54px; flex: none; }
.tip b { display: block; font-size: 15px; color: var(--ink); } .tip span { font-size: 13px; line-height: 1.45; color: var(--ink2); font-weight: 600; }
.bigstars { display: flex; justify-content: center; gap: 4px; margin: -4px 0 6px; height: 84px; align-items: flex-end; }
.bigstars svg { width: 72px; height: 72px; color: #ddd0f0; filter: drop-shadow(0 4px 0 rgba(90,60,150,.25)); }
.bigstars svg:nth-child(2) { width: 88px; height: 88px; margin-bottom: 6px; }
.bigstars svg.on { color: #ffc61a; filter: drop-shadow(0 4px 0 #c98200) drop-shadow(0 8px 10px rgba(180,110,0,.35)); animation: starIn .5s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes starIn { from { transform: scale(3) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.bigscore { font-family: var(--num); font-size: 50px; color: var(--pink-d); line-height: 1.1; text-shadow: 0 3px 0 #ffd0e2; }
.stamp { display: inline-block; font-weight: 900; font-size: 15px; color: #fff; background: linear-gradient(180deg, #ffb13d, #f08a1c); padding: 4px 14px; border-radius: 99px; border: 2px solid #fff; box-shadow: 0 3px 0 #b25a00; transform: rotate(-6deg); margin: 2px 0 6px; animation: starIn .5s .4s cubic-bezier(.2,1.8,.4,1) both; }
.sheet .art { width: 120px; height: 120px; margin: -8px auto 2px; display: block; filter: drop-shadow(0 8px 8px rgba(70,30,130,.3)); animation: heroFloat 3s ease-in-out infinite; }
.sheet .art.sad { filter: grayscale(.5) drop-shadow(0 8px 8px rgba(70,30,130,.3)); animation: none; transform: rotate(-12deg); }
.toggles { display: flex; justify-content: center; gap: 14px; margin-top: 14px; }
.toggles .ibtn { width: 54px; height: 54px; border-radius: 18px; } .toggles .ibtn svg { width: 28px; height: 28px; }
.howto { text-align: left; display: flex; flex-direction: column; gap: 10px; margin-top: 10px; max-height: 52vh; overflow-y: auto; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 12px; }
.day { border-radius: 12px; padding: 6px 0 5px; background: var(--paper2); font-family: var(--num); font-size: 13px; color: var(--ink2); position: relative; }
.day i { display: block; margin: 3px auto 0; }
.day.got { background: #d9f7df; color: var(--mint-d); } .day.now { background: #fff1b8; color: var(--gold-d); box-shadow: 0 0 0 2px #ffc42e; }
.reward { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; font-family: var(--num); font-size: 26px; color: var(--ink); }
.reward span { display: inline-flex; align-items: center; gap: 6px; } .reward img { width: 44px; height: 44px; }

#curtain { position: absolute; inset: 0; z-index: 70; background: #fff; opacity: 0; pointer-events: none; transition: opacity .16s; }
#curtain.on { opacity: 1; }

@media (max-height: 700px) {
  .logo { margin-top: 1vh; } .hero { min-height: 80px; } .btn.hero-btn { min-height: 66px; font-size: 26px; }
  .hud-panel { padding-top: 7px; padding-bottom: 7px; } .count { width: 60px; height: 60px; } .count b { font-size: 27px; } .hud-panel { grid-template-columns: 60px 1fr auto; }
  .tool { height: 66px; } .tool img { width: 48px; height: 48px; }
}
@media (max-height: 620px), (max-width: 350px) {
  #modal { padding: 34px 12px 10px; }
  .sheet { padding: 34px 14px 14px; } .sheet .acts { gap: 9px; margin-top: 12px; } .well { padding: 8px; margin-top: 8px; }
  .btn { min-height: 48px; font-size: 20px; padding: 0 14px; } .btn.small { min-height: 40px; font-size: 16px; }
  .bigscore { font-size: 38px; } .sheet .art { width: 78px; height: 78px; } .bigstars { height: 62px; } .bigstars svg { width: 52px; height: 52px; } .bigstars svg:nth-child(2) { width: 64px; height: 64px; }
  .kv { padding: 2px 4px; font-size: 14px; } .kv b { font-size: 19px; }
  .map-head { gap: 6px; padding-left: 8px; padding-right: 8px; } .map-head .ribbon { font-size: 16px; padding: 6px 12px 7px; } .map-head .sp { min-width: 0; } .chip { height: 34px; font-size: 16px; padding-right: 10px; }
  .btn .price { padding: 2px 8px 2px 5px; }
}
@media (prefers-reduced-motion: reduce) { .logo h1 span, .hero img, #mascot, #bgFloat img { animation: none; } }
