/* Battle HUD v3.1 (FEATURES-BRIEF 41a; boss 26 Nov 2026 on v3: "Sy rasa claustrophobic tgk UI ni..rasanya smua sempit").
   Calm, open, uncluttered: the battlefield is the star. Everything hugs the corners and edges with clear space between
   groups; nothing in the middle third except the battle (and the wind dial on the top edge). Logic: hud.js.
   Same look as the lobby (lobby.css "Look v3"): see-through dark glass, thin gold trim, metallic gold Cinzel labels,
   ArcName names, painted icons. Phone first: designed at 844x390.

   ONE PLACE for every control's size and position (41b, the per-button editor, will only change these numbers):
   unitless numbers in "HUD units"; 1 unit = 1px x HUD SIZE (Settings > GAME, 80-130%, --hs) x screen factor (--hz:
   1 on phones, up to 1.6 on big screens). -cx / -cy = the control's CENTRE, measured from the screen edge it hangs on
   (joystick: left + bottom; FIRE, skills, bag: right + bottom), inside the safe area. Touch targets never go under
   44 px (max(44px, ...)).
   The skills sit on a tight arc round FIRE's centre (r ~100: just outside the power arc, so nothing overlaps):
   skill 1 at 197 deg, skill 2 at 153 deg, SS at 110 deg (r 108); the power plate is at the arc's top (90 deg). */
#hud {
  --hs: 1; --hz: 1;
  --u: calc(1px * var(--hs) * var(--hz));
  --sl: max(12px, env(safe-area-inset-left)); --sr: max(12px, env(safe-area-inset-right));
  --st: max(6px, env(safe-area-inset-top));   --sb: max(8px, env(safe-area-inset-bottom));
  /* left thumb */
  --joy-size: 100;  --joy-cx: 92;  --joy-cy: 84;    /* floating joystick size; cx/cy = its default spot (the idle dot) */
  --zone-w: 40;     --zone-h: 66.667;               /* joystick zone: left 40 % x lower 2/3 of the screen (in %) */
  --dot-size: 16;   --fuel-size: 58;                /* idle dot; FUEL corner gauge */
  /* right thumb: FIRE + power arc, the 3 skills packed round it, the bag left of skill 1 */
  --fire-w: 96;     --fire-cx: 78; --fire-cy: 66;   /* FIRE hexagon (height = width x .866); power arc r 61 round it */
  --sk-size: 58;    --ss-size: 64;                  /* skill buttons; SS a little bigger */
  --sk1-cx: 174;    --sk1-cy: 37;                   /* skill 1: left of FIRE, a little low  (197 deg, r 100) */
  --sk2-cx: 167;    --sk2-cy: 111;                  /* skill 2: upper left                    (153 deg, r 100) */
  --ss-cx: 108;     --ss-cy: 178;                   /* SS: over FIRE, left of the power plate (105 deg, r 116: clear of skill 2's plate) */
  --bag-size: 46;   --bag-cx: 234; --bag-cy: 32;    /* BAG: just left of skill 1; its tray opens above it */
  --pin-size: 34;   --pin-cx: 290; --pin-cy: 28;    /* POWER MARKER pin button (stop G1): left of the bag, under the power bar */
  /* top */
  --wind-size: 64;  --timer-size: 32;               /* wind compass (top centre), turn timer ring beside it */
  --card-w: 140;    --card-h: 24;  --face: 30;      /* 1v1 player card */
  --mini-w: 128;    --mini-h: 22;  --mini-face: 26; /* 2v2 (two cards a side) */
  --tiny-w: 92;     --tiny-h: 19;  --tiny-face: 22; /* 3v3 / 4v4 (two columns a side) */
  --rnd: 44;                                        /* menu, pause, sound, chat, map */
  --me-size: 44;                                    /* MY HERO (under the map button, only while the view is away) */
  --map-w: 190;     --map-h: 32;                    /* minimap (opened by the map button) */
  --pbar-w: 46;     --pbar-h: 18;  --pbar-cy: 72;   /* POWER BAR while charging: width in % of the screen, centred; cy = centre from the bottom */
  --gold: #ffd36b; --rim: linear-gradient(180deg, #fff0b8, #e2aa45 45%, #9a6416);
  --glass: linear-gradient(180deg, rgba(30,20,52,.42), rgba(12,8,26,.5));
  --goldtxt: linear-gradient(180deg, #fffbe8 0%, #ffe6a0 30%, #f1bf52 58%, #b97416 100%);
  --serif: 'Cinzel', Georgia, 'Times New Roman', serif; --namefont: 'ArcName', Georgia, 'Times New Roman', serif;
  font-family: var(--serif);
}
/* placed by centre: --cx/--cy (units) + --d (px) set per control below */
#hud .hc-l, #hud .hc-r { position: absolute; width: var(--d); height: var(--d); bottom: calc(var(--sb) + var(--cy) * var(--u) - var(--d) / 2); }
#hud .hc-l { left: calc(var(--sl) + var(--cx) * var(--u) - var(--d) / 2); }
#hud .hc-r { right: calc(var(--sr) + var(--cx) * var(--u) - var(--d) / 2); }

/* metallic gold text (lobby Look v3): gradient fill, a hair of dark outline, shadow as a filter */
#hud .gtxt, #hud .fh-in b, #hud .bag-head, #hud #angleTxt {
  background: var(--goldtxt); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: .35px rgba(70,34,4,.85); filter: drop-shadow(0 1px 1px rgba(0,0,0,.85)) drop-shadow(0 0 3px rgba(0,0,0,.45)); }

/* ---------- top: menu + red cards | timer + wind compass, turn strip | blue cards + map button (minimap, MY HERO) ---------- */
#hud .top { position: absolute; left: var(--sl); right: var(--sr); top: var(--st); display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: start; gap: calc(8 * var(--u)); }
#hud .hud-l { display: flex; align-items: flex-start; gap: calc(8 * var(--u)); min-width: 0; }
#hud .hud-r { display: flex; flex-direction: column; align-items: flex-end; gap: calc(3 * var(--u)); min-width: 0; }
#hud .hr-top { display: flex; align-items: flex-start; justify-content: flex-end; gap: calc(8 * var(--u)); min-width: 0; max-width: 100%; }
/* the cards take their size, but never more than their side of the top bar (big HUD SIZE on a narrow phone: they
   shrink and the names end in "...", so they never run into the timer / wind dial) */
#hud .cards { display: flex; flex-direction: column; gap: calc(3 * var(--u)); padding-top: calc(2 * var(--u)); min-width: 0; flex: 0 1 auto; }
#hud .cards.right { align-items: flex-end; }
#hud .cards .pcard { max-width: calc(100% - var(--f) * .42 * var(--u)); box-sizing: border-box; }
#hud .cards.grid { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); gap: calc(3 * var(--u)) calc(4 * var(--u)); align-content: start; }
#hud .cards.right.grid { justify-content: end; }
/* a player card: slim see-through plate, small face medallion, [CLAN] name, HP bar */
.pcard { --w: var(--card-w); --h: var(--card-h); --f: var(--face); position: relative; display: flex; align-items: center;
  width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); margin-left: calc(var(--f) * .42 * var(--u));
  padding: 0 calc(7 * var(--u)) 0 calc(var(--f) * .64 * var(--u)); border-radius: calc(6 * var(--u));
  background: linear-gradient(90deg, rgba(90,16,22,.36), rgba(14,9,30,.16)) padding-box, linear-gradient(90deg, rgba(255,107,90,.85), rgba(226,170,69,.55) 40%, rgba(150,95,20,0)) border-box;
  border: 1px solid transparent; transition: box-shadow .2s, opacity .3s; }
