.actor-glyph{font:26px/1.25 Egyptian,sans-serif;letter-spacing:1px;white-space:nowrap}.allegiance-meaning{font:10px/1.4 system-ui,sans-serif;white-space:nowrap}.encounter-allegiance{display:inline-flex;align-items:center;justify-content:center;gap:12px;border:1px solid #64896e;padding:7px 12px;margin:9px auto 0;color:#26583e;background:#edf3ca70}.encounter-allegiance[data-allegiance=enemy]{border-color:#ba673f;color:#893d29;background:#f9d4ac70}.encounter-allegiance .actor-glyph{font-size:32px}.encounter-allegiance .allegiance-meaning{font-size:13px}#encounter-intent{font:11px/1.6 system-ui,sans-serif;margin:10px 0;color:#665638}.encounter-result{width:min(670px,94vw);text-align:center}.encounter-result h2{margin:8px 0 12px}.result-action{font:bold 27px/1.5 system-ui,sans-serif;letter-spacing:2px;color:#1f6553;border-bottom:1px solid #a48b55;padding:6px 0 12px;margin:8px 0}#encounter-result[data-kind=enemy] .result-action{color:#973f27}.fight-instructions>p:not(.eyebrow){font-size:15px;line-height:1.65;margin:10px 0}.encounter-result .ar-value{font-size:21px}.health-reward{color:#256343;background:#e2ebbf8c;padding:10px 12px;border:1px solid #9bae77;font:13px/1.6 system-ui,sans-serif!important}.fight-guide{text-align:left;display:grid;gap:8px;margin:14px 0 20px;padding:12px 15px;background:#fff6db6b;border:1px solid #c6ae7c;font:13px/1.6 system-ui,sans-serif}.fight-guide strong{color:#813d29}.fight-guide [lang=ar]{font-family:OsirisArabic,serif;font-size:19px;text-align:right}.encounter-result .primary{width:100%;font-size:16px}#friend-wait{font:13px/1.6 system-ui,sans-serif;color:#3f7155}#combat-guide{position:absolute;right:28px;top:154px;width:310px;padding:10px 14px;text-align:center;background:#082c2be8;border:1px solid #a5bb78;pointer-events:none;box-shadow:0 3px 20px #0004}#combat-guide[data-phase=windup]{background:#602c19f0;border-color:#ffc87b}#combat-guide[data-phase=recovery]{border-color:#76e4c3}#combat-phase{font:bold 13px/1.5 system-ui,sans-serif;color:#fff0bb}#combat-phase-ar{font:19px/1.4 OsirisArabic,serif}#combat-guide progress{display:block;width:100%;height:5px;accent-color:#81d9c2;border:0;margin:6px 0}#windup-meter{accent-color:#ffd08d!important}#attack-ready{font:10px/1.5 system-ui,sans-serif;color:#e6e9bd}#combat-feedback{font:bold 12px/1.5 system-ui,sans-serif;min-height:18px;color:#ffdc94}#combat-brief{font:10px/1.5 system-ui,sans-serif;color:#c8dbc8;margin-top:3px}.vital-numbers{display:flex;justify-content:space-between;font:9px/1.4 system-ui,sans-serif;color:#f1e8c1}
@media(max-width:600px){#combat-guide{top:143px;left:18px;right:18px;width:auto;padding:7px 10px}#combat-phase{font-size:11px}#combat-phase-ar{font-size:17px}#combat-brief{font-size:9px}.fight-guide{font-size:12px;padding:10px}.fight-guide [lang=ar]{font-size:18px}.encounter-result .ar-value{font-size:20px}.result-action{font-size:23px}.fight-instructions>p:not(.eyebrow){font-size:13px}}
@media(max-height:650px){#combat-guide{top:105px;left:auto;right:18px;width:245px;padding:5px 10px}#enemy-bar{top:72px}#combat-phase{font-size:11px}#combat-phase-ar{font-size:15px}#combat-brief{display:none}#combat-feedback{font-size:10px;min-height:15px}.fight-instructions>p:not(.eyebrow){margin:6px 0;font-size:12px}.encounter-result .ar-value{font-size:18px}.fight-guide{font-size:11px;gap:4px;margin:8px 0;padding:8px 12px}.fight-guide [lang=ar]{font-size:16px}.result-action{font-size:22px;padding:3px 0 7px}.encounter-result h2{font-size:24px}.encounter-allegiance{padding:4px 10px}.encounter-allegiance .actor-glyph{font-size:25px}}
#encounter-result[data-kind=friend]{align-items:flex-start;justify-content:flex-end;background:none;backdrop-filter:none;padding:130px 28px 20px;pointer-events:none}#encounter-result[data-kind=friend] .encounter-result{width:min(320px,calc(100vw - 36px));padding:10px 14px;box-shadow:0 0 0 3px #765b36,0 0 0 4px #d3b776,0 8px 28px #0005}#encounter-result[data-kind=friend] .eyebrow,#encounter-result[data-kind=friend] #result-title,#encounter-result[data-kind=friend] #result-copy,#encounter-result[data-kind=friend] #result-copy-ar{display:none}#encounter-result[data-kind=friend] #result-allegiance{margin:0 auto;padding:4px 8px;gap:8px}#encounter-result[data-kind=friend] .actor-glyph{font-size:24px}#encounter-result[data-kind=friend] .allegiance-meaning{font-size:11px}#encounter-result[data-kind=friend] #result-action{font-size:21px;line-height:1.25;padding:4px 0;margin:4px 0}#encounter-result[data-kind=friend] #result-heal{padding:6px;margin:4px 0;font-size:11px!important;line-height:1.5}#encounter-result[data-kind=friend] #friend-wait{font-size:11px;line-height:1.4;margin:4px 0}
@media(max-width:600px){#encounter-result[data-kind=friend]{justify-content:center;padding:100px 18px 15px}}
@media(max-height:650px) and (min-width:601px){#encounter-result[data-kind=friend]{padding-top:98px;padding-right:18px}#encounter-result[data-kind=friend] .encounter-result{width:260px}}

.mobile-controls{display:none}
body.touch-device .desktop-controls{display:none}
body.touch-device .mobile-controls{display:inline}
/* Keep the paused briefing scrollable, with its confirmation always reachable. */
body.touch-device #encounter-result[data-kind=enemy] .encounter-result{display:flex;flex-direction:column;overflow:hidden;padding:18px;width:min(670px,100%);max-height:calc(100dvh - 40px)}
body.touch-device .fight-instructions{overflow:auto;min-height:0;overscroll-behavior:contain;touch-action:pan-y;padding:0 4px}
body.touch-device #start-fight{flex:none;margin-top:12px;min-height:48px}
/* Live warnings stay above the joystick and action buttons in both orientations. */
body.touch-device #combat-guide{left:50%;right:auto;transform:translateX(-50%);width:min(350px,calc(100% - 36px));padding:6px 10px}
body.touch-device #combat-brief{display:none}
body.touch-device #combat-phase{font-size:11px;line-height:1.4}
body.touch-device #combat-phase-ar{font-size:17px;line-height:1.3}
body.touch-device #combat-feedback{font-size:10px;line-height:1.4;min-height:0}
body.touch-device #combat-feedback:empty{display:none}
body.touch-device #combat-guide progress{margin:4px 0}
@media(max-width:600px){
 body.touch-device #hud .portrait{display:none}
 body.touch-device #hud .bars{width:clamp(100px,35vw,150px)}
 body.touch-device #hud nav button{padding:8px 7px}
 body.touch-device #world-hud .region-wrap{display:none}
 body.touch-device .score-orb{position:absolute;right:0;bottom:145px}
 body.touch-device #combat-guide{top:133px}
}
@media(max-height:450px){
 body.touch-device #encounter-result[data-kind=enemy] .eyebrow,body.touch-device #result-title{display:none}
 body.touch-device #encounter-result[data-kind=enemy] .result-action{font-size:18px;line-height:1.2;margin:4px 0;padding:3px 0 7px}
 body.touch-device #encounter-result[data-kind=enemy] .encounter-allegiance{margin-top:0}
 body.touch-device #encounter-result[data-kind=enemy] .fight-instructions>p{font-size:11px;line-height:1.4;margin:5px 0}
 body.touch-device #encounter-result[data-kind=enemy] #result-copy-ar{font-size:16px}
 body.touch-device #encounter-result[data-kind=enemy] .health-reward{font-size:10px!important;padding:5px}
 body.touch-device #combat-guide{top:103px;padding:4px 8px}
 body.touch-device #combat-phase-ar{font-size:15px;line-height:1.2}
 body.touch-device #combat-guide progress{margin:3px 0}
 body.touch-device #attack-ready{font-size:9px;line-height:1.2}
 body.touch-device #combat-feedback{font-size:9px;line-height:1.3}
 body.touch-device .touch-actions{gap:5px;bottom:max(15px,env(safe-area-inset-bottom))}
 body.touch-device .touch-actions button{height:48px}
 body.touch-device #joystick{width:104px;height:104px;bottom:max(18px,env(safe-area-inset-bottom))}
 body.touch-device #stick{left:30px;top:30px}
 body.touch-device .score-orb{display:none}
}
