/* T-075 (+ follow-up): weapon hotbar at the bottom of the screen. Linked after the other card sheets (before bag-open.css) so it wins.
   1. Display only: no pointer events, so a mouse press over it reaches the canvas and shoots (switch with 1-8, wheel, Tab).
   2. Only carried weapons get a card (game.mjs adds/removes cards; an empty placeholder is never drawn). The bar is as wide as
      its cards (hotbarGeometry() in hud-layout.mjs), so one weapon is one small card, not a four-slot strip.
   3. Rarity is a SOLID element the active marker cannot hide: the name plate (top band) is filled with the tier colour
      (--weapon-rarity, same tokens as loot / bag / elevator cards) and carries a dark key chip; under the text a 5-segment
      tier meter lights 1..5 segments (common..legendary), so tiers whose colours are close still differ by shape.
      The durability bar at the bottom keeps its own colours.
   4. The active card is marked by a different cue: brighter face, mint outer frame, raised 3px. Inactive cards have a dark
      face and a slightly dimmed plate, so a legendary neighbour never looks "more active" than the active common card.
   5. Text: name on the plate, then ONE line "6発 · 耐久 100%". Dense cards (9+ weapons) keep plate + key + ammo + meters.
      Fonts follow the HUD scale with a 9px floor. Geometry numbers live in hud-layout.mjs hotbarGeometry(). */
