/* The workshop (ART_STYLE.md section 9), part seven: the in-game HUD, the slim brass look. Brass only where it earns it
   (the health dial, the shells, the clock); everything else is plain words with an ink outline straight over the world,
   so as little of the view as can be is covered. Health and buffs bottom left, the gun bottom right, the score top
   middle, the kill feed top right. On a phone the thumbs own the bottom corners, so the dial and the gun go up top.
   Built by hud-gauge.js and hud.js. */

:root { --hud-outl: 2px 2px 0 var(--wk-ink), -1px -1px 0 var(--wk-ink), 1px -1px 0 var(--wk-ink), -1px 1px 0 var(--wk-ink); --hud-plate: rgba(23, 20, 15, 0.84); }

/* ---- yer health: a pressure dial, shaking when you're hit and throbbing red when you're nearly done */
#gshud { position: absolute; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: 14px; width: 100px; height: 100px; pointer-events: none; }
#gshud svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 4px 0 var(--wk-ink)); overflow: visible; }
.gsneedle { transform-origin: 60px 60px; transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1); }
.gshpnum { font: 800 22px var(--f-ui); fill: var(--wk-ink); }
.gshplbl { font: 800 7px var(--f-ui); letter-spacing: 1.5px; fill: #5a4a36; }
#gshud.hit { animation: gsgaugehit 0.3s ease-out; }
#gshud.low svg { animation: gsgaugelow 0.9s ease-in-out infinite; }
@keyframes gsgaugehit { 0%, 100% { transform: none; } 25% { transform: translate(-3px, 1px) rotate(-3deg); } 60% { transform: translate(2px, -1px) rotate(2deg); } }
@keyframes gsgaugelow { 0%, 100% { filter: drop-shadow(0 4px 0 var(--wk-ink)); } 50% { filter: drop-shadow(0 4px 0 var(--wk-ink)) drop-shadow(0 0 10px rgba(255, 58, 26, 0.9)); } }

/* (what you last ate, eat-buffs.js: a line of green beside the dial, no plate) */
#gshud #gsfed { position: absolute; left: calc(100% + 10px); bottom: 8px; max-width: 220px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; rotate: 0deg; text-shadow: var(--hud-outl); }
body.touchplaying #gshud #gsfed { left: calc(100% + 8px); bottom: 2px; max-width: 160px; font-size: 10px; }

/* ---- the map, a brass porthole over the dial */
#gsmap { position: absolute; left: calc(18px + env(safe-area-inset-left, 0px)); bottom: 128px; width: 104px; height: 104px; border-radius: 50%; pointer-events: none; display: none;
  box-shadow: 0 0 0 2px var(--wk-brass), 0 0 0 4px var(--wk-ink); opacity: 0.92; }
#twmap { border: 0; box-shadow: 0 0 0 2px var(--wk-brass), 0 0 0 4px var(--wk-ink); opacity: 0.92; }

/* ---- the gun: the count big and amber, a strip of shells, its name, and keycaps for what else is to hand */
#gsweapon { position: absolute; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: 12px; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 10px; row-gap: 3px; justify-items: end; pointer-events: none; text-align: right; }
.gsclip { display: flex; align-items: baseline; gap: 3px; }
#gsammo { font: 800 36px/1 var(--f-ui); color: var(--wk-amber); font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(255, 154, 42, 0.6), var(--hud-outl); }
#gsmag { font: 800 13px var(--f-ui); color: #e8c070; text-shadow: var(--hud-outl); }
#gsshells { --n: 30; --w: calc(150px / var(--n)); position: relative; width: 150px; height: 14px;
  background: linear-gradient(90deg, rgba(58, 50, 40, 0.85) 0 calc(var(--w) - 2px), transparent 0) 0 0 / var(--w) 100% repeat-x; filter: drop-shadow(0 1px 0 var(--wk-ink)); }
#gsshells i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #f2b632 0 calc(var(--w) - 2px), transparent 0) 0 0 / var(--w) 100% repeat-x; transition: width 0.08s; }
#gsshells.none { display: none; }
#gsgunname { grid-column: 1 / 3; font: 800 10px var(--f-ui); letter-spacing: 1px; text-transform: uppercase; color: #e8c070; text-shadow: var(--hud-outl); white-space: nowrap; }
#gskeys { grid-column: 1 / 3; display: flex; gap: 12px; opacity: 0.85; }
#gskeys:empty { display: none; }
.gskey { display: inline-flex; align-items: center; gap: 5px; font: 800 11px var(--f-ui); letter-spacing: 0.5px; text-transform: uppercase; color: var(--wk-paper); text-shadow: var(--hud-outl); white-space: nowrap; }
.gskey kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid var(--wk-ink); border-radius: 4px; background: var(--wk-paper); color: var(--wk-ink); font: 800 11px var(--f-ui); text-shadow: none; box-shadow: 0 2px 0 var(--wk-ink); }

