.weapon-hud{position:fixed;inset:0;pointer-events:none;z-index:35;color:#efe7d4;font:12px system-ui}.weapon-hud[hidden]{display:none}.weapon-caption{position:absolute;bottom:120px;left:50%;transform:translateX(-50%);text-align:center;text-shadow:0 2px 4px #000;white-space:nowrap}.weapon-actions{position:absolute;right:24px;bottom:100px;display:none;gap:8px;pointer-events:auto}.equipped .weapon-actions{display:flex}.weapon-actions button{background:#172323dd;border:1px solid #ae9b70;color:#eee4ce;border-radius:5px;padding:10px}.weapon-reticle{display:none;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font:22px monospace;text-shadow:0 1px 3px #000}.equipped .weapon-reticle{display:block}.weapon-scope{display:none;position:absolute;inset:0;overflow:hidden}.scoped .weapon-scope{display:block}.scoped .weapon-reticle{display:none}.scope-glass{position:absolute;left:50%;top:50%;width:78vmin;height:78vmin;transform:translate(-50%,-50%);border:4px solid #090a09;border-radius:50%;box-shadow:0 0 0 150vmax #000,inset 0 0 50px 12px #0009;overflow:hidden}.scope-glass i,.scope-glass b{position:absolute;background:#080908}.scope-glass i{left:50%;top:0;width:1px;height:100%}.scope-glass b{top:50%;left:0;height:1px;width:100%}.scope-glass span{position:absolute;left:53%;top:55%;color:#111;font:12px monospace}.scoped .weapon-caption,.scoped .weapon-actions{z-index:1}@media(max-width:650px){.weapon-caption{white-space:normal;width:85%;bottom:165px}.weapon-actions{right:12px;bottom:115px}}
.scope-glass{
  box-sizing:border-box;
  width:72vmin;height:72vmin;
  border:10px solid #251e14;
  outline:2px solid #76603b;
  transform:translate(calc(-50% + var(--scope-kick-x,0px)),calc(-50% + var(--scope-kick,0px)));
  background:radial-gradient(ellipse at 40% 32%,#e9d9a508 0%,transparent 43%,#473c2426 70%,#13150f9c 92%,#030504f5 100%);
  box-shadow:0 0 0 3px #0d0b08,0 0 0 7px #716043,0 0 0 9px #30271b,0 0 0 13px #100e0b,0 0 0 150vmax #030303,inset 0 0 12px 4px #000,inset 0 0 50px 12px #070b0cb3;
}
.scope-glass::before{
  content:'';position:absolute;inset:0;border-radius:50%;pointer-events:none;
  background:radial-gradient(ellipse at 32% 22%,#e6dabd16,transparent 40%),radial-gradient(ellipse at 65% 80%,#718a7b12,transparent 45%);
  box-shadow:inset 2px 1px 4px #d9c28c66,inset -3px -2px 8px #000;
}
.scope-glass i,.scope-glass b{background:#19170fe6;box-shadow:0 0 1px #d5cba666;z-index:2}
.scope-glass i{width:1px;transform:translateX(-.5px)}
.scope-glass b{height:1px;transform:translateY(-.5px)}
.scope-patina{position:absolute;inset:0;border-radius:50%;box-shadow:inset 0 0 4px 2px #b5a17744;pointer-events:none}
.scoped .weapon-caption{font:italic 12px Georgia,serif;color:#b4ab97;bottom:56px}
.scoped .weapon-actions button{font:13px Georgia,serif;background:#17140fe8;border-color:#756346;color:#d8c9a8}
.scoped .weapon-actions{bottom:18px}

/* Give hand weapons their own dock, clear of the ship's bottom-right controls. */
.weapon-hud{
  display:grid;
  align-content:end;
  justify-items:start;
  gap:10px;
  box-sizing:border-box;
  padding:24px 310px max(32px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));
}
.weapon-hud .weapon-caption{
  position:relative;inset:auto;transform:none;
  width:auto;max-width:100%;white-space:normal;text-align:left;
  line-height:1.5;font-size:12px;
}
.weapon-hud .weapon-caption:empty{display:none}
.weapon-hud .weapon-actions{
  position:relative;inset:auto;max-width:100%;
  flex-wrap:wrap;gap:8px;padding:8px;box-sizing:border-box;
  border:1px solid #ae9b704d;border-radius:10px;
  background:#132426ed;box-shadow:0 4px 20px #0003;
}
.weapon-hud .weapon-actions button{min-height:44px;line-height:1.3}
.weapon-hud .weapon-actions button:disabled{opacity:.5;cursor:default}
.weapon-hud .weapon-actions button:focus-visible{outline:2px solid #e9d2a2;outline-offset:3px}
.weapon-hud.scoped .weapon-caption{font:italic 12px Georgia,serif;line-height:1.5}
@media(max-width:700px){
  .weapon-hud{
    align-content:start;
    padding:max(20px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 20px max(16px,env(safe-area-inset-left));
  }
  .weapon-hud .weapon-caption{max-width:360px}
  .weapon-hud .weapon-actions{max-width:360px;gap:6px}
  .weapon-hud .weapon-actions button{padding:8px;font-size:12px}
}

.scope-breath{display:none;position:absolute;z-index:2;left:50%;top:calc(50% + 36vmin + 26px);transform:translateX(-50%);align-items:center;gap:10px;color:#b4ab97;font:11px system-ui;letter-spacing:.04em;pointer-events:none}
.scoped .scope-breath{display:flex}
.scope-breath svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transform:scale(var(--lung-scale,1))}
.breath-track{width:112px;height:3px;background:#b4ab9733;margin-bottom:7px;overflow:hidden;border-radius:2px}
.breath-fill{height:100%;background:currentColor;transform-origin:left;transform:scaleX(var(--breath,1))}
.holding-breath .scope-breath{color:#d6dfc3}
.breath-exhausted .scope-breath{color:#cb987d}

/* Braced rifle: the scope ring fades and settles in at the end of the eased zoom. */
.weapon-scope{opacity:var(--scope-in,1)}
.scope-glass{scale:var(--scope-scale,1)}
.scope-zoom{position:absolute;z-index:2;left:50%;top:calc(50% - 39vmin - 30px);transform:translateX(-50%);color:#b4ab97;font:italic 12px Georgia,serif;letter-spacing:.06em;white-space:nowrap;pointer-events:none}