.arsenal,.arsenal * { pointer-events:none; }
.weapon-rack { --slot-h:44; grid-template-columns:repeat(var(--weapon-columns,4),minmax(0,1fr)); grid-auto-rows:calc(var(--slot-h) * 1px * var(--hud-scale)); gap:calc(4px * var(--hud-scale)); border-bottom:0; height:auto; }
.weapon-rack .weapon-card { border:0; border-radius:0; background:#1b2723; box-shadow:none; clip-path:none; transform:none; transition:none; overflow:visible; }
.weapon-rack .weapon-card:hover:not(:disabled),.weapon-rack .weapon-card:active:not(:disabled) { transform:none; background:#1b2723; }
.weapon-card canvas,.weapon-en,.weapon-stat { display:none; }

/* no empty placeholders: a card without a weapon is not drawn (the one template card stays in the DOM, hidden) */
.weapon-rack .weapon-card[data-empty="true"] { display:none; }

/* tier name plate (solid) */
.weapon-rack .weapon-card::before { content:""; display:block; position:absolute; top:0; left:0; right:0; height:calc(16px * var(--hud-scale)); background:#4a5a52; }
.weapon-card[data-rarity]:not([data-rarity=""])::before { background:var(--weapon-rarity); }
.weapon-top { top:calc(1.5px * var(--hud-scale)); left:calc(2px * var(--hud-scale)); z-index:1; }
.weapon-top kbd { min-width:calc(13px * var(--hud-scale)); height:calc(13px * var(--hud-scale)); padding:0; border:0; background:#10201c; color:var(--weapon-rarity,#e4eee1); font-weight:700; line-height:calc(13px * var(--hud-scale)); text-align:center; }
.weapon-rack .weapon-card > strong { top:calc(1.5px * var(--hud-scale)); left:calc(19px * var(--hud-scale)); right:calc(3px * var(--hud-scale)); z-index:1; color:#10201c; font-weight:700; line-height:calc(13px * var(--hud-scale)); }

/* one text line: ammo, separator, durability */
.weapon-rack .slot-meta { position:absolute; top:calc(19px * var(--hud-scale)); left:calc(5px * var(--hud-scale)); right:calc(3px * var(--hud-scale)); inset-block-end:auto; height:calc(12px * var(--hud-scale)); display:flex; align-items:baseline; overflow:hidden; white-space:nowrap; line-height:calc(12px * var(--hud-scale)); }
.weapon-rack .slot-ammo,.weapon-rack .slot-state { position:static; flex:none; font-size:max(9px,calc(10px * var(--hud-scale))); line-height:inherit; text-align:left; }
.weapon-rack .slot-ammo { color:#f1f6ec; font-weight:700; }
.weapon-rack .slot-ammo:not(:empty)::after { content:" \00b7 "; color:#7e9489; font-weight:400; }
.weapon-rack .slot-meta[data-tight] .slot-label { display:none; }
.weapon-rack .slot-state { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; color:#aebfb5; }

/* tier meter: 5 segments, the first rank+1 lit in the tier colour */
.weapon-tier { position:absolute; left:calc(5px * var(--hud-scale)); right:calc(5px * var(--hud-scale)); top:calc(33px * var(--hud-scale)); height:calc(3px * var(--hud-scale)); display:flex; gap:calc(2px * var(--hud-scale)); }
.weapon-tier i { flex:1 1 0; background:#34433c; }
.weapon-card[data-rank="0"] .weapon-tier i:nth-child(-n+1),.weapon-card[data-rank="1"] .weapon-tier i:nth-child(-n+2),.weapon-card[data-rank="2"] .weapon-tier i:nth-child(-n+3),
.weapon-card[data-rank="3"] .weapon-tier i:nth-child(-n+4),.weapon-card[data-rank="4"] .weapon-tier i:nth-child(-n+5) { background:var(--weapon-rarity); }
.weapon-rack .weapon-condition { left:calc(5px * var(--hud-scale)); right:calc(5px * var(--hud-scale)); bottom:calc(3px * var(--hud-scale)); height:calc(3px * var(--hud-scale)); background:#0d1512; }

/* the active card: its own cue (brighter face + mint frame + raised), never the tier colour */
.weapon-rack .weapon-card.active:not([data-empty="true"]),.weapon-rack .weapon-card[aria-pressed="true"]:not([data-empty="true"]) { background:#41674f; box-shadow:0 0 0 calc(2px * var(--hud-scale)) var(--mint); transform:translateY(calc(-3px * var(--hud-scale))); z-index:1; }
.weapon-rack .weapon-card:not(.active):not([aria-pressed="true"])::before { opacity:.86; }
.weapon-rack .weapon-card.active .slot-state { color:#d4e4d9; }
/* The low-durability warning must win on the ACTIVE card too (the weapon in hand is the one that matters most). Same orange as field-ui.css. */
.weapon-rack .weapon-card.active[data-condition="low"] .slot-state { color:#e9ae88; }

/* dense cards (9+ weapons): plate = name only; the key cap moves to the ammo row; no durability text (bar + aria-label) */
.weapon-rack[data-density="dense"] .weapon-card::before { height:calc(13px * var(--hud-scale)); }
.weapon-rack[data-density="dense"] .weapon-top { top:calc(16px * var(--hud-scale)); left:calc(3px * var(--hud-scale)); }
.weapon-rack[data-density="dense"] .weapon-top kbd { min-width:calc(11px * var(--hud-scale)); height:calc(11px * var(--hud-scale)); font-size:max(9px,calc(9px * var(--hud-scale))); line-height:calc(11px * var(--hud-scale)); }
.weapon-rack[data-density="dense"] .weapon-card > strong { top:calc(0.5px * var(--hud-scale)); left:calc(4px * var(--hud-scale)); right:calc(2px * var(--hud-scale)); font-size:max(9px,calc(10px * var(--hud-scale))); line-height:calc(12px * var(--hud-scale)); }
.weapon-rack[data-density="dense"] .slot-meta { top:calc(15px * var(--hud-scale)); left:calc(16px * var(--hud-scale)); right:calc(3px * var(--hud-scale)); height:calc(11px * var(--hud-scale)); justify-content:flex-end; line-height:calc(11px * var(--hud-scale)); }
.weapon-rack[data-density="dense"] .slot-ammo { font-size:max(9px,calc(10px * var(--hud-scale))); }
.weapon-rack[data-density="dense"] .slot-ammo:not(:empty)::after,.weapon-rack[data-density="dense"] .slot-state { display:none; }
.weapon-rack[data-density="dense"] .weapon-tier { top:calc(27px * var(--hud-scale)); left:calc(4px * var(--hud-scale)); right:calc(4px * var(--hud-scale)); }
.weapon-rack[data-density="dense"] .weapon-condition { left:calc(4px * var(--hud-scale)); right:calc(4px * var(--hud-scale)); bottom:calc(2px * var(--hud-scale)); }
/* slots 9+ have no number key (wheel / Tab only): no key cap, the ammo takes the row */
.weapon-rack[data-density="dense"] .weapon-card[data-keyed="false"] .weapon-top { display:none; }
.weapon-rack[data-density="dense"] .weapon-card[data-keyed="false"] .slot-meta { left:calc(4px * var(--hud-scale)); }