.pcard.right { margin: 0 calc(var(--f) * .42 * var(--u)) 0 0; padding: 0 calc(var(--f) * .64 * var(--u)) 0 calc(7 * var(--u)); flex-direction: row-reverse; text-align: right;
  background: linear-gradient(270deg, rgba(16,40,96,.36), rgba(14,9,30,.16)) padding-box, linear-gradient(270deg, rgba(90,162,255,.85), rgba(226,170,69,.55) 40%, rgba(150,95,20,0)) border-box; }
.pcard.mini { --w: var(--mini-w); --h: var(--mini-h); --f: var(--mini-face); }
.pcard.tiny { --w: var(--tiny-w); --h: var(--tiny-h); --f: var(--tiny-face); }
.pcard .pface { position: absolute; left: calc(var(--f) * -.42 * var(--u)); top: 50%; width: calc(var(--f) * var(--u)); height: calc(var(--f) * var(--u));
  transform: translateY(-50%); border-radius: 50%; padding: 1.5px; background: var(--rim); box-shadow: 0 0 0 1.5px #e5484d, 0 1px 4px rgba(0,0,0,.45); overflow: hidden; }
.pcard.right .pface { left: auto; right: calc(var(--f) * -.42 * var(--u)); box-shadow: 0 0 0 1.5px #3b82f6, 0 1px 4px rgba(0,0,0,.45); }
.pcard .pface img, .pcard .pface canvas { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 12%; display: block;
  background: radial-gradient(circle at 50% 35%, #5a4890, #1a1230); }
.pcard .pbody { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: calc(2 * var(--u)); }
.pcard .pname { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fffaf0;
  font: italic 700 max(9px, calc(10.5 * var(--u)))/1.1 var(--namefont); text-shadow: 0 1px 2px rgba(0,0,0,.95), 0 0 3px rgba(0,0,0,.6); }
.pcard.mini .pname { font-size: max(9px, calc(10 * var(--u))); }
.pcard.tiny .pname { font-size: max(9px, calc(9 * var(--u))); }
.pcard .pname .you { font-style: normal; font: 600 max(8px, calc(8 * var(--u))) var(--serif); color: var(--gold); margin-left: 3px; }
.pcard .hp { position: relative; height: calc(6 * var(--u)); border-radius: 99px; background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px rgba(255,214,120,.2); overflow: hidden; }
.pcard.mini .hp { height: calc(5 * var(--u)); }
.pcard.tiny .hp { height: calc(4 * var(--u)); }
.pcard .hp i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(180deg, #8af5b8, #2fbf72 55%, #1e8a50); transition: width .4s; }
.pcard .hp i.low { background: linear-gradient(180deg, #ff9a8a, #e5484d 55%, #a02028); }
.pcard.right .hp i { margin-left: auto; }
.pcard .hpnum { display: none; }
.pcard.active { box-shadow: 0 0 0 1.5px var(--gold), 0 0 10px rgba(255,211,107,.5); }
.pcard.dead { opacity: .4; filter: grayscale(.8); }
.pcard.away .pname { opacity: .6; }
/* the shop avatar (photo / frame / bought avatar) replaces the hero face in the medallion; never inside the name */
.pcard .pname .avatar { display: none; }

/* round gold-rim buttons: menu, pause, sound, chat (social.js's #chatBtn, moved into the row by hud.js), map */
#hud .hrnd, #hudSys #chatBtn { position: relative; width: max(44px, calc(var(--rnd) * var(--u))); height: max(44px, calc(var(--rnd) * var(--u))); padding: 0; flex: none;
  border: 0; border-radius: 50%; background: url('assets/ui/icons/btn-frame.png') center / 100% 100% no-repeat; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
#hud .hrnd svg { width: 46%; height: 46%; fill: #ffd98a; stroke: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.8)); }
#hud #btnHudMenu { opacity: .92; }
#hud #btnHudMenu.open { box-shadow: 0 0 0 2px #ffe08a, 0 0 12px rgba(255,211,107,.7); }
/* the menu row: drops out under the menu button, pause | sound | chat; closed = gone (no taps) */
#hud .hud-menu { position: relative; flex: none; }
#hud .hud-sys { position: absolute; left: 0; top: calc(100% + 6 * var(--u)); display: flex; gap: calc(6 * var(--u)); padding: calc(4 * var(--u));
  border-radius: 999px; border: 1px solid transparent; background: linear-gradient(rgba(12,8,26,.72), rgba(12,8,26,.72)) padding-box, var(--rim) border-box;
  box-shadow: 0 6px 16px rgba(0,0,0,.45); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility 0s .16s; z-index: 3; }
#hud .hud-sys.open { opacity: 1; visibility: visible; transform: none; transition: opacity .16s, transform .16s; }
#hud #btnMute svg { fill: none; stroke: #ffd98a; stroke-width: 2.2; stroke-linecap: round; }
#hud #btnMute svg circle { fill: #ffd98a; stroke: none; }
#hud #btnMute.off { opacity: .55; }
#hud #btnMute.off::after { content: ''; position: absolute; left: 22%; right: 22%; top: 50%; height: 2.5px; background: #ff6a5a; transform: rotate(-40deg); border-radius: 2px; }
#hudSys #chatBtn { inset: auto; z-index: auto; font-size: 0; }
#hudSys #chatBtn span { display: none; }
#hudSys #chatBtn::before { content: ''; position: absolute; inset: 27%; background: no-repeat center / contain
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5.5h16a1.5 1.5 0 0 1 1.5 1.5v9a1.5 1.5 0 0 1-1.5 1.5H10l-4.5 3.5V17.5H4A1.5 1.5 0 0 1 2.5 16V7A1.5 1.5 0 0 1 4 5.5z' fill='%23ffd98a'/%3E%3Ccircle cx='8' cy='11.5' r='1.4' fill='%233a2208'/%3E%3Ccircle cx='12' cy='11.5' r='1.4' fill='%233a2208'/%3E%3Ccircle cx='16' cy='11.5' r='1.4' fill='%233a2208'/%3E%3C/svg%3E"); }
#hudSys #chatBtn i { top: 4px; right: 4px; }
/* a new chat line while the row is closed: a red dot on the menu button */
#hud #btnHudMenu.dot::after { content: ''; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 1.5px #ffe3a0; }

/* map button: a painted parchment map in the gold frame; open = gold glow */
#hud #btnMap svg { width: 58%; height: 58%; fill: none; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.7)); }
#hud #btnMap .mp-sheet { fill: #f3dfae; stroke: #7a4c10; stroke-width: 1.1; stroke-linejoin: round; }
#hud #btnMap .mp-fold { stroke: rgba(122,76,16,.55); stroke-width: 1; }
#hud #btnMap .mp-path { stroke: #c0392b; stroke-width: 1.3; stroke-dasharray: 1.6 1.4; stroke-linecap: round; }
#hud #btnMap .mp-x { stroke: #c0392b; stroke-width: 1.6; stroke-linecap: round; }
#hud #btnMap.open { box-shadow: 0 0 0 2px #ffe08a, 0 0 12px rgba(255,211,107,.7); }

/* ---------- top centre: wind compass + timer ring ---------- */
#hud .mid { position: relative; display: flex; flex-direction: column; align-items: center; }
#hud .wind-row { display: flex; align-items: center; gap: calc(6 * var(--u)); }
/* the empty space right of the dial balances the timer on its left, so the dial stays on the screen's centre line */
#hud .wind-row::after { content: ''; width: calc(var(--timer-size) * var(--u)); flex: none; }
/* boss: "Wind tu buat jgn base solid...buat invisible tp jelas nampak": no disc, no plate. Only a thin gold ring, the
   strength arc, the arrow and the number float over the sky, each with a dark outline + soft shadow so they read on a
   bright sky, dark ground or an explosion. */
#hud #wind { position: relative; width: calc(var(--wind-size) * var(--u)); height: calc(var(--wind-size) * var(--u)); flex: none; border-radius: 50%; background: none; }
#hud #wind .wd-svg:first-child { filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
#hud .wd-halo { fill: none; stroke: rgba(20,10,0,.6); stroke-width: 3.6; }
#hud .wd-ring { fill: none; stroke: #f3cf72; stroke-width: 1.6; }
#hud .wd-svg, #hud .wd-arrow { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
#hud .wd-track { fill: none; stroke: rgba(0,0,0,.32); stroke-width: 5; }
#hud .wd-ticks { stroke: #f3cf72; stroke-width: 1.4; stroke-linecap: round; }
#hud .wd-arc { fill: none; stroke: url(#hudWindG); stroke-width: 3.6; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; transition: stroke-dashoffset .5s; }
#hud .wd-str { filter: drop-shadow(0 0 2.5px rgba(160,255,170,.9)); }
#hud .wd-str.strong .wd-arc { stroke: url(#hudWindG2); }
#hud .wd-str.strong { filter: drop-shadow(0 0 3px rgba(255,170,70,.95)); }
#hud .wd-str.left { transform: scaleX(-1); }
/* the arrow turns round the dial to point the way the wind blows (0 deg = to the right) */
#hud .wd-arrow { transition: transform .6s cubic-bezier(.3,1.3,.5,1), opacity .3s; }
#hud .wd-arrow svg { width: 100%; height: 100%; overflow: visible; }
#hud .wd-arrow path { fill: #ffe08a; stroke: #2a1400; stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.75)); }
#hud .wd-arrow.calm { opacity: 0; }
#hud #windNum { position: absolute; inset: 0; display: grid; place-items: center; font: 900 calc(22 * var(--u))/1 var(--serif); font-variant-numeric: tabular-nums;
  color: #fff6dc; -webkit-text-stroke: calc(3 * var(--u)) rgba(30,14,0,.92); paint-order: stroke fill; text-shadow: 0 1px 3px rgba(0,0,0,.7), 0 0 6px rgba(0,0,0,.35); }
/* turn timer: a small gold ring left of the dial, no fill (same "invisible but clear" look as the wind) */
#hud #timer { width: calc(var(--timer-size) * var(--u)); height: calc(var(--timer-size) * var(--u)); flex: none; border-radius: 50%; display: grid; place-items: center;
  font: 900 calc(14 * var(--u))/1 var(--serif); font-variant-numeric: tabular-nums; position: relative; background: none;
  border: 1.6px solid #f3cf72; box-shadow: 0 0 0 1px rgba(20,10,0,.6), inset 0 0 0 1px rgba(20,10,0,.6), 0 1px 3px rgba(0,0,0,.45); }
#hud #timer::before { content: attr(data-n); color: #fff6dc; -webkit-text-stroke: calc(2.6 * var(--u)) rgba(30,14,0,.92); paint-order: stroke fill;
  text-shadow: 0 1px 3px rgba(0,0,0,.7); }
#hud #timer.low { border-color: #ff6a5a; box-shadow: 0 0 0 1px rgba(20,10,0,.6), inset 0 0 0 1px rgba(20,10,0,.6), 0 0 10px rgba(255,80,60,.75); }
#hud #timer.low::before { color: #ffd0c8; }
#hud.tut #timer[data-n=""] { visibility: hidden; }   /* training: the player has no clock (audit 26 Nov 2026: a frozen "25") */
/* turn order under the dial: faces (now = bigger, gold ring; yours dashed), then ROUND n or SUDDEN DEATH xN.
   Shown for a moment at each turn start (hud.js adds .show), then it fades away. */
#hud #tq { position: absolute; top: calc(100% + 4 * var(--u)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: calc(3 * var(--u));
  height: calc(22 * var(--u)); padding: 0 calc(7 * var(--u)) 0 calc(3 * var(--u)); border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent; background: var(--glass) padding-box, linear-gradient(90deg, rgba(150,95,20,.5), #f3d27e, rgba(150,95,20,.5)) border-box;
  opacity: 0; transition: opacity .5s; pointer-events: none; }
#hud #tq.show { opacity: 1; transition: opacity .2s; }
#hud #tq[hidden] { display: none; }
#hud #tq .tq-f { position: relative; width: calc(15 * var(--u)); height: calc(15 * var(--u)); border-radius: 50%; overflow: hidden; border: 1.5px solid #e5484d; background: rgba(255,255,255,.08); flex: none; opacity: .85; }
#hud #tq .tq-f.t1 { border-color: #3b82f6; }
#hud #tq .tq-f.now { width: calc(19 * var(--u)); height: calc(19 * var(--u)); opacity: 1; box-shadow: 0 0 0 1.5px var(--gold), 0 0 6px rgba(255,211,107,.7); }
#hud #tq .tq-f.me { outline: 1.5px dashed var(--gold); outline-offset: 1px; }
/* each face's DELAY (stop G1): a small number under it (lower = sooner) */
#hud #tq .tq-w { position: relative; display: flex; flex-direction: column; align-items: center; flex: none; }
#hud #tq .tq-d { margin-top: 1px; font: 700 calc(7.5 * var(--u))/1 var(--serif); font-style: normal; font-variant-numeric: tabular-nums; color: #f8dc94; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
#hud #tq .tq-f img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
#hud #tq .tq-rd { margin-left: calc(3 * var(--u)); font: 700 calc(8.5 * var(--u))/1 var(--serif); letter-spacing: .07em; color: #f8dc94; white-space: nowrap; text-shadow: 0 1px 2px #000; }
#hud #tq .tq-rd.sd { color: #fff; background: linear-gradient(180deg, #ff6a5a, #c8281c); padding: 2px 6px; border-radius: 999px; animation: sdPulse 1.2s ease-in-out infinite; }
@keyframes sdPulse { 50% { box-shadow: 0 0 10px rgba(255,90,70,.8); } }

/* ---------- top right, under the map button: MY HERO (only while the view is away) + the minimap (only when opened) ---------- */
#hud .mm-row { display: flex; flex-direction: row-reverse; align-items: flex-start; gap: calc(8 * var(--u)); }
/* minimap: the whole map, red / blue dots, white box = what you see; tap or drag on it to look there. The canvas is
   --map-h tall; the 12 px padding above it makes the touch area 44 px (none below: the SS button is under it at 130 %). */
#hud #mmBox { position: relative; display: none; pointer-events: auto; }
#hud.map-on #mmBox { display: block; animation: hudFadeIn .18s ease-out; }
@keyframes hudFadeIn { from { opacity: 0; transform: translateY(-4px); } }
#hud #mmap { padding: 12px 0 0; touch-action: none; cursor: pointer; }
/* the minimap keeps its 100 % size when HUD SIZE is bigger (--um), so the opened map never reaches the skills */
#hud #mmBox { --um: min(var(--u), calc(1px * var(--hz))); }
#hud #minimap { display: block; width: calc(var(--map-w) * var(--um)); height: max(32px, calc(var(--map-h) * var(--um))); border-radius: calc(6 * var(--u));
  border: 1px solid transparent; background: linear-gradient(rgba(10,7,24,.55), rgba(10,7,24,.55)) padding-box, var(--rim) border-box; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
/* its X: a 44 px touch area, drawn small on the map's top-left corner */
#hud .mm-x { position: absolute; left: -22px; top: -10px; z-index: 1; display: grid; place-items: center; isolation: isolate; width: 44px; height: 44px; padding: 0;
  border: 0; background: none; color: #3a2208; font: 900 11px/1 system-ui, sans-serif; }
#hud .mm-x::before { content: ''; position: absolute; z-index: -1; left: 50%; top: 50%; width: 20px; height: 20px; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #fff0b8, #e2aa45 60%, #9a6416); box-shadow: 0 1px 3px rgba(0,0,0,.6); }
/* MY HERO: shown only while your hero is off the screen; a tap glides the view back */
#hud #btnMyHero { position: relative; flex: none; width: max(44px, calc(var(--me-size) * var(--u))); height: max(44px, calc(var(--me-size) * var(--u))); padding: 0;
  border-radius: 50%; background: url('assets/ui/icons/btn-frame.png') center / 100% 100% no-repeat; box-shadow: 0 0 0 2px rgba(255,211,107,.7), 0 0 10px rgba(255,211,107,.5);
  margin: calc(5 * var(--u)) 0 calc(8 * var(--u)); }
#hud #btnMyHero:not(.far) { display: none; }
#hud #btnMyHero.far { animation: hudFadeIn .2s ease-out; }
#hud .mh-face { position: absolute; inset: 11%; border-radius: 50%; overflow: hidden; }
#hud .mh-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
#hud .mh-x { position: absolute; inset: 4%; width: 92%; height: 92%; fill: none; stroke: rgba(255,226,150,.95); stroke-width: 1.4; filter: drop-shadow(0 0 1px #000); }
#hud #btnMyHero b { position: absolute; left: 50%; bottom: calc(-8 * var(--u)); transform: translateX(-50%); white-space: nowrap; padding: 1px 4px;
  font: 700 calc(7 * var(--u))/1.2 var(--serif); letter-spacing: .05em; }

/* the banner (YOUR TURN, SS name, SUDDEN DEATH) */
#banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); white-space: nowrap; opacity: 0; transition: opacity .3s;
  font: 800 calc(24 * var(--u))/1.1 var(--serif); letter-spacing: .08em; color: #ffe9a8; text-shadow: 0 0 2px #3c1d02, 0 2px 0 #3c1d02, 0 3px 14px rgba(0,0,0,.7); }
#banner.show { opacity: 1; }
#fxTags { position: absolute; left: 50%; bottom: calc(var(--sb) + 4px); transform: translateX(-50%); font: 700 max(10px, calc(11 * var(--u))) var(--serif);
  color: #ffe9a8; text-shadow: 0 1px 3px #000, 0 0 2px #000; white-space: nowrap; }

/* ---------- left thumb: the FLOATING joystick (hud.js) ----------
   #joyZone (invisible, under every other control) catches a press; the joystick appears centred under the finger and
   fades out on release. Idle = one small faint gold dot at the default spot; during training a ghost ring + thumb. */
#hud #joyZone { position: absolute; left: 0; bottom: 0; width: calc(var(--zone-w) * 1%); height: calc(var(--zone-h) * 1%); pointer-events: auto; touch-action: none; }
#hud #joyDot { position: absolute; pointer-events: none; width: calc(var(--dot-size) * var(--u)); height: calc(var(--dot-size) * var(--u)); border-radius: 50%;
  left: calc(var(--sl) + var(--joy-cx) * var(--u) - var(--dot-size) * var(--u) / 2); bottom: calc(var(--sb) + var(--joy-cy) * var(--u) - var(--dot-size) * var(--u) / 2);
  background: radial-gradient(circle at 40% 35%, #fff3c4, #f1bf52 55%, #b97416); box-shadow: 0 0 6px rgba(255,211,107,.6); opacity: .35; transition: opacity .25s; }
#hud #joyDot::after { content: ''; position: absolute; inset: calc(-9 * var(--u)); border-radius: 50%; border: 1px solid rgba(255,214,120,.55); }
#hud.joy-held #joyDot { opacity: 0; transition: opacity .08s; }
#hud #joy { --d: calc(var(--joy-size) * var(--u)); position: absolute; left: 0; top: 0; width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(.82); transition: opacity .25s, transform .25s; }
#hud #joy.on { opacity: 1; transform: none; transition: opacity .1s, transform .1s; }
/* training: ghost ring + a thumb at the default spot, "TOUCH & DRAG HERE" */
#hud #joyGhost { --d: calc(var(--joy-size) * var(--u)); position: absolute; display: none; pointer-events: none; width: var(--d); height: var(--d); border-radius: 50%;
  left: calc(var(--sl) + var(--joy-cx) * var(--u) - var(--d) / 2); bottom: calc(var(--sb) + var(--joy-cy) * var(--u) - var(--d) / 2);
  border: 2px dashed rgba(255,214,120,.55); background: radial-gradient(circle, rgba(255,214,120,.1), rgba(255,214,120,0) 70%); }
#hud.tut:not(.joy-held) #joyGhost { display: block; }
#hud .jg-thumb { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; fill: rgba(255,246,220,.85); filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
  transform: translate(-30%, -20%); animation: jgDrag 1.6s ease-in-out infinite; }
@keyframes jgDrag { 0%, 100% { transform: translate(-30%, -20%); } 50% { transform: translate(-30%, -55%); } }
#hud #joyGhost b { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; font: 700 max(9px, calc(9 * var(--u)))/1 var(--serif);
  letter-spacing: .06em; color: #ffe3a0; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
/* FUEL: a slim curved gauge hugging the bottom-left corner (display only, never catches a touch) */
#hud #fuelGauge { position: absolute; pointer-events: none; left: calc(var(--sl) - 6px); bottom: calc(var(--sb) - 6px);
  width: calc(var(--fuel-size) * var(--u)); height: calc(var(--fuel-size) * var(--u)); opacity: .9; }
#hud #fuelGauge svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 1px rgba(255,214,120,.7)); }
#hud #fuelGauge .arc-bg { stroke-width: 5.5; }
#hud #fuelGauge .arc-fill { stroke-width: 3.5; }
#hud .fuel-lbl { position: absolute; left: 6px; bottom: 6px; font: 700 max(8px, calc(8 * var(--u)))/1 var(--serif); letter-spacing: .08em; color: #bfe6ff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000; }
#hud .pow-arc { position: absolute; width: 133.333%; height: 133.333%; left: -16.667%; top: -16.667%; overflow: visible; pointer-events: none; }
#hud .arc-bg { fill: none; stroke: rgba(8,5,20,.5); stroke-width: 9; stroke-linecap: round; }
#hud .arc-fill { fill: none; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 0; transition: stroke-dashoffset .12s linear; }
#hud #fuelArc { stroke: url(#hudFuelG); }
#hud #powerArc { stroke: url(#hudPowG); transition: none; }
#hud .hud-tag { position: absolute; left: 50%; transform: translate(-50%, -50%); padding: calc(1.5 * var(--u)) calc(6 * var(--u)); white-space: nowrap; pointer-events: none;
  font: 700 calc(8.5 * var(--u))/1 var(--serif); letter-spacing: .08em; }
