/* A shared compact utility HUD for Normal and Hero. The landscape host scales
   this logical stage once; labels, cards and buttons stay inside their rails. */
.reference-assistance-toggle {display:none;}
#game-container[data-approved-ui] .story-tactical-backdrop>.tactical-modal[data-battle-rules="reference-v1"] {
  --battle-hud-inset:16%;
  grid-template-rows:140px minmax(0,1fr) 150px;
}
#game-container [data-battle-rules="reference-v1"] .sa-live-battle-rules {
  left:var(--battle-hud-inset,16%);right:var(--battle-hud-inset,16%);
}
#game-container [data-battle-rules="reference-v1"]>.reference-battle-dock {
  position:relative;grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) 206px;
  grid-template-rows:minmax(0,1fr);align-items:stretch;gap:12px;height:150px;
  min-width:0;min-height:0;padding:18px var(--battle-hud-inset,16%) 8px;box-sizing:border-box;background:transparent;
}
#game-container [data-battle-rules="reference-v1"] .reference-item-tray {
  position:relative;height:124px;min-width:0;min-height:0;margin:0;padding:4px;
  box-sizing:border-box;border:8px solid transparent;
  border-image:none;
  border-radius:10px;background:transparent;box-shadow:none;
  background-image:url('/assets/battle-ui/shinobi-v4/hud-panel.svg');background-position:center;background-size:100% 100%;background-repeat:no-repeat;background-origin:border-box;background-clip:border-box;}
#game-container [data-battle-rules="reference-v1"] .reference-item-tray>#battle-items {
  position:relative;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));
  gap:6px;height:100px;min-width:0;min-height:0;margin:0;padding:0;
  border:0;border-image:none;border-radius:0;background:transparent;box-shadow:none;overflow:visible;
}
#game-container [data-battle-rules="reference-v1"] #battle-items>.battle-item {
  position:relative;display:grid;grid-template-rows:30px minmax(0,1fr) 20px;
  align-items:stretch;justify-content:stretch;width:100%;height:100px;min-width:0;min-height:0;
  gap:0;margin:0;padding:0;border:4px solid transparent;box-sizing:border-box;
  border-image:none;
  border-radius:0;background:#f8f0d9;box-shadow:none;color:#263736;opacity:1;
  font-family:Arial,sans-serif;appearance:none;touch-action:manipulation;cursor:pointer;
  background-image:url('/assets/battle-ui/shinobi-v4/item-card.svg');background-position:center;background-size:100% 100%;background-repeat:no-repeat;background-origin:border-box;background-clip:border-box;}
#game-container [data-battle-rules="reference-v1"] #battle-items>.battle-item.selected {
  outline:2px solid #26847e;outline-offset:1px;background-color:#f8f0d9;
}
#game-container [data-battle-rules="reference-v1"] #battle-items .battle-item-heading {
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  width:100%;min-width:0;height:30px;padding:0 2px;box-sizing:border-box;
  background:#f8f0d9;
}
#game-container [data-battle-rules="reference-v1"] #battle-items .battle-item-name {
  position:static;display:block;width:100%;height:auto;margin:0;
  color:#263736;text-shadow:none;font-family:Arial,sans-serif;font-size:14px!important;
  font-weight:700;letter-spacing:-.4px;line-height:16px;white-space:nowrap;
  overflow:visible;text-overflow:clip;text-align:center;
}
#game-container [data-battle-rules="reference-v1"] #battle-items .battle-item-level {
  position:static;display:block;width:auto;height:13px;min-width:28px;padding:0 4px;
  box-sizing:border-box;border:1px solid #bea674;border-radius:3px;background:#efe1ba;
  color:#665637;text-shadow:none;font-size:10px!important;font-weight:700;line-height:11px;
}
#game-container [data-battle-rules="reference-v1"] #battle-items .battle-item-art {
  display:block;align-self:center;justify-self:center;width:42px;height:42px;min-width:0;min-height:0;
  margin:0;padding:0;box-sizing:border-box;background:transparent;
  border:0;border-radius:0;overflow:hidden;filter:none;
}
#game-container [data-battle-rules="reference-v1"] #battle-items .battle-item-art>:is(img,svg) {
  display:block;width:100%;height:100%;object-fit:contain;filter:none;
}
#game-container [data-battle-rules="reference-v1"] #battle-items .battle-item-stock {
  position:static;display:flex;align-items:center;justify-content:center;gap:4px;
  min-width:0;width:100%;height:20px;margin:0;padding:0;box-sizing:border-box;
  border:0;border-top:1px solid #c6b486;border-radius:0;background:#e9ddbc;
  color:#263736;text-shadow:none;font-size:17px!important;font-weight:700;line-height:19px;
  text-align:center;font-variant-numeric:tabular-nums;
}
#game-container [data-battle-rules="reference-v1"] #battle-items .battle-item-stock-label {
  color:#756344;font-size:10px!important;font-weight:400;line-height:1;
}
#game-container [data-battle-rules="reference-v1"] #battle-items .battle-item-stock>strong {
  min-width:14px;font-size:16px!important;font-weight:700;line-height:1;
}
#game-container [data-battle-rules="reference-v1"] #battle-items>.battle-item:is(:disabled,.is-unavailable) {
  opacity:1;cursor:default;background-color:#f8f0d9;color:#263736;
}
#game-container [data-battle-rules="reference-v1"] #battle-items>.battle-item:is(:disabled,.is-unavailable) .battle-item-art {
  filter:grayscale(1);opacity:.65;
}
#game-container [data-battle-rules="reference-v1"] #battle-items>.battle-item:not(:disabled):hover {
  outline:2px solid #caa655;outline-offset:1px;background-color:#f8f0d9;
}
#game-container [data-battle-rules="reference-v1"] #battle-items>.battle-item.selected:not(:disabled):hover {
  outline-color:#26847e;
}
#game-container [data-battle-rules="reference-v1"] .reference-battle-dock>.battle-bottom-toolbar {
  position:relative;display:grid;grid-template-columns:minmax(0,1fr);
  grid-template-rows:42px minmax(0,1fr);align-items:stretch;gap:8px;
  height:124px;min-width:0;min-height:0;margin:0;padding:4px;box-sizing:border-box;
  border:8px solid transparent;border-image:none;
  border-radius:10px;background:transparent;box-shadow:none;overflow:visible;
  background-image:url('/assets/battle-ui/shinobi-v4/hud-panel.svg');background-position:center;background-size:100% 100%;background-repeat:no-repeat;background-origin:border-box;background-clip:border-box;}
