#result-story{border-block:1px solid var(--line);padding:10px 0;margin:8px 0;color:var(--muted);font-size:13px;line-height:1.6}
#result-story>strong,#result-story>b{color:var(--acid);display:block}#result-story p{margin:5px 0}#result-story progress{width:100%;height:6px;accent-color:var(--acid)}
#share-story{display:block!important;font-size:12px!important;line-height:1.5!important;margin:8px 0 0!important;color:var(--acid)}
#app.handheld #result-screen .result-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
#feedback-dialog{box-sizing:border-box;width:min(620px,calc(100% - 24px));max-height:calc(100% - 24px);padding:0;border:1px solid var(--line);border-radius:12px;background:#172a20;color:var(--ink);overflow:auto}
#feedback-dialog::backdrop{background:#07110ee6}
#feedback-form{padding:20px;display:flex;flex-direction:column;gap:14px}
#feedback-form header{display:flex;justify-content:space-between;gap:12px}#feedback-form h2{margin:0;font-size:22px}#feedback-form p{margin:6px 0;font-size:13px;line-height:1.6}
#feedback-close{width:40px;height:40px;flex:none;font-size:24px;background:#243c25;border-radius:50%}
.feedback-fields{display:grid;gap:12px}.feedback-fields label{display:grid;gap:6px;font-size:14px}
.feedback-fields select,.feedback-fields textarea{box-sizing:border-box;min-width:0;width:100%;font:16px/1.5 sans-serif;border:1px solid #a3bf8059;border-radius:5px;background:#0f2017;color:var(--ink);padding:10px}
.feedback-fields textarea{resize:vertical;min-height:100px}.feedback-note{color:var(--muted)}#feedback-form footer{display:flex;align-items:center;justify-content:space-between;gap:12px}#feedback-submit{min-height:40px;white-space:nowrap}
.walk-guide{border-bottom:1px solid var(--line);padding-bottom:20px}.walk-guide article{border:1px solid var(--line);border-radius:8px;padding:14px;margin:12px 0}.walk-guide h4{margin:0;font-size:17px}.walk-guide button{margin:6px 8px 0 0;padding:9px 12px;min-height:40px}
@media(orientation:portrait) and (max-width:760px){#app.handheld #result-screen .result-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(orientation:landscape) and (max-height:600px){
 #app #result-story{font-size:11px;padding:6px 0;margin:5px 0;line-height:1.5}#app #result-story p{font-size:11px;margin:3px 0}
 #app.handheld #result-screen .result-buttons button{font-size:12px;padding:6px 3px}
 #feedback-form{padding:12px 16px;gap:8px}#feedback-form h2{font-size:17px}#feedback-form header>div>p{display:none}
 .feedback-fields{grid-template-columns:150px minmax(0,1fr);gap:8px 12px}.feedback-note{grid-column:1/-1;font-size:11px!important}.feedback-fields textarea{min-height:80px;height:80px}
 #feedback-form footer{position:sticky;bottom:-12px;background:#172a20;padding:6px 0}#feedback-form footer p{font-size:12px}
}

#result-message{display:none}
#app:not(.handheld) #result-screen .result-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}

#app #feedback-button{font-size:13px;white-space:nowrap;padding:8px 10px;min-height:44px;color:var(--ink);border:1px solid var(--line);background:#172a20}
#app #result-screen #share-button{background:#dbf773;color:#172513;border:2px solid #e9ffa7;box-shadow:0 0 18px #cdef6330;font-weight:800;gap:8px}
#app #result-screen #share-button:hover{background:#edffac;box-shadow:0 0 22px #cdef6360}#app #result-screen #share-button:focus-visible{outline:3px solid white;outline-offset:3px}
#share-button small{display:block;font-size:10px;font-weight:500;line-height:1.4;margin-top:2px}
@media(max-width:480px){#app.handheld .brand{font-size:12px;gap:5px}#app.handheld .brand-mark{width:26px;height:26px;font-size:17px}#app.handheld .header-actions{gap:3px}#app.handheld #feedback-button{padding:6px;font-size:12px}#app.handheld #inspect-return{padding:6px;font-size:12px}}
@media(orientation:landscape) and (max-height:600px){#app.handheld #result-screen #share-button{font-size:12px;padding:4px}#app #result-screen #share-button [data-icon]{width:18px;height:18px}#share-button small{font-size:9px;margin:0}}

#language-select{font:12px sans-serif;color:var(--ink);background:#172a20;border:1px solid var(--line);border-radius:5px;min-height:44px;width:64px;padding:5px;cursor:pointer}
html:not([lang="zh-Hant"]) body{font-family:Arial,"Noto Sans TC",sans-serif}
html:not([lang="zh-Hant"]) .header-actions button{font-size:12px}html:not([lang="zh-Hant"]) .brand{font-size:16px}
html:not([lang="zh-Hant"]) #app .result-buttons button{font-size:12px;overflow-wrap:anywhere}html:not([lang="zh-Hant"]) #share-button small{font-size:9px}
@media(max-width:480px){#app.handheld .brand>div{display:none}#app.handheld .topbar{gap:4px}#language-select{width:59px;padding:3px}#app.handheld #feedback-button{max-width:78px;white-space:normal;line-height:1.2}#app.handheld .header-actions{gap:3px}html:not([lang="zh-Hant"]) #app.handheld .inspect-actions button{font-size:11px;padding:7px 4px}html:not([lang="zh-Hant"]) #app.handheld .inspect-viewbar button{font-size:10px;padding:6px 3px}}
@media (any-pointer:coarse) and (orientation:landscape){
 #app.handheld .health-card{top:calc(var(--safe-top) + 50px);width:clamp(180px,25vw,220px)}
 #app.handheld #threat-banner{top:calc(var(--safe-top) + 88px)}
 #app.handheld #toast{top:calc(var(--safe-top) + 114px)}
}
.field-row-copy,.field-detail{overflow-wrap:anywhere}
#app .brief-shell{position:relative}
#app .difficulty-picker{position:absolute;z-index:12;right:12px;bottom:62px;width:min(430px,calc(100% - 24px));max-height:calc(100% - 70px);overflow:auto;padding:12px;background:#14271bf5;border:1px solid #d6f06e88;border-radius:12px;box-shadow:0 12px 50px #0009;animation:difficulty-in .18s ease-out}
.difficulty-picker header{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.difficulty-picker header>strong{font-size:15px}.difficulty-picker #difficulty-close{width:36px;height:36px;background:transparent;font-size:22px}
.difficulty-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}.difficulty-options button{padding:12px;text-align:left;background:#223b24;border:1px solid var(--line);border-radius:8px;min-height:104px}.difficulty-options button:first-child{border-color:var(--acid);background:#314925}.difficulty-options button:hover{background:#3d552c}.difficulty-options strong,.difficulty-options small,.difficulty-options span{display:block}.difficulty-options strong{color:var(--acid);font-size:18px}.difficulty-options small{font-size:11px;margin:5px 0}.difficulty-options span{font-size:12px;line-height:1.5;color:var(--muted)}.difficulty-picker>p{font-size:11px;line-height:1.5;margin:8px 0 0;color:var(--muted)}
.difficulty-tabs{display:flex;gap:8px;margin:0 0 16px}.difficulty-tabs button{min-height:44px;flex:1;border:1px solid var(--line);border-radius:6px;background:#203722;font-size:14px;padding:8px}.difficulty-tabs button[aria-pressed=true]{background:var(--acid);color:#172513;font-weight:700}.difficulty-label{display:inline-block;color:var(--acid);font-size:12px;margin:3px 0 8px}.result-heading #result-difficulty{margin-left:8px}.result-heading .eyebrow[style]+#result-difficulty{margin-left:0}
@keyframes difficulty-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){#app .difficulty-picker{animation:none}}
@media(orientation:landscape) and (max-height:500px){#app.handheld .difficulty-picker{bottom:46px;padding:8px 12px;max-height:calc(100% - 50px)}#app .difficulty-options button{min-height:88px;padding:8px}.difficulty-options strong{font-size:16px}.difficulty-options span{font-size:11px}.difficulty-picker header{margin:0}#app .difficulty-picker>p{margin:5px 0 0}.difficulty-tabs{margin-bottom:8px}}

#app #run-difficulty{display:inline-flex!important;align-items:center;flex-shrink:0;font-size:12px;font-weight:800;line-height:1.3;padding:4px 9px;border:1px solid var(--acid);border-radius:5px;background:#223819;color:var(--acid)}
#result-board .result-difficulty-tabs{position:sticky;top:0;z-index:2;background:#172b1f;padding:6px 0;margin:0 0 8px}#result-board .result-difficulty-tabs button{font-size:14px;min-height:40px}#result-board .result-board-content>.difficulty-label{display:none}
#result-board .result-board-content .leader-switch{margin-top:0}
@media(orientation:landscape) and (max-height:500px){
 #app .result-ranking-heading{padding-bottom:4px;margin-bottom:3px;min-height:24px}
 #app .result-records #result-status{margin:3px 0;font-size:10px;line-height:1.3}
 #result-board .result-difficulty-tabs{padding:2px 0;margin-bottom:4px;gap:6px}
 #result-board .result-difficulty-tabs button{min-height:30px;padding:4px;font-size:12px}
 #result-board .leader-switch{gap:5px;margin-bottom:4px}
 #result-board .leader-switch button{min-height:26px;padding:4px;font-size:11px}
 #result-board .score-table th,#result-board .score-table td{padding:4px;font-size:11px}
}
@media(orientation:landscape) and (max-height:500px){
 #app.handheld #result-screen .result-ranking-heading{min-height:20px;padding-bottom:2px;margin-bottom:0}
 #app.handheld #result-screen .result-trophy{width:20px;height:20px}
 #app.handheld #result-screen .result-ranking-heading h3{font-size:13px}
 #app.handheld #result-status{margin:2px 0;font-size:10px;line-height:1.2}
 #app.handheld #result-board .result-difficulty-tabs{padding:0;margin:2px 0}
 #app.handheld #result-board .result-difficulty-tabs button{min-height:28px;padding:3px}
 #app.handheld #result-board .leader-switch{padding:0;margin:3px 0}
 #app.handheld #result-board .leader-switch button{min-height:24px;font-size:10px;padding:3px}
 #app.handheld #result-board .score-table th{padding:2px 4px;font-size:10px}
}

#app #run-difficulty{display:inline-block!important;flex:0 0 auto;align-self:center;justify-self:start;width:max-content;height:auto;padding:0 6px 0 0;border:0;border-radius:0;background:none;color:var(--acid);font-size:12px;line-height:18px;font-weight:600;white-space:nowrap}
#result-board .leader-switch button{background:transparent;color:var(--muted);border:0;border-bottom:2px solid transparent;border-radius:0;box-shadow:none}#result-board .leader-switch button.active{background:#a8c38c16;color:var(--ink);border-bottom-color:#a8c38c88;font-weight:500}
#phone-pairing{max-width:650px;width:calc(100% - 32px);max-height:90dvh;overflow:auto;background:#17291e;color:#eef2df;border:1px solid #b8d2a655;border-radius:16px;padding:26px}#phone-pairing::backdrop{background:#030b08d9}#phone-pairing .pair-close{float:right;background:transparent;color:inherit;border:0;font-size:26px;cursor:pointer}#phone-pairing small{letter-spacing:2px;color:#a5b5a3;font-size:10px}#phone-pairing h2{font-size:24px;margin:14px 0}#phone-pairing p{font-size:13px;line-height:1.7;color:#a5b5a3}.pair-body{display:grid;grid-template-columns:240px 1fr;gap:24px;align-items:center;margin:20px 0}#pair-qr svg{width:100%;height:auto;display:block;background:white}#pair-state{font-size:16px;color:#d6f06e}#phone-pairing button:not(.pair-close){padding:10px 15px;min-height:42px;border-radius:6px;background:#2b412a;color:#eef2df;border:1px solid #b8d2a644;cursor:pointer}#pair-copy{display:block;margin-top:12px}.pair-actions{display:flex;gap:12px}#phone-pairing #pair-new{background:#d6f06e;color:#172513}#pair-link{font-size:12px;color:#d6f06e}#phone-controller-button{white-space:nowrap}@media(max-width:600px){.pair-body{grid-template-columns:1fr}#pair-qr{max-width:210px;margin:auto}#phone-pairing h2{font-size:20px}#app.handheld #phone-controller-button{font-size:10px;padding:6px}}
@media(max-width:600px){#app.handheld #phone-controller-button{display:none}}
/* Mobile play surface: native dynamic viewport, without a second visual offset. */
@media(any-pointer:coarse){
 html,body{height:100%;min-height:0}
 #app.handheld{top:0;left:0;width:100%;height:100dvh;transform:none}
 #app.handheld.keyboard-open{height:var(--viewport-height,100dvh)}
 #app.handheld .map-card,#app.handheld #feedback-button{display:none!important}
 #app.handheld .abilities .ability{border-radius:50%!important;overflow:hidden;isolation:isolate;clip-path:circle(50%);background-clip:padding-box}
 #app.handheld .abilities .ability.available,#app.handheld .abilities .ability:active{background:#56763b!important;border-color:#d6f06e;color:#f3f9db}
 #app.handheld .abilities .ability>span,#app.handheld .abilities .ability>kbd{background:transparent!important;box-shadow:none!important;border-radius:inherit}
 #app.handheld .timer-panel{display:flex!important;position:absolute;top:calc(var(--safe-top) + 105px);right:var(--safe-right);bottom:auto;gap:2px;background:#102419bb;padding:5px 8px;border-radius:5px;pointer-events:none}
 #app.handheld .timer-panel strong{font:600 16px ui-monospace,monospace;font-variant-numeric:tabular-nums;white-space:nowrap}
 #app.handheld .timer-panel .eyebrow{font-size:9px;letter-spacing:1px}
}
.mobile-directions{display:none}
#app.handheld[data-phase=playing] .mobile-directions{display:grid;position:absolute;right:var(--safe-right);bottom:calc(var(--safe-bottom) + 148px);grid-template-columns:repeat(3,40px);grid-template-rows:repeat(3,40px);gap:2px;z-index:8;touch-action:none}
.mobile-directions button{width:40px;height:40px;border-radius:50%;border:1px solid #bdd58b70;background:#192e21c9;color:#d8e8b8;font:21px system-ui;touch-action:none;-webkit-user-select:none;user-select:none;overflow:hidden}
.mobile-directions button:first-child{grid-column:2}.mobile-directions button:nth-child(2){grid-row:2;grid-column:1}.mobile-directions span{grid-row:2;grid-column:2;font-size:10px;display:grid;place-items:center;color:#c1d3ab}.mobile-directions button:nth-child(4){grid-row:2;grid-column:3}.mobile-directions button:last-child{grid-row:3;grid-column:2}.mobile-directions button.pressed,.mobile-directions button:active{background:#56763b;color:#f3f9db}
@media(any-pointer:coarse) and (orientation:landscape){
 #app.handheld .timer-panel{top:calc(var(--safe-top) + 49px);right:var(--safe-right)}
 #app.handheld[data-phase=playing] .mobile-directions{right:calc(var(--safe-right) + 181px);bottom:var(--safe-bottom)}
}
#app.handheld #phone-controller-button{display:none!important}
#app.handheld .abilities .ability:focus-visible{outline:none;box-shadow:inset 0 0 0 2px #e4f5a3}
#app.handheld #threat-banner{bottom:auto!important;height:auto!important;min-height:0!important;max-height:64px;overflow:hidden;pointer-events:none;top:calc(var(--safe-top) + 104px);width:max-content;max-width:65%;left:50%;right:auto;white-space:normal;line-height:1.4}
#app.handheld .health-card #damage-notice{bottom:auto!important;height:auto!important;min-height:0;max-height:50px;overflow:hidden;right:auto;width:max-content;max-width:90vw;white-space:normal;pointer-events:none}
@media(orientation:landscape){#app.handheld #threat-banner{top:calc(var(--safe-top) + 84px)}}
@media(any-pointer:coarse) and (orientation:portrait){#app.handheld #threat-banner{top:calc(var(--safe-top) + 146px)}}

#app:not([data-phase="playing"]):not([data-phase="bird"]) #damage-flash{opacity:0!important}
#app.handheld #damage-flash{display:block;box-shadow:inset 0 0 75px 18px #d82d16;background:radial-gradient(ellipse at center,transparent 48%,#b51c174d 100%)}
