@font-face { font-family: "Lilita One"; src: url(../fonts/lilita.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Fredoka"; src: url(../fonts/fredoka.woff2) format("woff2"); font-weight: 400 700; font-display: block; }
/* Lilita has one weight, so Chinese headings would fall back to a regular-weight
   system face. This alias points the CJK range at the device's bold system font. */
@font-face { font-family: "CJK Head"; unicode-range: U+2E80-9FFF, U+3000-303F, U+FF00-FFEF;
  src: local("PingFangSC-Semibold"), local("PingFang SC Semibold"), local("NotoSansCJKsc-Black"), local("Noto Sans CJK SC Black"), local("NotoSansCJKsc-Bold"), local("Noto Sans CJK SC Bold"),
    local("NotoSansSC-Bold"), local("SourceHanSansSC-Bold"), local("Microsoft YaHei Bold"), local("MicrosoftYaHei-Bold"), local("HiraginoSansGB-W6"); }

/* The newest element names use characters most phones lack (𬬻 鿏 鿫 …).
   A tiny Noto Sans CJK SC subset covers just those (fonts/OFL-NotoSansCJK.txt). */
@font-face { font-family: "CJK Rare"; src: url(../fonts/cjkrare-regular.woff2) format("woff2"); font-weight: 100 550; unicode-range: U+9FCF, U+9FD4, U+9FEB-9FED, U+2B4E7, U+2B7F7, U+2B7FC, U+2CB2D, U+2CB3B, U+2CB4A, U+2CB5B, U+2CB73, U+2CB76; }
@font-face { font-family: "CJK Rare"; src: url(../fonts/cjkrare-bold.woff2) format("woff2"); font-weight: 551 900; unicode-range: U+9FCF, U+9FD4, U+9FEB-9FED, U+2B4E7, U+2B7F7, U+2B7FC, U+2CB2D, U+2CB3B, U+2CB4A, U+2CB5B, U+2CB73, U+2CB76; }
@font-face { font-family: "CJK Rare Head"; src: url(../fonts/cjkrare-bold.woff2) format("woff2"); unicode-range: U+9FCF, U+9FD4, U+9FEB-9FED, U+2B4E7, U+2B7F7, U+2B7FC, U+2CB2D, U+2CB3B, U+2CB4A, U+2CB5B, U+2CB73, U+2CB76; }

:root {
  --ink: #5A2A6E;
  --ink2: #8A4F9E;
  --cream: #FFF8EF;
  --cream2: #FFEEDD;
  --pink: #FF6FA8;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --head: "Lilita One", "CJK Head", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "CJK Rare Head", sans-serif;
  --body: "Fredoka", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "CJK Rare", sans-serif;
  --navh: 74px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  background: #3A1D4E radial-gradient(circle at 20% 20%, #5A2E73 0, transparent 40%) fixed;
  font-family: var(--body); color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}
#app { position: fixed; inset: 0; max-width: 520px; margin: 0 auto; overflow: hidden; background: #FFD9EC; box-shadow: 0 0 60px rgba(0,0,0,.4); }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud, #page, #top, #modals, #fx { position: absolute; inset: 0; pointer-events: none; }
#hud > *, #page > *, #top > *, #modals > * { pointer-events: auto; }
#top { z-index: 15; bottom: auto; }
#fx { z-index: 40; }
#page { z-index: 10; }
#nav { z-index: 20; }
#modals { z-index: 30; }
.hidden { display: none !important; }
button.shopbadge { font: inherit; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
.ic { width: 100%; height: 100%; display: block; overflow: visible; }

/* outlined candy text */
.ot { font-family: var(--head); color: #fff; letter-spacing: .3px;
  text-shadow: 0 2px 0 var(--o, var(--ink)), 2px 0 0 var(--o, var(--ink)), -2px 0 0 var(--o, var(--ink)), 0 -2px 0 var(--o, var(--ink)),
    1.6px 1.6px 0 var(--o, var(--ink)), -1.6px 1.6px 0 var(--o, var(--ink)), 1.6px -1.6px 0 var(--o, var(--ink)), -1.6px -1.6px 0 var(--o, var(--ink)),
    0 4px 0 rgba(60,20,70,.35); }
.ot.thin { text-shadow: 0 1.5px 0 var(--o, var(--ink)), 1.5px 0 0 var(--o, var(--ink)), -1.5px 0 0 var(--o, var(--ink)), 0 -1.5px 0 var(--o, var(--ink)), 1px 1px 0 var(--o, var(--ink)), -1px 1px 0 var(--o, var(--ink)), 1px -1px 0 var(--o, var(--ink)), -1px -1px 0 var(--o, var(--ink)), 0 3px 0 rgba(60,20,70,.3); }

/* candy buttons */
.btn {
  --c1: #8BF57A; --c2: #38C653; --c3: #219140;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 6px 22px 10px; border-radius: 18px; border: 3px solid var(--ink);
  font-family: var(--head); font-size: 22px; color: #fff; --o: var(--c3);
  background: linear-gradient(var(--c1), var(--c2) 70%);
  box-shadow: inset 0 -6px 0 var(--c3), inset 0 3px 0 rgba(255,255,255,.55), 0 4px 0 var(--ink), 0 8px 14px rgba(60,20,70,.25);
  transition: transform .08s, box-shadow .08s, filter .15s;
  text-shadow: 0 2px 0 var(--c3), 2px 0 0 var(--c3), -2px 0 0 var(--c3), 0 -2px 0 var(--c3), 1.5px 1.5px 0 var(--c3), -1.5px 1.5px 0 var(--c3), 1.5px -1.5px 0 var(--c3), -1.5px -1.5px 0 var(--c3);
}
.btn::after { content: ""; position: absolute; left: 10px; right: 10px; top: 5px; height: 30%; border-radius: 12px; background: linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,0)); pointer-events: none; }
.btn:active:not([disabled]) { transform: translateY(3px); box-shadow: inset 0 -4px 0 var(--c3), inset 0 2px 0 rgba(255,255,255,.5), 0 1px 0 var(--ink), 0 3px 6px rgba(60,20,70,.2); }
.btn.pink { --c1: #FFA3CC; --c2: #F2559A; --c3: #C02D6C; }
.btn.blue { --c1: #8CDEFF; --c2: #3AA2F2; --c3: #1E6CC2; }
.btn.yellow { --c1: #FFEA7A; --c2: #FFB627; --c3: #C97A06; }
.btn.purple { --c1: #D3B0FF; --c2: #9A66F5; --c3: #6537C2; }
.btn.red { --c1: #FF9C9C; --c2: #F04C5C; --c3: #B4233A; }
.btn[disabled], .btn.off { --c1: #EAE3EF; --c2: #C9BED3; --c3: #9C90A9; filter: saturate(.7); cursor: default; }
.btn.sm { min-height: 40px; font-size: 18px; padding: 4px 14px 8px; border-radius: 14px; }
.btn.xs { min-height: 34px; font-size: 16px; padding: 2px 10px 6px; border-radius: 12px; box-shadow: inset 0 -4px 0 var(--c3), inset 0 2px 0 rgba(255,255,255,.55), 0 3px 0 var(--ink); }
.btn.lg { min-height: 62px; font-size: 28px; border-radius: 22px; padding: 6px 30px 12px; }
.btn .ic { width: 26px; height: 26px; flex: none; }
.btn.sm .ic, .btn.xs .ic { width: 20px; height: 20px; }
.btn .price { display: inline-flex; align-items: center; gap: 4px; }

.round { width: 46px; height: 46px; border-radius: 50%; padding: 8px; border: 3px solid var(--ink);
  background: linear-gradient(#FFA3CC, #F2559A 70%); box-shadow: inset 0 -5px 0 #C02D6C, inset 0 3px 0 rgba(255,255,255,.55), 0 3px 0 var(--ink); }
.round.blue { background: linear-gradient(#8CDEFF, #3AA2F2 70%); box-shadow: inset 0 -5px 0 #1E6CC2, inset 0 3px 0 rgba(255,255,255,.55), 0 3px 0 var(--ink); }
.round.purple { background: linear-gradient(#D3B0FF, #9A66F5 70%); box-shadow: inset 0 -5px 0 #6537C2, inset 0 3px 0 rgba(255,255,255,.55), 0 3px 0 var(--ink); }
.round:active { transform: translateY(2px); }
.xbtn { position: absolute; top: -16px; right: -12px; width: 46px; height: 46px; padding: 9px; border-radius: 50%; border: 3px solid var(--ink);
  background: linear-gradient(#FF9C9C, #F04C5C 70%); box-shadow: inset 0 -5px 0 #B4233A, inset 0 3px 0 rgba(255,255,255,.55), 0 3px 0 var(--ink); z-index: 3; }

/* resource pills */
.pill { position: relative; display: flex; align-items: center; height: 38px; padding: 0 12px 0 34px; border-radius: 20px;
  background: rgba(64,24,84,.62); border: 2.5px solid rgba(255,255,255,.85); box-shadow: 0 3px 0 rgba(60,20,70,.35); min-width: 84px; }
.pill > .ic { position: absolute; left: -8px; top: -5px; width: 42px; height: 42px; }
.pill .val { font-family: var(--head); font-size: 20px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.pill .add { position: absolute; right: -8px; width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: linear-gradient(#8BF57A, #38C653); border: 2.5px solid var(--ink); }
.pill.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.15); } }

/* top bar */
.topbar { position: absolute; top: calc(var(--sat) + 10px); left: calc(var(--sal) + 12px); right: calc(var(--sar) + 12px); display: flex; align-items: center; gap: 14px; }
.topbar .grow { flex: 1; }
.shopbadge { position: relative; display: flex; align-items: center; height: 42px; padding: 0 12px 0 46px; border-radius: 22px; background: rgba(64,24,84,.62); border: 2.5px solid rgba(255,255,255,.85); box-shadow: 0 3px 0 rgba(60,20,70,.35); }
.shopbadge .starbig { position: absolute; left: -10px; top: -9px; width: 56px; height: 56px; }
.shopbadge .starbig b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 5px; font-family: var(--head); font-size: 20px; color: #fff; text-shadow: 0 0 3px var(--ink), 0 2px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); }
.xpbar { width: 70px; height: 14px; border-radius: 8px; background: rgba(0,0,0,.35); overflow: hidden; border: 2px solid rgba(255,255,255,.7); }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(#FFB3D1, #FF5C9C); border-radius: 6px; transition: width .4s; }

/* bottom nav */
#nav { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--navh) + var(--sab)); padding: 0 calc(var(--sar) + 6px) var(--sab) calc(var(--sal) + 6px);
  display: grid; grid-template-columns: 1fr 1fr 1.35fr 1fr 1fr; align-items: center;
  background: linear-gradient(#FFFFFF, #FFE3F0); border-top: 4px solid #FFB8D6; border-radius: 26px 26px 0 0; box-shadow: 0 -6px 18px rgba(90,42,110,.18); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 64px; border-radius: 18px; transition: transform .15s; }
.tab .ic { width: 34px; height: 34px; transition: transform .2s; }
.tab span { font-family: var(--head); font-size: 13px; color: var(--ink2); margin-top: 2px; }
.tab.on { background: linear-gradient(rgba(255,143,192,.35), rgba(255,143,192,.12)); }
.tab.on .ic { transform: scale(1.18) translateY(-3px); }
.tab.on span { color: var(--ink); }
.dot { position: absolute; top: 4px; right: 18%; width: 18px; height: 18px; border-radius: 50%; background: #FF3B5C; border: 2.5px solid #fff; box-shadow: 0 2px 0 rgba(0,0,0,.2); font-family: var(--head); font-size: 11px; color: #fff; display: flex; align-items: center; justify-content: center; }
.playtab { position: relative; height: 100%; display: flex; justify-content: center; }
.btn.playbtn { position: absolute; bottom: 10px; width: 100%; max-width: 128px; height: 84px; border-radius: 28px; flex-direction: column; gap: 0; padding: 0 4px 6px; white-space: nowrap; }
.playbtn .t1 { font-size: 28px; line-height: 1; }
.playbtn .t2 { font-size: 15px; line-height: 1; margin-top: 3px; }
.playbtn.locked .t1 { font-size: 18px; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* panels */
.panel { background: var(--cream); border-radius: 24px; border: 4px solid #fff; box-shadow: 0 0 0 3px #EAB4D3, 0 10px 24px rgba(60,20,70,.25); }
.ribbon { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  font-family: var(--head); font-size: 26px; line-height: 1.15; color: #fff; padding: 6px 30px 9px; border-radius: 16px; border: 3px solid var(--ink);
  background: linear-gradient(#FFA3CC, #F2559A 75%); box-shadow: inset 0 -5px 0 #C02D6C, inset 0 3px 0 rgba(255,255,255,.5), 0 4px 0 var(--ink);
  text-shadow: 0 2px 0 #A0245A, 2px 0 0 #A0245A, -2px 0 0 #A0245A, 0 -2px 0 #A0245A; }
.ribbon.long { font-size: 21px; padding: 7px 22px 10px; }
.ribbon.green { background: linear-gradient(#8BF57A, #38C653 75%); box-shadow: inset 0 -5px 0 #219140, inset 0 3px 0 rgba(255,255,255,.5), 0 4px 0 var(--ink); text-shadow: 0 2px 0 #1B7A35, 2px 0 0 #1B7A35, -2px 0 0 #1B7A35, 0 -2px 0 #1B7A35; }
.ribbon.blue { background: linear-gradient(#8CDEFF, #3AA2F2 75%); box-shadow: inset 0 -5px 0 #1E6CC2, inset 0 3px 0 rgba(255,255,255,.5), 0 4px 0 var(--ink); text-shadow: 0 2px 0 #18579C, 2px 0 0 #18579C, -2px 0 0 #18579C, 0 -2px 0 #18579C; }
.ribbon.purple { background: linear-gradient(#D3B0FF, #9A66F5 75%); box-shadow: inset 0 -5px 0 #6537C2, inset 0 3px 0 rgba(255,255,255,.5), 0 4px 0 var(--ink); text-shadow: 0 2px 0 #4E2A99, 2px 0 0 #4E2A99, -2px 0 0 #4E2A99, 0 -2px 0 #4E2A99; }
.ribbon.grey { background: linear-gradient(#D6CCDD, #A898B5 75%); box-shadow: inset 0 -5px 0 #7D6C8C, inset 0 3px 0 rgba(255,255,255,.5), 0 4px 0 var(--ink); text-shadow: 0 2px 0 #5E4E6C, 2px 0 0 #5E4E6C, -2px 0 0 #5E4E6C, 0 -2px 0 #5E4E6C; }

/* modals */
.mwrap { position: absolute; inset: 0; isolation: isolate; display: flex; align-items: center; justify-content: center; padding: calc(var(--sat) + 30px) 16px calc(var(--sab) + 20px);
  background: rgba(42,16,60,.6); animation: fadeIn .2s ease-out; }
.mwrap.out { animation: fadeOut .18s ease-in forwards; }
.modal { position: relative; width: min(100%, 380px); max-height: 100%; display: flex; flex-direction: column; padding: 40px 12px 10px; animation: popIn .38s cubic-bezier(.2,1.5,.4,1); }
.mwrap.out .modal { animation: popOut .18s ease-in forwards; }
.modal .body { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; text-align: center; scrollbar-width: none; padding: 2px 6px 12px; }
.modal .body::-webkit-scrollbar { display: none; }
.modal .row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.modal p { margin: 8px 4px; font-size: 17px; line-height: 1.35; font-weight: 500; }
.modal.sheet { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 78%; border-radius: 28px 28px 0 0; border-bottom: 0;
  padding: 40px 8px calc(var(--sab) + 6px); animation: sheetIn .32s cubic-bezier(.2,1.2,.4,1); }
.mwrap.sheetwrap { align-items: flex-end; padding: 0; }
.modal.sheet > .xbtn { right: 10px; top: -18px; }
.mwrap.out .modal.sheet { animation: sheetOut .2s ease-in forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { transform: scale(.55); opacity: 0; } 70% { opacity: 1; } }
@keyframes popOut { to { transform: scale(.7); opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

/* toast */
.toast { position: absolute; left: 50%; top: 32%; transform: translate(-50%, 0); z-index: 50; pointer-events: none;
  font-family: var(--head); font-size: 20px; color: #fff; padding: 8px 18px 10px; border-radius: 18px; background: rgba(64,24,84,.85); border: 2.5px solid #fff; width: max-content; max-width: calc(100% - 40px); text-align: center; line-height: 1.25; animation: toast 1.6s ease-out forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 16px) scale(.8); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 20% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -20px); } }

/* boot */
#boot { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 35%, #FFE3F1 0, #FFB8D9 45%, #C9A6FF 100%); transition: opacity .4s; }
#boot.gone { opacity: 0; pointer-events: none; }
#boot canvas { width: 240px; height: 240px; }
#boot .logo { font-family: var(--head); font-size: 46px; line-height: .95; text-align: center; color: #fff; --o: var(--ink); }
#boot .logo small { display: block; font-size: 22px; color: #FFE36B; }
#boot .hint { margin-top: 24px; font-family: var(--head); font-size: 22px; color: #fff; --o: #C02D6C; animation: pulse 1.4s infinite; }

/* level HUD */
.lvtop { position: absolute; top: calc(var(--sat) + 8px); left: calc(var(--sal) + 8px); right: calc(var(--sar) + 8px); display: flex; gap: 8px; align-items: stretch; }
.movecard { position: relative; width: 88px; flex: none; padding: 6px 4px 6px; text-align: center; border-radius: 20px; border: 3px solid var(--ink);
  background: linear-gradient(#8CDEFF, #3AA2F2 75%); box-shadow: inset 0 -6px 0 #1E6CC2, inset 0 3px 0 rgba(255,255,255,.55), 0 4px 0 var(--ink); }
.movecard .lab { font-family: var(--head); font-size: 14px; color: #fff; text-shadow: 0 2px 0 #18579C; }
.movecard .num { font-family: var(--head); font-size: 40px; line-height: 1; color: #fff; --o: #18579C; }
.movecard.low { background: linear-gradient(#FF9C9C, #F04C5C 75%); box-shadow: inset 0 -6px 0 #B4233A, inset 0 3px 0 rgba(255,255,255,.55), 0 4px 0 var(--ink); animation: pulse .8s infinite; }
.movecard.low .num { --o: #8E1A2C; }
.goalcard { flex: 1; display: flex; align-items: center; justify-content: space-evenly; gap: 4px; padding: 6px 6px; border-radius: 20px; min-height: 76px; }
.goal { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 52px; }
.goal .gi { width: 48px; height: 48px; position: relative; }
.goal .gi img, .goal .gi canvas { width: 100%; height: 100%; display: block; object-fit: contain; }
.goal .cnt { font-family: var(--head); font-size: 18px; line-height: 1; margin-top: -4px; color: #fff; --o: var(--ink); }
.goal .gl { font-size: 11px; font-weight: 600; color: var(--ink2); white-space: nowrap; max-width: 76px; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; padding-bottom: 3px; }
.goal .gl sub, .fml sub, .mk sub, .fact sub, .tipbox sub { font-size: .72em; line-height: 0; }
.goal .tick { position: absolute; left: 50%; top: 36px; margin-left: -13px; width: 26px; height: 26px; padding: 3px; border-radius: 50%; background: linear-gradient(#8BF57A, #38C653); border: 2.5px solid var(--ink); animation: popIn .4s cubic-bezier(.2,1.6,.4,1); }
.goal.hit .gi { animation: bump .3s; }
.pausebtn { flex: none; align-self: flex-start; }
.lvbottom { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 12px); display: flex; justify-content: center; gap: 18px; }
.boost { position: relative; width: 66px; height: 66px; border-radius: 50%; padding: 10px; border: 3px solid var(--ink);
  background: radial-gradient(circle at 50% 35%, #fff, #FFE3F0 70%); box-shadow: inset 0 -5px 0 #F3B6D2, 0 4px 0 var(--ink), 0 8px 14px rgba(60,20,70,.2); }
.boost.on { background: radial-gradient(circle at 50% 35%, #FFFBD6, #FFE36B 70%); box-shadow: inset 0 -5px 0 #E0A500, 0 4px 0 var(--ink), 0 0 0 5px rgba(255,227,107,.6); }
.boost .bn { position: absolute; right: -6px; bottom: -4px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; font-family: var(--head); font-size: 15px; line-height: 22px; color: #fff; text-align: center; background: linear-gradient(#8BF57A, #38C653); border: 2.5px solid var(--ink); }
.boost .bn.buy { background: linear-gradient(#FFEA7A, #FFB627); color: var(--ink); font-size: 12px; display: flex; align-items: center; gap: 1px; }
.boost .bn.buy .ic { width: 14px; height: 14px; }
.boost:active { transform: translateY(2px); }
.boosthint { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 92px); font-family: var(--head); font-size: 18px; color: #fff; padding: 6px 14px 8px; border-radius: 14px; background: rgba(64,24,84,.85); border: 2px solid #fff; white-space: nowrap; }
.chtag { position: absolute; left: 50%; transform: translateX(-50%); font-family: var(--head); font-size: 15px; color: #fff; padding: 2px 12px 4px; border-radius: 12px; background: rgba(64,24,84,.55); white-space: nowrap; }

/* goal list inside modals */
.glist { display: flex; justify-content: center; gap: 12px; margin: 6px 0 4px; flex-wrap: wrap; }
.glist .goal { min-width: 74px; padding: 8px 6px 6px; border-radius: 16px; background: #fff; box-shadow: inset 0 -3px 0 #F3D9E8; }
.glist .goal .gi { width: 56px; height: 56px; }
.glist .goal .gl { font-size: 12px; max-width: 96px; white-space: normal; text-align: center; line-height: 1.15; }
.tipbox { display: flex; gap: 10px; align-items: center; text-align: left; margin: 12px 0 2px; padding: 10px 12px; border-radius: 16px; background: #FFF0F7; border: 2px dashed #FFB8D6; font-size: 15px; font-weight: 500; line-height: 1.3; }
.tipbox .ti { flex: none; width: 54px; height: 54px; }
.lvtitle { font-family: var(--head); font-size: 15px; color: var(--ink2); margin-top: -4px; }

/* win */
.stars { display: flex; justify-content: center; align-items: flex-end; gap: 2px; height: 86px; margin: -6px 0 4px; }
.stars .st { width: 64px; height: 64px; opacity: .25; transform: scale(.6); transition: transform .35s cubic-bezier(.2,1.8,.4,1), opacity .2s; }
.stars .st.mid { width: 80px; height: 80px; margin-bottom: 8px; }
.stars .st.on { opacity: 1; transform: scale(1); }
.rewards { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0; }
.rchip { display: flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border-radius: 16px; background: #fff; box-shadow: inset 0 -3px 0 #F3D9E8; font-family: var(--head); font-size: 17px; }
.rchip img, .rchip .ic { width: 30px; height: 30px; }
.bigcoin { display: inline-flex; align-items: center; gap: 6px; font-family: var(--head); font-size: 30px; color: #fff; --o: #C97A06; }
.bigcoin .ic { width: 44px; height: 44px; }

/* pages */
.pagewrap { position: absolute; inset: 0; bottom: calc(var(--navh) + var(--sab) - 22px); display: flex; flex-direction: column;
  padding: calc(var(--sat) + 104px) calc(var(--sar) + 12px) 30px calc(var(--sal) + 12px); background: linear-gradient(#FFE3F1, #E9D9FF); }
.pagewrap::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.55) 2.5px, transparent 3px); background-size: 26px 26px; pointer-events: none; }
.pagehead { position: absolute; top: calc(var(--sat) + 60px); z-index: 2; left: 0; right: 0; display: flex; justify-content: center; }
.pagehead .ribbon { position: relative; top: 0; left: 0; transform: none; }
.pagescroll { position: relative; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 2px 56px; scrollbar-width: none; }
.pagescroll::-webkit-scrollbar { display: none; }
.pagecoins { position: absolute; top: calc(var(--sat) + 16px); right: calc(var(--sar) + 12px); z-index: 3; }
.sec { font-family: var(--head); font-size: 20px; color: var(--ink); margin: 14px 4px 8px; display: flex; align-items: center; gap: 8px; }
.sec::after { content: ""; flex: 1; height: 3px; border-radius: 2px; background: rgba(90,42,110,.15); }
.sub { font-size: 14px; font-weight: 500; color: var(--ink2); margin: -2px 4px 8px; }

/* atomie cards */
.agrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.acard { position: relative; padding: 8px 4px 8px; border-radius: 20px; text-align: center; background: #fff; border: 3px solid #fff;
  box-shadow: 0 0 0 2.5px #E7BCD7, 0 5px 0 #E7BCD7; }
.acard img { width: 76%; aspect-ratio: 1; display: block; margin: 0 auto; }
.acard .nm { font-family: var(--head); font-size: 15px; margin-top: 2px; }
.acard .lv { font-size: 12px; font-weight: 600; color: var(--ink2); }
.acard.locked { background: #EFE6F4; }
.acard.locked img { filter: brightness(0) opacity(.22); }
.acard.more { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.acard .mn { font-family: var(--head); font-size: 30px; color: var(--ink2); }
.sec .tagline { margin-left: auto; }
.moreline { text-align: center; margin: -2px 0 12px; }
.via { font-size: 15px; font-weight: 700; color: #B02A8E; margin: 6px 0 0; }
.acard .new { position: absolute; top: -8px; right: -6px; font-family: var(--head); font-size: 12px; color: #fff; padding: 2px 7px 3px; border-radius: 10px; background: #FF3B5C; border: 2px solid #fff; }
.hearts { display: flex; justify-content: center; gap: 2px; margin-top: 2px; }
.hearts i { width: 13px; height: 13px; display: block; }
.hearts i.off { opacity: .25; filter: grayscale(1); }

.aprofile .por { width: 150px; height: 150px; margin: -6px auto 0; animation: floaty 2.4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(2deg); } }
.aprofile .nm { font-family: var(--head); font-size: 32px; line-height: 1; margin-top: 4px; }
.aprofile .nm .sym { display: inline-block; margin-left: 6px; padding: 0 10px 2px; font-size: 22px; border-radius: 10px; color: #fff; vertical-align: 4px; }
.aprofile .tg { font-size: 15px; font-weight: 600; color: var(--ink2); margin-top: 4px; }
.jersey { display: inline-block; margin-top: 6px; font-family: var(--head); font-size: 14px; color: #fff; padding: 2px 10px 3px; border-radius: 10px; background: var(--ink2); }
.facts { text-align: left; margin-top: 10px; }
.fact { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; margin: 6px 0; border-radius: 14px; background: #fff; box-shadow: inset 0 -3px 0 #F3D9E8; font-size: 15px; font-weight: 500; line-height: 1.3; }
.fact .fi { flex: none; width: 24px; height: 24px; }
.fact.locked { background: #F1E8F6; color: var(--ink2); }
.meter { height: 10px; border-radius: 6px; background: rgba(90,42,110,.15); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #FF8FC0, #FF5C9C); }
.makes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.makes .mk { display: flex; align-items: center; gap: 4px; padding: 3px 10px 3px 3px; border-radius: 14px; background: #fff; box-shadow: inset 0 -3px 0 #F3D9E8; font-family: var(--head); font-size: 15px; }
.makes .mk img { width: 30px; height: 30px; }

/* recipe rows / shop rows */
.rcard { position: relative; display: flex; gap: 10px; align-items: center; padding: 10px; margin-bottom: 10px; border-radius: 20px; background: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2.5px #E7BCD7, 0 5px 0 #E7BCD7; }
.rcard.locked { background: #EFE6F4; }
.rcard .ri { width: 64px; height: 64px; flex: none; position: relative; }
.rcard .ri img { width: 100%; height: 100%; }
.rcard.locked .ri img { filter: grayscale(1) opacity(.5); }
.rcard .rm { flex: 1; min-width: 0; text-align: left; }
.rcard .rn { font-family: var(--head); font-size: 18px; line-height: 1.1; }
.rcard .rd { font-size: 13px; font-weight: 500; color: var(--ink2); margin-top: 2px; }
.fml { font-family: var(--head); font-size: 20px; color: var(--ink); letter-spacing: .5px; }
.atomrow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.achip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px 1px 1px; border-radius: 12px; background: #F7EEF9; font-family: var(--head); font-size: 14px; }
.achip img { width: 24px; height: 24px; }
.achip.short { background: #FFE1E6; color: #D02B4A; }
.molimg { width: 74px; height: 56px; flex: none; }
.rcard .rr { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.coinv { display: inline-flex; align-items: center; gap: 3px; font-family: var(--head); font-size: 16px; }
.coinv .ic { width: 22px; height: 22px; }
.timev { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.timev .ic { width: 16px; height: 16px; }
.tagline { font-size: 12px; font-weight: 600; color: #fff; padding: 1px 8px 2px; border-radius: 8px; background: var(--ink2); display: inline-block; }
.lvpips { display: flex; gap: 3px; margin-top: 4px; }
.lvpips i { width: 14px; height: 8px; border-radius: 4px; background: rgba(90,42,110,.15); }
.lvpips i.on { background: linear-gradient(#8BF57A, #38C653); }

/* craft sheet */
.pantry { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: -4px 0 8px; }
.machinehead { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.qrow { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.qslot { width: 52px; height: 52px; border-radius: 14px; background: #F3E7F7; border: 2.5px dashed #D8BCE5; position: relative; overflow: hidden; }
.qslot img { width: 100%; height: 100%; position: relative; }
.qslot .qp { position: absolute; left: 0; bottom: 0; height: 100%; background: rgba(91,227,138,.35); }

/* settings */
.setrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 6px 0; border-radius: 16px; background: #fff; box-shadow: inset 0 -3px 0 #F3D9E8; text-align: left; }
.setrow .si { width: 36px; height: 36px; flex: none; }
.setrow .sl { flex: 1; font-family: var(--head); font-size: 18px; }
.toggle { width: 64px; height: 34px; border-radius: 18px; background: #D6CCDD; border: 3px solid var(--ink); position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.2); transition: left .2s; }
.toggle.on { background: #5BE38A; }
.toggle.on::after { left: 32px; }
.seg { display: flex; border-radius: 14px; border: 3px solid var(--ink); overflow: hidden; flex: none; }
.seg button { padding: 4px 12px 6px; font-family: var(--head); font-size: 15px; background: #fff; }
.seg button.on { background: linear-gradient(#FFA3CC, #F2559A); color: #fff; }

/* tutorial pointer */
.tut { position: absolute; z-index: 45; pointer-events: none; }
.tutbubble { position: absolute; left: 50%; transform: translateX(-50%); width: min(88%, 360px); z-index: 46; pointer-events: none;
  padding: 12px 14px 14px 70px; border-radius: 20px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); font-size: 16px; font-weight: 600; line-height: 1.3; animation: popIn .35s cubic-bezier(.2,1.5,.4,1); }
.tutbubble img { position: absolute; left: 6px; bottom: 4px; width: 60px; height: 60px; }
.tuthand { width: 54px; height: 54px; animation: tap 1.1s ease-in-out infinite; transform-origin: 30% 10%; }
@keyframes tap { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-4px, -10px) scale(.92); } }
.ring { position: absolute; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 4px rgba(255,111,168,.6); animation: ring 1.2s ease-out infinite; }
@keyframes ring { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

@media (max-height: 640px) {
  :root { --navh: 64px; }
  .goal .gi { width: 40px; height: 40px; }
  .movecard .num { font-size: 32px; }
  .boost { width: 56px; height: 56px; }
  .btn.playbtn { height: 74px; }
}

/* scene wipe */
.wipe { position: absolute; inset: 0; z-index: 55; pointer-events: all; background: radial-gradient(circle at 50% 50%, #FFE3F1 0, #FFB8D9 55%, #C9A6FF 100%); animation: fadeIn .22s ease-out; }
.wipe::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.6) 4px, transparent 5px); background-size: 34px 34px; }
.wipe.out { animation: fadeOut .4s ease-in forwards; }

/* molecule goal pool */
.goal .gpool { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; max-width: 84px; font-size: 10px; font-weight: 600; color: var(--ink2); line-height: 1.15; }
.goal .gpool b { font-weight: 700; margin-right: 1px; }
.acard, .mk { font: inherit; color: inherit; }
.ri .ic { width: 100%; height: 100%; }

/* level map */
.chcard { position: relative; margin: 0 0 14px; padding: 10px 8px 6px; border-radius: 24px; border: 3px solid #fff;
  background: linear-gradient(160deg, var(--s1), var(--s2)); box-shadow: 0 0 0 2.5px #E7BCD7, 0 5px 0 #E7BCD7; }
.chcard.far { filter: saturate(.45) brightness(1.05); }
.chhead { display: flex; align-items: center; gap: 6px; padding: 0 4px 4px; }
.chname { font-size: 19px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chstars { display: inline-flex; align-items: center; gap: 2px; font-family: var(--head); font-size: 15px; color: #fff; padding: 1px 8px 2px 2px; border-radius: 10px; background: rgba(64,24,84,.5); }
.chstars .ic { width: 20px; height: 20px; }
.lgrid { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 82px; justify-items: center; align-items: start; padding-top: 4px; }
.lpath { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lpath path { fill: none; stroke: rgba(255,255,255,.6); stroke-width: 16; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lpath path.dots { stroke: rgba(90,42,110,.28); stroke-width: 5; stroke-dasharray: 0 13; }
.lnode { position: relative; width: 52px; height: 52px; margin-top: 4px; border-radius: 50%; border: 3px solid var(--ink); font-family: var(--head); font-size: 20px; color: #fff;
  --c1: #FFA3CC; --c2: #F2559A; --c3: #C02D6C; background: linear-gradient(var(--c1), var(--c2) 70%);
  box-shadow: inset 0 -5px 0 var(--c3), inset 0 3px 0 rgba(255,255,255,.55), 0 3px 0 var(--ink); }
.lnode b { font-weight: 400; text-shadow: 0 2px 0 var(--c3), 1.5px 0 0 var(--c3), -1.5px 0 0 var(--c3), 0 -1.5px 0 var(--c3); }
.lnode.hard { --c1: #8CDEFF; --c2: #3AA2F2; --c3: #1E6CC2; }
.lnode.boss { --c1: #D3B0FF; --c2: #9A66F5; --c3: #6537C2; width: 58px; height: 58px; margin-top: 1px; }
.lnode.cur { --c1: #8BF57A; --c2: #38C653; --c3: #219140; animation: pulse 1.6s ease-in-out infinite; box-shadow: inset 0 -5px 0 var(--c3), inset 0 3px 0 rgba(255,255,255,.55), 0 3px 0 var(--ink), 0 0 0 6px rgba(255,255,255,.75); }
.lnode.gate { --c1: #FFEA7A; --c2: #FFB627; --c3: #C97A06; padding: 9px; }
.lnode.shut { --c1: #F1EAF5; --c2: #D6CCDD; --c3: #A898B5; color: #fff; }
.lnode:active { transform: translateY(2px); }
.llock { display: block; width: 100%; height: 100%; }
.lface { position: absolute; right: -14px; top: -12px; width: 30px; height: 30px; filter: drop-shadow(0 2px 0 rgba(60,20,70,.3)); }
.lface.ghost { filter: brightness(0) opacity(.25); }
.lstars { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%); display: flex; gap: 0; }
.lstars i { width: 17px; height: 17px; display: block; }
.lstars i:nth-child(2) { margin-top: 3px; }
.lstars i:not(.on) { opacity: .55; }
.lneed { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); font-size: 13px; color: #fff; padding: 0 6px 1px; border-radius: 8px; background: var(--ink2); white-space: nowrap; }
.stars.small { height: 56px; margin: 4px 0 0; }
.stars.small .st { width: 42px; height: 42px; opacity: 1; transform: none; }
.stars.small .st.mid { width: 52px; height: 52px; margin-bottom: 6px; }
.rchip[data-a], .achip[data-a] { cursor: pointer; }
.findrow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.pageback { position: absolute; left: calc(var(--sal) + 14px); top: 2px; width: 44px; height: 44px; padding: 8px; }

/* shop side buttons */
.sidebtns { position: absolute; display: flex; flex-direction: column; gap: 4px; }
.sbtn { position: relative; display: flex; flex-direction: column; align-items: center; width: 48px; }
.sbtn .round { width: 46px; height: 46px; padding: 6px; background: linear-gradient(#FFEA7A, #FFB627 70%); box-shadow: inset 0 -5px 0 #C97A06, inset 0 3px 0 rgba(255,255,255,.55), 0 3px 0 var(--ink); }
.sbtn .sl { font-size: 13px; margin-top: -4px; white-space: nowrap; }
.sbtn .dot { top: -4px; right: -2px; }
.sbtn:active .round { transform: translateY(2px); }

/* recipe discovery puzzle */
.disc .dname { display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--head); font-size: 22px; margin-top: -6px; }
.disc .dname img { width: 44px; height: 44px; }
.dmolbox { display: flex; justify-content: center; margin: 2px 0; }
.dmolbox canvas { display: block; }
.dfml { font-size: 28px; min-height: 36px; }
.dfml.big { font-size: 40px; animation: popIn .45s cubic-bezier(.2,1.8,.4,1); }
.dhint { text-align: center; margin: 2px 0 6px; }
.dchips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; touch-action: none; }
.dchip { position: relative; width: 70px; padding: 6px 2px 6px; border-radius: 18px; background: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2.5px #E7BCD7, 0 4px 0 #E7BCD7; }
.dchip img { width: 50px; height: 50px; display: block; margin: 0 auto; pointer-events: none; }
.dchip .dn { display: block; font-family: var(--head); font-size: 13px; line-height: 1.1; pointer-events: none; }
.dchip .dc { position: absolute; top: -8px; right: -6px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: #9A66F5; border: 2px solid #fff; font-family: var(--head); font-size: 13px; color: #fff; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.dchip .dc .ic { width: 16px; height: 16px; }
.dchip.full .dc { background: #38C653; padding: 2px; }
.dchip:active:not([disabled]) { transform: translateY(2px); }
.dchip.wrong { background: #EFE6F4; box-shadow: 0 0 0 2.5px #D6CCDD, 0 4px 0 #D6CCDD; }
.dchip.wrong img { filter: grayscale(1) opacity(.45); }
.dchip.wrong::after { content: ""; position: absolute; left: 50%; top: 30px; width: 46px; height: 6px; margin-left: -23px; border-radius: 3px; background: #F04C5C; transform: rotate(-35deg); }
.shake { animation: shake .36s; }
@keyframes shake { 20% { transform: translateX(-6px) rotate(-4deg); } 40% { transform: translateX(6px) rotate(4deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.dmsg { min-height: 22px; margin-top: 8px; font-size: 15px; font-weight: 700; color: #B02A8E; opacity: 0; }
.dmsg.show { animation: fadeIn .2s forwards; opacity: 1; }
.dres { animation: popIn .35s cubic-bezier(.2,1.5,.4,1); }
.dres .tagline { margin: 4px 0 2px; }

/* tasks page */
.seg.tabs { width: max-content; margin: 2px auto 4px; overflow: visible; }
.seg.tabs button:first-child { border-radius: 11px 0 0 11px; }
.seg.tabs button:last-child { border-radius: 0 11px 11px 0; }
.seg.tabs button { position: relative; padding: 6px 22px 8px; font-size: 17px; }
.seg.tabs .dot { top: -6px; right: -4px; width: 14px; height: 14px; }
.gifts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gift { position: relative; display: flex; flex-direction: column; align-items: center; padding: 5px 2px 6px; border-radius: 16px; background: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2.5px #E7BCD7, 0 4px 0 #E7BCD7; }
.gift.big { grid-column: span 2; }
.gift .gd { font-size: 11px; font-weight: 700; color: var(--ink2); }
.gift .gi { width: 36px; height: 36px; }
.gift .ga { font-family: var(--head); font-size: 15px; }
.gift.now { background: #FFF6C9; box-shadow: 0 0 0 3px #FFB627, 0 4px 0 #C97A06; animation: pulse 1.6s ease-in-out infinite; }
.gift.got { background: #EFE6F4; }
.gift.got .gi { opacity: .45; }
.gift .gok { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: #38C653; border: 2px solid #fff; }
.task .ri.tk { width: 50px; height: 50px; padding: 6px; border-radius: 16px; background: #F7EEF9; }
.task .ri.tk.gold { background: #FFF1B8; }
.task .meter { margin-top: 5px; }
.task .rd { margin-top: 3px; }
.task.claimed { opacity: .7; }
.task .rr .rwd { display: flex; align-items: center; gap: 4px; }
.boostv { display: inline-flex; gap: 1px; }
.boostv .ic { width: 24px; height: 24px; }

/* order board */
.ordpill { position: absolute; display: flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px 0 4px; border-radius: 13px; background: #FFF8EF; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-size: 15px; color: var(--ink); }
.ordpill .ic { width: 24px; height: 24px; margin-top: -6px; transform: rotate(-8deg); }
.ordpill .dot { top: -9px; right: -9px; }
.ordpill:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.ocard { margin-bottom: 12px; padding: 10px 10px 10px; border-radius: 20px; background: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2.5px #B9DDF7, 0 5px 0 #B9DDF7; text-align: left; }
.ocard.empty { background: #F2F7FC; box-shadow: 0 0 0 2.5px #CFE3F3, 0 5px 0 #CFE3F3; }
.owait { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 64px; font-weight: 600; color: var(--ink2); }
.owait .ic { width: 24px; height: 24px; }
.ohead { display: flex; align-items: center; gap: 8px; }
.oface { position: relative; width: 50px; height: 48px; margin: -4px 0 -2px -2px; overflow: hidden; flex: none; }
.oface img { position: absolute; width: 76px; height: 76px; left: -13px; top: -11px; }
.owho { flex: 1; min-width: 0; }
.onm { font-family: var(--head); font-size: 18px; line-height: 1.1; }
.onote { font-size: 13px; font-weight: 500; color: var(--ink2); }
.oskip { width: 34px; height: 34px; padding: 4px; border-radius: 12px; background: #F4EEF8; flex: none; opacity: .8; }
.oitems { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 6px; }
.oitem { position: relative; width: 64px; padding: 4px 2px 3px; border-radius: 16px; background: #F7EEF9; display: flex; flex-direction: column; align-items: center; }
.oitem img { width: 46px; height: 46px; }
.oitem .oc { font-family: var(--head); font-size: 15px; line-height: 1; display: flex; align-items: center; height: 18px; }
.oitem .oc .ic { width: 18px; height: 18px; }
.oitem.done { background: #E4F8E8; }
.oitem.done .oc .ic { background: #38C653; border-radius: 50%; padding: 2px; }
.oitem.have { background: #FFF6C9; box-shadow: inset 0 0 0 2.5px #FFB627; }
.oitem.short img { filter: saturate(.35) opacity(.7); }
.oitem .oh { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: #FFB627; border: 2px solid #fff; font-style: normal; font-family: var(--head); font-size: 13px; color: #fff; display: flex; align-items: center; justify-content: center; }
.ofoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ofoot .rwd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.xpv { display: inline-flex; align-items: center; gap: 2px; font-family: var(--head); font-size: 16px; }
.xpv .ic, .ofoot .coinv .ic { width: 22px; height: 22px; }

/* decor spots on the upgrades page */
.dspot { padding: 8px 10px 10px; margin-bottom: 10px; border-radius: 20px; background: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2.5px #E7BCD7, 0 5px 0 #E7BCD7; }
.dsh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 6px; }
.dsn { font-family: var(--head); font-size: 18px; color: var(--ink); }
.dsb { font-size: 13px; font-weight: 600; color: #2E9E48; text-align: right; }
.dgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dthumb { position: relative; aspect-ratio: 1; padding: 0; border-radius: 14px; background: #FFF4FA; border: 2.5px solid #F2D3E6; }
.dthumb img { width: 100%; height: 100%; display: block; }
.dthumb.locked { background: #EFE6F4; border-color: #E2D6EC; }
.dthumb.locked img { filter: grayscale(1) opacity(.45); }
.dthumb.own { background: #FFFBEA; border-color: #FFD978; }
.dthumb.shown { background: #EFFFF0; border-color: #38C653; box-shadow: 0 0 0 2px #B9F0C4; }
.dtag { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
  font-style: normal; font-family: var(--head); font-size: 12px; line-height: 1; color: #fff; padding: 3px 6px 4px; border-radius: 9px; background: #A898B5; border: 2px solid #fff; }
.dtag .ic { width: 12px; height: 12px; }
.dtag.price { background: #C9B6D6; }
.dtag.price.can { background: #F2A516; }
.dtag.on { background: #38C653; padding: 3px 4px; }
.dtag.lock { background: #A898B5; }
.dbon { font-family: var(--head); font-size: 18px; color: #2E9E48; margin: 6px 0 2px; }

/* daily challenge: card on the map, star chip in the level */
.chalcard { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 10px 10px 8px; border-radius: 22px; border: 3px solid #fff;
  background: linear-gradient(135deg, #FFE1F0, #E5D6FF); box-shadow: 0 0 0 2.5px #D9A9E6, 0 5px 0 #D9A9E6; }
.chalcard.won { background: linear-gradient(135deg, #E4FBE6, #E5F2FF); }
.chalcard.off { opacity: .8; filter: saturate(.5); }
.chalcard .chi { width: 42px; height: 42px; flex: none; }
.chalcard .chm { flex: 1; min-width: 0; text-align: left; }
.chalcard .chn { font-family: var(--head); font-size: 19px; line-height: 1.1; color: var(--ink); }
.chalcard .chs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--ink2); }
.chalcard .chs .tagline { font-size: 12px; padding: 2px 8px 3px; }
.chalcard .chst { color: #E8740C; }
.chalcard .chok { display: inline-flex; align-items: center; gap: 2px; color: #2E9E48; }
.chalcard .chok .ic { width: 14px; height: 14px; }
.chalcard .coinv { font-size: 14px; }
.chalcard .coinv .ic { width: 16px; height: 16px; }
.chalcard .chlock { width: 26px; height: 26px; flex: none; opacity: .6; }
.chstar { position: relative; width: 44px; height: 44px; flex: none; padding: 0; border-radius: 50%; background: #fff; border: 2.5px solid #FFD23F; }
.chstar img { width: 100%; height: 100%; }
.chstar b, .starchip b { position: absolute; right: -6px; bottom: -6px; font-family: var(--head); font-size: 12px; line-height: 1; color: #fff; padding: 2px 4px 3px; border-radius: 8px; background: #FF9F45; border: 2px solid #fff; }
.starchip { position: absolute; right: 2px; top: 62px; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid #FFD23F; box-shadow: 0 3px 0 rgba(74,37,86,.35); }
.starchip img { width: 100%; height: 100%; }
/* until today's challenge is won it stays pinned above the chapters */
.chalcard.pin { position: sticky; top: 2px; z-index: 3; }

/* ---------- polish pass ---------- */
/* pressable cards give a little squish */
.acard, .dthumb, .mk, .gift, .chstar, .pagescroll .rcard[data-p], .lnode, .sbtn, .ordpill { transition: transform .1s; }
.acard:active, .dthumb:active, .mk:active, .pagescroll .rcard[data-p]:active { transform: scale(.96); }
.gift.now:active { transform: scale(.95); animation: none; }
.tab:active .ic { transform: scale(.9); }
/* a fresh page rises in */
.pagewrap.enter .pagescroll { animation: pageIn .32s cubic-bezier(.2,1.2,.4,1) both; }
.pagewrap.enter .pagehead .ribbon { animation: popIn .38s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(18px); } }

/* moves card: the stars you'd get if you finished now */
.movecard .mstars { display: flex; justify-content: center; gap: 1px; margin-top: 3px; }
.movecard .mstars i { width: 18px; height: 18px; display: block; transition: opacity .25s, transform .3s cubic-bezier(.2,1.8,.4,1); }
.movecard .mstars i.off { opacity: .3; filter: grayscale(1) brightness(1.4); transform: scale(.75); }
.movecard .mstars i.lose { animation: starLose .5s; }
@keyframes starLose { 30% { transform: scale(1.35) rotate(-12deg); } }
/* booster names under the buttons */
.boost .bl { position: absolute; left: 50%; top: 100%; margin-top: 7px; transform: translateX(-50%); font-family: var(--head); font-size: 13px; line-height: 1; color: #fff; white-space: nowrap; --o: var(--ink); }
.lvbottom { bottom: calc(var(--sab) + 30px); }
.boosthint { bottom: calc(var(--sab) + 120px); }
/* level and chapter above the board */
.lvchip { position: absolute; left: 50%; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 6px; padding: 3px 14px 5px; border-radius: 14px;
  font-family: var(--head); font-size: 15px; color: #fff; white-space: nowrap; background: rgba(64,24,84,.42); border: 2px solid rgba(255,255,255,.6); pointer-events: none; }
.lvchip .tagline { font-family: var(--body); font-size: 11px; padding: 1px 7px 2px; }

/* confetti layer */
.cf { position: absolute; top: 0; left: 0; width: 9px; height: 14px; border-radius: 2px; pointer-events: none; will-change: transform, opacity; }

/* shop ★ level up */
.lvup .bigstar { position: relative; width: 132px; height: 132px; margin: -4px auto 0; animation: lvStar .9s cubic-bezier(.2,1.6,.4,1) both; }
.lvup .bigstar .ic { width: 100%; height: 100%; filter: drop-shadow(0 6px 0 rgba(90,42,110,.25)); }
.lvup .bigstar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 12px; font-family: var(--head); font-size: 46px; color: #fff; --o: #C97A06; }
.lvup .rays { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%; z-index: -1;
  background: repeating-conic-gradient(rgba(255,214,90,.42) 0 10deg, transparent 10deg 24deg); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes lvStar { from { transform: scale(.2) rotate(-40deg); opacity: 0; } }
.unl { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 6px 0; border-radius: 16px; background: #fff; box-shadow: inset 0 -3px 0 #F3D9E8; text-align: left; animation: rise .4s both; }
.unl:nth-child(2) { animation-delay: .1s; } .unl:nth-child(3) { animation-delay: .2s; } .unl:nth-child(4) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.unl .ui { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; }
.unl .ui img, .unl .ui .ic { width: 100%; height: 100%; }
.unl .uk { font-size: 12px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .4px; }
.unl .un { font-family: var(--head); font-size: 17px; line-height: 1.15; }
.unl .imgs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.unl .imgs img { width: 28px; height: 28px; }

/* upgrade rows: what the next level gives */
.upv { font-family: var(--head); font-size: 13px; color: #2E9E48; margin-left: 4px; white-space: nowrap; }
.upv i { font-style: normal; color: var(--ink2); opacity: .7; }
/* Atomie cards: how many are in the pantry */
.acard .cntb { position: absolute; top: 6px; left: 6px; min-width: 24px; padding: 1px 6px 2px; border-radius: 10px; background: #F7EEF9; font-family: var(--head); font-size: 12px; color: var(--ink2); }
/* gate: progress toward the ★ the chapter needs */
.gatebar { display: flex; align-items: center; gap: 8px; margin: 10px 6px 2px; }
.gatebar .meter { flex: 1; height: 16px; margin: 0; }
.gatebar .gs { position: relative; width: 38px; height: 38px; flex: none; }
.gatebar .gs b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 3px; font-family: var(--head); font-size: 14px; color: #fff; --o: var(--ink); }
.gatebar .gs.dim .ic { filter: grayscale(.6) opacity(.6); }
.gatehow { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gatehow span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 4px; border-radius: 14px; background: #fff; box-shadow: inset 0 -3px 0 #F3D9E8; font-size: 14px; font-weight: 600; }
.gatehow .ic { width: 26px; height: 26px; }
/* level intro: how many spare moves earn ★★★ */
.starline { display: flex; align-items: center; justify-content: center; gap: 1px; margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--ink2); }
.starline .ic { width: 18px; height: 18px; flex: none; }
.starline span { margin-left: 6px; }
/* short on atoms */
.shortrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 6px 0; border-radius: 16px; background: #fff; box-shadow: inset 0 -3px 0 #F3D9E8; text-align: left; }
.shortrow .sa { width: 48px; height: 48px; flex: none; }
.shortrow .sa img { width: 100%; height: 100%; }
.shortrow .sm { flex: 1; min-width: 0; }
.shortrow .sn { font-family: var(--head); font-size: 16px; line-height: 1.1; }
.shortrow .sc { font-size: 14px; font-weight: 600; color: var(--ink2); }
.shortrow .sc b { color: #D02B4A; }
.shortrow .sl { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* first boards: a finger swipes the hinted pair */
.swipehand { position: absolute; left: 0; top: 0; width: 54px; height: 54px; margin: -2px 0 0 -14px; pointer-events: none; z-index: 6;
  filter: drop-shadow(0 3px 0 rgba(58,31,90,.35)); animation: swipe 1.7s ease-in-out infinite; }
@keyframes swipe {
  0% { transform: translate(var(--ax), var(--ay)) scale(1.1); opacity: 0; }
  15% { transform: translate(var(--ax), var(--ay)) scale(.92); opacity: 1; }
  60% { transform: translate(var(--bx), var(--by)) scale(.92); opacity: 1; }
  78%, 100% { transform: translate(var(--bx), var(--by)) scale(1.1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .swipehand { animation: none; transform: translate(var(--ax), var(--ay)); } }
