/* Default battle styling with the requested compact control order. */
#huntView .runTop{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px;align-items:center}
#huntView .runTop>div{display:contents}
#huntView #runTitle{grid-column:1/-1;grid-row:1;display:flex;align-items:center;justify-content:center;gap:12px;min-width:0;margin:0;padding:9px 12px;border:1px solid #737777;border-bottom-color:#434747;background:linear-gradient(90deg,#202220,#303432 50%,#202220);color:#d2d6d6;font-size:24px;font-weight:400;line-height:1.35;letter-spacing:.04em;text-align:center;overflow-wrap:anywhere;text-shadow:1px 2px #101211}
#huntView #runTitle::before,#huntView #runTitle::after{content:"";width:32px;height:5px;flex:none;background:linear-gradient(90deg,#464e4b,#a4aeaa);clip-path:polygon(0 40%,80% 40%,80% 0,100% 0,100% 100%,80% 100%,80% 60%,0 60%)}
#huntView #runTitle::after{transform:scaleX(-1)}
#huntView #runEyebrow{grid-column:1;grid-row:2;justify-self:start}
#huntView #killCount{grid-column:2;grid-row:2;justify-self:end;text-align:right}
@media(max-width:520px){#huntView #runTitle{font-size:20px;gap:8px;padding:8px}#huntView #runTitle::before,#huntView #runTitle::after{width:18px}}

#huntView .combatants:is(.withBattleBelt,.withBattlePotions) {
  grid-template-rows:76px auto 40px calc(var(--attack-intent-height) + 18px) 148px 0 0 88px;
}
/* Enemy types and odds share a row. Keep both in the same column so Grid
   cannot create an implicit second column and squeeze the portrait/readouts. */
#huntView .combatants>.combatant {grid-template-columns:minmax(0,1fr)}
#huntView .combatants>.combatant>* {grid-column:1}
#huntView .combatName {grid-row:1}
#huntView .battlePortraitFrame {grid-row:2}
#huntView .heroResourceBars,#huntView .enemyHealthBar {grid-row:3;margin:0}
#huntView .heroResourceBars {grid-template-rows:16px 16px;gap:8px}
#huntView .heroResourceTrack .bar,#huntView .enemyHealthBar {height:16px}
#huntView .heroAttackIntent,#huntView #enemyAttackIntent {grid-row:4}
#huntView .battleSupplies {grid-row:5}
#huntView .enemyTypes {grid-row:5;margin-top:12px;justify-content:center;text-align:center}
#huntView .enemyOdds {grid-row:5;align-self:end;margin:0 0 8px;text-align:center}
#huntView .combatants.withBattlePotions>.versus {grid-row:4}
#huntView #heroEffects,#huntView #enemyEffects {grid-row:8}

/* Keep the two battle actions on opposite edges of the same row. */
#huntView .battleActionPanel {container-type:inline-size}
#huntView .battleActionPanel>.actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
}
#huntView #runBtn {grid-column:1;grid-row:1;justify-self:start}
#huntView #skipBtn {grid-column:2;grid-row:1;justify-self:end}

/* A single concise readout lives inside each resource bar. Exact amounts are
   revealed by pointer hover or keyboard focus and refreshed with combat. */
#huntView .resourceBar {position:relative;overflow:visible;cursor:help}
#huntView .heroHealthBar #heroPct,
#huntView #heroManaPct,
#huntView #enemyPct {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  transform:none;
  font-size:10px;
  line-height:1;
  text-align:center;
  color:#f5e9d2;
  text-shadow:1px 1px #11130d,-1px 0 #11130d;
  pointer-events:none;
}
#huntView .resourceTooltip {
  display:none;
  position:absolute;
  z-index:12;
  bottom:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  width:max-content;
  max-width:min(270px,80vw);
  padding:7px 9px;
  border:1px solid #89765a;
  background:#181a15;
  box-shadow:0 3px 8px #0008;
  color:#f0e3c7;
  font-size:12px;
  line-height:1.4;
  text-align:center;
  text-shadow:none;
  overflow-wrap:anywhere;
  pointer-events:none;
}
#huntView .resourceBar:is(:hover,:focus-visible) {z-index:5}
#huntView .resourceBar:is(:hover,:focus-visible) .resourceTooltip {display:block}
#huntView .resourceBar:focus-visible {outline:1px solid #cbbb8b;outline-offset:3px}