/* small label plates (FUEL, 1 / 2 / SS, MY HERO): solid gold text on a dark plate with the gold rim */
#hud .hud-tag, #hud .skb b, #hud #btnMyHero b { color: #ffe3a0; text-shadow: 0 0 1px #3c1d02, 0 1px 2px rgba(0,0,0,.9);
  border: 1px solid transparent; border-radius: calc(5 * var(--u)); background: linear-gradient(rgba(12,8,26,.8), rgba(12,8,26,.8)) padding-box, var(--rim) border-box; }
#hud .joy-base { position: absolute; inset: 0; border-radius: 50%; border: calc(3 * var(--u)) solid transparent;
  background: radial-gradient(circle at 50% 40%, rgba(60,44,96,.38), rgba(12,8,26,.48) 70%) padding-box,
    linear-gradient(160deg, #fff0b8, #c58a28 35%, #7a4c10 55%, #f6d98a 80%, #9a6416) border-box;
  box-shadow: inset 0 0 0 calc(4 * var(--u)) rgba(8,5,18,.25), inset 0 0 0 calc(5 * var(--u)) rgba(255,214,120,.25), 0 3px 10px rgba(0,0,0,.3); }
#hud .joy-ar { position: absolute; width: 0; height: 0; border: calc(5.5 * var(--u)) solid transparent; opacity: .75; }
#hud .joy-ar.u { left: 50%; top: 8%; transform: translateX(-50%); border-bottom: calc(8 * var(--u)) solid #f1bf52; border-top: 0; }
#hud .joy-ar.d { left: 50%; bottom: 8%; transform: translateX(-50%); border-top: calc(8 * var(--u)) solid #f1bf52; border-bottom: 0; }
#hud .joy-ar.l { top: 50%; left: 8%; transform: translateY(-50%); border-right: calc(8 * var(--u)) solid #f1bf52; border-left: 0; }
#hud .joy-ar.r { top: 50%; right: 8%; transform: translateY(-50%); border-left: calc(8 * var(--u)) solid #f1bf52; border-right: 0; }
#hud .joy-knob { --kx: 0px; --ky: 0px; position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; border-radius: 50%;
  transform: translate(calc(-50% + var(--kx)), calc(-50% + var(--ky)));
  background: radial-gradient(circle at 38% 30%, #fffbe0 0%, #ffe08a 22%, #e2a23a 55%, #8f5a12 100%);
  box-shadow: 0 0 0 2px rgba(90,52,10,.8), 0 3px 8px rgba(0,0,0,.5), 0 0 12px rgba(255,200,90,.45); }
