/* v0.33.1: keep the encounter and its actions together at normal zoom.
   Secondary information follows the controls in DOM and keyboard order. */
.hq-battle-player-view #mobile-status,
.hq-battle-player-view #tracked-mobile,
.hq-battle-player-view #right-rail{display:none}
.hq-battle-player-view .content-grid{grid-template-columns:minmax(0,1fr);gap:0;padding:14px 24px 28px;min-width:0}
.hq-battle-player-view #main-content{min-width:0;width:100%;max-width:1200px;margin:0 auto}
.battle-play-panel{min-width:0;scroll-margin-top:12px}
.battle-play-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;min-width:0}
.battle-play-heading h1{font:600 17px/1.35 var(--font);margin:0;min-width:0;overflow-wrap:anywhere;color:var(--text)}
.battle-play-heading h1 span{font-weight:400;color:var(--muted)}
.battle-play-heading .pill{flex:none;font-size:10px;letter-spacing:.35px;padding:6px 9px;white-space:nowrap}
.hq-battle-player-view .battle-arena{height:clamp(180px,calc(var(--hq-vh) - 350px),340px)}
.hq-battle-player-view .battle-hud{inset:14px 16px auto;gap:22px}
.hq-battle-player-view .combatant-hud{width:46%;max-width:350px;min-width:0}
.hq-battle-player-view .hud-name{font-size:15px;line-height:1.3;overflow-wrap:anywhere;margin-bottom:6px}
.hq-battle-player-view .hud-meta{font-size:12px;line-height:1.35;gap:6px;flex-wrap:wrap;font-variant-numeric:tabular-nums}
.hq-battle-player-view .hud-meta span{min-width:0;overflow-wrap:anywhere}
.hq-battle-player-view .combatant-hud.right .hud-meta{justify-content:flex-end}
.hq-battle-player-view .turn-marker{bottom:10px;font-size:10px;line-height:1.3;letter-spacing:.7px;max-width:calc(100% - 20px);white-space:normal;text-align:center;padding:5px 9px}
.battle-resource-strip{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;padding:9px 2px 0;min-width:0}
.battle-resource-strip>div{min-width:0}
.battle-resource-strip .resource-label{font-size:12px;line-height:1.3;margin:0 0 5px;gap:6px;align-items:baseline}
.battle-resource-strip .resource-label span:first-child{font-size:11px;flex:none;letter-spacing:.3px}
.battle-resource-strip .bar{height:5px}
.battle-controls[hidden]{display:none!important}
.hq-battle-player-view .skills{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:10px 0}
.hq-battle-player-view .skill{display:grid;grid-template-columns:22px minmax(0,1fr);column-gap:9px;align-content:center;min-width:0;min-height:80px;padding:12px;touch-action:manipulation}
.hq-battle-player-view .skill .skill-top{grid-column:1;grid-row:1 / 3;display:flex;align-items:center;justify-content:center}
.hq-battle-player-view .skill .icon{width:22px;height:22px}
.hq-battle-player-view .skill .key{position:absolute;top:5px;right:6px;font-size:10px}
.hq-battle-player-view .skill strong{grid-column:2;grid-row:1;margin:0 0 3px;font-size:15px;line-height:1.25;overflow-wrap:anywhere}
.hq-battle-player-view .skill small{grid-column:2;grid-row:2;font-size:12px;line-height:1.35;overflow-wrap:anywhere}
/* Remaining cooldown already appears in the skill's readable description. */
.hq-battle-player-view .skill .cooldown-tag{display:none}
.hq-battle-player-view .combat-tools{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0;align-items:stretch}
.hq-battle-player-view .combat-tools .button{min-height:46px;min-width:0;font-size:14px;line-height:1.35;padding:10px 12px;white-space:normal;margin:0}
#battle-player-status{margin-top:12px}
.hq-battle-player-view .encounter-buffs{margin:14px 0;gap:8px;min-width:0}
.hq-battle-player-view .encounter-buffs>.eyebrow{flex-basis:100%;line-height:1.5}
.hq-battle-player-view .encounter-buffs .buff-chip{font-size:12px;line-height:1.4;white-space:normal;overflow-wrap:anywhere;max-width:100%}
.battle-status-effects{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:14px 0;min-width:0}
.battle-status-effects>.eyebrow{flex-basis:100%;font-size:11px;line-height:1.5}
.hq-battle-player-view .battle-status-effects .status-chip{margin:0;max-width:100%;font-size:12px;line-height:1.4;white-space:normal;overflow-wrap:anywhere;padding:6px 8px}
.hq-battle-player-view .encounter-accuracy summary{min-height:44px;display:list-item;align-content:center;font-size:13px}
.hq-battle-player-view .stamina-preview-note{font-size:13px;line-height:1.5}
.hq-battle-player-view .result-banner{margin:12px 0 0;gap:12px;flex-wrap:wrap}
.hq-battle-player-view .result-banner .button{min-height:44px;font-size:14px;white-space:normal;margin-left:auto}
.hq-battle-player-view .combat-log{margin-top:14px}
@media(max-width:960px){
  .hq-battle-player-view .content-grid{padding:10px 16px 28px}
}
@media(max-width:640px){
  .hq-battle-player-view .content-grid{padding:8px 12px 24px}
  .battle-play-heading{gap:8px;margin-bottom:8px}
  .battle-play-heading h1{font-size:14px;line-height:1.3}
  .battle-play-heading h1 span{display:none}
  .battle-play-heading .pill{font-size:10px;padding:5px 7px}
  .hq-battle-player-view .battle-arena{height:clamp(160px,calc(var(--hq-vh) - 445px),290px)}
  .hq-battle-player-view .battle-hud{inset:10px 10px auto;gap:12px}
  .hq-battle-player-view .hud-name{font-size:13px;line-height:1.25}
  .hq-battle-player-view .hud-meta{font-size:11px;line-height:1.3;gap:3px}
  .hq-battle-player-view .hud-meta span:last-child{flex-basis:100%}
  .hq-battle-player-view .status-chip{font-size:9px;line-height:1.3;padding:3px 5px;margin-top:4px;max-width:100%;white-space:normal}
  .battle-resource-strip{padding-top:7px;gap:12px}
  .battle-resource-strip .resource-label{font-size:12px;line-height:1.25;gap:4px;margin-bottom:4px}
  .battle-resource-strip .resource-label span:first-child{font-size:10px}
  .hq-battle-player-view .skills{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:8px 0}
  .hq-battle-player-view .skill{grid-template-columns:18px minmax(0,1fr);gap:0 6px;min-height:64px;padding:8px 9px}
  .hq-battle-player-view .skill .icon{width:18px;height:18px}
  .hq-battle-player-view .skill .key{display:none}
  .hq-battle-player-view .skill strong{font-size:14px;line-height:1.25;margin:0 0 2px}
  .hq-battle-player-view .skill small{font-size:12px;line-height:1.25}
  .hq-battle-player-view .combat-tools{gap:8px}
  .hq-battle-player-view .combat-tools .button{min-height:44px;padding:9px 7px;font-size:13px}
  #battle-player-status{margin-top:10px}
  .hq-battle-player-view .result-banner .button{width:100%;margin:0}
}
/* A wide, short screen can keep all four skills in one row. Do not reduce
   targets, block zoom, or clip optional information to manufacture a fit. */
