/* The portrait HUD and notices share normal flow; the battlefield remains separate. */
.battle-info,.battle-notices{display:contents}
body.playing:not(.wide-game) .battle-info {
  position:absolute;top:0;left:0;right:0;z-index:12;
  display:flex;flex-direction:column;gap:5px;
  max-height:min(46%,calc(100% - var(--battle-controls-height,190px) - 40px));
  padding:max(6px,env(safe-area-inset-top)) 8px 0;
  box-sizing:border-box;pointer-events:none;
}
body.playing:not(.wide-game) .battle-info .game-hud {
  position:relative!important;inset:auto!important;width:100%!important;
  flex:0 0 auto;padding:5px 6px!important;min-width:0;
  background:#071b24ed!important;border:1px solid #849b8455!important;
  border-radius:5px;pointer-events:auto;
}
body.playing:not(.wide-game) #boss-hud>div:first-child {
  display:flex;flex-wrap:wrap;align-items:baseline;gap:3px 8px;
  text-align:left;line-height:1.4;
}
body.playing:not(.wide-game) #boss-name {
  flex:1 1 150px;min-width:0;font-size:16px;line-height:1.4;
  white-space:normal;overflow-wrap:anywhere;
}
body.playing:not(.wide-game) #boss-number {
  flex:1 1 100%;font-size:14px;line-height:1.4;white-space:normal;
  overflow-wrap:anywhere;text-align:left;
}
body.playing:not(.wide-game) .battle-notices {
  display:flex;flex-direction:column;gap:5px;flex:0 1 auto;
  min-height:0;overflow:auto;overscroll-behavior:contain;
  scrollbar-width:thin;pointer-events:auto;
}
body.playing:not(.wide-game) .battle-notices .dream-status {
  position:static!important;inset:auto!important;width:auto!important;
  max-width:none!important;min-height:0;flex:none;order:0;
  display:flex;flex-direction:column;gap:4px;margin:0;
}
body.playing:not(.wide-game) .battle-notices #stage-goal {
  width:100%!important;min-height:38px;font-size:18px!important;
  line-height:1.4!important;white-space:normal;overflow-wrap:anywhere;
  background:#123a33f2!important;border:1px solid #ad9a69!important;
}
body.playing:not(.wide-game) .battle-notices #battle-alert {
  display:block;order:-1;font-size:18px!important;line-height:1.45!important;
  white-space:normal;overflow-wrap:anywhere;
  padding:6px 8px;background:#49251eee!important;color:#ffedbe;
  border:1px solid #d09863;border-radius:4px;
}
body.playing:not(.wide-game) .battle-notices #game-message {
  position:static!important;inset:auto!important;width:auto!important;
  max-width:none!important;transform:none!important;flex:none;order:1;
  font:600 18px/1.45 "Microsoft JhengHei",sans-serif!important;
  letter-spacing:0!important;text-align:left;padding:6px 8px;
  background:#102e2af0!important;border:1px solid #869e79;
  border-radius:4px;white-space:normal;overflow-wrap:anywhere;
}
body.playing:not(.wide-game) .battle-notices #game-message[data-urgent="true"] {
  order:-1;background:#49251ef5!important;border-color:#d09863;color:#ffedbe;
}
.battle-info [hidden]{display:none!important}
body.playing:has(dialog[open]) .battle-info{visibility:hidden}