#hud #joy.on .joy-knob { box-shadow: 0 0 0 2px rgba(90,52,10,.8), 0 4px 10px rgba(0,0,0,.55), 0 0 24px rgba(255,214,120,.95); }

/* ---------- right thumb: FIRE hexagon + power arc ---------- */
#hud #fireWrap { --cx: var(--fire-cx); --cy: var(--fire-cy); --d: calc(var(--fire-w) * 1.27 * var(--u)); pointer-events: none; }
#hud .pow-arc { width: 121.2%; height: 121.2%; left: -10.6%; top: -10.6%; filter: drop-shadow(0 0 1px rgba(255,214,120,.8)); }
#hud .pow-mark { stroke: #fff; stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 2px #000); }
/* the power number: in a small gold plate centred on the arc's midpoint (its top = the top edge of #fireWrap) */
#hud .pow-plate { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); z-index: 2; pointer-events: none;
  min-width: calc(30 * var(--u)); padding: calc(2 * var(--u)) calc(5 * var(--u)); border-radius: calc(6 * var(--u)); text-align: center;
  font: 800 calc(13 * var(--u))/1 var(--serif); font-variant-numeric: tabular-nums; color: #3a1d02; text-shadow: 0 1px 0 rgba(255,240,200,.6);
  background: linear-gradient(180deg, #fff3c4, #f1bf52 55%, #b97416); box-shadow: 0 0 0 1px #6a3c06, 0 2px 5px rgba(0,0,0,.5); }
#hud .pow-plate:empty { display: none; }
#hud .pow-plate.last { opacity: .72; }
#hud .fire-hex { position: absolute; left: 50%; top: 50%; width: max(80px, calc(var(--fire-w) * var(--u))); aspect-ratio: 1 / .866; transform: translate(-50%, -50%);
  padding: 0; background: none; pointer-events: auto; touch-action: none; filter: drop-shadow(0 3px 6px rgba(0,0,0,.45)); }