/* ---- the score: no plate; yer side cyan, theirs red, the clock in a little brass window */
#gsscore { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--wk-paper); font: 800 15px var(--f-ui); text-shadow: var(--hud-outl); }
#scopes.dark #gsscore { background: none; color: var(--wk-paper); }
#gsscore.cells { display: flex; align-items: center; gap: 12px; overflow: visible; }
.gssc { display: flex; flex-direction: column; align-items: center; min-width: 48px; line-height: 1.05; }
.gssc small { font: 800 9px var(--f-ui); letter-spacing: 1.5px; text-transform: uppercase; color: #e8c070; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.gssc b { font: 800 22px var(--f-ui); font-variant-numeric: tabular-nums; }
.gssc.me b { color: var(--wk-cyan); text-shadow: 0 0 10px rgba(42, 224, 255, 0.6), var(--hud-outl); }
.gssc.them b { color: var(--wk-red); text-shadow: 0 0 10px rgba(255, 58, 26, 0.5), var(--hud-outl); }
.gssc.clk { flex-direction: column-reverse; padding: 2px 10px; border-radius: 6px; border: 2px solid var(--wk-ink); background: #0a0806; box-shadow: inset 0 0 0 1px #5a4020; text-shadow: none; }
.gssc.clk b { font-size: 16px; color: var(--wk-amber); text-shadow: 0 0 10px rgba(255, 154, 42, 0.6); }

/* ---- the kill feed: words over the world, the newest bright, the older ones fading */
.gsfrow { padding: 0; border-radius: 0; background: none; font: 800 13px var(--f-ui); text-shadow: var(--hud-outl); }
.gsfrow:not(:last-child) { opacity: 0.7; }
#gsfeed { gap: 2px; }

/* ---- what E does, messages and the revive bar: a slim dark plate with a brass edge (on a target, world-tags.css has it) */
#gsprompt, #gsrevive, #gsmsg { border: 3px solid var(--wk-ink); border-radius: 8px; background: var(--hud-plate); box-shadow: inset 0 0 0 2px #c8902a, 0 3px 0 var(--wk-ink); color: var(--wk-paper); font-family: var(--f-ui); font-weight: 800; }
#gsprompt.cant { box-shadow: inset 0 0 0 2px var(--wk-red), 0 3px 0 var(--wk-ink); }
#gsmsg { font-size: 20px; }
/* (the streaks sit over the gun's keycaps, and the "play an instrument" hint goes bottom middle, off the health) */
#gsstreaks { bottom: 112px; }
#instbar.idle { left: 50%; right: auto; bottom: 10px; transform: translateX(-50%); padding: 0; border: 0; background: none; box-shadow: none; color: var(--wk-paper); font: 800 12px var(--f-ui); text-shadow: var(--hud-outl); }

/* ---- phones and tablets: the dial top left, the gun under the little buttons top right, the score and feed top middle */
body.touchplaying #gshud { top: 6px; bottom: auto; left: calc(8px + env(safe-area-inset-left, 0px)); width: 58px; height: 58px; }
body.touchplaying #gsmap, body.touchplaying #twmap { top: 72px; bottom: auto; left: calc(12px + env(safe-area-inset-left, 0px)); width: 60px; height: 60px; }
body.touchplaying #twhos { top: 140px; left: calc(8px + env(safe-area-inset-left, 0px)); width: 104px; font-size: 10px; }
body.touchplaying #twstars { top: 10px; right: auto; left: calc(74px + env(safe-area-inset-left, 0px)); font-size: 20px; }
body.touchplaying #gsweapon { top: 58px; bottom: auto; right: calc(14px + env(safe-area-inset-right, 0px)); }
body.touchplaying #gsammo { font-size: 22px; }
body.touchplaying #gsmag { font-size: 10px; }
body.touchplaying #gsshells { width: 110px; height: 8px; --w: calc(110px / var(--n)); }
body.touchplaying #gsgunname { display: none; }
body.touchplaying #gsscore { top: 6px; left: 50%; right: auto; transform: translateX(-50%); max-width: calc(100% - 460px); min-width: 180px; font-size: 12px; padding: 0; }
body.touchplaying #gsscore.cells { justify-content: center; gap: 8px; }
body.touchplaying .gssc b { font-size: 16px; }
body.touchplaying .gssc.clk b { font-size: 12px; }
body.touchplaying .gssc small { font-size: 7px; max-width: 70px; }
body.touchplaying #gsfeed { top: 50px; right: auto; left: 50%; transform: translateX(-50%); align-items: center; }
body.touchplaying .gsfrow { font-size: 10px; }
body.touchplaying .gsfrow:nth-last-child(n+3) { display: none; }
/* (the buttons go hollow: a brass ring with the world showing through, the same size, so just as easy to hit) */
#touchpad.arena .tcb { background: rgba(10, 6, 18, 0.18); border: 2px solid rgba(200, 144, 42, 0.8); box-shadow: 0 0 0 1px rgba(10, 6, 18, 0.6); text-shadow: 0 1px 0 var(--wk-ink); }
#touchpad.arena .tcb[data-id=fire] { background: rgba(179, 32, 44, 0.3); border-color: rgba(255, 90, 60, 0.85); }
#touchpad.arena .tcb[data-id=use] { background: rgba(60, 110, 30, 0.3); border-color: rgba(122, 255, 42, 0.75); }
#touchpad.arena .tcb.down, #touchpad.arena .tcb[data-id=fire].down, #touchpad.arena .tcb[data-id=use].down { background: rgba(242, 182, 50, 0.45); }

/* (a phone's streaks: just their icons, in a row under the gun, clear of the buttons) */
body.touchplaying #gsstreaks { top: 92px; bottom: auto; right: calc(14px + env(safe-area-inset-right, 0px)); flex-direction: row; gap: 4px; }
body.touchplaying #gsstreaks .gsstk { padding: 2px 5px; gap: 0; }
body.touchplaying #gsstreaks .gsstkinfo { display: none; }

/* (a narrow screen without touch: a smaller dial and a shorter strip, so the gun doesn't reach the dial) */
@media (max-width: 480px) { #gshud { width: 80px; height: 80px; } #gsshells { width: 100px; --w: calc(100px / var(--n)); } #gsammo { font-size: 28px; } }

@media (prefers-reduced-motion: reduce) { #gshud.hit, #gshud.low svg { animation: none; } .gsneedle { transition: none; } }
