/* v0.11.10 — atomic reward surface and screen-state isolation. */
body.theme-ashen.screen-battle-active .enemy-intent-slot .enemy-intent{
  box-sizing:border-box!important;
  max-width:100%!important;
}
body.theme-ashen.screen-battle-active.reward-flow-open .battle-result-panel{
  position:fixed!important;
  z-index:90!important;
  top:var(--reward-panel-top,6px)!important;
  bottom:var(--reward-panel-bottom,6px)!important;
  left:50%!important;
  display:grid!important;
  place-items:stretch!important;
  width:min(720px,calc(100% - 8px))!important;
  min-height:0!important;
  padding:0!important;
  overflow:hidden!important;
  transform:translateX(-50%)!important;
  background:linear-gradient(180deg,rgba(4,8,7,.985),rgba(2,6,5,.995))!important;
}
body.theme-ashen.screen-battle-active.reward-flow-open .battle-result-card,
body.theme-ashen.screen-battle-active.reward-flow-open .battle-result-card.ruins-reward-compact{
  display:grid!important;
  grid-template-rows:minmax(0,1fr) auto!important;
  align-content:stretch!important;
  width:100%!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  padding:0!important;
  overflow:hidden!important;
  border-radius:12px 12px 0 0!important;
}
body.theme-ashen.screen-battle-active.reward-flow-open .reward-card-scroll{
  min-height:0!important;
  padding:10px 12px 8px!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
}
body.theme-ashen.screen-battle-active.reward-flow-open .reward-action-dock{
  position:relative!important;
  z-index:2!important;
  display:grid!important;
  gap:7px!important;
  margin:0!important;
  padding:8px 12px max(9px,env(safe-area-inset-bottom))!important;
  border-top:1px solid rgba(117,105,76,.55)!important;
  background:linear-gradient(180deg,rgba(10,15,13,.99),rgba(4,8,7,.999))!important;
  box-shadow:0 -12px 24px rgba(0,0,0,.46)!important;
}
body.theme-ashen.screen-battle-active.reward-flow-open .reward-action-dock .reward-main-action,
body.theme-ashen.screen-battle-active.reward-flow-open .reward-action-dock .reward-secondary-actions button{
  min-height:44px!important;
  max-height:none!important;
}
body.theme-ashen.screen-battle-active.reward-flow-open .reward-fallback .reward-empty-text{
  display:block!important;
  padding:18px 8px!important;
}
@media(max-width:380px){
  body.theme-ashen.screen-battle-active.reward-flow-open .reward-card-scroll{padding:8px 9px 7px!important}
  body.theme-ashen.screen-battle-active.reward-flow-open .reward-action-dock{padding:7px 9px max(8px,env(safe-area-inset-bottom))!important}
}

body.theme-ashen #rewardResultPanel[hidden]{display:none!important;}
body.theme-ashen:not(.reward-flow-open) #rewardResultPanel{pointer-events:none!important;}

/* v0.11.10: reward is a real modal over the completed battle, never a replacement screen. */
body.theme-ashen .emergency-settings-button{
  display:grid!important;
  place-items:center!important;
  width:44px!important;
  min-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  padding:0!important;
  border-radius:50%!important;
  border:1px solid rgba(113,143,133,.48)!important;
  background:linear-gradient(180deg,rgba(17,28,25,.96),rgba(8,15,13,.98))!important;
  color:#d6c28f!important;
  font-size:18px!important;
  line-height:1!important;
}
body.theme-ashen .emergency-settings-button:active{transform:scale(.96)}

body.theme-ashen.screen-battle-active.reward-flow-open .battle-result-panel{
  inset:0!important;
  top:0!important;
  right:0!important;
  bottom:0!important;
  left:0!important;
  width:100%!important;
  min-height:100dvh!important;
  padding:max(14px,env(safe-area-inset-top)) 12px max(14px,env(safe-area-inset-bottom))!important;
  transform:none!important;
  place-items:center!important;
  overflow:auto!important;
  background:rgba(0,4,3,.78)!important;
  backdrop-filter:blur(3px)!important;
  -webkit-backdrop-filter:blur(3px)!important;
}
body.theme-ashen.screen-battle-active.reward-flow-open .battle-result-card,
body.theme-ashen.screen-battle-active.reward-flow-open .battle-result-card.ruins-reward-compact{
  width:min(560px,100%)!important;
  height:auto!important;
  max-height:calc(100dvh - max(28px,env(safe-area-inset-top)) - max(28px,env(safe-area-inset-bottom)))!important;
  min-height:0!important;
  border-radius:18px!important;
  border:1px solid rgba(180,145,67,.72)!important;
  box-shadow:0 24px 70px rgba(0,0,0,.68)!important;
}
body.theme-ashen.screen-battle-active.reward-flow-open .reward-card-scroll{
  max-height:calc(100dvh - 190px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;
}
body.theme-ashen.screen-battle-active.reward-flow-open .reward-action-dock{
  border-radius:0 0 18px 18px!important;
}

@media(max-width:390px){
  body.theme-ashen .top-utility-actions{gap:5px!important}
  body.theme-ashen .emergency-settings-button,
  body.theme-ashen .client-refresh-button{width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important}
  body.theme-ashen.screen-battle-active.reward-flow-open .battle-result-panel{padding-inline:8px!important}
}

/* v0.11.10 — emergency recovery remains reachable on every screen. */
body.theme-ashen .top-utility-actions{
  display:flex!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
  gap:4px!important;
}
body.theme-ashen .emergency-settings-button{
  flex:0 0 auto!important;
  width:40px!important;
  min-width:40px!important;
  height:40px!important;
  min-height:40px!important;
  font-size:17px!important;
}
@media(max-width:390px){
  body.theme-ashen .top-actions{gap:3px!important}
  body.theme-ashen .top-summary{gap:3px!important}
  body.theme-ashen .top-utility-actions{gap:2px!important}
  body.theme-ashen .emergency-settings-button,
  body.theme-ashen .client-refresh-button{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important}
  body.theme-ashen .developer-toggle{width:38px!important;min-width:38px!important}
}

/* The reward is shown immediately after the durable victory commit. */
body.theme-ashen.reward-flow-open{overflow:hidden!important}
body.theme-ashen.screen-battle-active.reward-flow-open #rewardResultPanel{
  display:grid!important;
  visibility:visible!important;
  pointer-events:auto!important;
}
