/* Shared leader meter: native game fonts, transparent frame control, quiet rows with no enclosing borders. */
.gtop__actions { --gtop-ready-h: max(.56rem, 30px); display: flex; align-items: flex-start; gap: max(.12rem, 8px); }
.gtop__actions .readybtn { height: var(--gtop-ready-h); white-space: nowrap; }
/* A single vertical flow wraps to at most two columns according to actual item and viewport heights.
   No ancestor transform: the fixed floating window remains relative to the viewport even when this stack scrolls. */
.gm__hud > .battle-right-tools {
  position: absolute; top: 2.4rem; right: .3rem;
  display: block;
  box-sizing: border-box; padding: max(.05rem, 2px);
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin;
  pointer-events: none;
}
.battle-right-tools[data-scroll="true"] { pointer-events: auto; }
.gm.is-pen .battle-right-tools[data-scroll="true"] { pointer-events: none; }
.battle-right-tools > .gm__effects, .battle-right-tools .effects { display: contents; }
.battle-right-tools > .gm__effects { position: static; }
.battle-right-tools .effects > * { pointer-events: auto; }
.battle-right-tools__controls { display: flex; flex-direction: column; align-items: flex-end; width: max-content; gap: max(.12rem, 8px); }
.battle-right-tools__boss:empty { display: none; }
/* display:contents has no box for opacity; apply the original placement/choice hiding to its actual items. */
.gm.is-pen .battle-right-tools .effects > *, .gm.has-sp .battle-right-tools .effects > * {
  opacity: 0; pointer-events: none;
}
.battle-right-tools__cost.is-placeholder { visibility: hidden; }
/* Reserve the same horizontal space for every value and font; only viewport scale changes the box width. */
.battle-right-tools .dpbox { position: static; transform: none; width: max(.8rem, 48px); }
.battle-right-tools .dpbox .num { width: 100%; text-align: center; white-space: nowrap; }
.battle-right-tools .dpbox, .battle-right-tools .boss-damage-toggle { pointer-events: auto; }
.boss-damage-toggle.control-frame {
  width: max(.56rem, 30px); height: max(.56rem, 30px); flex: none;
  --control-bg: transparent; --control-border: var(--line-2); color: var(--text-lo);
}
.boss-damage-toggle.control-frame:focus-visible { outline: none; }
.boss-damage {
  position: fixed; z-index: 40; display: flex; flex-direction: column; box-sizing: border-box;
  padding: 10px 12px 12px; margin: 0; border: 0;
  background: rgba(3, 12, 8, .92); box-shadow: 0 7px 28px #0009;
  color: var(--text-hi); font-size: max(calc(.16 * var(--t)), 13px); font-family: var(--font-cjk);
  line-height: 1.25; text-align: left; letter-spacing: 0; pointer-events: auto;
}
.boss-damage__head {
  display: flex; flex: 0 0 var(--meter-header); align-items: center; min-width: 0; gap: 8px;
  cursor: move; touch-action: none; user-select: none;
}
.boss-damage__head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1em; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.boss-damage__basis, .boss-damage__close {
  display: flex; align-items: center; justify-content: center; flex: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--text-lo); font: inherit; line-height: 1; cursor: pointer;
}
.boss-damage__basis { min-height: 28px; padding: 0 4px; font-size: .88em; white-space: nowrap; }
.boss-damage__close { width: 24px; height: 24px; }
.boss-damage__close .icon { display: block; width: 20px; height: 20px; }
.boss-damage__basis:hover, .boss-damage__basis:focus-visible,
.boss-damage__close:hover, .boss-damage__close:focus-visible { color: var(--mint-400); }
.boss-damage__head h2:focus-visible, .boss-damage__basis:focus-visible,
.boss-damage__close:focus-visible, .boss-damage__resize--se:focus-visible { outline: 1px solid var(--mint-500); outline-offset: 1px; }
.boss-damage__list { flex: 1 1 auto; min-height: 0; overflow: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--mint-800) transparent; }
.boss-damage__rows { position: relative; width: 100%; }
.boss-damage__row {
  position: absolute; top: 0; left: 0; width: 100%; height: var(--meter-row);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 1.5fr); align-items: center; gap: 8px;
  border: 0; background: transparent; transition: transform .34s cubic-bezier(.22, .7, .25, 1);
}
.boss-damage__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text-hi); }
.boss-damage__row.is-me .boss-damage__name { color: var(--mint-400); }
.boss-damage__bar { position: relative; height: max(22px, 1.45em); min-width: 120px; overflow: hidden; background: rgba(177, 192, 185, .08); }
.boss-damage__fill { position: absolute; inset: 0 auto 0 0; display: flex; transition: width .24s linear; }
.boss-damage__segment { flex: none; height: 100%; opacity: .72; }
.boss-damage__segment--phys { background: #f6a329; }
.boss-damage__segment--arts { background: #9fd4ff; }
.boss-damage__segment--true { background: #ff7272; }
.boss-damage__segment--elemental { background: #cf9fff; }
.boss-damage__segment--unknown { background: rgba(163, 187, 175, .58); }
.boss-damage__percent { position: absolute; inset: 0 6px 0 auto; display: flex; align-items: center; font-size: max(.9em, 12px); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.boss-damage__resize { position: absolute; touch-action: none; user-select: none; }
.boss-damage__resize--n, .boss-damage__resize--s { left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
.boss-damage__resize--n { top: 0; } .boss-damage__resize--s { bottom: 0; }
.boss-damage__resize--e, .boss-damage__resize--w { top: 12px; bottom: 12px; width: 6px; cursor: ew-resize; }
.boss-damage__resize--e { right: 0; } .boss-damage__resize--w { left: 0; }
.boss-damage__resize--ne, .boss-damage__resize--sw, .boss-damage__resize--nw { width: 12px; height: 12px; }
.boss-damage__resize--ne { top: 0; right: 0; cursor: nesw-resize; }
.boss-damage__resize--sw { bottom: 0; left: 0; cursor: nesw-resize; }
.boss-damage__resize--nw { top: 0; left: 0; cursor: nwse-resize; }
.boss-damage__resize--se {
  bottom: 0; right: 0; width: 20px; height: 20px; display: grid; place-items: center;
  border: 0; padding: 2px; background: transparent; color: var(--text-dim); cursor: nwse-resize;
}
.boss-damage__resize--se svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.boss-damage__resize--se:hover { color: var(--mint-400); }
@media (pointer: coarse) {
  .boss-damage__resize--se { width: 24px; height: 24px; }
}
@media (max-height: 600px) and (pointer: coarse), (max-height: 600px) and (any-pointer: coarse) {
  .gtop__actions { --gtop-ready-h: max(.56rem, 34px); }
  .boss-damage-toggle.control-frame { width: max(.56rem, 34px); height: max(.56rem, 34px); }
}
@media (prefers-reduced-motion: reduce) {
  .boss-damage__row, .boss-damage__fill { transition: none; }
}
