@font-face{font-family:GameSerif;src:local('Noto Serif CJK SC'),local('Songti SC'),local('Georgia')}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#dbe9e1;color:#183f43;font-family:Inter,ui-sans-serif,system-ui,-apple-system,'PingFang SC','Microsoft Yahei',sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #ce7c43;outline-offset:4px}#app{height:100%;width:100%;position:relative;isolation:isolate}#world{position:absolute;inset:0;outline:none}#world canvas{display:block;width:100%;height:100%;touch-action:none}#bar{position:absolute;left:0;top:0;right:0;min-height:76px;padding:20px max(26px,env(safe-area-inset-right));display:flex;align-items:center;justify-content:space-between;gap:18px;pointer-events:none;background:linear-gradient(#f4f1e6e8,#f4f1e600);z-index:5}#bar>*{pointer-events:auto}.brand{text-decoration:none;font-family:GameSerif,serif;font-size:21px;font-weight:700;color:#173e43;white-space:nowrap;display:flex;gap:12px;align-items:center}.brand:first-letter{font-size:30px}.level-ident{display:flex;gap:15px;align-items:center}.level-ident span{font-size:11px;letter-spacing:.16em;opacity:.66}.level-ident strong{font-size:13px;font-weight:550}nav{display:flex;gap:7px}nav button{border:1px solid #31595524;border-radius:50%;width:36px;height:36px;background:#f8f5ebbe;font-size:16px;position:relative;backdrop-filter:blur(12px)}nav button:hover{background:#fffdf3;transform:translateY(-1px)}nav button:first-child{font-size:11px;font-weight:700}.slash{position:absolute;left:11px;top:8px;font-size:22px}#hud{position:absolute;left:28px;right:28px;top:84px;display:flex;align-items:center;gap:20px;font-size:12px;pointer-events:none;z-index:3}#feathers{display:flex;align-items:center;gap:8px;font-variant-numeric:tabular-nums}#feathers>span{font-size:11px;letter-spacing:.03em}#energy{display:flex;align-items:center;gap:4px}#energy>span{width:16px;height:5px;background:#bbd0c4;border-radius:8px}#energy>span.full{background:#497b70}#energy small{font-size:10px;margin-left:4px;opacity:.65}#mechanicState{margin-left:auto;background:#fcf8eda8;padding:8px 12px;border-radius:20px;max-width:52%;text-align:right;font-size:11px;font-variant-numeric:tabular-nums;backdrop-filter:blur(8px)}#hint{position:absolute;left:50%;bottom:30px;transform:translateX(-50%);padding:12px 18px;border-radius:40px;background:#fbf8efde;box-shadow:0 6px 28px #294c4820;font-size:12px;text-align:center;max-width:min(600px,85vw);line-height:1.6;pointer-events:none;transition:opacity .2s;z-index:3}#hint:empty{opacity:0}#toast{position:absolute;top:133px;left:50%;transform:translate(-50%,-8px);font-size:13px;line-height:1.6;padding:9px 16px;border-radius:9px;background:#193f44ed;color:#fbf2dc;opacity:0;transition:.2s;pointer-events:none;max-width:min(600px,85vw);text-align:center;z-index:6}#toast.visible{opacity:1;transform:translate(-50%,0)}#dialogHost:empty{display:none}#dialogHost{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#12363838;backdrop-filter:blur(7px);z-index:20;padding:24px}.dialog{max-width:680px;width:100%;max-height:calc(100dvh - 48px);overflow:auto;background:#faf6eaeF;border:1px solid #fff7e8;box-shadow:0 30px 100px #153b4540;border-radius:23px;padding:37px 42px}.dialog.hero{max-width:780px;position:relative;padding:43px 46px}.eyebrow{font-size:10px;letter-spacing:.19em;text-transform:uppercase;color:#75918a;font-weight:750}.dialog h1{font-family:GameSerif,serif;font-size:52px;line-height:1.18;letter-spacing:-.02em;margin:17px 0;color:#173e43;font-weight:650}.dialog h2{font-family:GameSerif,serif;font-size:32px;line-height:1.2;font-weight:600;margin:12px 0 17px}.dialog p{font-size:14px;line-height:1.85;color:#59716d}.dialog .lead{font-size:16px;color:#3c625d;max-width:480px}.hero .subtitle{font-family:GameSerif,serif;color:#a37b49;font-size:18px;margin:13px 0 25px}.keys{display:flex;gap:17px;flex-wrap:wrap;margin:25px 0 30px;font-size:12px;color:#69807a;align-items:center}.keys span{display:flex;gap:6px;align-items:center}kbd{font:500 13px ui-sans-serif,system-ui;border:1px solid #acbbb0;box-shadow:0 2px #bccabd;border-radius:6px;padding:5px 9px;min-width:29px;text-align:center;background:#fffcf1;color:#365a54}.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:23px}.actions button,.secondary{border:1px solid #b3c4b5;border-radius:50px;background:transparent;padding:12px 21px;font-size:12px;min-height:44px}.actions .primary{background:#234f4b;color:#fff5de;border-color:#234f4b;padding:14px 28px;font-weight:700}.actions .primary:hover{background:#34695f}.fine{font-size:11px!important;line-height:1.6!important;color:#84938a!important;margin-top:22px}.settings{display:flex;gap:17px;flex-wrap:wrap;margin-top:22px;font-size:12px}.settings label{display:flex;align-items:center;gap:7px}.settings input{accent-color:#3d7467}.level-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-top:22px}.level-grid button{min-height:73px;position:relative;border:1px solid #bdcdbb;border-radius:12px;background:#fffaf0;text-align:left;padding:11px;font-size:11px}.level-grid button strong{display:block;font-size:19px;color:#849b8a;margin-bottom:4px}.level-grid button:disabled{opacity:.38;cursor:not-allowed}.proof{background:#eaf0e5;padding:20px;border-radius:13px;margin-top:17px;line-height:1.9;font-size:13px;color:#315e52;white-space:pre-line}.proof-label{font-size:10px;letter-spacing:.12em;text-transform:uppercase;display:block;margin-bottom:8px;color:#79977d}.proof code{font:inherit}.math-note{font-size:12px!important;color:#7b8878!important}.progress-ribbon{display:flex;gap:6px;margin:20px 0}.progress-ribbon i{flex:1;height:5px;border-radius:5px;background:#d6dfcf}.progress-ribbon i.complete{background:#749b71}#touch{position:absolute;inset:0;pointer-events:none;z-index:8;display:none}#touch .direction{position:absolute;bottom:max(28px,env(safe-area-inset-bottom));left:25px;display:flex;gap:13px}#touch button{pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;border:1px solid #f8f4eaaa;background:#fbf8eecb;backdrop-filter:blur(6px);box-shadow:0 3px 18px #193d421c;border-radius:50%;width:62px;height:62px;font-size:27px;color:#23554e}#touch button.pressed{background:#49756b;color:#fff7de;transform:scale(.96)}#touch .fly{position:absolute;right:28px;bottom:max(28px,env(safe-area-inset-bottom));width:79px;height:79px;display:flex;flex-direction:column;justify-content:center;align-items:center}#touch .fly small{font-size:9px;margin-top:0}#debug{position:absolute;bottom:8px;left:8px;font:9px ui-monospace,monospace;color:#3b6354;z-index:10;opacity:.4}#debug[open]{opacity:1;background:#fffbe8f2;padding:9px;border-radius:7px;max-width:320px}#debug output{display:block;white-space:pre-line;padding-top:7px}#loading{position:absolute;inset:0;background:#f2f0e5;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:14px;z-index:40;font-size:13px}.loading-bird{font-size:60px;color:#416c5e}#webglError{position:absolute;inset:0;background:#f7f1e2;padding:15vh 12vw;z-index:50}#webglError h1{font-size:30px}#webglError p{line-height:1.8;max-width:40em}.chapter-end{color:#a2793d;font-size:13px}.collect{display:inline-flex;color:#b08c42;font-size:22px;margin:10px 0}.end-quote{font-family:GameSerif,serif;font-size:22px!important;color:#41614f!important}@media(pointer:coarse){#touch{display:block}#hint{bottom:125px}#debug{bottom:4px}}@media(max-width:700px){#bar{padding:16px 17px;min-height:62px}.brand{font-size:15px;gap:5px}.level-ident{gap:7px}.level-ident strong{display:none}.level-ident span{font-size:9px;letter-spacing:.03em}nav{gap:4px}nav button{width:31px;height:31px}#hud{top:69px;left:19px;right:19px;gap:12px}#energy small{display:none}#mechanicState{font-size:9px;padding:7px 8px}#toast{top:111px;font-size:11px}.dialog,.dialog.hero{padding:28px 25px;border-radius:18px}.dialog h1{font-size:38px}.dialog h2{font-size:27px}.dialog .lead{font-size:14px}.hero .subtitle{font-size:15px}.keys{gap:11px;font-size:10px}.dialog p{font-size:12px}.level-grid{grid-template-columns:repeat(2,1fr)}.fine{margin-top:15px}#hint{font-size:10px;padding:10px 14px}.actions button{padding:11px 16px}.settings{font-size:10px;gap:11px}}@media(max-height:540px){#bar{min-height:53px;padding:11px 20px}#hud{top:58px}#toast{top:92px}.dialog,.dialog.hero{padding:21px 29px}.dialog h1{font-size:35px;margin:9px 0}.dialog .lead{font-size:13px}.hero .subtitle{margin:8px 0}.keys{margin:15px 0;gap:14px}.fine{margin-top:12px!important}.dialog h2{font-size:25px}#hint{bottom:17px;max-width:54vw}#touch .direction{bottom:20px}#touch .fly{bottom:20px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

