@font-face { font-family: "Pop"; src: url("assets/fonts/Poppins-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Pop"; src: url("assets/fonts/Poppins-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
:root {
  --pink: #e8457f; --pink-l: #ffe4ef; --lav: #7a5fd6; --lav-d: #5b3fc4; --lav-l: #efe8ff; --ice: #e3f2ff; --ice-d: #2f7cc8;
  --cream: #fffaf2; --gold: #ffc21a; --gold-l: #fff1c9; --ink: #3a2e52; --muted: #6f6488;
  --ok: #2f9e5a; --ok-l: #e2f8e9; --no: #e0566a; --no-l: #ffeef0; --shadow: 0 6px 18px rgba(100, 80, 170, .16);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: "Pop", "Avenir Next", "Segoe UI", system-ui, sans-serif; font-weight: 500; color: var(--ink);
  background: radial-gradient(circle at 12% 8%, #ffe9f3 0, transparent 42%), radial-gradient(circle at 88% 92%, #dfeeff 0, transparent 48%), #f8f5ff;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
img { display: block; -webkit-user-drag: none; user-select: none; pointer-events: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; -webkit-appearance: none; appearance: none; }
button:focus-visible, a:focus-visible { outline: 4px solid var(--lav); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.app { width: 1280px; height: 800px; position: absolute; left: 0; top: 0; transform-origin: 0 0; display: flex; flex-direction: column; padding: 14px 26px 18px; }

/* top bar */
.top { display: flex; align-items: center; gap: 14px; height: 60px; flex: none; }
.tbtn { height: 52px; padding: 0 18px 0 14px; border-radius: 26px; background: #fff; box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--lav-d); }
.tbtn img { width: 26px; height: 26px; }
.tbtn-en { font-size: 13px; color: var(--muted); font-weight: 500; }
.prog { flex: 1; display: flex; gap: 8px; align-items: center; }
.seg { flex: 1; height: 14px; border-radius: 7px; background: #e9e1f5; overflow: hidden; }
.seg.done { background: linear-gradient(90deg, #ffa6c8, var(--pink)); }
.seg.cur { background: linear-gradient(90deg, #c7b4ff, var(--lav)); }
.stars { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 26px; padding: 0 18px 0 10px; height: 52px; box-shadow: var(--shadow); font-weight: 700; font-size: 22px; }
.stars img { width: 34px; height: 34px; }
.stars.bump img { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.45) rotate(15deg); } }

/* stage & screens */
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-top: 8px; overflow: hidden; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.screen.enter { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
.head { text-align: center; margin: 0 0 6px; flex: none; }
.kicker { display: inline-block; font-size: 14px; font-weight: 700; color: var(--lav-d); background: var(--lav-l); padding: 3px 14px; border-radius: 14px; }
.title { font-size: 36px; font-weight: 700; color: var(--pink); margin: 4px 0 0; line-height: 1.15; }
.en { color: var(--muted); font-size: 17px; font-weight: 500; }
.body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 0; overflow: auto; }
.nav { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; }
.nbtn { height: 66px; min-width: 160px; padding: 0 26px; border-radius: 33px; font-size: 21px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 10px; box-shadow: var(--shadow); transition: transform .12s; }
.nbtn img { width: 24px; height: 24px; }
.nbtn:active { transform: scale(.96); }
.nbtn.next { background: linear-gradient(180deg, #ff7fae, var(--pink)); color: #fff; box-shadow: 0 6px 0 #c22f68, var(--shadow); }
.nbtn.next.glow { animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 6px 0 #c22f68, 0 0 0 10px rgba(232,69,127,.2), var(--shadow); } }
.nbtn.back { background: #fff; color: var(--lav-d); }
.nbtn.soft { background: var(--lav-l); color: var(--lav-d); }
.count { font-size: 17px; color: var(--muted); font-weight: 700; }
.fb { min-height: 46px; font-size: 24px; font-weight: 700; text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.fb.ok { color: var(--ok); } .fb.no { color: var(--no); }
.fb .en { font-size: 16px; }
.q { text-align: center; }
.q .ro { font-size: 38px; font-weight: 700; color: var(--lav-d); line-height: 1.15; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* menu */
.menu { flex: 1; display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: center; }
.hero { text-align: center; }
.hero h1 { font-size: 40px; line-height: 1.08; color: var(--pink); margin: 6px 0 4px; }
.hero h2 { font-size: 22px; color: var(--lav); margin: 0; }
.hero .bear { width: 190px; height: 190px; margin: 0 auto; animation: wave 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wave { 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
.hero .pct { margin-top: 12px; display: inline-block; background: #fff; border-radius: 18px; padding: 6px 16px; box-shadow: var(--shadow); font-weight: 700; color: var(--lav-d); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile { background: #fff; border-radius: 26px; padding: 10px 10px 12px; box-shadow: var(--shadow); text-align: center; position: relative; border: 4px solid transparent; transition: transform .15s; }
.tile:active { transform: scale(.97); }
.tile .pic { height: 150px; border-radius: 18px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile .pic img { max-width: 92%; max-height: 92%; }
.tile .n { position: absolute; top: 2px; left: 2px; width: 34px; height: 34px; border-radius: 50%; background: var(--lav); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.tile.done { border-color: #9ee0b4; }
.tile.done .n { background: var(--ok); }
.tile .tt { font-size: 17px; font-weight: 700; margin-top: 6px; line-height: 1.15; min-height: 40px; display: flex; align-items: center; justify-content: center; }
.tile .en { font-size: 13px; }
.bg0 { background: #e6f3ff; } .bg1 { background: #ffedf4; } .bg2 { background: #f1ebff; } .bg3 { background: #fff4dc; }
.menu-foot { grid-column: 1 / -1; display: flex; justify-content: center; }

/* flashcards */
.flash { display: flex; align-items: center; gap: 30px; }
.fcard { width: 470px; background: #fff; border-radius: 40px; padding: 18px 18px 20px; box-shadow: 0 14px 40px rgba(100,80,170,.2); text-align: center; position: relative; }
.fcard .pic { border-radius: 30px; height: 300px; display: flex; align-items: center; justify-content: center; }
.fcard .pic img { height: 92%; }
.fcard .w { font-size: 60px; font-weight: 700; margin-top: 8px; line-height: 1.05; }
.fcard .en { font-size: 24px; }
.fcard.pop { animation: pop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: scale(.75) rotate(-4deg); opacity: .2; } }
.fcard.wiggle { animation: wig .7s ease; }
@keyframes wig { 20% { transform: rotate(-4deg) scale(1.04); } 50% { transform: rotate(4deg) scale(1.06); } 80% { transform: rotate(-2deg); } }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst i { position: absolute; left: 50%; top: 40%; width: 18px; height: 18px; background: url("assets/icons/star.svg") center/contain no-repeat; animation: fly .9s ease-out forwards; opacity: 0; }
@keyframes fly { 0% { opacity: 1; transform: translate(0,0) scale(.4); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.3); } }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: #e2d8f2; }
.dots i.on { background: var(--pink); transform: scale(1.25); }
.tap-hint { font-size: 15px; color: var(--muted); }

/* detective house */
.house { position: relative; width: 660px; height: 506px; flex: none; }
.house > img.shell { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 30px; }
.room, .item { position: absolute; }
.room { border-radius: 6px; overflow: hidden; z-index: 1; }
.room img { width: 100%; height: 100%; }
.item { z-index: 2; border-radius: 16px; }
.item.small { z-index: 4; }
.item img { width: 100%; height: 100%; }
.frontlayer { position: absolute; z-index: 3; pointer-events: none; }
.frontlayer img { width: 100%; height: 100%; }
.room.right, .item.right { outline: 5px solid var(--ok); outline-offset: 2px; box-shadow: 0 0 0 10px rgba(47,158,90,.22); z-index: 5; }
.room.wrong, .item.wrong { outline: 5px solid var(--no); outline-offset: 2px; }
.det { display: flex; gap: 24px; align-items: center; }
.det-side { width: 420px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.say-card { background: #fff; border-radius: 26px; padding: 14px 18px; box-shadow: var(--shadow); width: 100%; }
.say-card .ro { font-size: 26px; font-weight: 700; color: var(--ok); }

/* boots prep */
.prep { display: flex; gap: 22px; align-items: center; width: 100%; justify-content: center; }
.choices { display: flex; gap: 20px; }
.choice { width: 220px; background: #fff; border-radius: 28px; padding: 12px; box-shadow: var(--shadow); border: 5px solid transparent; }
.choice img { width: 100%; }
.choice.sel { border-color: var(--lav); background: var(--lav-l); transform: translateY(-6px); }
.tool { width: 170px; background: #fff; border-radius: 28px; padding: 10px; box-shadow: var(--shadow); border: 5px solid transparent; text-align: center; font-weight: 700; font-size: 18px; }
.tool img { width: 100%; }
.tool.sel { border-color: var(--lav); background: var(--lav-l); }
.bootbtn { position: relative; width: 300px; height: 300px; background: #fff; border-radius: 34px; box-shadow: var(--shadow); border: 5px solid transparent; }
.bootbtn.armed { border-color: var(--lav); border-style: dashed; }
.bootbtn img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); transition: opacity .4s; }
.pips { display: flex; gap: 10px; justify-content: center; }
.pips i { width: 22px; height: 22px; border-radius: 50%; background: #e2d8f2; }
.pips i.on { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-l); }
.hall { position: relative; width: 640px; height: 416px; border-radius: 30px; overflow: hidden; box-shadow: 0 12px 34px rgba(100,80,170,.22); flex: none; }
.hall > img.bg { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 1.2s ease; }
.hall .mat { position: absolute; left: 174px; top: 318px; width: 240px; height: 80px; border-radius: 50%; border: 5px dashed var(--pink); background: rgba(255,255,255,.25); z-index: 2; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(232,69,127,.25); background: rgba(255,255,255,.5); } }
.hall .onmat { position: absolute; left: 206px; top: 192px; width: 176px; height: 176px; z-index: 3; border-radius: 30px; }
.hall .onmat img { width: 100%; height: 100%; transition: opacity .6s; position: absolute; inset: 0; }
.hall .glowring { position: absolute; left: 144px; top: 130px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(255,230,140,.85), rgba(255,230,140,0) 70%); z-index: 2; pointer-events: none; animation: shine 1.6s ease-out; }
@keyframes shine { from { transform: scale(.3); opacity: 0; } 50% { opacity: 1; } }
.pop-items { position: absolute; left: 204px; top: 150px; width: 180px; height: 120px; z-index: 4; pointer-events: none; }
.pop-items img { position: absolute; width: 70px; height: 70px; left: 55px; top: 30px; animation: rise 1.4s cubic-bezier(.2,.9,.3,1.2) forwards; opacity: 0; }
@keyframes rise { 0% { opacity: 0; transform: translate(0, 40px) scale(.3); } 60% { opacity: 1; } 100% { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1); } }
.sun-btn { background: linear-gradient(180deg, #ffd86b, #ffb41f); color: #5a3a00; box-shadow: 0 6px 0 #d08a00, var(--shadow); }
.stagebar { display: flex; gap: 8px; }
.stagebar i { width: 38px; height: 10px; border-radius: 5px; background: #e2d8f2; }
.stagebar i.on { background: var(--lav); } .stagebar i.done { background: var(--pink); }

/* sort into boots */
.tray { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; width: 100%; }
.scard { width: 118px; background: #fff; border-radius: 24px; padding: 8px; box-shadow: var(--shadow); border: 4px solid transparent; touch-action: none; transition: transform .12s; text-align: center; }
.scard img { width: 100%; }
.scard span { font-size: 15px; font-weight: 700; display: block; line-height: 1.15; min-height: 34px; }
.scard.sel { border-color: var(--lav); transform: translateY(-6px) scale(1.05); }
.scard.wrong { border-color: var(--no); animation: shake .45s; }
.scard.dragging { opacity: .3; }
.bootzone { width: 520px; min-height: 230px; border-radius: 34px; background: var(--ice); border: 5px dashed #a9d3f2; display: flex; align-items: center; gap: 16px; padding: 10px 18px; }
.bootzone.hot, .bootzone.armed { border-color: var(--lav); border-style: solid; }
.bootzone.bad { animation: shake .45s; }
.bootzone > img { width: 200px; height: 200px; flex: none; }
.bootzone .inbox { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; flex: 1; }
.bootzone .inbox img { width: 62px; height: 62px; background: #fff; border-radius: 14px; padding: 4px; animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
.drag-ghost { position: fixed; z-index: 50; width: 118px; pointer-events: none; transform: translate(-50%, -55%) rotate(-6deg) scale(1.08); background: #fff; border-radius: 24px; padding: 8px; box-shadow: 0 16px 34px rgba(60,40,120,.3); }
.drag-ghost img { width: 100%; }

/* wishes */
.wish { display: flex; gap: 26px; align-items: center; }
.gifts { display: grid; grid-template-columns: repeat(3, 160px); gap: 14px; }
.gcard { background: #fff; border-radius: 24px; padding: 8px 8px 10px; box-shadow: var(--shadow); border: 4px solid transparent; text-align: center; }
.gcard .pic { height: 120px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
.gcard .pic img { height: 88%; }
.gcard span { font-weight: 700; font-size: 17px; display: block; margin-top: 4px; }
.gcard.sel { border-color: var(--pink); background: var(--pink-l); }
.gcard.tried { box-shadow: 0 0 0 3px #ffe08a, var(--shadow); }
.wish-out { width: 470px; background: #fff; border-radius: 34px; padding: 18px; box-shadow: 0 12px 32px rgba(100,80,170,.18); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 420px; justify-content: center; }
.wish-out .sent { font-size: 38px; font-weight: 700; line-height: 1.15; }
.wish-out .sent b { color: var(--pink); }
.wish-out .big { width: 190px; height: 190px; animation: pop .55s cubic-bezier(.3,1.6,.5,1); }
.speak { display: inline-flex; align-items: center; gap: 10px; background: var(--gold-l); color: #7a5200; border-radius: 20px; padding: 8px 16px; font-weight: 700; font-size: 18px; }
.speak img { width: 44px; height: 44px; }

/* story */
.story { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.story .scene { width: 580px; height: 377px; border-radius: 32px; box-shadow: 0 12px 34px rgba(100,80,170,.22); }
.story .ro { font-size: 34px; font-weight: 700; text-align: center; line-height: 1.2; max-width: 980px; }
.story .en { font-size: 18px; text-align: center; }
.opts { display: flex; gap: 22px; justify-content: center; }
.opt { width: 220px; background: #fff; border-radius: 30px; padding: 12px 12px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; border: 4px solid transparent; }
.opt .pic { width: 100%; height: 190px; border-radius: 22px; display: flex; align-items: center; justify-content: center; background: var(--ice); }
.opt .pic img { max-width: 86%; max-height: 86%; }
.opt .lbl { font-size: 20px; font-weight: 700; min-height: 30px; text-align: center; line-height: 1.15; }
.opt.right { border-color: var(--ok); background: var(--ok-l); }
.opt.wrong { border-color: var(--no); background: var(--no-l); }
.opt.dim { opacity: .5; }

/* memory */
.mem { display: grid; grid-template-columns: repeat(6, 150px); gap: 16px; }
.mcard { width: 150px; height: 190px; perspective: 900px; }
.mcard .inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.mcard.open .inner, .mcard.matched .inner { transform: rotateY(180deg); }
.mcard .face { position: absolute; inset: 0; border-radius: 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.mcard .back { background: linear-gradient(160deg, #b9a2ff, #7a5fd6); }
.mcard .back img { width: 70px; height: 70px; opacity: .9; }
.mcard .front { background: #fff; transform: rotateY(180deg); }
.mcard .front img { width: 112px; height: 112px; }
.mcard .front span { font-weight: 700; font-size: 18px; }
.mcard.matched .front { background: var(--ok-l); box-shadow: 0 0 0 4px #9ee0b4, var(--shadow); }

/* wordwall */
.ww { display: flex; gap: 30px; }
.wwcard { width: 430px; background: #fff; border-radius: 34px; padding: 18px; box-shadow: 0 12px 32px rgba(100,80,170,.18); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; border: 4px solid transparent; }
.wwcard .pic { width: 100%; height: 210px; border-radius: 24px; display: flex; align-items: center; justify-content: center; }
.wwcard .pic img { height: 92%; }
.wwcard .nm { font-size: 28px; font-weight: 700; }
.wwcard .go { display: inline-flex; align-items: center; gap: 10px; color: #fff; border-radius: 30px; padding: 14px 28px; font-size: 22px; font-weight: 700; }
.wwcard .go img { width: 22px; height: 22px; }
.wwcard.opened { border-color: #9ee0b4; }
.net img { width: 28px; height: 28px; flex: none; }
.net { display: inline-flex; align-items: center; gap: 10px; background: var(--gold-l); color: #6b4a00; border-radius: 18px; padding: 8px 18px; font-size: 17px; font-weight: 700; }

/* final */
.final { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.final .art { position: relative; }
.final .art img.cel { width: 100%; border-radius: 34px; box-shadow: 0 14px 40px rgba(100,80,170,.22); }
.final .side { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.final h1 { font-size: 58px; color: var(--pink); margin: 0; line-height: 1.05; }
.final h2 { font-size: 28px; color: var(--lav-d); margin: 0; }
.total { display: inline-flex; align-items: center; gap: 12px; background: #fff; padding: 10px 28px; border-radius: 40px; box-shadow: var(--shadow); font-size: 36px; font-weight: 700; }
.total img { width: 54px; height: 54px; }
.final .bear { width: 150px; height: 150px; animation: wave 2s ease-in-out infinite; transform-origin: 50% 90%; }
.snowfx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.snowfx i { position: absolute; top: -20px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px rgba(150,180,230,.9); animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) translateX(var(--sx)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .snowfx { display: none; }
}
