/* Bifrost fixed-frontline adapter. Preserve shared typography and 68–78px skill targets. */
@media(max-width:460px){
 #game-shell:has(#frontline-status:not([hidden])) .battle-top>.battle-score{max-width:none;width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;text-align:left}
 #game-shell:has(#frontline-status:not([hidden])) #battle-ruleset-label{grid-column:1;grid-row:1;max-width:none}
 #game-shell:has(#frontline-status:not([hidden])) #battle-clock{grid-column:2;grid-row:1}
 #game-shell:has(#frontline-status:not([hidden])) #supply-value{grid-column:1 / 3;grid-row:2}
 #game-shell:has(#frontline-status:not([hidden])) #objective-status{grid-column:1 / 3;grid-row:3}
 #game-shell:has(#frontline-status:not([hidden])) #battle-locale{grid-column:3;grid-row:2;align-self:start;justify-self:end}
 #game-shell:has(#frontline-status:not([hidden])) .hero-hud,
 #game-shell:has(#frontline-status:not([hidden])) #minimap{top:calc(var(--bf-header-bottom,134px) + 8px)}
 #game-shell:has(#frontline-status:not([hidden])) #frontline-status{top:calc(var(--bf-row-bottom,224px) + 8px)!important}
 #game-shell:has(#frontline-status:not([hidden])) #tutorial-card{top:calc(var(--bf-row-bottom,224px) + 70px)!important}
 #game-shell:has(#frontline-status:not([hidden])) #frontline-support-mode:not([hidden]){left:auto;right:12px;bottom:198px;width:168px;max-width:none;display:grid;grid-template-columns:1fr 1fr;gap:4px}
 #game-shell:has(#frontline-status:not([hidden])) #frontline-support-mode button{min-width:0;min-height:48px;white-space:normal}
}
/* Optional per-run coaching; critical current danger remains separate from hidden hints. */
#frontline-onboarding{position:absolute;left:18px;top:calc(var(--bf-row-bottom,158px) + 8px);width:340px;max-width:calc(100% - 36px);z-index:4;color:var(--ag-ui-text,#edf3df);font:var(--ag-type-caption)}
#frontline-onboarding[hidden],#frontline-onboarding [hidden]{display:none}
#frontline-onboarding button{width:100%;min-height:44px;padding:6px 10px;font:inherit;white-space:normal;text-align:left;background:#12343eeb}
#frontline-onboarding p{margin:0;padding:6px 10px;line-height:18px;background:#12343eeb;pointer-events:none}
#frontline-onboarding-danger{border:2px solid #eca39d;color:#fff1df}
@media(max-height:600px) and (orientation:landscape){#frontline-onboarding{left:12px;width:232px;top:calc(var(--bf-row-bottom,133px) + 8px)}#frontline-onboarding p{line-height:16px}}
@media(max-width:460px){#frontline-onboarding{left:12px;width:calc(100% - 24px);max-width:none;top:calc(var(--bf-row-bottom,224px) + 70px)}}

#frontline-onboarding{display:grid;grid-template-columns:minmax(0,1fr) 52px;gap:0 4px}#frontline-onboarding-coach,#frontline-onboarding-danger{grid-column:1 / 3}#frontline-onboarding-toggle{grid-column:1;grid-row:1}#frontline-onboarding-help{grid-column:2;grid-row:1;text-align:center!important}
/* Current danger gets the compact first row; recovery navigation never sits on the stick. */
#frontline-onboarding[data-priority]:not([data-priority=""]) #frontline-onboarding-toggle{display:none}
#frontline-onboarding[data-priority]:not([data-priority=""]) #frontline-onboarding-danger{grid-column:1;grid-row:1}
@media(min-width:640px) and (max-height:600px) and (orientation:landscape){
 #game-shell:has(#frontline-status:not([hidden])) #frontline-support-mode:not([hidden]){left:250px;right:auto;bottom:130px;width:168px;display:grid;grid-template-columns:1fr 1fr;gap:4px}
 #game-shell:has(#frontline-status:not([hidden])) #frontline-support-mode button{min-height:48px;min-width:0;white-space:normal}
 #game-shell:has(#frontline-status:not([hidden])) #practice-target-label[data-kind="recovery"]{top:calc(var(--bf-row-bottom,133px) + 70px)!important;left:12px!important;transform:none;width:232px;white-space:normal;min-height:44px}
}
@media(max-width:460px){#game-shell:has(#frontline-status:not([hidden])) #practice-target-label[data-kind="recovery"]{top:calc(var(--bf-row-bottom,224px) + 140px)!important;left:12px!important;transform:none;width:calc(100% - 24px);white-space:normal;min-height:44px}}

/* Camera and recall controls stay beside the minimap, away from movement/skills. */
#recenter{min-width:64px!important;width:64px;font-size:11px!important;line-height:15px;white-space:normal}
#camera-recall-controls{position:absolute;z-index:5;right:18px;top:235px;display:grid;grid-template-columns:90px 118px;gap:4px;max-width:calc(100% - 24px)}
#camera-recall-controls button{min-height:48px;padding:4px;font:var(--ag-type-caption);white-space:normal}
#camera-recall-controls p{grid-column:1 / 3;margin:0;padding:8px;background:#12343ef5;color:#edf3df;font:var(--ag-type-caption);line-height:18px;max-width:300px}
#camera-recall-controls [hidden]{display:none}
@media(max-width:460px){#camera-recall-controls{top:calc(var(--bf-row-bottom,224px) + 8px);left:12px;right:138px;grid-template-columns:82px minmax(0,1fr)}#recenter{min-width:56px!important;width:56px}#frontline-onboarding{top:calc(var(--bf-row-bottom,224px) + 112px)}}
@media(max-height:600px) and (orientation:landscape){#camera-recall-controls{left:250px;right:auto;top:66px;grid-template-columns:72px 110px}#camera-recall-controls p{position:absolute;right:0;top:48px;width:280px;max-height:110px;overflow:auto}#camera-recall-controls #recall-status{top:48px;left:0;right:auto;width:182px;max-height:none;pointer-events:none}}
/* The battlefield button rule must never make an invisible alert a hit target. */
#battle-ui #objective-toast:not(.visible){visibility:hidden;pointer-events:none}
#battle-ui #objective-toast.visible{visibility:visible;pointer-events:auto}

/* Progression reuses the existing mission button; its full warning remains live without another battlefield box. */
#frontline-progression-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;pointer-events:none}