#hud .fh-rim, #hud .fh-in { position: absolute; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
#hud .fh-rim { inset: 0; background: linear-gradient(160deg, #fff0b8, #e2aa45 30%, #7a4c10 55%, #f6d98a 78%, #9a6416); }
#hud .fh-in { inset: 5%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: radial-gradient(circle at 50% 30%, #ff9a5a 0%, #e5481c 45%, #8e1a10 100%); box-shadow: inset 0 0 12px rgba(0,0,0,.4); }
#hud .fh-in img { width: 27%; margin-top: 2%; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
#hud .fh-in b { font: 900 calc(20 * var(--u))/1 var(--serif); letter-spacing: .06em; -webkit-text-stroke: .7px rgba(110,36,0,.9);
  background: linear-gradient(180deg, #fffdf2 0%, #fff0c4 40%, #ffd77a 70%, #f2a93a 100%); -webkit-background-clip: text; background-clip: text; }
/* the aim angle under the word FIRE */
#hud #angleTxt { margin-top: calc(2 * var(--u)); font: 800 calc(12 * var(--u))/1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
#hud .fire-hex.held { filter: drop-shadow(0 0 12px rgba(255,170,60,.95)) brightness(1.12); }
#hud .fire-hex.held .fh-in { transform: scale(.97); }

/* ---------- the 3 skills packed round FIRE (skills.js), MOBA style ---------- */
#hud #hudSkills { position: absolute; inset: 0; pointer-events: none; }
#hud .skb { position: absolute; --d: max(44px, calc(var(--sk-size) * var(--u))); width: var(--d); height: var(--d); bottom: calc(var(--sb) + var(--cy) * var(--u) - var(--d) / 2);
  right: calc(var(--sr) + var(--cx) * var(--u) - var(--d) / 2); padding: 0; border-radius: 50%; pointer-events: auto; touch-action: none; overflow: visible; min-width: 0; text-align: center;
  background: url('assets/ui/icons/btn-frame.png') center / 100% 100% no-repeat; border: 0; box-shadow: 0 3px 8px rgba(0,0,0,.4); transition: box-shadow .15s, transform .15s; }
#hud .skb[data-sel="0"] { --cx: var(--sk1-cx); --cy: var(--sk1-cy); }
#hud .skb[data-sel="1"] { --cx: var(--sk2-cx); --cy: var(--sk2-cy); }
#hud .skb.ss { --cx: var(--ss-cx); --cy: var(--ss-cy); --d: max(44px, calc(var(--ss-size) * var(--u))); }
#hud .skb canvas, #hud .skb .sk-art { position: absolute; inset: 11%; width: 78%; height: 78%; border-radius: 50%; pointer-events: none; }
/* painted skill art (assets/ui/skills/<heroId>-<1|2|ss>.png) when it exists; the drawn shell is the fallback */
#hud .skb .sk-art { inset: 7%; width: 86%; height: 86%; object-fit: contain; display: none; }
#hud .skb.art .sk-art { display: block; }
#hud .skb.art canvas { display: none; }
/* key plate on top: 1 / 2 / SS */
#hud .skb b { position: absolute; left: 50%; top: calc(-5 * var(--u)); transform: translateX(-50%); padding: 0 calc(4.5 * var(--u)); z-index: 2;
  font: 800 calc(10 * var(--u))/1.25 var(--serif); }
/* skill name: small, only for the selected one; left of skill 2 / SS (open sky there), above skill 1 */
#hud .skb span { position: absolute; right: calc(100% + 5px); top: 50%; transform: translateY(-50%); white-space: nowrap; font: 700 max(8px, calc(8.5 * var(--u)))/1.1 var(--serif);
  color: #fff4d6; text-shadow: 0 1px 2px #000, 0 0 3px #000; opacity: 0; transition: opacity .15s; pointer-events: none; }
