/* Combat feedback stays inside existing HUD and never intercepts flight input. */
#game-screen.rem-battle--phase4 .hud-bottom {
  height:164px!important;min-height:164px!important;max-height:164px!important;
  grid-template-rows:18px 20px 20px 14px 60px!important;gap:3px!important;
  padding:7px 8px!important;
}
#game-screen.rem-battle--phase4 .hud-bottom::before {display:none;}
#game-screen.rem-battle--phase4 .rem-battle-rhythm {grid-row:3;display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;pointer-events:none;color:var(--battle-paper);font:700 10px/1 var(--battle-display);}
#game-screen.rem-battle--phase4 .rem-battle-chain {display:flex;align-items:baseline;gap:6px;position:relative;min-width:0;padding-bottom:4px;color:#c1d1d7;}
#game-screen.rem-battle--phase4 .rem-battle-chain strong {font-size:16px;min-width:22px;font-variant-numeric:tabular-nums;color:#f2fcff;}
#game-screen.rem-battle--phase4 .rem-battle-chain small {font-size:9px;white-space:nowrap;}
#game-screen.rem-battle--phase4 .rem-battle-chain>i {position:absolute;bottom:0;left:0;width:100%;height:2px;background:#31505a;}
#game-screen.rem-battle--phase4 .rem-battle-chain>i>b {display:block;width:100%;height:100%;background:var(--battle-cyan);transform-origin:left;}
#game-screen.rem-battle--phase4 .rem-battle-chain.is-flowing {color:var(--battle-cyan-pale);}
#game-screen.rem-battle--phase4 .rem-battle-chain.is-milestone strong {color:#ffe199;animation:rem-combat-count .36s ease-out both;}
#game-screen.rem-battle--phase4 .rem-battle-special-state {display:flex;gap:6px;align-items:center;min-width:0;white-space:nowrap;color:#c0ced6;}
#game-screen.rem-battle--phase4 .rem-battle-special-state strong {font-size:11px;}
#game-screen.rem-battle--phase4 .rem-battle-special-state.is-ready {color:#fff0af;animation:rem-combat-ready .65s ease-out both;}
#game-screen.rem-battle--phase4 #status-text {grid-row:4!important;font-size:10px!important;line-height:14px!important;height:14px!important;min-height:14px!important;}
#game-screen.rem-battle--phase4 .bottom-row {grid-row:5!important;grid-template-rows:14px 44px!important;gap:2px!important;}
#game-screen.rem-battle--phase4 .weapon-panel {height:14px!important;min-height:14px!important;max-height:14px!important;padding:0 3px!important;border:0!important;}
#game-screen.rem-battle--phase4 .item-btn {height:44px!important;min-height:44px!important;max-height:44px!important;font-size:10px!important;}
#game-screen.rem-battle--phase4 :is(#hp-text,#dust-text) {font-size:10px!important;}
#game-screen.rem-battle--phase4 .hp-head .label {font-size:8px!important;color:var(--battle-copy)!important;}
#game-screen.rem-battle--phase4 .hp-gauge {height:12px!important;}
#game-screen.rem-battle--phase4 .boss-gauge {position:relative;isolation:isolate;}
#game-screen.rem-battle--phase4 .rem-battle-damage-trail {position:absolute;left:0;top:0;height:100%;width:100%;background:#f5efcf;opacity:.75;z-index:0;pointer-events:none;}
#game-screen.rem-battle--phase4 .boss-fill {position:relative;z-index:1;transition:none!important;}
#game-screen.rem-battle--phase4 .boss-hud-sealed .rem-battle-damage-trail {background:#a6dbff;}
@keyframes rem-combat-count {from{transform:translateY(2px) scale(1.18)}to{transform:none}}
@keyframes rem-combat-ready {0%{opacity:.45;transform:translateX(5px)}100%{opacity:1;transform:none}}
@media (orientation:landscape) and (max-height:520px) {
 #game-screen.rem-battle--phase4 .hud-bottom {height:144px!important;min-height:144px!important;max-height:144px!important;grid-template-rows:16px 16px 20px 14px 44px!important;}
 #game-screen.rem-battle--phase4 .bottom-row {grid-template-columns:minmax(70px,.8fr) 2.4fr!important;grid-template-rows:44px!important;}
 #game-screen.rem-battle--phase4 .weapon-panel {height:44px!important;min-height:44px!important;max-height:44px!important;}
}
@media (prefers-reduced-motion:reduce) {
 #game-screen.rem-battle--phase4 :is(.rem-battle-chain strong,.rem-battle-special-state) {animation:none!important;}
}
/* Give the boss an entire gauge row instead of squeezing it beside a long name. */
#game-screen.rem-battle--phase4 #boss-hud {grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:17px 9px!important;align-items:center!important;gap:4px 8px!important;height:44px!important;min-height:44px!important;max-height:44px!important;padding:6px 8px!important;}
#game-screen.rem-battle--phase4 #boss-name {grid-column:1;grid-row:1;font-size:12px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}
#game-screen.rem-battle--phase4 #boss-name::before {display:none!important;}
#game-screen.rem-battle--phase4 #boss-phase {grid-column:2;grid-row:1;font-size:10px!important;max-width:150px;white-space:nowrap;}
#game-screen.rem-battle--phase4 .boss-gauge {grid-column:1/-1;grid-row:2;width:100%!important;height:9px!important;}
#game-screen.rem-battle--phase4 .hud-top .label {font-size:9px!important;letter-spacing:.04em!important;}
#game-screen.rem-battle--phase4 #score-value {font-size:22px!important;}
#game-screen.rem-battle--phase4 #run-hi-value {font-size:16px!important;}
#game-screen.rem-battle--phase4 :is(#credit-value,#stage-value,#mode-value) {font-size:11px!important;}
#game-screen.rem-battle--phase4 .special-skill-btn {bottom:calc(176px + env(safe-area-inset-bottom))!important;}
@media (orientation:landscape) and (max-height:520px) {
 #game-screen.rem-battle--phase4 .special-skill-btn {bottom:calc(20px + env(safe-area-inset-bottom))!important;}
}
#game-screen.rem-battle--phase4 .hud-block--mode {grid-template-columns:minmax(0,1fr)!important;}
#game-screen.rem-battle--phase4 .hud-block--mode .label {display:none!important;}
#game-screen.rem-battle--phase4 #mode-value {text-overflow:ellipsis!important;}
