#collection{font-size:12px;min-width:58px;padding-inline:8px}
#research{display:block;width:100%;flex:none;border:0;border-bottom:1px solid #c4a06d;background:#f4dfac;color:#593a24;text-align:left;padding:8px 16px;font:500 12px/1.6 'Noto Sans TC',sans-serif;cursor:pointer}
#researchText{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#modal.result-sheet{width:min(560px,94vw);max-height:92dvh;padding:22px;text-align:left;border:1px solid #b58752;border-radius:16px;box-shadow:0 14px 45px #29170d55}
.result-heading h2{margin:0 0 8px;font-size:27px;line-height:1.35;color:#772d20}
.result-heading p{display:flex;flex-wrap:wrap;gap:7px;justify-content:space-between;margin:0 0 17px;color:#69482f;font-size:12px;line-height:1.7}
.result-heading p span{font-variant-numeric:tabular-nums}
.plate-photo{width:100%;height:auto;display:block;border-radius:12px;background:#e5bc83}
.result-sheet section{padding-block:19px;border-bottom:1px solid #d7bb8c}
.result-sheet h3{font-size:16px;line-height:1.5;margin:0 0 10px;color:#593824}
.discovery p,.share-section>p{font-size:12px;line-height:1.8;color:#765033;margin:9px 0 0}
.discovery-tags{display:flex;gap:6px;flex-wrap:wrap}
.discovery-tags button{display:flex;gap:9px;align-items:center;border:1px solid #c29961;border-radius:6px;padding:7px 9px;background:#f5dfad;color:#683c22;font-size:12px}
.discovery-tags button span{color:#9d3929}
.research-feedback{padding:13px;background:#f1dfb9;color:#654027;font-size:12px;line-height:1.8;border-radius:8px}
.ball-list>div{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.ball-list button{border:0;border-radius:6px;display:flex;align-items:center;gap:6px;background:#f1e2c5;color:#563822;padding:5px;text-align:left;min-width:0}
.ball-list img{width:47px;height:47px;object-fit:cover;border-radius:4px}
.ball-list button span{font-size:12px;line-height:1.7;min-width:0}
.ball-list small{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ball-list .cut-label{margin-left:auto;font-size:12px;color:#813628;white-space:nowrap}
.cut-section canvas{display:block;width:100%;height:auto;border-radius:10px}
.cut-section p{font-size:12px;color:#65452e;line-height:1.8;margin-bottom:0}
.share-actions{display:flex;gap:8px;margin-top:12px}
.share-actions button{flex:1;min-height:44px;font-size:13px}
.share-actions button:not(.primary),.result-actions>button:not(.primary){background:#fff7e4;border:1px solid #a87545;border-radius:8px;padding:9px;color:#6f3d27;font-weight:700}
.result-actions{display:flex;gap:8px;padding-top:19px}
.result-actions>button{flex:1;font-size:13px;min-height:44px}
#journal{width:min(740px,96vw);height:min(870px,94dvh);max-height:94dvh;margin:auto;padding:0;border:1px solid #b48d59;border-radius:16px;background:#fff2d5;color:#483025;box-shadow:0 18px 70px #22140b66;text-align:left;overflow:hidden}
#journal[open]{display:flex;flex-direction:column}
#journal::backdrop{background:#291b10a8;backdrop-filter:none}
.journal-header{display:flex;align-items:center;justify-content:space-between;height:auto;min-height:66px;flex:none;padding:14px 20px;background:#9b3025;color:#fff5de;border-bottom:3px solid #dcb67a;gap:12px}
.journal-header h2{font-size:21px;margin:0;color:inherit;line-height:1.4}
.journal-header .journal-close{border:1px solid #f0cca2;background:#fff2d5;color:#6e3626;font-size:12px;border-radius:7px;padding:8px 12px;min-height:40px;flex:none;display:block}
.journal-scroll{overflow:auto;overscroll-behavior:contain;padding:19px 20px 26px;scrollbar-color:#b98552 #f3dfb8;scrollbar-width:thin}
.journal-intro{margin:0 0 17px;font-size:13px;line-height:1.8;color:#745036}
.journal-intro strong{display:block;color:#873324;margin-top:7px;font-size:16px}
.dex-filters{display:flex;gap:6px;overflow:auto;padding-bottom:12px;scrollbar-width:thin}
.dex-filters button{white-space:nowrap;background:transparent;border:1px solid #b68b57;border-radius:6px;color:#6e452d;font-size:12px;padding:8px 11px;min-height:38px}
.dex-filters button.active{background:#8f3527;border-color:#8f3527;color:#fff2d5}
.dex-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}
.dex-entry{background:transparent;border:0;border-bottom:1px solid #cfb281;border-radius:0;display:flex;align-items:flex-start;gap:10px;padding:18px 0;text-align:left;min-width:0;color:#513723}
.dex-art{width:82px;height:82px;flex:none;display:grid;place-items:center;background:#f0ddba;border-radius:8px;overflow:hidden}
.dex-art img{width:100%;height:100%;object-fit:cover}
.dex-art>span{font-size:32px;font-weight:500;color:#886542}
.dex-copy{min-width:0}
.dex-copy small{font-size:12px;color:#7a5639;line-height:1.6}
.dex-copy h3{font-size:15px;line-height:1.5;margin:5px 0;color:#6c3323}
.dex-copy p{font-size:12px;line-height:1.7;margin:0;color:#735034}
.dex-copy>span{display:block;font-size:12px;color:#8a3b28;margin-top:8px}
.journal-log{padding-top:24px}
.journal-log h3{font-size:17px;margin:0 0 8px}
.journal-log p{display:flex;flex-wrap:wrap;justify-content:space-between;gap:5px;border-bottom:1px dashed #d7bd92;padding:9px 0;margin:0;font-size:12px;line-height:1.7}
.journal-log small{font-size:12px;color:#785335}
.journal-achievements{margin-top:20px;font-size:13px;color:#68452e;line-height:1.8}
.journal-achievements summary{cursor:pointer;padding:8px 0}
.journal-achievements ul{list-style:none;padding:0;margin:0}
.journal-achievements li{padding:8px 0;border-bottom:1px solid #d6ba8b}
.journal-achievements small{display:block;font-size:12px;color:#765237}
.recipe-detail{max-width:520px;width:100%;margin-inline:auto}
.text-button{background:transparent;border:0;color:#773d28;padding:8px 0;font-size:13px}
.recipe-art{max-width:230px;aspect-ratio:1;margin:10px auto 19px;border-radius:12px;display:grid;place-items:center;background:#f0ddba;overflow:hidden}
.recipe-art img{width:100%;height:100%;object-fit:cover}
.recipe-art>span{font-size:70px;color:#97724e}
.recipe-number{color:#765238;font-size:12px;margin:0 0 8px}
.recipe-detail>h3{font-size:25px;margin:0 0 10px;color:#772f22}
.recipe-hint{font-size:15px;line-height:1.9;color:#61402b}
.recipe-method{padding:15px;background:#f3e1bd;margin:17px 0;border-radius:8px;font-size:13px;line-height:1.8;color:#66432d}
.recipe-method h4{font-size:15px;margin:0 0 8px}
.recipe-method ul{padding-left:22px;margin:0}
.recipe-method p{font-size:12px;margin:10px 0 0}
.recipe-detail>.muted{color:#785238;font-size:13px}
#trackRecipe{margin-top:15px}
@media(max-width:520px){.dex-grid{grid-template-columns:1fr}.dex-art{width:84px;height:84px}.journal-scroll{padding:15px}.journal-header{padding:12px 15px}.journal-header h2{font-size:19px}#modal.result-sheet{padding:17px}.result-heading h2{font-size:24px}.ball-list>div{grid-template-columns:1fr}.ball-list img{width:50px;height:50px}.ball-list button span,.ball-list small{font-size:12px}.result-actions{flex-direction:column}.share-actions button{font-size:12px}#research{padding:6px 12px;font-size:12px}}
@media(prefers-reduced-motion:reduce){.cut-section{scroll-behavior:auto}}
/* Keep the full game name readable beside the cooking controls. */
#home{gap:7px;min-width:0}
#home b{font-size:clamp(14px,3.7vw,20px);letter-spacing:.03em;white-space:nowrap}
#home .seal{width:34px;height:34px;flex:none;font-size:21px}
#home b span{font-size:12px;letter-spacing:1.5px}
.status-actions{display:flex;align-items:center;gap:8px;flex:none}
#help{border:1px solid #a77c4f;background:#fff7e5;color:#70452c;border-radius:6px;min-height:31px;padding:4px 9px;font-size:12px;font-weight:700}
#helpDialog{width:min(450px,94vw);max-height:90dvh;border:1px solid #ae7b48;border-radius:14px;padding:24px;text-align:left;box-shadow:0 16px 50px #26150d66}
#helpDialog h2{font-size:23px;line-height:1.5;margin:0 0 11px;color:#762f21}
.help-intro{font-size:13px;line-height:1.8;color:#6b482f;margin:0 0 19px}
.game-instructions{padding-left:22px;margin:0}
.game-instructions li{padding-left:4px;margin-bottom:18px;color:#873b26}
.game-instructions h3{font-size:15px;line-height:1.5;margin:0 0 6px;color:#5e3b25}
.game-instructions p{font-size:13px;line-height:1.85;color:#704a31;margin:0}
.help-note{font-size:12px;color:#704a31;line-height:1.7;margin:18px 0}
@media(max-width:360px){.status-actions{gap:5px}#help{padding-inline:7px}#status #title{font-size:16px}}
/* Keep every control reachable on short screens and under text scaling. */
body.play{overflow-x:hidden;overflow-y:auto}
body.play header{height:64px;padding:8px 10px}
body.play header>div{display:flex;gap:4px}
body.play header>div button{height:44px;min-width:44px}
body.play #home{min-height:44px}
body.play #status{height:auto;min-height:64px}
#help{min-height:44px;min-width:44px}
#heat button{min-height:44px}
#tools button{min-height:48px;font-size:12px}
#guide{font-size:12px;line-height:1.65;min-height:36px}
#inspector{font-size:12px;min-height:31px}
#target{font-size:12px;color:#785134;line-height:1.65}
.steps{font-size:12px;color:#795b3e}
.primary,.discovery-tags button,.dex-filters button,.text-button{min-height:44px}
#c:focus-visible{outline:3px solid #ffe19a;outline-offset:-5px}
@media(max-height:600px){body.play main{height:auto;min-height:100dvh}body.play #scene{height:240px;min-height:240px;flex:none}}
.keyboard-help{font-size:12px;color:#6b482f;line-height:1.8;margin:16px 0}
.keyboard-help summary{cursor:pointer;min-height:32px;padding:4px 0}
.keyboard-help p{margin:8px 0}
#research,#journal .journal-close,.keyboard-help summary{min-height:44px}
@media(max-height:500px) and (min-width:700px){
 body.play main{display:grid;grid-template-columns:minmax(0,1fr)310px;grid-template-rows:64px 64px auto minmax(0,1fr);grid-template-areas:'brand brand' 'status controls' 'research controls' 'scene controls';height:100dvh;min-height:0;max-width:100%;width:100%}
 body.play header{grid-area:brand}
 body.play #status{grid-area:status}
 body.play #research{grid-area:research}
 body.play #scene{grid-area:scene;height:auto;min-height:0}
 body.play #controls{grid-area:controls;min-width:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
}

.primary{background:#b83b2b}
#selectedTag{font-size:12px}
body.play main{box-shadow:0 8px 36px #00000033}
#home b span{color:#ffe8bd}

/* Compact controls keep the horizontal cooking surface large on phones. */
body.play header{height:54px;padding:5px 10px}
body.play #status{min-height:50px;padding:3px 12px}
body.play #controls{padding:6px 10px max(7px,env(safe-area-inset-bottom))}
#controls .steps,#controls #target{display:none}
#guide{min-height:32px;margin:3px 0;line-height:1.4}
#inspector{min-height:26px;padding:4px 7px}
#heat{margin:4px 0;gap:4px}
#tools{margin:4px 0;gap:4px}
#tools button{min-height:44px;padding:3px 0;font-size:12px}
#tools button.on{padding:2px 0}
#tools button span{font-size:18px;line-height:1;margin-bottom:1px}
#next{min-height:44px;padding:6px}
body.play #scene{min-height:200px}
@media(max-height:600px){body.play #scene{height:270px;min-height:270px}}
@media(max-height:500px) and (min-width:700px){body.play #scene{height:auto;min-height:0}}

/* Canvas dimensions must not feed back into the flex layout. */
#c{position:absolute;inset:0;width:100%;height:100%}
#guide{height:34px;min-height:34px;margin:3px 0;overflow-y:auto;overscroll-behavior:contain}
#inspector{height:28px;min-height:28px;align-items:center;white-space:nowrap;overflow-x:auto;scrollbar-width:none}
#inspector span{flex:none}
#selectedTag{max-width:calc(100% - 112px);border-radius:8px;line-height:1.5}
#amountTag{position:absolute;right:10px;top:10px;z-index:2;pointer-events:none;min-width:80px;padding:5px 9px;background:#fff3d9f5;border:1px solid #a87943;border-radius:8px;color:#6d3420;text-align:center;font-size:12px;line-height:1.4;font-variant-numeric:tabular-nums}
#amountTag strong{display:block;font-size:24px;line-height:1.15;color:#9b3025}
#amountTag small{display:block;font:inherit;font-size:12px}

#amountTag[data-level="low"]{border-color:#b16a27}#amountTag[data-level="good"]{border-color:#627545}#amountTag[data-level="good"] strong{color:#50622e}#amountTag[data-level="excess"]{background:#fff0d5;border-color:#a33124}#amountTag small{white-space:nowrap}

#selectedTag{max-width:calc(100% - 160px)}

.oil-feedback{font-size:12px;line-height:1.8;color:#704a31;margin:12px 0 20px}

/* Slim visual buttons retain a 44px-tall pointer area. */
#help,#feedback{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:32px;min-height:32px;padding:3px 8px;border:1px solid #a77c4f;background:#fff7e5;color:#70452c;border-radius:6px;font:700 12px/1.4 'Noto Sans TC',sans-serif;text-decoration:none;flex:none}
#help::before,#feedback::before{content:'';position:absolute;inset:-6px 0}
#feedback:focus-visible{outline:3px solid #9b3025;outline-offset:3px}
.status-actions{gap:6px}
@media(max-width:360px){#status #title{font-size:14px}.status-actions{gap:4px}#help,#feedback{padding-inline:6px}}