#compatBadge{position:absolute;right:25px;bottom:9px;font-size:9px;letter-spacing:.03em;color:#32574a;opacity:.7;pointer-events:none;z-index:9;background:#fff8eaaa;border-radius:10px;padding:4px 9px}@media(pointer:coarse){#compatBadge{bottom:9px;right:50%;transform:translateX(50%);white-space:nowrap}}

.proof .katex-display{margin:1em 0;overflow-x:auto;overflow-y:hidden}.proof .katex{font-size:1.08em}

/* The night-world counters retain a quiet opaque paper backing. */
#app[data-scene-tone="night"] #feathers,#app[data-scene-tone="night"] #energy{color:#183f43;background:#faf6ea;padding:7px 10px;border-radius:20px;box-shadow:0 1px 4px #102c3420}
#app[data-scene-tone="night"] #energy small{color:#365d5a;opacity:1}

/* Give the night-world chapter label the same opaque paper backing as its counters. */
#app[data-scene-tone="night"] .level-ident{color:#183f43;background:#faf6ea;padding:7px 10px;border-radius:20px;box-shadow:0 1px 4px #102c3420}
#app[data-scene-tone="night"] .level-ident span{color:#365d5a;opacity:1}

/* Keep the compact header readable without squeezing the counter or language label. */
@media(max-width:420px){#bar{gap:8px;padding:12px;min-height:62px}#bar .brand{min-width:0;white-space:normal;line-height:1.25}#bar .level-ident{flex-shrink:0;white-space:nowrap}#bar .level-ident span{font-size:11px;white-space:nowrap}#bar nav{flex-shrink:0}#bar nav button{padding:0;white-space:nowrap;flex-shrink:0}}

.level-grid button small{display:block;margin-top:7px;color:#59796b;font-size:10px}.progress-tools{margin-top:24px;font-size:11px;color:#5d776d}.progress-tools summary{cursor:pointer}.progress-tools .actions{margin-top:12px}

@media(max-width:700px){#bar .brand{min-width:0;white-space:normal;line-height:1.2}#bar .level-ident,#bar nav{flex-shrink:0;white-space:nowrap}#bar nav button{padding:0;white-space:nowrap;flex-shrink:0}}

#debug[open]{max-height:70vh;overflow:auto}#debug output{overflow-wrap:anywhere}

/* The approved flying-bird image is decorative beside the game title. */
#app{--game-brand-slot:48px;--game-brand-gap:10px;--game-bar-height:76px}
#bar{padding-block:calc((var(--game-bar-height) - var(--game-brand-slot))/2);min-height:var(--game-bar-height)}
#home.brand{font-size:20px;gap:var(--game-brand-gap)}
#home .game-brand-mark,#loading .game-brand-mark{display:block;width:var(--game-brand-slot);height:var(--game-brand-slot);flex:0 0 var(--game-brand-slot);object-fit:contain;object-position:center;border:0;border-radius:0;background:none;box-shadow:none;filter:none}
#home #brandLabel{min-width:0}
#loading .loading-bird{display:flex;align-items:center;justify-content:center}
@media(max-width:700px){#app{--game-bar-height:62px}#home.brand{font-size:15px}#home #brandLabel{overflow-wrap:normal;word-break:normal}}
@media(max-height:540px){#app{--game-bar-height:53px}}
@media(max-width:420px){#app{--game-bar-height:62px}html[lang="en"] #home #brandLabel{font-size:12px;line-height:1.2}}
@media(max-width:360px),(max-height:420px){#app{--game-brand-slot:40px;--game-brand-gap:8px}}

/* Use Latin punctuation metrics for English game titles. */
html[lang="en"] #home #brandLabel,html[lang="en"] .dialog.hero h1{font-family:Georgia,"Noto Serif","DejaVu Serif","Times New Roman",serif}

/* Concise guidance in the existing status area; controls keep their positions. */
#mechanicState{min-width:0;border-radius:12px;line-height:1.4}
#currentGoal{display:block;font-size:14px;font-weight:650;overflow-wrap:break-word}
#mechanicDetail{display:block;margin-top:3px;font-size:12px;opacity:.8}
#mechanicDetail[hidden]{display:none}
.play-reminder{margin:16px 0;padding:12px 16px;border:1px solid #b3c4b5;border-radius:12px;background:#fffaf0}
.play-reminder p{margin:0;font-size:14px;line-height:1.6}
.play-reminder p+p{margin-top:10px}
.play-reminder strong,.play-reminder span{display:block}
.play-reminder strong{font-size:12px;color:#315b53;margin-bottom:3px}
@media(max-width:700px){#mechanicState{max-width:58%;padding:6px 8px}#currentGoal{font-size:14px}#mechanicDetail{font-size:12px}.play-reminder{padding:10px 12px}.play-reminder p{font-size:13px}}

#pause .pause-mark{display:block;width:16px;height:16px;fill:currentColor;margin:auto;pointer-events:none}

/* Keep transient messages below the measured goal and decision figures. */
#toast{top:max(133px,calc(var(--hud-bottom,125px) + 8px))}
@media(max-width:700px){#toast{top:max(111px,calc(var(--hud-bottom,103px) + 8px))}}
@media(max-height:540px){#toast{top:max(92px,calc(var(--hud-bottom,84px) + 8px))}}

/* In a short viewport, read the transient message before the play instructions. */
@media(max-height:360px){#toast.visible + #hint{visibility:hidden}}

.dialog .progress-status{padding:12px 14px;border:1px solid #b39b61;border-radius:8px;background:#fff8df;color:#594a29;text-align:left;line-height:1.6}

/* Keep the full title beside the four controls at very narrow widths. */
@media(max-width:340px){
  #app #bar .level-ident{position:absolute;right:12px;top:1px;padding:0 3px;line-height:1.2}
  #bar nav{transform:translateY(2px)}
}

/* The night scene keeps a stable paper ground behind the wordmark only. */
#app[data-scene-tone="night"] #brandLabel{color:#173e43;background:#faf6ea;border-radius:3px;box-shadow:0 0 0 2px #faf6ea}

/* One shared Bert identity, with no enclosing badge. */
.menu-bert{display:block;width:clamp(145px,22vw,245px);max-height:30vh;height:auto;object-fit:contain;margin:0 auto .2rem}.hero h1{margin-top:0}.brand .game-brand-mark{width:48px;height:46px;object-fit:contain}.loading-bird .game-brand-mark{width:92px;height:88px;object-fit:contain}#compatBadge{display:none}