#game-container [data-battle-rules="reference-v1"] .reference-toolbar-heading {
  position:absolute;top:2px;right:var(--battle-hud-inset,16%);width:206px;height:14px;
  display:block;margin:0;padding:0;color:#fffbe5;font:700 12px/14px Arial,sans-serif;
  letter-spacing:.9px;text-align:center;text-transform:uppercase;text-shadow:0 1px 2px #1b2928;
  pointer-events:none;
}
#game-container [data-battle-rules="reference-v1"] .reference-toolbar-secondary {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0;min-height:0;
}
#game-container [data-battle-rules="reference-v1"] .reference-toolbar-secondary>button {
  display:flex;align-items:center;justify-content:center;gap:4px;width:100%;height:42px;
  min-height:0;min-width:0;margin:0;padding:0 2px;box-sizing:border-box;
  border:2px solid #abb1d1;border-image:none;border-radius:5px;
  background:linear-gradient(#8891de,#545cb3);box-shadow:inset 0 2px #c5cff2;
  color:#fffef0!important;text-shadow:1px 1px #464773;
  font-family:Arial,sans-serif;font-size:15px!important;font-weight:700;line-height:1.1;
  white-space:nowrap;appearance:none;touch-action:manipulation;
}
#game-container [data-battle-rules="reference-v1"] .reference-toolbar-secondary>[data-action="battle-settings"] {
  border-color:#989b98;background:linear-gradient(#9eaaa9,#737e81);
  box-shadow:inset 0 2px #bdc4c1;color:#fffef0!important;text-shadow:1px 1px #505c5e;
}
#game-container [data-battle-rules="reference-v1"] .reference-toolbar-label {
  position:static;display:block;width:auto;margin:0;padding:0;font-size:15px!important;line-height:1.1;
}
#game-container [data-battle-rules="reference-v1"] .reference-toolbar-art,
#game-container [data-battle-rules="reference-v1"] .reference-toolbar-art>:is(img,svg) {
  display:block;flex:0 0 18px;width:18px;height:18px;margin:0;padding:0;object-fit:contain;
}
#game-container [data-battle-rules="reference-v1"] .reference-toolbar-art>.battle-control-reference-art {
  filter:brightness(0) invert(1);opacity:.92;
}
/* Match the upper battle controls while retaining a dark orange Auto action. */
#game-container [data-battle-rules="reference-v1"] .reference-battle-dock>.battle-bottom-toolbar>[data-action="toggle-tactical-auto"] {
  grid-row:2;grid-column:1;position:relative;display:flex;align-items:center;justify-content:center;
  width:100%;height:100%;min-height:0;min-width:0;margin:0;padding:0 4px;box-sizing:border-box;
  border:2px solid #dfab73;border-image:none;border-radius:5px;
  background:linear-gradient(#de893f,#ac4f1f);box-shadow:inset 0 2px #ffc58d;
  color:#fffef0;text-shadow:1px 1px #77380e;
  font-family:Arial,sans-serif;font-size:19px!important;font-weight:700;line-height:1.1;white-space:nowrap;
  appearance:none;touch-action:manipulation;
}
#game-container [data-battle-rules="reference-v1"] .reference-battle-dock>.battle-bottom-toolbar>[data-action="toggle-tactical-auto"][aria-pressed="true"] {
  border-color:#e4a76b;background:linear-gradient(#ca732e,#8b3e18);color:#fffef0;
  box-shadow:inset 0 2px #f4af6e;
}
#game-container [data-battle-rules="reference-v1"] .reference-battle-dock>.battle-bottom-toolbar>[data-action="toggle-tactical-auto"]:not(:disabled):hover {
  filter:brightness(1.08);box-shadow:none;
}
#game-container [data-battle-rules="reference-v1"] .reference-auto-label {
  position:relative;display:block;margin:0;padding:0;font-size:19px!important;line-height:1.1;
}
#game-container [data-battle-rules="reference-v1"] .battle-bottom-toolbar>[data-action="suspend-battle"] {display:none;}
#game-container [data-battle-rules="reference-v1"] .reference-battle-dock button:focus-visible {
  outline:2px solid #26847e;outline-offset:2px;
}
#game-container [data-battle-rules="reference-v1"] .reference-battle-dock .battle-bottom-toolbar button:disabled {
  filter:grayscale(1);opacity:.6;cursor:default;
}
#game-container [data-battle-rules="reference-v1"] #tactical-status.reference-unit-menu [data-action="manual-skill"][aria-expanded="true"] {
  outline:2px solid #d1af60;outline-offset:0;
}