#hud .skb[data-sel="0"] span { right: 50%; top: auto; bottom: calc(100% + 6 * var(--u)); transform: none; }   /* above the bag, clear of skill 2 */
#hud .skb.on span { opacity: 1; }
#hud.bagopen .skb span { opacity: 0; }   /* the open BAG tray sits where the skill names go */
#hud .skb i { display: none; }
#hud .skb.on { box-shadow: 0 0 0 2.5px #ffe08a, 0 0 14px 3px rgba(255,211,107,.8); transform: scale(1.05); }
/* SS: cooldown ring (conic, --cd 0..1 filled), purple-gold glow when ready */
#hud .skb.ss::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(#c58bff calc(var(--cd, 0) * 360deg), rgba(0,0,0,.4) 0);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(closest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); }
#hud .skb.ss.locked canvas, #hud .skb.ss.locked .sk-art { filter: grayscale(.85) brightness(.6); }
#hud .skb.ss.locked::before { content: attr(data-cd); position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; color: #fff;
  font: 800 calc(14 * var(--u))/1 var(--serif); text-shadow: 0 0 3px #000, 0 2px 2px #000; }
#hud .skb.ss:not(.locked) { box-shadow: 0 0 0 2px #ffd36b, 0 0 12px 3px rgba(190,110,255,.75); animation: ssReady 1.6s ease-in-out infinite; }
#hud .skb.ss:not(.locked)::after { background: conic-gradient(#ffe08a, #c58bff, #ffe08a, #c58bff, #ffe08a); }
#hud .skb.ss.on:not(.locked) { box-shadow: 0 0 0 3px #ffe08a, 0 0 20px 5px rgba(190,110,255,.9); }
@keyframes ssReady { 50% { box-shadow: 0 0 0 2px #ffd36b, 0 0 18px 6px rgba(255,200,90,.7); } }

/* ---------- BAG (just left of skill 1) + tray ---------- */
#hud #btnBag { --cx: var(--bag-cx); --cy: var(--bag-cy); --d: max(44px, calc(var(--bag-size) * var(--u))); position: absolute; width: var(--d); height: var(--d);
  bottom: calc(var(--sb) + var(--cy) * var(--u) - var(--d) / 2); right: calc(var(--sr) + var(--cx) * var(--u) - var(--d) / 2); padding: 0; border-radius: 50%;
  background: url('assets/ui/icons/btn-frame.png') center / 100% 100% no-repeat; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
#hud #btnBag img { position: absolute; inset: 17%; width: 66%; height: 66%; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
#hud #btnBag em { position: absolute; right: -3px; top: -3px; min-width: calc(16 * var(--u)); height: calc(16 * var(--u)); padding: 0 3px; border-radius: 99px;
  font: 800 calc(10 * var(--u))/calc(16 * var(--u)) system-ui, sans-serif; font-style: normal; color: #fff; text-align: center;
  background: radial-gradient(circle at 40% 30%, #ff7a6a, #d0201a); box-shadow: 0 0 0 1.5px #ffe3a0, 0 1px 3px rgba(0,0,0,.6); }
#hud #btnBag em:empty { display: none; }
#hud #btnBag.open { box-shadow: 0 0 0 2.5px #ffe08a, 0 0 14px 3px rgba(255,211,107,.8); }
/* POWER MARKER pin (stop G1): a small round gold-rim button; the pinned power under the pin; gold glow while set */
#hud #btnPin { --cx: var(--pin-cx); --cy: var(--pin-cy); --d: max(44px, calc(var(--pin-size) * var(--u))); position: absolute; width: var(--d); height: var(--d);
  bottom: calc(var(--sb) + var(--cy) * var(--u) - var(--d) / 2); right: calc(var(--sr) + var(--cx) * var(--u) - var(--d) / 2); padding: 0; border: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(20,12,36,.62) 0 calc(var(--pin-size) * .5 * var(--u) - 1.5px), #e2aa45 calc(var(--pin-size) * .5 * var(--u) - 1.5px) calc(var(--pin-size) * .5 * var(--u)), transparent calc(var(--pin-size) * .5 * var(--u) + .5px));
  touch-action: none; display: grid; place-items: center; }
#hud #btnPin svg { width: calc(15 * var(--u)); height: calc(15 * var(--u)); fill: #f8dc94; filter: drop-shadow(0 1px 1px #000); margin-top: calc(-3 * var(--u)); }
#hud #btnPin b { position: absolute; left: 50%; bottom: calc(50% - var(--pin-size) * .5 * var(--u) + 1px); transform: translateX(-50%); font: 800 calc(8 * var(--u))/1 var(--serif); color: #ffe08a; text-shadow: 0 1px 2px #000; }
#hud #btnPin.on svg { fill: #ffd36b; }
#hud #btnPin.on { filter: drop-shadow(0 0 5px rgba(255,211,107,.8)); }
/* the delay this turn will cost (selected shot + item + walk): a small plate on FIRE's top edge, only on your turn */
#hud .dl-tag { position: absolute; left: 50%; top: calc(50% - var(--fire-w) * .433 * var(--u) - 6 * var(--u)); transform: translate(-50%, -50%); z-index: 2; pointer-events: none;
  padding: calc(1.5 * var(--u)) calc(5 * var(--u)); border-radius: 99px; font: 800 calc(10 * var(--u))/1 var(--serif); font-variant-numeric: tabular-nums; color: #ffe9b0;
  background: rgba(16,10,30,.72); box-shadow: 0 0 0 1px rgba(226,170,69,.85); text-shadow: 0 1px 1px #000; white-space: nowrap; }
#hud .dl-tag:empty { display: none; }
#hud.wait .dl-tag { display: none; }
/* the tray's right edge = the bag's right edge, so it never covers skill 1 / 2 (audit 26 Nov 2026, HUD SIZE 130 %) */
#hud #bagTray { position: absolute; pointer-events: auto; right: calc(var(--sr) + (var(--bag-cx) - var(--bag-size) / 2) * var(--u));
  bottom: calc(var(--sb) + (var(--bag-cy) + var(--bag-size) / 2 + 10) * var(--u)); padding: calc(6 * var(--u)) calc(8 * var(--u)) calc(8 * var(--u));
  border-radius: calc(10 * var(--u)); border: 1.5px solid transparent; background: linear-gradient(180deg, rgba(30,20,52,.86), rgba(12,8,26,.9)) padding-box, var(--rim) border-box;
  box-shadow: 0 8px 22px rgba(0,0,0,.5); z-index: 3; }
#hud #bagTray::after { content: ''; position: absolute; right: calc(var(--bag-size) / 2 * var(--u) - 8px); top: 100%; border: 8px solid transparent; border-top-color: #c58a28; }
#hud .bag-head { font: 700 calc(10 * var(--u))/1.2 var(--serif); letter-spacing: .08em; margin-bottom: calc(5 * var(--u)); }
#hud .bag-head small { font-size: calc(8 * var(--u)); letter-spacing: .02em; font-weight: 600; margin-left: 4px; }
#hud #itembar { display: grid; grid-template-columns: repeat(3, auto); gap: calc(6 * var(--u)); }
#hud .itb { position: relative; width: max(44px, 54px, calc(62 * var(--u))); height: max(44px, calc(56 * var(--u))); padding: calc(4 * var(--u)) calc(4 * var(--u)) calc(12 * var(--u));
  border-radius: calc(9 * var(--u)); border: 1px solid rgba(255,214,120,.45); background: radial-gradient(circle at 50% 35%, rgba(80,60,120,.55), rgba(12,8,26,.7));
  font-size: calc(22 * var(--u)); line-height: 1; color: #fff; }
/* big POWER BAR (boss: "Tekan fire..bar tu x nampak": the thumb covers the arc). Lower middle, between the thumbs, above
   the bag / skill 1 and under skill 2. Shown only while charging (#powBar.on, game.js updateHud), fades out .4 s after
   release. Display only. --p = power now, --lp = last shot (both 0-100). */
#hud #powBar { --p: 0; --lp: -1; --h: calc(var(--pbar-h) * var(--u));
  position: absolute; left: 50%; bottom: calc(var(--sb) + var(--pbar-cy) * var(--u) - var(--h) / 2);
  width: min(calc(var(--pbar-w) * 1% * var(--hs)), 56%); height: var(--h); transform: translateX(-50%); box-sizing: border-box;
  pointer-events: none; opacity: 0; transition: opacity .25s ease .4s;
  border: 1.5px solid transparent; border-radius: calc(var(--h) / 2);
  background: linear-gradient(180deg, rgba(30,20,52,.55), rgba(8,5,20,.66)) padding-box, var(--rim) border-box;
  box-shadow: 0 0 0 1px rgba(70,34,4,.7), 0 3px 10px rgba(0,0,0,.45), 0 0 14px rgba(255,150,40,.35); }
