@font-face{
  font-family:'CandySoft';
  src:url('assets/ui/candy-soft-subset.woff2?v=13dd1d41') format('woff2');
  font-display:swap;
}
:root{
  /* Single source of truth for every typeface in the app - CSS reads it via
     var(--font-game), canvas code reads it back off the computed style. */
  --font-game:'CandySoft',"Arial Rounded MT Bold","Microsoft YaHei","PingFang SC",system-ui,sans-serif;
  --ink:#17375f;--blue:#178eea;--sky:#54ccff;--yellow:#ffbd25;--orange:#ff8420;
  --panel:rgba(255,255,255,.93);--shadow:0 14px 32px rgba(21,72,126,.22);
  --splash-bg:url('assets/ui/responsive/splash-meadow-v2-1448.webp');
  --home-bg:url('assets/ui/responsive/home-background-1448.webp');
  font-family:var(--font-game);
}
@media(max-width:1080px){:root{--splash-bg:url('assets/ui/responsive/splash-meadow-v2-1080.webp');--home-bg:url('assets/ui/responsive/home-background-1080.webp')}}
@media(max-width:720px){:root{--splash-bg:url('assets/ui/responsive/splash-meadow-v2-720.webp');--home-bg:url('assets/ui/responsive/home-background-720.webp')}}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{width:100%;height:100%;margin:0;overflow:hidden;background:#128edc;color:var(--ink);user-select:none;touch-action:manipulation}
button{border:0;font:inherit;cursor:pointer;color:inherit}
button:focus-visible{outline:5px solid #fff;outline-offset:4px}
img{display:block;max-width:100%;pointer-events:none}
#app{position:relative;width:100%;height:100%;overflow:hidden;background:#45c6ff}
.screen{position:absolute;inset:0;overflow:hidden}
.stage-canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
.ui-layer{position:absolute;inset:0;pointer-events:none}
.ui-layer>*{pointer-events:auto}
/* The prompt lives in the top bar next to the title, so it never covers the
   play field and every game reads the same way. Flex keeps the row centred
   even when the title is hidden on narrow screens. */
.topbar{--topbar-gap:clamp(8px,1.2vw,16px);position:absolute;left:0;right:0;top:0;height:clamp(74px,10vh,104px);display:flex;align-items:center;gap:var(--topbar-gap);padding:max(10px,env(safe-area-inset-top)) clamp(14px,2vw,28px) 8px;z-index:20;pointer-events:none}
.topbar>*{pointer-events:auto}
.topbar>div:last-child{flex:0 0 auto;margin-left:auto}
.round-icon{width:clamp(54px,7.4vh,78px);aspect-ratio:1;background:transparent;padding:0;transition:transform .14s ease}
.round-icon:active{transform:scale(.9)}
/* The nine round buttons come out of one sheet instead of nine files. They are
   drawn centred on a nominal 3x3 grid - the painted circles wander by at most
   4% of a cell, which is invisible on a round button - so plain percentage
   positioning is enough and nothing has to know the pixel boxes.
   assets/ui/base-iocn.json has the measured ones if anything ever needs them. */
.ui-icon{display:block;width:100%;aspect-ratio:1;background-image:url('assets/ui/base-iocn.png');background-size:300% 300%;background-repeat:no-repeat}
.ui-icon--back{background-position:0% 0%}
.ui-icon--home{background-position:50% 0%}
.ui-icon--mute{background-position:100% 0%}
.ui-icon--next{background-position:0% 50%}
.ui-icon--pause{background-position:50% 50%}
.ui-icon--play{background-position:100% 50%}
.ui-icon--replay{background-position:0% 100%}
.ui-icon--settings{background-position:50% 100%}
.ui-icon--sound{background-position:100% 100%}
/* flex-shrink 100: when the bar runs out of room the static game title gives way
   first, so the per-round prompt keeps its full width for as long as possible. */
/* line-height 1.32, not 1: CandySoft's glyph box is 1.2em tall, so a line box
   the size of the em clips the bottom of every character against the
   overflow:hidden that the ellipsis needs. */
/* Pulled 60% of the row gap back toward the home button: the two belong
   together as "this game, and the way out of it", while the prompt bubble in
   the middle is a separate thing and keeps the full gap. */
.top-title{margin-left:calc(var(--topbar-gap) * -0.6);flex:0 100 auto;min-width:0;overflow:hidden;background:transparent;border:0;border-radius:0;padding:0;color:#fff;text-shadow:0 3px 2px rgba(16,83,146,.58),0 6px 14px rgba(8,60,112,.22);font-size:clamp(21px,2.7vw,36px);font-weight:400;line-height:1.32;white-space:nowrap;text-overflow:ellipsis}
.progress-pill{display:flex;align-items:center;gap:7px;background:rgba(255,255,255,.94);border:4px solid #fff;border-radius:999px;padding:7px 14px;box-shadow:var(--shadow);font-size:clamp(17px,2.2vw,26px);font-weight:400}
.progress-pill img{width:32px;height:32px;object-fit:contain}
.instruction{flex:0 1 auto;display:flex;align-items:center;justify-content:center;gap:.45em;min-width:0;max-width:min(48vw,640px);margin:0 auto;padding:8px 20px;background:rgba(255,255,255,.95);border:4px solid #d7f3ff;border-radius:999px;box-shadow:var(--shadow);text-align:center;font-size:clamp(16px,2.2vw,29px);font-weight:400;line-height:1.2;color:#1768bd;white-space:nowrap;cursor:pointer;transition:transform .12s ease}
/* The badge that marks the bar as a question you can tap to hear again. Drawn
   rather than shipped: base-iocn.png has no question mark, and one glyph in a
   circle costs nothing and scales with the surrounding text instead of being
   pinned to a bitmap's resolution. em units throughout so it tracks the
   clamp()ed font size. */
.instruction__ask{flex:0 0 auto;display:grid;place-items:center;width:1.32em;height:1.32em;border-radius:50%;background:#ffb01f;color:#fff;font-size:.82em;line-height:1;font-weight:400;text-shadow:0 1px 1px rgba(150,80,0,.45);box-shadow:0 2px 0 #e08800}
.instruction__text{min-width:0;overflow:hidden;text-overflow:ellipsis}
.instruction:active{transform:scale(.96)}
.instruction strong{color:#ff4d68;font-weight:inherit}
/* Three dots ripple only while this prompt's own voice line is playing, so the
   child can see that tapping the bar started the narration. */
.instruction__voice{display:none;flex:0 0 auto;align-items:center;gap:.22em}
.instruction.is-speaking .instruction__voice{display:flex}
.instruction__voice i{width:.3em;height:.3em;border-radius:50%;background:#ff4d68;animation:instructionVoice 1s ease-in-out infinite}
.instruction__voice i:nth-child(2){animation-delay:.16s}
.instruction__voice i:nth-child(3){animation-delay:.32s}
@keyframes instructionVoice{
  0%,60%,100%{opacity:.3;transform:translateY(0) scale(.8)}
  30%{opacity:1;transform:translateY(-.22em) scale(1.15)}
}
@media (prefers-reduced-motion:reduce){
  .instruction__voice i{animation:none;opacity:.85}
}
.game-submit-btn{position:absolute;right:clamp(28px,4vw,64px);bottom:clamp(28px,5vh,58px);z-index:24;min-width:clamp(112px,14vw,190px);min-height:clamp(58px,9vh,82px);padding:10px 28px;border:6px solid #fff;border-radius:999px;background:linear-gradient(180deg,#ffc642,#ff8d18);box-shadow:0 9px 0 #d85d09,0 14px 28px rgba(71,48,15,.3);color:#fff;font:900 clamp(22px,3vw,36px)/1 var(--font-game);text-shadow:0 3px 2px rgba(150,64,0,.28);cursor:pointer;pointer-events:auto}
.game-submit-btn:active{transform:translateY(6px);box-shadow:0 3px 0 #d85d09,0 8px 18px rgba(71,48,15,.25)}
.game-canvas-wrap{position:absolute;left:clamp(10px,1.5vw,24px);right:clamp(10px,1.5vw,24px);top:clamp(72px,10vh,104px);bottom:clamp(10px,1.5vh,22px);border:6px solid rgba(255,255,255,.9);border-radius:30px;overflow:hidden;box-shadow:var(--shadow);background:#8ddfff}
.cover-capture .game-canvas-wrap{left:50%;right:auto;top:50%;bottom:auto;width:min(100vw,145.84vh);height:auto;aspect-ratio:859/589;transform:translate(-50%,-50%);border:0;border-radius:0;box-shadow:none}
.cover-capture .ui-layer,.cover-capture + .rotate-note{display:none!important}
.boot-screen,.game-loading-screen{display:grid;place-items:center;background:linear-gradient(180deg,#38c4f5,#83ddff 58%,#7dd441);isolation:isolate}
.boot-screen::after,.game-loading-screen::after{content:"";position:absolute;inset:0;background:linear-gradient(rgba(31,174,235,.12),rgba(32,123,53,.08));z-index:-1}
.boot-card,.game-loading-card{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:min(74vw,430px);padding:clamp(22px,4vw,44px);border:6px solid rgba(255,255,255,.96);border-radius:34px;background:rgba(255,255,255,.9);box-shadow:0 18px 46px rgba(24,82,128,.24);text-align:center}
.boot-card p,.game-loading-card p{margin:0;color:#236399;font-size:clamp(18px,2.4vw,29px)}
.boot-star,.game-loading-star{display:grid;place-items:center;width:clamp(58px,8vw,92px);aspect-ratio:1;color:#ffd52d;font-size:clamp(46px,6.5vw,76px);line-height:1;filter:drop-shadow(0 5px 0 #ee9f16);animation:loadingStar 1.1s ease-in-out infinite}
.boot-meter,.game-loading-meter{width:min(58vw,330px);height:16px;overflow:hidden;border:3px solid #fff;border-radius:999px;background:#d8f1ff;box-shadow:inset 0 2px 4px rgba(27,85,132,.14)}
.boot-meter i,.game-loading-meter i{display:block;width:12%;height:100%;border-radius:inherit;background:linear-gradient(90deg,#ffb51d,#ff7d22);transition:width .18s ease}
.boot-meter i{animation:bootProgress 1.4s ease-in-out infinite}
.game-loading-cover{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-3;filter:saturate(1.03)}
.game-loading-shade{position:absolute;inset:0;z-index:-2;background:rgba(25,111,162,.32);backdrop-filter:blur(5px)}
.game-loading-card h2{margin:0;color:#1768bd;font-size:clamp(27px,4vw,48px)}
.round-loading{position:absolute;inset:0;z-index:90;display:grid;place-content:center;justify-items:center;gap:8px;background:rgba(20,87,139,.28);backdrop-filter:blur(4px);color:#fff;text-shadow:0 3px 4px rgba(10,65,110,.35);font-size:clamp(19px,2.5vw,30px)}
.round-loading span{color:#ffd52d;font-size:clamp(50px,7vw,84px);filter:drop-shadow(0 4px 0 #e89815);animation:loadingStar 1.1s ease-in-out infinite}
.round-loading p{margin:0}
@keyframes loadingStar{50%{transform:translateY(-7px) rotate(7deg) scale(1.06)}}
@keyframes bootProgress{0%{width:12%}70%{width:82%}100%{width:94%}}
@media (prefers-reduced-motion:reduce){.boot-star,.game-loading-star,.round-loading span,.boot-meter i{animation:none}}
.primary-btn,.secondary-btn{border:6px solid #fff;border-radius:999px;color:#fff;font-weight:400;box-shadow:0 8px 0 #cb6815,var(--shadow);text-shadow:0 3px 0 rgba(137,58,0,.25);padding:14px 34px;font-size:clamp(21px,3vw,36px);background:linear-gradient(#ffc439,#ff861c);transition:transform .12s ease}
.primary-btn:active,.secondary-btn:active{transform:translateY(5px)}
.secondary-btn{background:linear-gradient(#4bbcff,#237fe8);box-shadow:0 7px 0 #175eb5,var(--shadow);font-size:clamp(18px,2.3vw,27px);padding:11px 25px}

/* Splash */
.splash-screen{background:#35c8f4;overflow:hidden}
.splash-title{position:absolute;z-index:6;left:50%;top:13%;transform:translateX(-80%);width:max-content;text-align:center;pointer-events:none}
.splash-title h1{margin:0;font-size:clamp(56px,9.3vw,142px);line-height:.95;letter-spacing:-.035em;-webkit-text-stroke:clamp(4px,.55vw,8px) #fff;paint-order:stroke fill;color:#fff;text-shadow:0 .045em 0 #fff,0 .095em .04em #fff,0 .16em .24em #fff}
.splash-title h1 span:nth-child(1){color:#ff4a5d}.splash-title h1 span:nth-child(2){color:#ffac19}.splash-title h1 span:nth-child(3){color:#66cc2d}.splash-title h1 span:nth-child(4){color:#2398ed}.splash-title h1 span:nth-child(5){color:#8b48e8}
.splash-title p{display:inline-block;margin:8px 0 0;padding:7px 25px;background:#197bd4;border:4px solid #68caff;border-radius:999px;color:#fff;font-size:clamp(16px,2.2vw,25px);font-weight:400}
.splash-actions{position:absolute;z-index:7;right:10.5%;bottom:10%;transform:translateX(-80%);display:flex;flex-direction:column;align-items:center;gap:15px}
.splash-actions .primary-btn{min-width:clamp(208px,23.2vw,336px);padding-block:clamp(9px,1.15vw,14px);font-size:clamp(26px,3.36vw,46px);border-width:clamp(5px,.56vw,8px);box-shadow:0 clamp(8px,1vw,14px) 0 #e25d0e,0 18px 38px rgba(125,72,9,.22);display:inline-flex;align-items:center;justify-content:center;line-height:1}
.splash-sound{position:absolute;z-index:8;right:2%;top:2%}

/* Menu */
.menu-header{position:absolute;z-index:7;top:1%;left:2%;right:2%;height:11%;display:flex;align-items:center;justify-content:space-between;pointer-events:none}
.menu-header>*{pointer-events:auto}
.menu-brand{font-size:clamp(28px,4.6vw,58px);font-weight:400;color:#fff;text-shadow:0 4px 0 #176ab3}
.menu-stars{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.94);border:4px solid #fff;border-radius:999px;padding:7px 15px;font-size:clamp(17px,2.2vw,26px);font-weight:400;box-shadow:var(--shadow)}
.menu-stars img{width:34px}
.menu-grid{position:absolute;z-index:5;left:5%;right:5%;top:13%;bottom:6%;display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(2,minmax(0,1fr));gap:clamp(8px,1.3vw,18px)}
.game-card{position:relative;overflow:hidden;border-radius:24px;border:5px solid #fff;background:#fff;box-shadow:var(--shadow);text-align:left;transition:transform .16s ease}
.game-card:active{transform:scale(.965)}
.game-card-cover{position:absolute;inset:0;background-position:center;background-size:cover;filter:saturate(1.06)}
.game-card::after{content:"";position:absolute;inset:44% 0 0;background:linear-gradient(transparent,rgba(11,50,90,.94))}
.game-card-info{position:absolute;z-index:2;left:10px;right:10px;bottom:8px;color:#fff;text-shadow:0 2px 3px rgba(0,0,0,.35)}
.game-card-title{font-size:clamp(15px,1.75vw,25px);font-weight:400;line-height:1.05}
.game-card-desc{font-size:clamp(10px,1.1vw,14px);opacity:.92;margin-top:4px}
.card-stars{display:flex;margin-top:5px;gap:2px}.card-stars img{width:clamp(17px,1.8vw,25px);filter:grayscale(1);opacity:.35}.card-stars img.on{filter:none;opacity:1}

/* Canvas UI overlays */
.hint-btn{position:absolute;z-index:20;left:50%;bottom:3%;transform:translateX(-80%);padding:10px 25px;border-radius:999px;background:linear-gradient(#ffd342,#ff9421);border:5px solid #fff;color:#fff;font-size:clamp(17px,2.1vw,25px);font-weight:400;box-shadow:var(--shadow)}
.trace-clear{position:absolute;z-index:20;right:3%;bottom:3%;width:clamp(58px,7vw,82px);background:transparent}

/* Celebration */
.feedback{position:absolute;inset:0;z-index:100;background:rgba(12,63,111,.32);backdrop-filter:blur(5px);display:grid;place-items:center;padding:clamp(6px,1vw,14px);animation:feedbackFadeIn .22s ease both}
/* --fb-w is the card's own width. Everything inside is sized from it rather
   than from vw, because on a wide but short window the card is limited by the
   height while vw keeps growing: the 继续玩 label reached 52px inside a 71px
   button and the flex row squeezed it until the glyphs were sliced off. */
.feedback-card{--fb-w:min(calc(100vw - clamp(12px,2vw,28px)),calc((100vh - clamp(12px,2vw,28px))*1.333333));position:relative;width:var(--fb-w);height:auto;aspect-ratio:1448/1086;overflow:hidden;border-radius:4.7%;box-shadow:0 24px 65px rgba(12,50,91,.38);background:#9ee7ff}
.feedback-background{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center}
.feedback-actions{position:absolute;z-index:3;left:43%;right:7%;top:55%;bottom:8%;display:flex;flex-direction:column;align-items:center;justify-content:flex-start}
.reward-stars{display:flex;justify-content:center;align-items:center;gap:clamp(10px,calc(var(--fb-w)*.032),56px);width:100%}
.reward-stars img{width:clamp(34px,calc(var(--fb-w)*.083),124px);height:auto;filter:drop-shadow(0 .1em .06em rgba(201,117,0,.28));transform-origin:center;animation:feedbackStarPop .5s calc(.1s + var(--star-order)*.1s) cubic-bezier(.18,.95,.3,1.25) both,feedbackStarTwinkle 1.25s calc(.65s + var(--star-order)*.22s) ease-in-out infinite}
.reward-stars img.is-locked{filter:grayscale(1) opacity(.22);animation:feedbackStarPop .5s calc(.1s + var(--star-order)*.1s) cubic-bezier(.18,.95,.3,1.25) both}
.feedback-continue{position:relative;isolation:isolate;overflow:hidden;margin-top:auto;flex:none;min-width:clamp(132px,calc(var(--fb-w)*.30),420px);padding:clamp(7px,calc(var(--fb-w)*.015),21px) clamp(20px,calc(var(--fb-w)*.054),76px);font-size:clamp(15px,calc(var(--fb-w)*.036),52px);line-height:1.15;border-width:clamp(3px,calc(var(--fb-w)*.0055),8px);box-shadow:0 clamp(8px,1vw,14px) 0 #d85a08,0 18px 34px rgba(124,71,7,.24),0 0 0 0 rgba(255,236,81,.55);animation:feedbackButtonIn .42s .45s ease-out both,feedbackButtonGlow 1.35s 1s ease-in-out infinite}
.feedback-continue::before{content:"";position:absolute;z-index:-1;inset:-5px -45%;background:linear-gradient(105deg,transparent 35%,rgba(255,255,255,.9) 48%,rgba(255,255,255,.25) 55%,transparent 68%);transform:translateX(-65%);animation:feedbackMarquee 1.8s 1s linear infinite}
.feedback-continue span{position:relative;z-index:2}
@keyframes feedbackFadeIn{from{opacity:0}to{opacity:1}}
@keyframes feedbackStarPop{0%{opacity:0;transform:scale(.2) rotate(-18deg)}70%{opacity:1;transform:scale(1.12) rotate(3deg)}100%{opacity:1;transform:scale(1) rotate(0)}}
@keyframes feedbackStarTwinkle{0%,100%{opacity:.82;transform:scale(.94);filter:drop-shadow(0 .1em .06em rgba(201,117,0,.24)) brightness(.95)}45%{opacity:1;transform:scale(1.1) rotate(2deg);filter:drop-shadow(0 0 .2em #fff4a6) drop-shadow(0 .12em .07em rgba(201,117,0,.32)) brightness(1.18)}}
@keyframes feedbackButtonIn{from{opacity:0;transform:translateY(22%)}to{opacity:1;transform:none}}
@keyframes feedbackButtonGlow{0%,100%{box-shadow:0 clamp(8px,1vw,14px) 0 #d85a08,0 18px 34px rgba(124,71,7,.24),0 0 0 0 rgba(255,236,81,.5)}50%{box-shadow:0 clamp(8px,1vw,14px) 0 #d85a08,0 18px 34px rgba(124,71,7,.24),0 0 0 clamp(8px,.9vw,13px) rgba(255,236,81,0)}}
@keyframes feedbackMarquee{0%{transform:translateX(-65%)}100%{transform:translateX(65%)}}

.rotate-note{display:none;position:absolute;inset:0;z-index:999;background:#159be9;color:#fff;place-items:center;text-align:center;font-size:30px;font-weight:400;padding:30px}.rotate-note img,.rotate-note .ui-icon{width:130px;margin:0 auto 18px}
@media (orientation:portrait) and (max-width:900px){.rotate-note{display:grid}}
@media (max-width:820px){.menu-grid{left:3%;right:3%;gap:7px}.game-card{border-width:3px;border-radius:16px}.game-card-desc{display:none}.game-canvas-wrap{border-width:4px;border-radius:22px}.instruction{border-width:3px}.top-title{border-width:3px}}
@media (max-aspect-ratio:3/2){
 .feedback-actions{left:42%;right:5.5%}
}
@media (prefers-reduced-motion:reduce){
 .feedback,.reward-stars img,.feedback-continue,.feedback-continue::before{animation:none!important}
}

/* Below this width the title and the prompt cannot both fit on the bar. The
   prompt wins: it is the only part that changes from round to round. */
@media(max-width:860px){
 .topbar .top-title{display:none}
}
@media(max-width:1100px){
 .instruction{max-width:min(64vw,560px)}
}

/* V4 parent controls and repaired menu cards */
.compact-icon{width:clamp(46px,6.3vh,66px)}
.splash-tools{position:absolute;z-index:8;right:2.2%;top:2.5%;display:flex;gap:clamp(8px,1vw,16px)}
.splash-tools .round-icon{width:clamp(58px,7.5vw,96px)}
@media (max-aspect-ratio:5/4){
 .splash-title{top:15%}
 .splash-title h1{font-size:clamp(50px,10vw,104px)}
 .splash-actions{right:6%;bottom:8%}
 .splash-actions .primary-btn{min-width:clamp(220px,34vw,340px)}
}
.menu-left,.menu-right{display:flex;align-items:center;gap:12px}
.menu-header{height:12%}
.menu-grid{top:14%;bottom:4%}
.game-card{display:grid;grid-template-rows:minmax(0,1fr) auto;background:#eaf9ff;overflow:hidden}
.game-card-cover{position:relative;inset:auto;display:grid;place-items:center;overflow:hidden;background:linear-gradient(#dff7ff,#f7fdff);min-height:0;padding:4px}
.game-card-cover img{width:100%;height:100%;object-fit:contain;object-position:center;display:block}
.game-card::after{display:none}
.game-card-info{position:relative;left:auto;right:auto;bottom:auto;display:block;background:linear-gradient(135deg,#176fc7,#284aa2);padding:8px 10px 7px;min-height:72px;color:#fff;text-shadow:0 2px 3px rgba(0,0,0,.26)}
.game-card-title{display:block}.game-card-desc{display:block}.card-stars{margin-top:4px}
.parent-modal,.break-modal,.time-lock{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:22px;background:rgba(10,42,84,.52);backdrop-filter:blur(7px)}
.parent-card{position:relative;width:min(92vw,640px);max-height:92vh;overflow:auto;background:linear-gradient(180deg,#fffdf0,#e7f8ff);border:8px solid #fff;border-radius:38px;box-shadow:0 28px 70px rgba(10,42,84,.4);padding:28px;text-align:center;color:#17375f}
.gate-card{width:min(92vw,480px);border-width:6px;border-radius:29px;padding:21px}
.parent-card h2{margin:4px 0 8px;font-size:clamp(28px,4vw,46px);color:#2469b4}.parent-card p{margin:0 0 20px;font-size:clamp(16px,2vw,23px);font-weight:800;color:#527191}
.parent-gear{width:94px;margin:0 auto 5px}.settings-head .ui-icon{width:74px;flex:0 0 auto}.hold-to-unlock{position:relative;width:min(100%,430px);height:78px;margin:12px auto 18px;overflow:hidden;border:6px solid #fff;border-radius:999px;background:#d9e9f3;box-shadow:0 8px 0 #9db7c8;font-size:clamp(19px,2.5vw,28px);font-weight:400;color:#174d80}
.hold-to-unlock i{position:absolute;left:0;top:0;bottom:0;width:0;background:linear-gradient(90deg,#65d644,#ffd83e);transition:width .05s linear}.hold-to-unlock span{position:relative;z-index:2}
.modal-close{position:absolute;z-index:2;top:12px;right:14px;width:46px;height:46px;border:0;border-radius:50%;background:#e8f5ff;color:#3974a8;box-shadow:0 4px 0 #b9d8ed;font-size:34px;font-weight:900;line-height:42px;padding:0;text-decoration:none}
.modal-close:active{transform:translateY(3px);box-shadow:0 1px 0 #b9d8ed}
/* The settings card scrolls its own body rather than the whole card. The card
   used to be `overflow:auto` on .parent-card, which put a scrollbar down the
   right edge over the rounded border and let the heading scroll away. Now the
   card is a flex column that never exceeds the viewport, the head stays put,
   and .settings-scroll takes whatever height is left. */
.settings-card{text-align:left;width:min(94vw,720px);display:flex;flex-direction:column;max-height:min(92vh,860px);overflow:hidden;padding-bottom:0}
.settings-head{display:flex;align-items:center;gap:16px;margin-bottom:14px;flex:0 0 auto}
.settings-head img{width:74px}.settings-head h2,.settings-head p{text-align:left;margin:0}
/* scrollbar-width/::-webkit-scrollbar hide the bar itself; the content is still
   scrollable by wheel, drag and keyboard. The fade below is what tells a parent
   there is more, which a 6px bar over a rounded corner never did well. */
/* The bottom padding matches the fade height so the last row can always be
   scrolled clear of it - otherwise the two action buttons sit under the fade at
   the end of the list and look disabled. */
.settings-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:64px}
.settings-scroll::-webkit-scrollbar{display:none}
/* Sits inside the card's padding box, above the scrolling content, and matches
   the card's own bottom colour so the list dissolves into it. pointer-events
   off or it would eat clicks on the last row of buttons. */
.settings-card::after{content:"";position:absolute;left:0;right:0;bottom:0;height:64px;pointer-events:none;border-radius:0 0 30px 30px;background:linear-gradient(rgba(231,248,255,0),rgba(231,248,255,.92) 58%,#e7f8ff)}
.usage-summary{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0 20px}.usage-summary>div{background:#fff;border:4px solid #d9f1ff;border-radius:20px;padding:14px;text-align:center}.usage-summary span{display:block;color:#66839d;font-weight:800;font-size:15px}.usage-summary strong{display:block;margin-top:4px;color:#ff7f24;font-size:clamp(23px,3vw,34px)}
.settings-card label{display:grid;grid-template-columns:1fr minmax(170px,220px);align-items:center;gap:15px;margin:12px 0;padding:13px 15px;background:rgba(255,255,255,.82);border-radius:18px;font-size:clamp(17px,2vw,22px);font-weight:900}.settings-card select{width:100%;border:3px solid #b9ddf5;border-radius:13px;background:#fff;padding:10px;font:inherit;color:#24557d}
/* .settings-footer and its 保存设置 button are gone: every control in this card
   applies on change, so a save button had nothing to do but mislead. */
.settings-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:18px}.settings-actions .secondary-btn{font-size:17px;padding:10px 17px;border-width:4px;box-shadow:0 5px 0 #175eb5}.settings-actions .danger{background:linear-gradient(#ff7b86,#e9485b);box-shadow:0 5px 0 #af2435}
.break-card,.time-card{width:min(88vw,580px)}.break-illustration,.time-moon{font-size:76px;line-height:1}.break-card>[data-break-count]{display:block;font-size:68px;color:#ff9825;margin:8px}.break-card button:disabled{opacity:.5;filter:grayscale(.7);cursor:not-allowed}.time-card>.secondary-btn,.time-card>.primary-btn{display:block;width:min(100%,400px);margin:12px auto}
.exit-confirm-card{display:flex;flex-direction:column;justify-content:center}
.exit-confirm-actions{display:flex;gap:14px;justify-content:center;margin-top:22px}

/* Login / registration */
.auth-screen{
  display:grid;
  place-items:center;
  padding:max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));
  background:#85d9f6 var(--splash-bg) center/cover no-repeat;
}
.auth-screen + .rotate-note{display:none!important}
.auth-card{
  width:min(90vw,560px);
  max-height:94vh;
  overflow:auto;
  padding:clamp(22px,3.2vw,42px);
  border:clamp(6px,.7vw,10px) solid rgba(255,255,255,.96);
  border-radius:clamp(30px,4vw,52px);
  background:rgba(255,253,239,.94);
  box-shadow:0 28px 70px rgba(18,82,121,.34),inset 0 0 40px rgba(211,246,255,.72);
}
.auth-brand-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(14px,2.5vw,30px);
  min-height:clamp(112px,19vh,180px);
  margin-bottom:clamp(8px,1.8vh,18px);
}
.auth-mascot{
  position:relative;
  flex:0 0 auto;
  width:clamp(92px,13vw,150px);
  height:clamp(112px,19vh,180px);
}
.auth-mascot img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center bottom;
  filter:drop-shadow(0 8px 8px rgba(56,91,59,.20));
  transition:opacity .16s ease;
}
.auth-mascot-idle{opacity:1}
.auth-mascot-cover{opacity:0}
.auth-mascot.is-covering .auth-mascot-idle{opacity:0}
.auth-mascot.is-covering .auth-mascot-cover{opacity:1}
@media(prefers-reduced-motion:reduce){
  .auth-mascot img{transition:none}
}
.auth-brand-row h1{
  margin:0;
  color:#176bc0;
  font-size:clamp(34px,5vw,60px);
  font-weight:400;
  line-height:1;
  white-space:nowrap;
  text-shadow:0 3px 0 #fff,0 7px 15px rgba(22,91,151,.18);
}
.auth-form{display:grid;gap:clamp(10px,1.5vh,15px)}
.auth-field{display:block}
.auth-field>span{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}
.auth-field input{
  width:100%;
  height:clamp(58px,8.5vh,78px);
  padding:0 clamp(18px,2.5vw,28px);
  border:4px solid #b9e2ff;
  border-radius:clamp(17px,2.2vw,24px);
  outline:0;
  background:#eef4ff;
  color:#17375f;
  font:700 clamp(19px,2.2vw,27px)/1 var(--font-game);
  text-align:center;
  letter-spacing:.04em;
  user-select:text;
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
.auth-field input::placeholder{color:#7290aa;font-weight:600;letter-spacing:0}
.auth-field input:focus{border-color:#49aaf3;background:#fff;box-shadow:0 0 0 5px rgba(73,170,243,.18)}
.auth-confirm-field[hidden]{display:none}
.auth-error{
  min-height:1.35em;
  margin:0;
  color:#e84654;
  text-align:center;
  font-size:clamp(14px,1.5vw,18px);
  font-weight:800;
}
.auth-submit{
  width:100%;
  min-height:clamp(66px,9vh,88px);
  margin-top:2px;
  font-size:clamp(25px,3vw,36px);
}
.auth-submit:disabled{opacity:.68;cursor:wait}
@media(max-height:680px){
  .auth-card{width:min(86vw,680px);padding:16px 28px;border-radius:30px}
  .auth-brand-row{min-height:86px;margin-bottom:4px}
  .auth-mascot{width:82px;height:88px}
  .auth-brand-row h1{font-size:38px}
  .auth-form{grid-template-columns:1fr 1fr;gap:9px 12px}
  .auth-confirm-field,.auth-error,.auth-submit{grid-column:1/-1}
  .auth-field input{height:52px;font-size:19px}
  .auth-submit{min-height:58px;font-size:25px}
}
@media(max-width:560px){
  .auth-card{width:min(94vw,460px);padding:22px 18px}
  .auth-brand-row{gap:10px}
  .auth-mascot{width:90px}
  .auth-brand-row h1{font-size:34px}
}
@media (max-width:1050px){.menu-brand{font-size:clamp(24px,4vw,42px)}.menu-grid{left:2.5%;right:2.5%;gap:7px}.game-card-info{min-height:62px;padding:6px 8px}.game-card-desc{display:none}.game-card-title{font-size:clamp(14px,1.65vw,20px)}.card-stars img{width:17px}}
@media (max-width:820px){.menu-left,.menu-right{gap:6px}.menu-stars{padding:5px 9px}.game-card-info{min-height:56px}.settings-card label{grid-template-columns:1fr}}
.menu-grid{align-items:center}
.game-card{align-self:center;height:auto;width:100%}
.game-card-cover{display:block}
.house-hit-layer{position:absolute;inset:0;z-index:5;pointer-events:none}
.house-hit{position:absolute;top:14%;height:54%;pointer-events:auto;background:transparent;border:0;border-radius:24px}
.house-hit:active{background:rgba(255,221,66,.13)}


/* ===== V5: 三列大卡片、场景一致性与描写结果 ===== */
.menu-screen-v5{overflow:hidden;background:#35bdf6}
.menu-screen-v5 .stage-canvas{filter:saturate(1.04) contrast(1.01)}
.menu-header{position:absolute;left:0;right:0;top:0;z-index:30;height:clamp(82px,10.5vh,108px);padding:max(10px,env(safe-area-inset-top)) clamp(16px,2.2vw,30px) 8px;display:flex;align-items:center;justify-content:space-between;gap:18px;background:transparent}
.menu-left,.menu-right{display:flex;align-items:center;gap:12px}
/* The home button and the wordmark read as one unit, so they sit closer than the
   unrelated controls on the right. */
.menu-left{gap:6px}
/* Declared here rather than with the other narrow-screen rules further up: the
   V5 block is later in the file and at equal specificity, so a copy up there
   would lose and small screens would keep the old spacing. */
@media (max-width:820px){.menu-left{gap:3px}}
/* align-items:center centres the two *boxes*, which is not what the eye reads:
   the candy font hangs its glyphs low in the line box and the wordmark carries a
   3px drop shadow, so the characters land below the middle of the home disc.
   The nudge is in em so it tracks the clamped font size. */
.menu-brand{font-size:clamp(28px,4vw,52px);font-weight:400;color:#fff;text-shadow:0 3px 0 #176ab3,0 6px 14px rgba(10,62,115,.26);white-space:nowrap;transform:translateY(-.06em)}
.menu-kicker{margin-top:2px;font-size:clamp(13px,1.55vw,20px);font-weight:900;color:#eaf9ff;letter-spacing:.05em}
.compact-icon{width:clamp(52px,6.6vh,70px)}
.menu-scroll{position:absolute;z-index:8;left:3.5%;right:3.5%;top:clamp(88px,11.4vh,116px);bottom:0;overflow-y:auto;overflow-x:hidden;padding:8px 5px clamp(118px,17vh,180px);scrollbar-width:none;-webkit-overflow-scrolling:touch;scroll-behavior:smooth;overscroll-behavior:contain}
.menu-scroll::-webkit-scrollbar{display:none}
.menu-grid{position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;width:100%;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:none!important;grid-auto-rows:auto;gap:clamp(14px,1.8vw,24px)!important}
/* padding:0 is load bearing. .game-card is a <button>, and the global button
   reset on line 20 clears the border but not the padding, so it kept Chrome's
   default 1px 6px. Against the 6px white border that made the frame 12px down
   each side and 7px along the top, which is the uneven frame the menu was
   pulled up on. */
.game-card{--reveal:0;--card-radius:28px;--card-border:6px;position:relative;display:grid;grid-template-rows:auto auto;overflow:hidden;padding:0;border:var(--card-border) solid rgba(255,255,255,.96)!important;border-radius:var(--card-radius)!important;background:#fff!important;box-shadow:0 14px 30px rgba(13,62,112,.24),inset 0 1px 0 rgba(255,255,255,.9)!important;text-align:left;opacity:calc(.06 + var(--reveal)*.94);transform:translateY(calc((1 - var(--reveal))*82px));transform-origin:50% 100%;transition:opacity .24s ease,transform .24s cubic-bezier(.2,.8,.2,1),box-shadow .16s ease;will-change:opacity,transform}
.game-card:hover{box-shadow:0 19px 38px rgba(13,62,112,.3),inset 0 1px 0 rgba(255,255,255,.9)!important}
.game-card:active{filter:brightness(.98) saturate(1.08)}
.game-card::after{display:none!important}
/* width:100% with align-self:start drives the height from the aspect ratio
   rather than from whatever the stretched card row leaves over, so the artwork
   meets all three edges and the only white is the border itself. */
.game-card-cover{position:relative!important;inset:auto!important;display:flex!important;align-items:center;justify-content:center;width:100%;align-self:start;min-height:0;aspect-ratio:859/589;overflow:hidden;padding:0!important;background:transparent;border-radius:calc(var(--card-radius) - var(--card-border)) calc(var(--card-radius) - var(--card-border)) 0 0}
.game-card-cover img{width:100%;height:100%;object-fit:cover;object-position:50% 50%;display:block;border-radius:inherit;filter:saturate(1.04) contrast(1.01)}
.game-card-info{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;z-index:3;min-height:72px;padding:10px 13px 11px;display:flex;align-items:center;justify-content:space-between;gap:10px;background:linear-gradient(180deg,#fff,#edf9ff);color:#17446f!important;text-shadow:none!important;border-top:1px solid rgba(63,151,211,.18)}
.game-card-title{font-size:clamp(18px,2vw,27px)!important;line-height:1.05}
.game-card-desc{font-size:clamp(11px,1.15vw,15px)!important;color:#477291;opacity:1!important;margin-top:5px}
.card-stars{margin-top:0!important;flex:none}.card-stars img{width:clamp(20px,2vw,29px)!important}
.game-index{position:absolute;left:10px;top:10px;z-index:6;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(#ffcb40,#ff8b1d);border:3px solid #fff;color:#fff;font-size:21px;font-weight:400;box-shadow:0 5px 12px rgba(119,62,10,.25)}
.menu-grass-reveal{position:absolute;z-index:9;left:0;right:0;bottom:0;height:clamp(76px,10.5vh,112px);pointer-events:none;background:var(--home-bg) center bottom/cover no-repeat;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 62%,#000 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 62%,#000 100%)}
.menu-swipe-tip{position:absolute;left:50%;bottom:clamp(16px,3vh,30px);z-index:12;transform:translateX(-50%);width:min(62vw,390px);padding:6px 16px;border:3px solid rgba(255,255,255,.88);border-radius:999px;background:linear-gradient(180deg,#75d452,#35ad39);box-shadow:0 4px 0 rgba(31,132,48,.34),0 8px 16px rgba(21,95,54,.2);color:#fff;font-family:var(--font-game);font-size:clamp(13px,1.35vw,18px);font-weight:600;text-align:center;text-shadow:0 2px 2px rgba(24,100,40,.32);pointer-events:none;transition:opacity .22s ease,transform .22s ease}
.menu-swipe-tip span{display:inline-block;animation:menuHintText 1.8s ease-in-out infinite}
.menu-swipe-tip.is-scrolled{opacity:.68;transform:translateX(-50%) translateY(8px) scale(.96)}
@keyframes menuHintText{0%,100%{transform:translateY(0);opacity:.9;text-shadow:0 2px 2px rgba(24,100,40,.32)}50%{transform:translateY(-1px);opacity:1;text-shadow:0 2px 5px rgba(255,255,255,.55)}}
@media(max-width:900px){
  .menu-grid{grid-auto-rows:auto}
  .game-card-info{min-height:64px;padding:8px 10px}
  .game-card-desc{display:none}
}
@media(max-width:720px){
  .menu-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;grid-auto-rows:auto}
  .game-card{--card-radius:18px;--card-border:4px}
  .game-card-title{font-size:15px!important}
  .card-stars img{width:17px!important}
  .menu-swipe-tip{width:min(72vw,330px);padding:5px 12px;border-width:2px}
}
@media(prefers-reduced-motion:reduce){
  .menu-scroll{scroll-behavior:auto}
  .game-card,.menu-swipe-tip{transition:none}
  .menu-swipe-tip span{animation:none}
}

/* 描数字完成度和结果演出 */
.trace-meter{position:absolute;left:50%;bottom:3.2%;z-index:24;transform:translateX(-80%);width:min(42%,430px);height:36px;padding:5px 66px 5px 6px;border:4px solid #fff;border-radius:999px;background:rgba(21,76,129,.3);box-shadow:var(--shadow);overflow:hidden}
.trace-meter::before{content:"";position:absolute;left:6px;right:58px;top:6px;bottom:6px;border-radius:999px;background:rgba(255,255,255,.55)}
.trace-meter i{position:absolute;left:6px;top:6px;bottom:6px;width:0;border-radius:999px;background:linear-gradient(90deg,#5bd447,#ffe046,#ff9b2c);transition:width .14s linear}
.trace-meter span{position:absolute;right:13px;top:50%;transform:translateY(-50%);font-size:16px;font-weight:400;color:#fff;text-shadow:0 2px 3px rgba(0,0,0,.25)}
.trace-clear{position:absolute;right:3%;bottom:2.5%;z-index:24;width:clamp(58px,7vw,82px);background:transparent;padding:0}
.trace-result{position:absolute;inset:0;z-index:90;display:grid;place-items:center;background:rgba(22,92,145,.25);backdrop-filter:blur(3px);animation:v5ResultIn .25s ease both}
.trace-result>div{width:min(52vw,520px);min-height:min(52vh,430px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;border:8px solid #fff;border-radius:38px;background:linear-gradient(180deg,#fffce8,#dff8ff);box-shadow:0 22px 52px rgba(14,59,104,.34);text-align:center}
/* canvas as well as img: the glyph is cut from the number sheet at load time,
   so what gets prepended here is a <canvas>, not an <img>. */
.trace-result img,.trace-result canvas{height:min(28vh,220px);width:auto;object-fit:contain;animation:v5NumberBounce .7s cubic-bezier(.2,1.5,.4,1) both}
.trace-result h3{margin:4px 0 4px;font-size:clamp(34px,5vw,60px);color:#ff586c;text-shadow:0 3px 0 #fff}
.trace-result p{margin:0;font-size:clamp(20px,2.6vw,31px);font-weight:400;color:#2572b6}
@keyframes v5ResultIn{from{opacity:0}to{opacity:1}}
@keyframes v5NumberBounce{0%{opacity:0;transform:scale(.25) rotate(-18deg)}65%{transform:scale(1.14) rotate(4deg)}100%{opacity:1;transform:none}}

/* ===== 手机横屏 =====
   A phone on its side gives the page about 390 CSS pixels of height. Every
   size above is a clamp whose *floor* was chosen for portrait, where height is
   the plentiful axis - and on a short screen the floor is what applies, so
   nothing shrinks. The chrome took 74px of 390, a fifth of the screen, before
   the game got any.

   Keyed on height rather than orientation: a 1024x600 tablet on its side is
   landscape too but has room to spare, and matching it would shrink the UI for
   no reason. 520px is above every phone in landscape and below every tablet.

   Last in the file on purpose. Several blocks above are equally specific, so a
   copy placed with the other media queries would lose to them - the menu's
   header spacing was already fixed once for this reason.

   Tap targets stay at or above 44px, which is the smallest a small hand
   reliably hits. */
@media (max-height:520px){
 .topbar{height:clamp(50px,13.5vh,74px);padding:max(4px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 3px max(10px,env(safe-area-inset-left));--topbar-gap:clamp(5px,1vw,10px)}
 .round-icon{width:clamp(44px,11.5vh,54px)}
 .compact-icon{width:clamp(42px,11vh,52px)}
 .top-title{font-size:clamp(16px,4.6vh,24px);line-height:1.2}
 .instruction{max-width:min(52vw,520px);padding:3px 12px;border-width:3px;font-size:clamp(13px,3.9vh,20px)}
 .progress-pill{padding:3px 10px;border-width:3px;gap:5px;font-size:clamp(13px,3.6vh,19px)}
 .progress-pill img{width:22px;height:22px}
 .game-canvas-wrap{top:clamp(50px,13.5vh,74px);bottom:clamp(5px,1.2vh,12px);left:max(6px,env(safe-area-inset-left));right:max(6px,env(safe-area-inset-right));border-width:4px;border-radius:20px}
 /* The meter and the redo button sit over the bottom of the writing board when
    there is this little height; pull them into the corners and shrink them. */
 .trace-meter{width:min(38%,300px);height:26px;padding:4px 48px 4px 5px;border-width:3px;bottom:2%;transform:translateX(-92%)}
 .trace-meter::before{left:5px;right:42px;top:5px;bottom:5px}
 .trace-meter i{left:5px;top:5px;bottom:5px}
 .trace-meter span{right:10px;font-size:13px}
 .trace-clear{width:clamp(44px,12vh,58px);bottom:2%;right:2%}
 /* The celebration card is taller than the screen at this height. */
 .trace-result>div{width:min(62vw,460px);min-height:0;max-height:88vh;padding:10px 18px;border-width:5px;border-radius:24px}
 .trace-result img,.trace-result canvas{height:min(34vh,140px)}
 .trace-result h3{font-size:clamp(22px,7vh,34px);margin:2px 0}
 .trace-result p{font-size:clamp(15px,4.4vh,22px)}
 /* Menu: three columns of cards do not fit above the fold, but the grid
    scrolls, so the fix is to make a card short enough that a row and a bit is
    visible and the child can tell there is more below. */
 .menu-header{height:clamp(52px,14vh,78px);padding:max(4px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 4px max(12px,env(safe-area-inset-left))}
 .menu-brand{font-size:clamp(20px,6vh,32px)}
 .menu-stars{padding:3px 10px;border-width:3px;font-size:clamp(13px,3.6vh,18px)}
 .menu-stars img{width:22px}
 .menu-scroll{top:clamp(56px,15vh,84px);padding-bottom:clamp(20px,6vh,40px)}
 .menu-grid{gap:clamp(8px,1.4vw,14px)!important}
 .game-card-info{min-height:0;padding:5px 8px 6px}
 .game-card-title{font-size:clamp(13px,1.7vw,18px)}
 .game-card-desc{display:none}
 .card-stars img{width:15px}
 /* Modals: these are centred grids with fixed padding and overflow the screen. */
 .parent-card{padding:14px 18px;border-width:5px;border-radius:24px;max-height:94vh}
 .gate-card{padding:14px;border-radius:20px}
 .parent-modal,.break-modal,.time-lock{padding:10px}
}