/* Hard pixel bands, chipped glints and stepped corners give the small meters
   depth without smooth gradients or changing their live percentage geometry. */
#huntView .resourceBar {
  padding:2px;
  border:0;
  background:none;
  box-shadow:none;
}
#huntView .resourceBar::before {
  content:"";
  position:absolute;
  inset:0;
  background:#1a1411;
  box-shadow:inset 0 0 0 1px #5d4b36;
  clip-path:polygon(2px 0,calc(100% - 2px) 0,calc(100% - 2px) 2px,100% 2px,100% calc(100% - 2px),calc(100% - 2px) calc(100% - 2px),calc(100% - 2px) 100%,2px 100%,2px calc(100% - 2px),0 calc(100% - 2px),0 2px,2px 2px);
  pointer-events:none;
}
#huntView .resourceBar .fill {
  --pixel-glint:#e1a17a;
  --pixel-shade:#57202a;
  position:relative;
  height:100%;
  background:linear-gradient(180deg,#9e5142 0 1px,#c47759 1px 3px,#aa4b3e 3px 5px,#91392f 5px 8px,#6b282a 8px 10px,#451f24 10px);
  clip-path:polygon(2px 0,calc(100% - 3px) 0,calc(100% - 3px) 1px,calc(100% - 1px) 1px,calc(100% - 1px) 3px,100% 3px,100% calc(100% - 3px),calc(100% - 1px) calc(100% - 3px),calc(100% - 1px) calc(100% - 1px),calc(100% - 3px) calc(100% - 1px),calc(100% - 3px) 100%,2px 100%,2px calc(100% - 1px),0 calc(100% - 1px),0 2px,2px 2px);
}
#huntView .resourceBar.mana .fill {
  --pixel-glint:#a4c6ce;
  --pixel-shade:#203244;
  background:linear-gradient(180deg,#476b82 0 1px,#78a5b6 1px 3px,#56869f 3px 5px,#3d6b87 5px 8px,#294c65 8px 10px,#1c3044 10px);
}
#huntView .resourceBar .fill::before,
#huntView .resourceBar .fill::after {
  content:"";
  position:absolute;
  left:0;
  right:0;
  height:1px;
  pointer-events:none;
}
#huntView .resourceBar .fill::before {
  top:1px;
  background:linear-gradient(90deg,transparent 0 8px,var(--pixel-glint) 8px 15px,transparent 15px 38px,var(--pixel-glint) 38px 41px,transparent 41px 72px,var(--pixel-glint) 72px 81px,transparent 81px 114px,var(--pixel-glint) 114px 118px,transparent 118px 151px,var(--pixel-glint) 151px 158px,transparent 158px);
}
#huntView .resourceBar .fill::after {
  bottom:2px;
  background:repeating-linear-gradient(90deg,transparent 0 11px,var(--pixel-shade) 11px 13px,transparent 13px 29px);
}

/* A restrained pixel shadow adds depth without a raised or bevelled frame. */
#huntView .attackIntent {
  box-shadow:0 3px 0 #0f0c09,1px 3px 0 #0f0c09;
}
#huntView .attackIntentFill {
  background:linear-gradient(180deg,#927951 0 2px,#806744 2px 5px,#766040 5px calc(100% - 5px),#5e4b32 calc(100% - 5px) calc(100% - 2px),#463724 calc(100% - 2px));
}
#huntView .attackIntentLabel {
  color:#f0dfbd;
  text-shadow:1px 1px 0 #171008,0 2px 0 #080604;
}