#hud #powBar.on { opacity: 1; transition: opacity .12s ease 0s; }
#hud #powBar > i { position: absolute; inset: 2px; border-radius: inherit; pointer-events: none; }
#hud #powBar .pb-fill { background: linear-gradient(90deg, #ffe066 0%, #ffb02e 35%, #ff7a1a 65%, #e5281c 100%);
  clip-path: inset(0 calc(100% - var(--p) * 1%) 0 0 round calc(var(--h) / 2));
  box-shadow: inset 0 2px 2px rgba(255,250,220,.55), inset 0 -3px 4px rgba(120,20,0,.45); }
#hud #powBar .pb-ticks { background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(255,236,190,.55) calc(10% - 1px) 10%);
  -webkit-mask: linear-gradient(180deg, transparent 0 22%, #000 22% 78%, transparent 78%); mask: linear-gradient(180deg, transparent 0 22%, #000 22% 78%, transparent 78%); }
/* bold quarter ticks 25 / 50 / 75 / 100 (FEATURES-BRIEF 47a: the "bars" players count in), full height over the 10s */
#hud #powBar .pb-q { inset: 1px 2px; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 3px), rgba(30,12,0,.6) calc(25% - 3px) calc(25% - 2.5px), #fff6d8 calc(25% - 2.5px) 25%); }
#hud #powBar .pb-last { inset: -3px auto; left: calc(2px + (100% - 4px) * var(--lp) / 100); width: 3px; margin-left: -1.5px; border-radius: 2px;
  background: #fff; box-shadow: 0 0 0 1px rgba(20,10,30,.8), 0 0 4px rgba(255,255,255,.8); }
#hud #powBar.nolast .pb-last { display: none; }
/* the player's own pinned POWER MARKER (stop G1): gold, taller than the last-shot mark, with a little head */
#hud #powBar .pb-pin { inset: -6px auto; left: calc(2px + (100% - 4px) * var(--pin, 0) / 100); width: 3px; margin-left: -1.5px; border-radius: 2px; z-index: 1;
  background: #ffd36b; box-shadow: 0 0 0 1px #6a3c06, 0 0 5px rgba(255,211,107,.9); }
#hud #powBar .pb-pin::before { content: ''; position: absolute; left: 50%; top: -5px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #ffd36b; box-shadow: 0 0 0 1px #6a3c06; }
#hud #powBar.nopin .pb-pin { display: none; }
/* the live number: a small gold plate riding the end of the fill */
#hud #powBar .pb-num { position: absolute; top: 50%; left: min(max(calc(15 * var(--u)), calc(var(--p) * 1%)), calc(100% - 15 * var(--u))); transform: translate(-50%, -50%); z-index: 2;
  min-width: calc(30 * var(--u)); padding: calc(2.5 * var(--u)) calc(5 * var(--u)); box-sizing: border-box; border-radius: calc(6 * var(--u)); text-align: center;
  font: 800 calc(14 * var(--u))/1 var(--serif); font-variant-numeric: tabular-nums; color: #3a1d02; text-shadow: 0 1px 0 rgba(255,240,200,.6);
  background: linear-gradient(180deg, #fff3c4, #f1bf52 55%, #b97416); box-shadow: 0 0 0 1px #6a3c06, 0 2px 6px rgba(0,0,0,.55), 0 0 8px rgba(255,200,90,.6); }
#hud .itb img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 6px; pointer-events: none; }
#hud .itb .nm { position: absolute; left: 0; right: 0; bottom: calc(2 * var(--u)); font: 700 max(7.5px, calc(7.5 * var(--u)))/1 var(--serif); color: #f8dc94;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 1px; letter-spacing: -.03em; text-shadow: 0 1px 2px #000; }
#hud .itb.big { border-color: rgba(255,214,120,.85); }
/* copies of one item (Double Shot x3): the count LEFT, top right */
#hud .itb .cnt { position: absolute; top: calc(-5 * var(--u)); right: calc(-5 * var(--u)); min-width: calc(18 * var(--u)); padding: calc(2 * var(--u)) calc(4 * var(--u)); box-sizing: border-box; border-radius: 999px; font: 800 max(9px, calc(10 * var(--u)))/1 var(--serif); font-style: normal; color: #3a1d02; background: linear-gradient(180deg, #fff3c4, #f1bf52 55%, #b97416); box-shadow: 0 0 0 1px #6a3c06, 0 1px 3px rgba(0,0,0,.6); pointer-events: none; z-index: 1; }
#hud .itb.used { opacity: .25; filter: grayscale(1); }
#hud .itb:disabled:not(.used) { opacity: .6; }
#hud .itb:not(:disabled):active { transform: scale(.95); }

/* not your turn: the thumb controls go quiet */
#hud.wait #joy.on, #hud.wait #fireWrap, #hud.wait .skb, #hud.wait #btnBag { opacity: .5; }
#hud.wait .skb.ss:not(.locked) { animation: none; }

/* the tutorial glow keeps round controls round */
#hud #joy.tut-hl, #hud #joyGhost.tut-hl, #hud #btnBag.tut-hl, #hud .skb.tut-hl, #hud #btnMyHero.tut-hl, #hud #wind.tut-hl { border-radius: 50%; }
#hud #btnFire.tut-hl { border-radius: 30%; }
#hud #btnFire.tut-hl { animation: none; filter: drop-shadow(0 0 6px #f5b83d) drop-shadow(0 0 14px rgba(245,184,61,.9)); }

/* GRAPHICS LOW (Settings): no blur, no glow filters, no looping animations */
html.gfx-low #hud .gtxt, html.gfx-low #hud .fh-in b,
html.gfx-low #hud .bag-head, html.gfx-low #hud #angleTxt { filter: none; background: none; -webkit-text-fill-color: #ffe3a0; color: #ffe3a0;
  text-shadow: 0 0 1px #3c1d02, 0 1px 2px rgba(0,0,0,.9); }
html.gfx-low #hud #fuelGauge svg, html.gfx-low #hud .pow-arc, html.gfx-low #hud .fire-hex, html.gfx-low #hud .hrnd svg, html.gfx-low #hud #btnBag img,
html.gfx-low #hud .wd-str, html.gfx-low #hud .wd-arrow path { filter: none; }
html.gfx-low #hud .wd-arrow { transition: opacity .3s; }
html.gfx-low #hud #powBar { box-shadow: 0 0 0 1px rgba(70,34,4,.7); }
html.gfx-low #hud #powBar .pb-fill { box-shadow: none; }
html.gfx-low #hud #powBar .pb-num, html.gfx-low #hud #powBar .pb-last { box-shadow: 0 0 0 1px #6a3c06; }
html.gfx-low #hud .skb.ss:not(.locked), html.gfx-low #hud #tq .tq-rd.sd, html.gfx-low #hud .jg-thumb { animation: none; }

/* Boss 26 Nov 2026 ("Dekat fire tu x yah dah bar fire"): no power arc or number round FIRE any more; the big
   POWER BAR (#powBar, lower middle) shows the power while charging. Elements kept (game.js still writes them). */
#hud .pow-arc, #hud .pow-plate { display: none !important; }

/* Wind changes (boss 26 Nov 2026: the wind keeps its way for a few turns, Sim.nextWind): .wsoon = it changes next turn
   (a soft gold pulse round the dial), .wswirl = it just changed (a quick swirl). game.js windFx. No motion on LOW. */
#hud #wind::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; opacity: 0; }
#hud #wind.wsoon::after { border: 2px dashed rgba(255, 214, 120, .75); animation: wsoon 1.2s ease-in-out infinite; }
#hud #wind.wswirl::before { content: ''; position: absolute; inset: -2px; border-radius: 50%; pointer-events: none;
  border: 3px solid transparent; border-top-color: #fff1c2; border-right-color: rgba(255, 214, 120, .6); animation: wswirl .9s ease-out 1 forwards; }
@keyframes wsoon { 0%, 100% { opacity: .25; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes wswirl { 0% { opacity: 1; transform: rotate(0) scale(.85); } 100% { opacity: 0; transform: rotate(540deg) scale(1.15); } }
html.gfx-low #hud #wind.wsoon::after { animation: none; opacity: .8; }
html.gfx-low #hud #wind.wswirl::before { animation: none; display: none; }

/* skill / bag tooltips (skills.js showTip): a small gold-glass card above the button, kept on screen */
#hud .sk-tip { position: absolute; z-index: 60; max-width: min(260px, 60vw); padding: 7px 10px 6px; border-radius: 10px; pointer-events: none;
  background: linear-gradient(180deg, rgba(40, 24, 62, .9), rgba(18, 10, 30, .92)); border: 1px solid rgba(232, 190, 100, .85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 240, 200, .18); color: #f3ead8; text-align: left; }
#hud .sk-tip[hidden] { display: none; }
#hud .sk-tip b { display: block; font: 700 13px/1.2 var(--serif, 'Cinzel', serif); color: #ffd36b; letter-spacing: .03em; }
#hud .sk-tip p { margin: 3px 0 4px; font: 500 11.5px/1.3 system-ui, sans-serif; }
#hud .sk-tip small { display: block; font: 600 10.5px/1.2 system-ui, sans-serif; color: #d9c49a; }

/* ---------- stop G2: SCORE MODE lives (under the wind dial) + the SPIRIT SUPPORT panel (dead players) ---------- */
#hud #scoreBox { display: flex; align-items: center; justify-content: center; gap: calc(6 * var(--u)); margin-top: calc(2 * var(--u)); padding: calc(2 * var(--u)) calc(8 * var(--u));
  border-radius: 99px; background: rgba(16,10,30,.55); box-shadow: 0 0 0 1px rgba(226,170,69,.6); pointer-events: none; }
#hud #scoreBox[hidden] { display: none; }
#hud #scoreBox b { font: 800 calc(13 * var(--u))/1 var(--serif); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
#hud #scoreBox .sc-l { color: #ff8a80; } #hud #scoreBox .sc-r { color: #8fbaff; }
#hud #scoreBox small { font: 700 calc(7.5 * var(--u))/1 var(--serif); letter-spacing: .08em; color: #f8dc94; }
#hud .pcard .pss { position: absolute; top: 100%; font: 700 calc(8 * var(--u))/1.3 var(--serif); font-style: normal; color: #d9b3ff; text-shadow: 0 1px 2px #000; }
#hud .pcard .pss[hidden] { display: none; }
#hud #spirit { position: absolute; right: calc(var(--sr) + 8 * var(--u)); bottom: calc(var(--sb) + 8 * var(--u)); padding: calc(6 * var(--u)) calc(8 * var(--u));
  border-radius: calc(10 * var(--u)); background: linear-gradient(180deg, rgba(30,40,70,.72), rgba(12,14,30,.78)); box-shadow: 0 0 0 1px rgba(160,210,255,.6), 0 4px 14px rgba(0,0,0,.5); z-index: 6; }
#hud #spirit[hidden] { display: none; }
#hud #spirit .sp-head { font: 800 calc(11 * var(--u))/1 var(--serif); letter-spacing: .1em; color: #cfe9ff; margin-bottom: calc(5 * var(--u)); }
#hud #spirit .sp-head small { margin-left: 6px; font-size: .78em; color: #f8dc94; letter-spacing: .04em; }
#hud #spirit .sp-row { display: grid; grid-template-columns: repeat(2, auto); gap: calc(5 * var(--u)); }
#hud #spirit button { min-width: 44px; min-height: 44px; padding: 0 calc(9 * var(--u)); border-radius: calc(8 * var(--u)); border: 0; font: 700 calc(10 * var(--u))/1 var(--serif); color: #fff;
  background: rgba(70,110,170,.55); box-shadow: 0 0 0 1px rgba(160,210,255,.7); }
#hud #spirit button:disabled { opacity: .45; }
#hud #spirit.ready button:not(:disabled) { box-shadow: 0 0 0 1.5px #bfe8ff, 0 0 8px rgba(160,210,255,.6); }
#hud #spirit #spSpark.on { background: rgba(160,120,255,.75); }#hud.spirit #fireWrap, #hud.spirit #hudSkills, #hud.spirit #btnBag, #hud.spirit #btnPin, #hud.spirit #powBar, #hud.spirit #bagTray { display: none; }

/* ---------- Latency: ping bars (game.js pingUi; CLAUDE.md "Latency (ping)") ----------
   4 small bars: green < 120 ms (4 lit), yellow < 250 (3), red above (1), grey = not measured yet; a tap shows "N ms" for 3 s.
   Battle HUD: #pingHud under the menu button (top left, clear of the cards; the menu row covers it while open), online only.
   Room: one in every human seat's plate (renderLobby). */
.ping { position: relative; display: inline-flex; align-items: flex-end; gap: 1.5px; height: 11px; vertical-align: middle; cursor: pointer; }
.ping i { display: block; width: 3px; border-radius: 1px; background: rgba(255,255,255,.22); box-shadow: 0 0 0 .5px rgba(0,0,0,.45); }
.ping i:nth-of-type(1) { height: 30%; } .ping i:nth-of-type(2) { height: 55%; } .ping i:nth-of-type(3) { height: 80%; } .ping i:nth-of-type(4) { height: 100%; }
.ping.p-g i { background: #4ade80; }
.ping.p-y i:nth-of-type(-n+3) { background: #facc15; }
.ping.p-r i:nth-of-type(1) { background: #f87171; }
.ping b { display: none; position: absolute; left: calc(100% + 4px); bottom: -1px; white-space: nowrap; font: 700 10px/1 var(--serif, Georgia, serif);
  color: #fff6da; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.ping.num b { display: block; }
#hud #pingHud { position: absolute; left: 50%; top: 100%; width: 44px; height: 40px; margin-left: -22px; padding: 0 0 25px; border: 0; background: none;
  display: inline-flex; justify-content: center; align-items: flex-end; opacity: .85; }
#hud #pingHud[hidden] { display: none; }
#hud #pingHud b { left: calc(50% + 12px); bottom: 25px; }
/* room seat plate (boss 29 Nov 2026: "22ms ni besar sgt"): the plate's own text rules made the number name-sized and it ran
   over the title pill; here it is a small plain tag ABOVE the bars, centred, never over the pill */
#lobby .ping b { left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); font: 700 8px/1 Georgia, serif !important;
  font-style: normal !important; letter-spacing: 0; padding: 1px 3px; border-radius: 3px; background: rgba(0,0,0,.55); text-shadow: none; }