@media(min-width:641px) and (max-height:600px){
  .hq-battle-player-view .battle-arena{height:clamp(130px,calc(var(--hq-vh) - 300px),230px)}
  .hq-battle-player-view .skill{min-height:66px;padding:8px}
  .hq-battle-player-view .skill strong{font-size:13px}
  .hq-battle-player-view .skill small{font-size:11px}
}
@media(min-width:641px) and (max-height:520px){
  .hq-battle-player-view .topbar{min-height:56px;padding:5px 12px}
  .hq-battle-player-view .content-grid{padding-top:6px;padding-left:12px;padding-right:12px}
  .battle-play-heading{margin-bottom:6px}
  .battle-play-heading h1{font-size:14px}
  .battle-play-heading .pill{font-size:9px;padding:4px 7px}
  .hq-battle-player-view .battle-arena{height:130px}
  .hq-battle-player-view .battle-hud{inset:9px 12px auto}
  .hq-battle-player-view .hud-name{font-size:13px;margin-bottom:4px}
  .hq-battle-player-view .hud-meta{font-size:11px}
  .battle-resource-strip{padding-top:5px}
  .battle-resource-strip .resource-label{font-size:11px;margin-bottom:3px}
  .battle-resource-strip .resource-label span:first-child{font-size:10px}
  .hq-battle-player-view .skills{gap:6px;margin:6px 0}
  .hq-battle-player-view .skill{grid-template-columns:16px minmax(0,1fr);column-gap:5px;min-height:62px;padding:7px}
  .hq-battle-player-view .skill .icon{width:16px;height:16px}
  .hq-battle-player-view .skill .key{display:none}
  .hq-battle-player-view .skill strong{font-size:13px}
  .hq-battle-player-view .skill small{font-size:12px;line-height:1.25}
  .hq-battle-player-view .combat-tools .button{min-height:44px;padding:8px;font-size:13px}
}
