/* 孩子端：顶部状态 + 中间内容 + 底部三个大按钮 */
body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
.app { max-width: 480px; margin: 0 auto; height: 100%; height: 100dvh; display: flex; flex-direction: column; }

.top { padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hello .face { width: 50px; height: 50px; border-radius: 50%; background: var(--card); display: grid; place-items: center; border: 3px solid var(--pink-soft); flex: none; overflow: hidden; font-size: 28px; }
.hello h1 { margin: 0; font-size: 22px; line-height: 1.15; }
.hello p { margin: 2px 0 0; font-size: 15px; color: var(--ink-soft); }
.starpill { display: flex; align-items: center; gap: 6px; background: var(--sun-soft); border: 2px solid var(--sun); border-radius: 999px; padding: 6px 14px 6px 10px; font-size: 24px; font-variant-numeric: tabular-nums; flex: none; }

main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: 4px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 16px; }

/* 世界横幅 */
.banner { border-radius: 24px; padding: 14px 16px; display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: center; text-align: left; width: 100%; }
.banner .art { display: grid; place-items: center; }
.banner h2 { margin: 0 0 4px; font-size: 22px; }
.banner p { margin: 0; font-size: 16px; color: var(--ink); line-height: 1.45; }
.banner .count { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.bar { height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .85); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.3, 1.4, .5, 1); }
.w-rainbow { background: linear-gradient(135deg, var(--pink-soft), var(--sun-soft)); }
.w-rainbow .bar i { background: linear-gradient(90deg, #FF6B6B, #FFB627, #7BD389, #4BA9F5, #9B7BFF); }
.w-frozen { background: linear-gradient(135deg, var(--ice-soft), #F4FAFF); }
.w-frozen .bar i { background: var(--ice); }
.w-unicorn { background: linear-gradient(135deg, var(--lilac-soft), var(--pink-soft)); }
.w-unicorn .bar i { background: var(--lilac); }

.sec-title { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px -4px; gap: 8px; }
.sec-title h3 { margin: 0; font-size: 21px; }
.sec-title span { font-size: 15px; color: var(--ink-soft); }

/* 任务卡 */
.tasks { display: flex; flex-direction: column; gap: 12px; }
.task { background: var(--card); border-radius: 22px; padding: 12px; display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; border: 3px solid transparent; }
.task.is-done { background: var(--mint-soft); }
.task.is-pending { border-color: var(--sun); border-style: dashed; }
.task .icon { width: 70px; height: 70px; border-radius: 20px; background: var(--bg); display: grid; place-items: center; font-size: 40px; position: relative; }
.task .icon .spk { position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; border-radius: 50%; background: var(--ice); color: #fff; font-size: 14px; display: grid; place-items: center; border: 2px solid var(--card); }
.task .name { font-size: 23px; line-height: 1.15; font-weight: 800; }
.task .meta { font-size: 16px; color: var(--ink-soft); margin-top: 4px; }
.task .btn { padding: 10px 14px; font-size: 19px; white-space: nowrap; }
.btn-wait { background: var(--sun-soft); color: #7A4F00; border-radius: 16px; padding: 10px 12px; font-size: 16px; font-weight: 700; line-height: 1.3; text-align: center; border: 2px solid var(--sun); min-height: 52px; }
.tick { width: 56px; height: 56px; border-radius: 50%; background: var(--mint); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 800; }
.alldone { text-align: center; background: var(--card); border-radius: 22px; padding: 16px; font-size: 17px; color: var(--ink-soft); }
.alldone b { font-size: 24px; color: var(--mint-deep); display: block; margin-bottom: 4px; }

/* 世界页 */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { background: var(--card); border-radius: 16px; padding: 10px 4px; font-size: 15px; border: 3px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.seg button b { font-size: 26px; line-height: 1.1; }
.seg button[aria-pressed="true"] { border-color: var(--ink); }
.seg .lk { font-size: 13px; color: var(--ink-soft); }
.stage { border-radius: 26px; padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.stage h2 { margin: 0; font-size: 24px; }
.stage .sub { margin: 0; font-size: 16px; color: var(--ink); }
.stage .art { display: grid; place-items: center; padding-block: 8px; width: 100%; }
.season { text-align: center; font-size: 15px; color: var(--ink-soft); }
.outfits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.outfit { background: rgba(255, 255, 255, .88); border-radius: 16px; padding: 8px 2px; text-align: center; font-size: 14px; border: 2px solid transparent; }
.outfit b { display: block; font-size: 30px; line-height: 1.25; }
.outfit.next { border: 2px dashed var(--pink); }
.outfit.cur { border-color: var(--pink); }
.castle { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; max-width: 100%; margin: 4px auto; }
.castle i { aspect-ratio: 1; border-radius: 5px; }
.castle i.o { border: 2px dashed #B3D2F0; }
.castle i.on { background: linear-gradient(160deg, #C7EAFF, #6FBEF7); box-shadow: inset 0 -3px 0 rgba(30, 90, 160, .25); }
.castle i.fresh { animation: pop .6s ease .3s both; }
@keyframes pop { 0% { transform: scale(.1); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
.steps { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.steps span { font-size: 14px; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .85); color: var(--ink-soft); }
.steps span.on { background: var(--lilac); color: #fff; }
.door { background: linear-gradient(160deg, #F6F1FF, #E8F3FF); align-items: center; text-align: center; }

/* 礼物页 */
.goal { background: var(--card); border-radius: 26px; padding: 18px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; width: 100%; border: 3px solid var(--sun); }
.goal .tag { font-size: 14px; font-weight: 700; color: #7A4F00; background: var(--sun-soft); border-radius: 99px; padding: 3px 12px; }
.goal .gi { font-size: 64px; line-height: 1; }
.goal .gn { font-size: 24px; font-weight: 800; }
.dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; font-size: 20px; line-height: 1; max-width: 300px; }
.dots .off { opacity: .28; filter: grayscale(1); }
.goal .need { font-size: 17px; color: var(--ink); }
.gifts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gift { background: var(--card); border-radius: 22px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.gift.can { border: 3px solid var(--mint); }
.gift .gi { font-size: 44px; line-height: 1; }
.gift .gn { font-size: 17px; font-weight: 800; }
.gift .gp { font-size: 15px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.gift .btn { min-height: 46px; padding: 6px 18px; font-size: 18px; }
.orders { background: var(--card); border-radius: 22px; padding: 4px 14px; }
.order { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.order:last-child { border-bottom: 0; }
.order .st { margin-left: auto; font-size: 14px; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.st.wait { background: var(--sun-soft); color: #7A4F00; }
.st.ok { background: var(--mint-soft); color: var(--mint-deep); }
.st.refunded { background: var(--bg); color: var(--ink-soft); }

/* 底部导航 */
nav.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--card); border-top: 2px solid var(--line); padding-top: 6px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
nav.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 16px; font-size: 15px; color: var(--ink-soft); }
nav.tabs button b { font-size: 28px; line-height: 1; transition: transform .2s; }
nav.tabs button[aria-current="page"] { color: var(--ink); background: var(--bg); font-weight: 700; }
nav.tabs button[aria-current="page"] b { transform: scale(1.15); }

/* 奶奶确认 */
.pin-dots { display: flex; gap: 14px; margin: 4px 0; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--ink); }
.pin-dots i.on { background: var(--ink); }
.pin-err { color: var(--danger); font-size: 17px; font-weight: 700; min-height: 24px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.keypad button { height: 64px; border-radius: 18px; background: var(--bg); font-size: 30px; font-weight: 800; }
.keypad button:active { background: var(--line); }
.keypad .fn { font-size: 18px; font-weight: 600; }
.sheet .row2 { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* 庆祝 */
.cele .big { font-size: 80px; line-height: 1; animation: spin 1s ease; }
@keyframes spin { 0% { transform: scale(0) rotate(-180deg); } 70% { transform: scale(1.25) rotate(15deg); } 100% { transform: none; } }
.cele .plus { font-weight: 800; font-size: 36px; color: var(--sun-deep); }
.cele ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.cele li { background: var(--bg); border-radius: 14px; padding: 10px 12px; font-size: 17px; }
.giftbox { font-size: 110px; line-height: 1; animation: wobble 1s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg) scale(1.05); } 40% { transform: rotate(10deg) scale(1.05); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(6deg); } }
.portal { width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: center; font-size: 76px; position: relative; }
.portal::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(#FF6B6B, #FFB627, #FFE14D, #7BD389, #4BA9F5, #9B7BFF, #FF6B6B); animation: turn 2.4s linear infinite; }
.portal::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--card); }
.portal span { position: relative; z-index: 1; animation: spin 1s ease; }
@keyframes turn { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty .big { font-size: 64px; }
