/* War of the East — the battle HUD (replica/bfme1/ui.md §1, §4; the thumb-arc pass, docs/design/hud-thumb-arc/).
   Two layouts, picked per pointer by TouchBar.trackInput (<html data-hud>):
   - desk (a mouse on a large screen): BFME1's single bottom-left cluster (replica/bfme1/ui.md §1, measured in
     docs/research/bfme-refs/hud/): the round parchment atlas in a metal bezel with three rim buttons, the gold and
     command-point plaque across its foot, the palantír (the selection's portrait) to its right with the order ring
     around it (hotkey badges), its round sockets in a tray to the right of that and the commands and powers under
     them; the hero crests in a column on the left edge above the atlas. No top bar and no group bar (the 1-9 keys
     stay): only the clock, speed and pause chip at the top right.
   - arc (touch, and every phone-sized screen; Main/PhoneHero/PhoneBuilding/Tablet.dc.html): the thumb arc at the end
     of this file.
   Per-faction metals come from the #hud[data-faction] variables. All ornaments are our own SVG.
   Geometry: every piece is placed in the viewport (#console and its groups are display: contents) from the custom
   properties below. */

#hud {
  /* Desktop geometry (Desktop.dc.html), in viewport coordinates */
  --bar-h: 0px;                             /* no top bar (BFME1 has none) */
  --mm: clamp(190px, min(33vh, 36vw), 380px);          /* atlas bezel diameter: BFME1 draws an oval 0.40 wide and 0.31 high; this circle is 0.33 of the screen height */
  --pal: clamp(150px, min(25vh, 26vw), 280px);         /* palantír diameter: about 0.25 of the height */
  --sock: clamp(44px, 5.4vh, 56px);         /* command socket diameter */
  --rb: clamp(44px, 5.8vh, 58px);           /* order ring button diameter */
  --sg: 7px;                                /* socket gap */
  --plq: clamp(30px, 4.2vh, 42px);          /* resources plaque height */
  --name-h: 46px;                           /* the nameplate under the palantír */
  --hero: clamp(42px, 6.6vh, 62px);         /* hero crest diameter: about 0.07 of the height */
  --gx: calc(var(--safe-left) + 12px);      /* the cluster's left edge */
  --gy: calc(var(--safe-bottom) + 10px);    /* and its bottom edge */
  --mm-bottom: calc(var(--gy) + var(--plq) * .55);   /* the atlas sits on the plaque, which overlaps its foot */
  --rows: 3;                                /* socket rows in the tray (JS reads data-rows) */
  --cols: 6;                                /* visible socket columns */
  --arc: 0px;                               /* the tray no longer tucks in: the ring sits between it and the palantír */
  --pal-cx: calc(var(--gx) + var(--mm) + var(--pal) * .42);       /* palantír centre, from the left: right of the atlas, overlapping its rim */
  --pal-cy: calc(var(--safe-bottom) + 34px + var(--pal) / 2);    /* palantír centre, from the bottom */
  --ring-r: calc(var(--pal) / 2 + var(--rb) / 2 + 16px);         /* order ring radius */
  --tray-h: calc(var(--sock) * var(--rows) + var(--sg) * (var(--rows) - 1));
  --tray-x: calc(var(--pal-cx) + var(--ring-r) + var(--rb) / 2 + 18px);
  --cmd-x: var(--tray-x);
  --cmd-y: calc(var(--safe-bottom) + 18px);
  --tray-y: calc(var(--cmd-y) + var(--sock) + 12px);
  --tray-w: min(calc((var(--sock) + var(--sg)) * var(--cols)), calc(100vw - var(--tray-x) - var(--safe-right) - 24px));
  /* Faction materials: overridden per faction below */
  --m-hi: #f6dc9a; --m-mid: #c08f43; --m-lo: #6b4718; --m-edge: #2a1a08; --m-glint: #fff4cf;
  --f-panel: rgba(20, 13, 8, .9); --f-panel-solid: #1a1009; --f-text: #f4e9d0; --f-muted: #c9b48c; --f-accent: #f3d99b;
  --f-icon: #f8ecc8; --f-glow: rgba(255, 214, 120, .55); --f-danger: #e0685a; --f-health: #9fc27a;
  --f-display: "Cinzel", "Palatino Linotype", Georgia, serif;
  --glass-a: #9fc3e8; --glass-b: #1d3352; --glass-c: #050a14;
  --paint-sky: #6f87a6; --paint-earth: #3c3424;
  --orn-pal: none; --orn-mm: none; --orn-band: none;
  --metal: linear-gradient(165deg, var(--m-hi) 0%, var(--m-mid) 34%, var(--m-lo) 58%, var(--m-mid) 80%, var(--m-hi) 100%);
  --metal-ring: conic-gradient(from 200deg, var(--m-hi), var(--m-lo) 22%, var(--m-mid) 38%, var(--m-glint) 50%, var(--m-mid) 60%, var(--m-lo) 78%, var(--m-hi));
  position: fixed; inset: 0; z-index: 10; pointer-events: none; user-select: none; -webkit-user-select: none; color: var(--f-text);
}
#hud button, #hud input, #hud select, #hud canvas { pointer-events: auto; }
#hud kbd { border: 0; padding: 0; background: none; color: var(--f-muted); font: 600 9px/1 var(--mono); }
#hud button:disabled { cursor: default; }
/* Disabled sockets stay solid (darkened, not see-through), as in BFME. */
#hud :is(.sock, .pbtn, .command-buttons > button, .ability-btn, .rim-btn, .platform-option):disabled, .medallion:disabled { opacity: 1; }
#hud button:focus-visible { outline: 2px solid var(--f-accent); outline-offset: 3px; }

/* ---- Top right: clock, speed, pause (small) ---- */
#topbar { position: absolute; top: calc(var(--safe-top) + 3px); right: calc(var(--safe-right) + 10px); display: flex; align-items: center; gap: 10px; padding: 3px 4px 3px 12px; border-radius: 24px; background: var(--f-panel); box-shadow: 0 0 0 1px var(--m-lo), 0 0 0 2px var(--m-edge), 0 3px 12px rgba(0, 0, 0, .45); pointer-events: auto; }
#mapTitle { max-width: 22vw; color: var(--f-muted); font: 13px var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#clockWrap { display: flex; align-items: center; gap: 6px; }
#clock { min-width: 42px; color: var(--f-text); font: 600 13px var(--body); font-variant-numeric: tabular-nums; text-align: center; }
#speedBtn, #pauseBtn { display: grid; place-items: center; min-width: 40px; height: 34px; padding: 0 8px; border: 0; border-radius: 17px; background: var(--metal); color: var(--m-edge); font: 700 12px var(--body); box-shadow: inset 0 0 0 1px var(--m-glint), 0 1px 3px rgba(0, 0, 0, .5); }
#pauseBtn .icon { width: 16px; height: 16px; stroke-width: 2.6; }
/* beta 15 minor 5: the battle menu's Pause and speed entries are 44 px targets on a touch screen */
@media (pointer: coarse) { #speedBtn, #pauseBtn { min-width: 44px; height: 44px; border-radius: 22px; } }
#speedBtn:not(:disabled):hover, #pauseBtn:not(:disabled):hover { filter: brightness(1.12); }

/* BFME1's top of the screen is empty: the clock and speed chip is an option on the desktop (pause menu); a phone's lives in its battle menu. */
:root:not([data-hud="arc"]):not([data-chip="on"]) #topbar { display: none; }
/* The start-of-game transient centre text: about 6 s, then it fades. */
.start-text { position: absolute; left: 50%; top: calc(var(--safe-top) + 18vh); transform: translateX(-50%); z-index: 5; max-width: 80vw; margin: 0; color: #f1d9a0; font: 600 clamp(18px, 2.4vw, 30px)/1.2 var(--f-display, Georgia, serif); letter-spacing: .04em; text-align: center; text-shadow: 0 2px 0 #2a1806, 0 0 14px rgba(0, 0, 0, .85); pointer-events: none; opacity: 0; }
.start-text.show { animation: start-text 6s ease-out forwards; }
.start-text span { display: block; }
.start-text #startSub { margin-top: 6px; font-size: .6em; letter-spacing: .08em; color: #d9c48e; }
@keyframes start-text { 0% { opacity: 0; } 8% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.pause-options { display: grid; gap: 8px; margin: 14px 0 4px; padding: 10px 12px; border-radius: 6px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); text-align: left; }
.pause-options label { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 32px; cursor: pointer; }
.pause-options input { width: 18px; height: 18px; }
.pause-clockrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pause-clockrow time { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---- Top left: the objective plaque (small); the objectives rim button collapses it ---- */
.mission { position: absolute; top: calc(var(--safe-top) + var(--bar-h) + 8px); left: calc(var(--safe-left) + 14px); max-width: min(520px, calc(100% - 700px)); padding: 5px 14px 6px; border-radius: 3px; background: var(--f-panel); box-shadow: 0 0 0 1px var(--m-lo), 0 3px 12px rgba(0, 0, 0, .4); }
.mission.collapsed { display: none; }
#factionBadge { color: var(--f-accent); font: 600 10px/1.3 var(--f-display); letter-spacing: .12em; text-transform: uppercase; }
#objective { margin: 1px 0 0; color: var(--f-text); font: 14px/1.35 var(--f-display); }
#controlHint { display: none; position: absolute; left: 50%; top: calc(var(--safe-top) + 10px); transform: translateX(-50%); z-index: 4; margin: 0; padding: 8px 16px; border-radius: 18px; background: var(--f-panel); box-shadow: 0 0 0 1px color-mix(in srgb, var(--m-mid) 55%, transparent), 0 3px 12px rgba(0, 0, 0, .45); color: var(--f-text); font-size: 14px; white-space: nowrap; }
#controlHint b { color: var(--f-accent); }
:root[data-tips="on"] #hud[data-ctx="troops"] #controlHint { display: block; } /* only behind the tips toggle (BFME1 has no hint bar) */
:root[data-tips="on"] #hud[data-ctx="troops"] #alerts { top: calc(var(--safe-top) + 58px); } /* the hint takes the top centre while troops are selected */
.touch-hint { display: none; }

/* ---- The cluster ---- */
#console, #commandDock, #selPanel, .selection-heading, #orderRing, #stancePanel, .stance-buttons, #thumbLeft { display: contents; }
#minimapWrap, #resWrap, #powersWrap, .palantir, .nameplate, .socket-tray, .command-buttons { position: absolute; z-index: 2; }
.arc-only, .arc-label, .arc-badge, .hero-hp { display: none; }

/* The atlas: a round parchment map in a bezel */
#minimapWrap { left: var(--gx); bottom: var(--mm-bottom); width: var(--mm); height: var(--mm); border-radius: 50%; background: var(--metal-ring); box-shadow: 0 0 0 1px var(--m-edge), 0 8px 22px rgba(0, 0, 0, .6), inset 0 0 0 1px var(--m-glint); pointer-events: auto; }
#minimapWrap .mm-ring { position: absolute; inset: 0; border-radius: 50%; background: var(--orn-mm) center / 100% 100% no-repeat; pointer-events: none; }
#minimap { position: absolute; inset: 7%; width: 86%; height: 86%; border-radius: 50%; background: #d8c49a; box-shadow: 0 0 0 2px var(--m-edge), 0 0 0 3px var(--m-lo); touch-action: none; cursor: crosshair; }
#minimapWrap::after { content: ""; position: absolute; inset: 7%; border-radius: 50%; box-shadow: inset 0 0 18px rgba(60, 35, 10, .65), inset 0 0 3px rgba(0, 0, 0, .8); pointer-events: none; }
.mm-rim { position: absolute; inset: 0; pointer-events: none; }
.rim-btn { position: absolute; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 38%, var(--paint-sky), var(--glass-c) 75%); box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 4px var(--m-mid), 0 0 0 5px var(--m-edge), 0 3px 8px rgba(0, 0, 0, .6), inset 0 0 8px rgba(0, 0, 0, .6); color: var(--f-icon); z-index: 1; }
.rim-btn .icon { width: 22px; height: 22px; stroke-width: 1.8; filter: drop-shadow(0 0 3px rgba(0, 0, 0, .9)); }
.rim-btn:not(:disabled):hover { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 4px var(--m-hi), 0 0 0 5px var(--m-edge), 0 0 14px var(--f-glow), inset 0 0 8px rgba(0, 0, 0, .4); }
.rim-btn:disabled { filter: grayscale(.7) brightness(.7); }
/* 11, 12 and 1 o'clock on the bezel */
.mm-rim { --rim-r: .5; --rim-s: .6; --rim-c: .8; }
.rim-a { left: calc(50% - 22px - var(--mm) * var(--rim-r) * var(--rim-s)); top: calc(50% - 22px - var(--mm) * var(--rim-r) * var(--rim-c)); }
.rim-b { left: calc(50% - 22px); top: -16px; width: 50px; height: 50px; margin-left: -3px; background: radial-gradient(circle at 50% 40%, #e9f6ff, #5f9fe0 30%, #183a6e 64%, #050b18); }
.rim-c { left: calc(50% - 22px + var(--mm) * var(--rim-r) * var(--rim-s)); top: calc(50% - 22px - var(--mm) * var(--rim-r) * var(--rim-c)); }
.rim-badge { position: absolute; right: -6px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #8d1d12; color: #fff3df; font: 700 12px/20px var(--body); text-align: center; box-shadow: 0 0 0 1.5px var(--m-hi), 0 1px 3px rgba(0, 0, 0, .7); }

/* Resources and command points plaque under the atlas */
#resWrap { left: calc(var(--gx) + var(--mm) * .05); bottom: var(--gy); width: calc(var(--mm) * .9); height: var(--plq); z-index: 3; display: flex; align-items: center; justify-content: space-around; gap: 8px; padding: 0 8px; border-radius: calc(var(--plq) / 2); background: var(--orn-band) center / auto 60% repeat-x, var(--metal); box-shadow: 0 0 0 1px var(--m-edge), inset 0 0 0 1px var(--m-glint), 0 4px 12px rgba(0, 0, 0, .55); pointer-events: auto; }
.res { display: flex; align-items: center; gap: 4px; height: calc(var(--plq) - 10px); padding: 0 6px; border-radius: 12px; background: rgba(10, 6, 3, .78); white-space: nowrap; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .8); }
.res .icon { width: 15px; height: 15px; color: var(--f-accent); stroke-width: 1.9; }
.res > [id] { color: var(--f-text); font: 700 clamp(11px, 1.5vh, 13px) var(--body); font-variant-numeric: tabular-nums; }

/* The palantír: a round crystal showing the selection */
.palantir { left: calc(var(--pal-cx) - var(--pal) / 2); bottom: calc(var(--pal-cy) - var(--pal) / 2); width: var(--pal); height: var(--pal); border-radius: 50%; background: var(--metal-ring); box-shadow: 0 0 0 1px var(--m-edge), 0 8px 24px rgba(0, 0, 0, .65); pointer-events: none; }
.pal-ring { position: absolute; inset: -6%; border-radius: 50%; background: var(--orn-pal) center / 100% 100% no-repeat; }
.pal-glass { position: absolute; inset: 9%; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 38% 30%, var(--glass-a) 0%, var(--glass-b) 42%, var(--glass-c) 80%); box-shadow: inset 0 0 0 2px var(--m-edge), inset 0 -10px 24px rgba(0, 0, 0, .7), inset 0 8px 18px rgba(255, 255, 255, .15); }
.pal-glass::after { content: ""; position: absolute; left: 18%; top: 9%; width: 42%; height: 24%; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 70%); transform: rotate(-18deg); }
.portrait { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .12s; }
.portrait .icon, .portrait svg { width: 58%; height: 58%; color: var(--f-icon); stroke-width: 1.3; filter: drop-shadow(0 0 6px rgba(0, 0, 0, .85)) drop-shadow(0 0 14px var(--f-glow)); }
.portrait .hero-crest { width: 84%; height: 84%; filter: drop-shadow(0 0 8px rgba(0, 0, 0, .8)); }
.portrait .portrait-count { position: absolute; bottom: 14%; font: 700 18px var(--f-display); color: var(--f-text); text-shadow: 0 1px 4px #000; }
.portrait.hovering .icon, .portrait.hovering svg { filter: drop-shadow(0 0 6px rgba(0, 0, 0, .85)) drop-shadow(0 0 18px var(--f-glow)); }

/* The nameplate under the crystal */
.nameplate { left: var(--pal-cx); bottom: calc(var(--safe-bottom) + 6px); transform: translateX(-50%); width: calc(var(--pal) * .84); min-height: var(--name-h); padding: 5px 12px 6px; border-radius: 6px; text-align: center; background: var(--f-panel-solid); box-shadow: 0 0 0 1px var(--m-hi), 0 0 0 3px var(--m-lo), 0 0 0 4px var(--m-edge), 0 4px 14px rgba(0, 0, 0, .6); pointer-events: auto; z-index: 1; }
/* The palantír's texts wrap (two lines, then a clip) instead of ending in an ellipsis: "Gondor Castle Wall", "2 battalions selected" (beta 5 item 3). */
#selName { margin: 0; overflow: hidden; color: var(--f-text); font: 600 14px/1.2 var(--f-display); text-wrap: balance; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
#selSub { margin: 2px 0 0; overflow: hidden; color: var(--f-muted); font-size: 11px; line-height: 1.3; text-wrap: balance; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.health-bar { height: 4px; margin: 3px auto 0; width: 86%; border-radius: 2px; background: rgba(0, 0, 0, .7); overflow: hidden; }
.health-bar > span { display: block; height: 100%; width: 100%; background: var(--f-health); transition: width .2s; }
.health-bar.low > span { background: var(--f-danger); }

/* The socket tray: round sockets on an arc hugging the palantír, the rest in rows. Positions come from
   layoutSockets() in main.js (data-row / data-col); empty slots are not drawn. */
.socket-tray { left: var(--tray-x); bottom: var(--tray-y); width: var(--tray-w); height: calc(var(--tray-h) + 8px); padding: 4px 0 4px var(--arc); overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--m-mid) transparent; touch-action: pan-x; pointer-events: auto; }
.socket-tray::-webkit-scrollbar { height: 5px; }
.socket-tray::-webkit-scrollbar-thumb { background: var(--m-mid); border-radius: 3px; }
#selBtns, #heroAbilities, #stancePanel, .stance-buttons { display: contents; }
#stancePanel.hidden { display: none; }
.socket-tray .sock { position: absolute; top: calc(4px + var(--row, 0) * (var(--sock) + var(--sg))); left: calc(var(--arc) + var(--col, 0) * (var(--sock) + var(--sg)) - var(--tuck, 0px)); }
.socket-tray [data-col="0"][data-row="0"], .socket-tray [data-col="0"][data-row="2"] { --tuck: var(--arc); }
.socket-tray [data-col="0"][data-rows="2"] { --tuck: calc(var(--arc) * .5); }

/* A socket: a round painted vignette in a metal ring */
.sock, .command-buttons > button, .pbtn, .ability-btn { position: relative; width: var(--sock); height: var(--sock); padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; overflow: visible; color: var(--f-icon); background: radial-gradient(circle at 50% 30%, var(--paint-sky) 0%, color-mix(in srgb, var(--paint-sky) 40%, var(--paint-earth)) 45%, var(--paint-earth) 70%, #0b0805 100%); box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-hi), 0 0 0 5px var(--m-edge), 0 3px 8px rgba(0, 0, 0, .6), inset 0 -6px 10px rgba(0, 0, 0, .55), inset 0 4px 6px rgba(255, 255, 255, .12); }
.sock > .icon, .command-buttons > button > .icon, .pbtn > .icon, .sock .sock-art > .icon { width: 56%; height: 56%; stroke-width: 1.7; color: var(--f-icon); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .9)) drop-shadow(0 0 5px rgba(0, 0, 0, .6)); }
.sock .hero-crest { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); }
.sock:not(:disabled):hover, .command-buttons > button:not(:disabled):hover, .pbtn:not(:disabled):hover, .ability-btn:not(:disabled):hover, .sock.tip-on { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-glint), 0 0 0 5px var(--m-edge), 0 0 16px var(--f-glow), inset 0 -6px 10px rgba(0, 0, 0, .45), inset 0 4px 8px rgba(255, 255, 255, .22); }
.sock:not(:disabled):active, .command-buttons > button:not(:disabled):active, .pbtn:not(:disabled):active { transform: scale(.94); }
.sock:disabled, .command-buttons > button:disabled, .pbtn:disabled:not(.locked) { filter: grayscale(.85) brightness(.62); }
.sock[aria-pressed="true"], .sock.active { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px #9fe07a, 0 0 0 5px var(--m-edge), 0 0 14px rgba(140, 220, 110, .55), inset 0 -6px 10px rgba(0, 0, 0, .55); }
.sock.armed { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px #ff6a3d, 0 0 0 5px var(--m-edge), 0 0 18px rgba(255, 90, 42, .8), inset 0 -6px 10px rgba(0, 0, 0, .55); animation: sock-pulse .7s ease-in-out infinite alternate; }
@keyframes sock-pulse { to { filter: brightness(1.3); } }
.sock .sock-text, .command-buttons .sock-text, .pbtn .power-name, .pbtn .power-cost { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sock kbd, .command-buttons kbd, .pbtn > kbd, .ability-btn kbd { position: absolute; left: -4px; top: -4px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--f-panel-solid); box-shadow: 0 0 0 1px var(--m-mid); color: var(--f-accent); font: 700 9px/15px var(--mono); text-align: center; transform: none; opacity: 1; }
/* Painted families: a sky-to-earth wash per kind of order */
.sock[data-cat="train"] { --paint-sky: #8fae7a; --paint-earth: #3b3a22; }
.sock[data-cat="hero"] { --paint-sky: #d9b86a; --paint-earth: #3a2410; }
.sock[data-cat="forge"] { --paint-sky: #f0a04b; --paint-earth: #3c170b; }
.sock[data-cat="wall"] { --paint-sky: #a7a9a4; --paint-earth: #2f2f2c; }
.sock[data-cat="danger"] { --paint-sky: #d0583e; --paint-earth: #2a0b07; }
.sock[data-cat="perk"] { --paint-sky: #f5e08a; --paint-earth: #4a3410; }
.sock[data-cat="stance"] { --paint-sky: #7c95b8; --paint-earth: #1d2433; }
/* Production count and progress on a training socket (BFME ShowProductionCount) */
.sock[data-count]::after { content: attr(data-count); position: absolute; right: -5px; bottom: -4px; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 9px; background: #1c4f17; color: #eaffd9; font: 700 10px/17px var(--body); text-align: center; box-shadow: 0 0 0 1px var(--m-hi); }
.sock[data-count=""]::after { display: none; }
.sock[style*="--prog"]::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(rgba(150, 240, 120, .9) calc(var(--prog) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); pointer-events: none; }
.sock.fallen .hero-crest { filter: grayscale(.8); }
/* Hero ability sockets: a cooldown sweep and the lock level */
.ability-btn { --paint-sky: #b996e0; --paint-earth: #24143a; color: var(--f-icon); cursor: pointer; }
.ability-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(0, 0, 0, .7) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.ability-btn .ability-glyph { font: 700 15px/1 var(--f-display); letter-spacing: .02em; text-shadow: 0 1px 3px #000; }
.ability-btn .ability-lock { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; font: 700 13px/1 var(--body); text-shadow: 0 1px 3px #000; }
.ability-btn .ability-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ability-btn.locked { filter: grayscale(1) brightness(.55); }
.ability-btn.locked .ability-glyph, .ability-btn.cooling .ability-glyph { opacity: .35; }
.ability-btn.passive { --paint-sky: #6f6a8a; cursor: default; }
.ability-btn.passive::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .45); }
.ability-btn.on { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px #9fe07a, 0 0 0 5px var(--m-edge), inset 0 -6px 10px rgba(0, 0, 0, .55); }

/* Commands (build, army, base, stop) and powers (Z X C): a row above the tray */
.command-buttons { left: var(--cmd-x); bottom: var(--cmd-y); display: flex; gap: var(--sg); pointer-events: none; }
.command-buttons > button { --paint-sky: #8a7a5a; --paint-earth: #2a1f12; }
.command-buttons > #buildBtn { --paint-sky: #e0b766; --paint-earth: #4a2c0e; }
#powersWrap { left: calc(var(--cmd-x) + 3 * (var(--sock) + var(--sg)) + 14px); bottom: var(--cmd-y); display: flex; gap: var(--sg); pointer-events: none; }
#stopBtn { display: none; } /* Stop sits on the order ring (desk) and the troop arc (touch) */
#powersWrap { flex-wrap: wrap-reverse; max-width: calc(4 * (var(--sock) + var(--sg))); } /* up to eight learned powers: two rows of four */
.pbtn { --paint-sky: #9ccff0; --paint-earth: #12294a; }
.pbtn#power-heal { --paint-sky: #a9e39a; --paint-earth: #123516; }
.pbtn#power-storm { --paint-sky: #ffd27a; --paint-earth: #3c1a08; }
.pbtn .cd { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(5, 4, 3, .72); color: var(--f-text); font: 700 12px var(--body); pointer-events: none; }
.pbtn .cd:empty { display: none; }
.pbtn.locked { filter: grayscale(.6) brightness(.8); }
.pbtn.locked::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--f-panel-solid) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 7V5.5a3 3 0 0 1 6 0V7M4 7h8v6H4z' fill='none' stroke='%23f3d99b' stroke-width='1.4'/%3E%3C/svg%3E") center / 12px no-repeat; box-shadow: 0 0 0 1px var(--m-mid); }

/* The tooltip: a dark panel with a thin gold frame over the hovered socket; the palantír shows its portrait */
.sock-tip { position: fixed; left: 0; top: 0; z-index: 30; width: max-content; max-width: min(300px, calc(100vw - 20px)); padding: 8px 11px 9px; border-radius: 3px; background: rgba(12, 8, 5, .96); box-shadow: 0 0 0 1px var(--m-hi), 0 0 0 2px var(--m-edge), 0 8px 24px rgba(0, 0, 0, .6); pointer-events: none; }
.sock-tip strong { display: block; color: var(--f-text); font: 600 14px/1.25 var(--f-display); }
.sock-tip .sock-tip-cost { display: block; margin-top: 2px; color: var(--f-accent); font: 12px/1.35 var(--body); }
.sock-tip .sock-tip-cost:empty, .sock-tip .sock-tip-text:empty { display: none; }
.sock-tip .sock-tip-text { display: block; margin-top: 4px; color: var(--f-muted); font: 12px/1.4 var(--body); white-space: pre-line; }

/* ---- The hero column: round crests on the left edge above the atlas ---- */
.hero-column { position: absolute; left: calc(var(--gx) + 4px); bottom: calc(var(--mm-bottom) + var(--mm) + 12px); display: flex; flex-direction: column; gap: 8px; z-index: 3; pointer-events: none; }
/* Desk: a carved bracket along the screen edge behind the crests, as BFME1's (the arc layout has none) */
:root:not([data-hud="arc"]) .hero-column::before { content: ""; position: absolute; z-index: -1; left: calc(-1 * var(--gx) - 4px); right: -9px; top: -9px; bottom: -9px; border-radius: 0 16px 16px 0; background: linear-gradient(90deg, rgba(10, 6, 4, .85), rgba(24, 16, 10, .62)); box-shadow: inset -1px 0 0 var(--m-mid), 0 0 0 1px rgba(0, 0, 0, .5), 4px 0 12px rgba(0, 0, 0, .4); pointer-events: none; }
.hero-icon { position: relative; width: var(--hero); height: var(--hero); padding: 0; border: 0; border-radius: 50%; background: #120c08; box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-hi), 0 0 0 5px var(--m-edge), 0 3px 10px rgba(0, 0, 0, .55); cursor: pointer; pointer-events: auto; }
.hero-icon .hero-crest { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); }
.hero-icon .hero-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hero-icon.fallen { background: #2a2420; }
.hero-icon.fallen .hero-crest { filter: grayscale(1) brightness(.5); }
.hero-icon .hero-ring circle { fill: none; stroke: #7cc46a; stroke-width: 3; stroke-dasharray: var(--hp, 100) 100; stroke-linecap: round; }
.hero-icon.low .hero-ring circle { stroke: #e0563c; }
.hero-icon.selected { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-glint), 0 0 0 5px var(--m-edge), 0 0 16px var(--f-glow); }
.hero-icon .hero-level { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px; background: var(--f-panel-solid); box-shadow: 0 0 0 1px var(--m-hi); color: var(--f-text); font: 700 10px/18px Cinzel, Georgia, serif; text-align: center; }
.hero-icon .hero-timer { position: absolute; inset: 0; display: grid; place-items: center; color: #fff4d6; font: 700 12px/1 Georgia, serif; text-shadow: 0 1px 2px #000; pointer-events: none; }
.hero-icon.reviving .hero-crest { filter: grayscale(1) brightness(.55); }
.hero-icon.reviving .hero-ring circle { stroke: transparent; }
.hero-icon:focus-visible { outline: 2px solid var(--f-accent); outline-offset: 4px; }

/* ---- Panels above the cluster: build, placement hint, counsel, alerts ---- */
#buildPanel { position: absolute; left: var(--tray-x); bottom: calc(var(--tray-y) + var(--tray-h) + 18px); width: min(600px, calc(100vw - var(--tray-x) - var(--safe-right) - 24px)); max-height: calc(100vh - var(--tray-y) - var(--tray-h) - var(--safe-top) - var(--bar-h) - 40px); overflow: auto; padding: 12px 14px 14px; border-radius: 4px; background: var(--f-panel-solid); box-shadow: 0 0 0 1px var(--m-hi), 0 0 0 3px var(--m-lo), 0 0 0 4px var(--m-edge), 0 10px 30px rgba(0, 0, 0, .55); touch-action: pan-y; scrollbar-width: thin; pointer-events: auto; z-index: 4; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-heading h2 { margin: 0; color: var(--f-text); font: 600 17px var(--f-display); }
#hud .compact-btn { min-height: 34px; padding: 4px 12px; border: 0; border-radius: 17px; background: rgba(0, 0, 0, .45); color: var(--f-text); font-size: 12px; box-shadow: inset 0 0 0 1px var(--m-mid); }
#hud .compact-btn:not(:disabled):hover { box-shadow: inset 0 0 0 1px var(--m-glint), 0 0 10px var(--f-glow); }
#hud .compact-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--m-mid) 35%, transparent); box-shadow: inset 0 0 0 1px var(--m-glint); }
#buildBtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px 8px; }
.bbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 0 0 2px; border: 0; background: none; color: var(--f-text); font-size: 12px; line-height: 1.2; text-align: center; box-shadow: none; }
.bbtn > .icon { box-sizing: content-box; width: 26px; height: 26px; padding: 13px; border-radius: 50%; color: var(--f-icon); stroke-width: 1.7; background: radial-gradient(circle at 50% 30%, #d9b86a, #4a2c0e 70%, #0b0805); box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-hi), 0 0 0 5px var(--m-edge), 0 3px 8px rgba(0, 0, 0, .6), inset 0 -6px 10px rgba(0, 0, 0, .5); filter: none; }
.bbtn:not(:disabled):hover > .icon { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-glint), 0 0 0 5px var(--m-edge), 0 0 16px var(--f-glow); }
.bbtn:disabled { opacity: .5; }
.bbtn .cost { color: var(--f-accent); font: 11px var(--body); }
.panel-tip { margin: 10px 0 0; color: var(--f-muted); font-size: 12px; }
.plot-section { margin-top: 12px; border-top: 1px solid color-mix(in srgb, var(--m-mid) 40%, transparent); padding-top: 10px; }
.plot-section h3 { margin: 0 0 8px; color: var(--f-accent); font: 600 14px var(--f-display); }
.plot-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.fortify-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.fortify-actions > span { color: var(--f-muted); font-size: 11px; }
.repeat-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: 12px; pointer-events: auto; }
.repeat-toggle input { width: 20px; height: 20px; accent-color: var(--m-mid); }
#modeHint { position: absolute; left: var(--tray-x); bottom: calc(var(--tray-y) + var(--tray-h) + 18px); max-width: min(640px, calc(100vw - var(--tray-x) - var(--safe-right) - 24px)); display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-radius: 4px; background: var(--f-panel-solid); box-shadow: 0 0 0 1px var(--m-hi), 0 0 0 2px var(--m-edge), 0 6px 20px rgba(0, 0, 0, .5); z-index: 3; pointer-events: auto; }
#modeHint > .icon { width: 18px; height: 18px; color: var(--f-accent); }
#modeText { font-size: 13px; }
#placementStatus { margin: 3px 0 0; color: var(--f-accent); font-size: 12px; }
#cancelMode { flex-shrink: 0; }
#tipBox { position: absolute; right: calc(var(--safe-right) + 10px); top: calc(var(--safe-top) + 54px); width: min(320px, calc(100% - 20px - var(--safe-left) - var(--safe-right))); padding: 8px 11px 9px; border-radius: 3px; background: var(--f-panel); box-shadow: 0 0 0 1px var(--m-lo), 0 4px 14px rgba(0, 0, 0, .45); pointer-events: auto; z-index: 5; }
#tipBox.hidden { display: none; }
#tipBox .tip-label { color: var(--f-accent); font: 600 12px/1.4 var(--f-display); letter-spacing: .06em; }
#tipText { margin: 3px 0 6px; color: var(--f-text); font-size: 13px; line-height: 1.4; }
#tipBox .tip-actions { display: flex; gap: 6px; justify-content: flex-end; }
#buildPanel:not(.hidden) ~ #tipBox, #modeHint:not(.hidden) ~ #tipBox { display: none; }
#alerts { position: absolute; top: calc(var(--safe-top) + var(--bar-h) + 10px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; max-width: min(440px, 46vw); pointer-events: none; z-index: 4; }
#hud .alert { padding: 6px 14px; border: 0; border-radius: 3px; background: var(--f-panel); box-shadow: 0 0 0 1px var(--m-lo), 0 4px 14px rgba(0, 0, 0, .35); color: var(--f-text); font-size: 13px; text-align: center; animation: alert-in .2s ease-out; }
#hud .alert.error, #hud .alert.danger { box-shadow: 0 0 0 1px var(--f-danger), 0 0 14px rgba(224, 104, 90, .35); }
#hud .net-banner { top: calc(var(--safe-top) + 56px); }
#hud .net-debug { bottom: calc(var(--tray-y) + var(--tray-h) + 18px); }

/* ---- On-map radial menus: wall platforms (fortify) and build plots, round options in an arc ---- */
.platform-menu { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 12; pointer-events: none; }
.platform-option, .platform-close { position: absolute; pointer-events: auto; display: grid; place-items: center; text-align: center; border: 0; border-radius: 50%; color: var(--f-text); background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--m-mid) 55%, #222), var(--f-panel-solid) 72%); box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-hi), 0 0 0 5px var(--m-edge), 0 4px 14px rgba(0, 0, 0, .6); }
.platform-option { width: var(--d, 72px); height: var(--d, 72px); left: calc(var(--dx) - var(--d, 72px) / 2); top: calc(var(--dy) - var(--d, 72px) / 2); padding: 6px; align-content: center; gap: 1px; font: 600 9px/1.15 var(--body); animation: platform-in .16s ease-out both; }
.platform-option .icon { width: 22px; height: 22px; color: var(--f-icon); stroke-width: 1.7; }
.platform-option .cost { color: var(--f-accent); font: 700 10px/1 var(--body); }
.platform-option:disabled { filter: grayscale(.8) brightness(.6); }
.platform-option:not(:disabled):hover, .platform-option:focus-visible { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-glint), 0 0 0 5px var(--m-edge), 0 0 18px var(--f-glow); outline: none; }
.platform-menu .ring-safe { position: fixed; visibility: hidden; pointer-events: none; width: 0; height: 0; padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); }
.platform-close { width: 30px; height: 30px; left: -15px; top: -15px; font-size: 18px; line-height: 1; }
.platform-menu.plot-menu::before { content: ""; position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--m-hi) 70%, transparent); background: radial-gradient(circle, rgba(0, 0, 0, .25), transparent 70%); }
@keyframes platform-in { from { opacity: 0; transform: scale(.6); } }
/* Icon-only ring buttons (BFME1): the name, price and tooltip are in .ring-tip; an unaffordable or locked one is greyed
   (aria-disabled, so it can still be hovered and long-pressed for its tooltip). */
.platform-option .icon { width: 30px; height: 30px; }
.platform-option.off { filter: grayscale(.8) brightness(.6); cursor: not-allowed; }
.platform-option.locked::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: rgba(0, 0, 0, .35); pointer-events: none; z-index: 1; }
.platform-option[data-count]::after { content: attr(data-count); position: absolute; right: -4px; bottom: -3px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: #1c4f17; color: #eaffd9; font: 700 12px/20px var(--body); text-align: center; box-shadow: 0 0 0 1px var(--m-hi); z-index: 3; pointer-events: none; }
.platform-option[style*="--prog"]::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(rgba(150, 240, 120, .95) calc(var(--prog) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); pointer-events: none; z-index: 2; }
.platform-option.revive { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px #e6c35a, 0 0 0 5px var(--m-edge), 0 0 14px rgba(230, 195, 90, .55), 0 4px 14px rgba(0, 0, 0, .6); }
/* BFME1's on-map buttons (Uruk Pit radial, docs/research/bfme-refs): a painting in a thin gold-rimmed OVAL, bright gold when it
   can be used, dim when it cannot. The box stays as wide as the ring layout assumes and is 16 % shorter, so no neighbour
   is nearer than before; the centre is still (--dx, --dy). */
.platform-option { height: calc(var(--d, 72px) * .84); top: calc(var(--dy) - var(--d, 72px) * .42); border-radius: 50%; background: radial-gradient(ellipse at 50% 28%, #3b2d15, #150e06 78%);
  box-shadow: 0 0 0 2.5px #dcb95a, 0 0 0 4px #1d1407, 0 4px 12px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 236, 160, .4); }
.platform-close { box-shadow: 0 0 0 2px #dcb95a, 0 0 0 3.5px #1d1407, 0 3px 10px rgba(0, 0, 0, .6); }
.platform-option:not(:disabled):hover, .platform-option:focus-visible { box-shadow: 0 0 0 2.5px #ffe27a, 0 0 0 4px #1d1407, 0 0 18px rgba(255, 214, 90, .8), inset 0 0 0 1px rgba(255, 244, 190, .5); outline: none; }
.platform-option.off, .platform-option.locked { box-shadow: 0 0 0 2.5px #8d7f4f, 0 0 0 4px #1d1407, 0 4px 12px rgba(0, 0, 0, .6); }
.platform-option.revive { box-shadow: 0 0 0 2.5px #f1d36d, 0 0 0 4px #1d1407, 0 0 14px rgba(230, 195, 90, .6), 0 4px 14px rgba(0, 0, 0, .6); }
.platform-option.off:not(:disabled):hover, .platform-option.off:focus-visible { box-shadow: 0 0 0 2.5px #8d7f4f, 0 0 0 4px #1d1407, 0 4px 12px rgba(0, 0, 0, .6); }
.ring-tip { position: fixed; left: 0; top: 0; z-index: 13; max-width: min(300px, calc(100vw - 16px)); display: grid; gap: 2px; padding: 7px 10px; border-radius: 3px; background: var(--f-panel-solid); color: var(--f-text); box-shadow: 0 0 0 1px var(--m-lo), 0 0 0 2px var(--m-edge), 0 6px 18px rgba(0, 0, 0, .55); pointer-events: none; font: 500 12px/1.3 var(--body); }
.ring-tip[hidden] { display: none; }
.ring-tip-name { font: 700 13px/1.2 var(--body); color: var(--f-accent); }
.ring-tip-cost:not(:empty) { font-weight: 700; }
.ring-tip-text:not(:empty) { opacity: .85; white-space: pre-line; }
@media (pointer: coarse) {
  .platform-close { width: 44px; height: 44px; left: -22px; top: -22px; }
}

/* ---- The Powers screen: a full-screen orb with a tiered medallion tree (ui.md §2), one skin for every faction ---- */
#spellbook.powers-screen { padding: calc(var(--safe-top) + 12px) calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 12px) calc(var(--safe-left) + 12px); background: radial-gradient(ellipse at 50% 55%, rgba(70, 14, 4, .78), rgba(8, 2, 1, .94) 70%); }
#spellbook.powers-screen::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .32; background: repeating-radial-gradient(circle at 50% 54%, transparent 0 42px, rgba(255, 110, 30, .22) 43px 44px, transparent 45px 70px); }
.powers-stage { position: relative; display: flex; flex-direction: column; align-items: center; width: min(92vmin, 760px); max-height: 100%; animation: orb-in .35s ease-out; }
@keyframes orb-in { from { opacity: 0; transform: scale(.88); } }
.powers-plaque { position: relative; z-index: 2; margin-bottom: -18px; padding: 6px 34px 8px; border-radius: 4px; background: linear-gradient(180deg, #4a1d0c, #1d0a04); box-shadow: 0 0 0 1px #f0a24b, 0 0 0 3px #5a2209, 0 6px 18px rgba(0, 0, 0, .6); }
.powers-plaque h2 { margin: 0; color: #ffe2a8; font: 700 22px var(--display); letter-spacing: .14em; text-transform: uppercase; }
.powers-orb { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; aspect-ratio: 1; max-height: calc(100vh - var(--safe-top) - var(--safe-bottom) - 110px); max-width: calc(100vh - var(--safe-top) - var(--safe-bottom) - 110px); padding: 13% 10% 8%; border-radius: 50%; overflow-y: auto; scrollbar-width: none; background: radial-gradient(circle at 50% 42%, #2a120a 0%, #110604 55%, #050101 78%); box-shadow: 0 0 0 3px #ff8a2a, 0 0 0 7px #4a1606, 0 0 50px rgba(255, 110, 30, .55), inset 0 0 60px rgba(255, 90, 20, .25), inset 0 0 0 2px rgba(255, 190, 110, .35); }
.powers-points { margin: 0; color: #ffd38a; font: 700 15px var(--display); letter-spacing: .1em; text-align: center; text-transform: uppercase; }
.powers-points .powers-number { display: block; margin-top: 4px; font-size: 1.7em; letter-spacing: .04em; }
.powers-intro:empty { display: none; }
.powers-points small { display: block; margin-top: 2px; color: #c9926a; font: 12px var(--body); letter-spacing: 0; text-transform: none; }
.powers-intro { max-width: 34em; margin: 6px 0 0; color: #c8a588; font: italic 12px/1.45 var(--display); text-align: center; }
.powers-tree { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 14px 0 0; padding: 0; list-style: none; }
.powers-tree::before { content: ""; position: absolute; z-index: 0; top: 30px; bottom: 30px; left: 50%; width: 2px; background: linear-gradient(#ffb460, rgba(255, 180, 96, .2)); transform: translateX(-1px); }
.power-tier { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; width: min(520px, 100%); }
.tier-mark { justify-self: end; color: #b4764a; font: 700 13px var(--display); letter-spacing: .1em; }
.medallion { position: relative; display: grid; place-items: center; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 50%; color: #ffe9c0; background: radial-gradient(circle at 50% 32%, #7a4a26, #2a130a 68%, #0b0402); box-shadow: 0 0 0 2px #6b3612, 0 0 0 4px #f0a24b, 0 0 0 6px #2a0d03, 0 4px 14px rgba(0, 0, 0, .7), inset 0 -8px 14px rgba(0, 0, 0, .6); }
.medallion .icon { width: 30px; height: 30px; stroke-width: 1.6; margin-top: -10px; }
.medallion .medal-name { position: absolute; bottom: 18px; font: 600 9px var(--display); letter-spacing: .04em; white-space: nowrap; }
.medallion .medal-state { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); padding: 1px 8px; border-radius: 9px; background: #1a0a04; box-shadow: 0 0 0 1px #9a5a24; color: #ffd38a; font: 700 11px/16px var(--body); white-space: nowrap; }
.medallion kbd { position: absolute; top: -2px; left: -2px; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 3px; border: 0; background: #1a0a04; box-shadow: 0 0 0 1px #9a5a24; color: #ffd38a; font: 700 9px/16px var(--mono); }
.medallion.learned { color: #fff8e4; background: radial-gradient(circle at 50% 32%, #fff2b0, #f0a24b 38%, #7a2c08 75%); box-shadow: 0 0 0 2px #6b3612, 0 0 0 4px #ffe2a0, 0 0 0 6px #2a0d03, 0 0 26px rgba(255, 170, 60, .85); }
.medallion.learned .icon { color: #3a1204; }
.medallion.learned .medal-name { color: #3a1204; }
.medallion.ready:not(:disabled) { animation: medal-ready 1.2s ease-in-out infinite alternate; }
@keyframes medal-ready { to { box-shadow: 0 0 0 2px #6b3612, 0 0 0 4px #ffd27a, 0 0 0 6px #2a0d03, 0 0 22px rgba(255, 170, 60, .7); } }
.medallion:disabled:not(.learned) { filter: grayscale(.75) brightness(.55); cursor: default; }
.medallion:focus-visible { outline: 2px solid #ffe2a0; outline-offset: 6px; }
.medal-text { margin: 0; color: #e6c7a6; font-size: 12px; line-height: 1.35; }
.medal-cost { grid-column: 1 / -1; margin: 18px 0 0; color: #b4865e; font-size: 11px; text-align: center; }
.power-tier .medal-text { grid-column: 3; }
/* Beta 10 B item 12: 1.06's Powers screen shows each medallion's art with its price under it (unaffordable ones faded) and nothing else: no name over the art, no
   numbered tiers, no line joining them (footage; docs/research/beta-2026-10-20-10.md minor 8). The names stay for assistive technology (aria-label) and the status line. */
#spellbook.real-powers .medal-name, #spellbook.real-powers .tier-mark, #spellbook.real-powers .powers-tree::before { display: none; }
/* P7: a tier holds the book's two or three powers side by side (the tree scrolls inside the orb on small screens). */
.powers-tree { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 4px 8px 26px; }
.power-tier .tier-medals { grid-column: 2 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 30px 18px; }
.tier-power { display: flex; flex-direction: column; align-items: center; width: 96px; }
.tier-power .medal-cost { margin-top: 26px; text-align: center; }
.tier-power .medal-name { width: 84%; white-space: normal; line-height: 1.05; text-align: center; bottom: 12px; }
#spellStatus { min-height: 1.4em; margin: 10px 0 0; color: #ffd38a; font-size: 12px; text-align: center; }
.powers-close { position: relative; z-index: 2; margin-top: -20px; min-width: 120px; min-height: 44px; padding: 6px 22px; border: 0; border-radius: 0 0 22px 22px; background: linear-gradient(180deg, #4a1d0c, #1d0a04); color: #ffe2a8; font: 600 15px var(--display); letter-spacing: .1em; box-shadow: 0 0 0 1px #f0a24b, 0 0 0 3px #5a2209, 0 6px 18px rgba(0, 0, 0, .6); }
.powers-close kbd { margin-left: 6px; border: 0; color: #c9926a; font-size: 10px; }
@media (pointer: coarse) { .powers-close kbd, .medallion kbd { display: none; } }

/* ---- Phones: the Powers screen (the battle HUD itself is the thumb arc on every phone-sized screen, below) ---- */
@media (max-width: 700px) and (orientation: portrait) {
  .powers-orb { border-radius: 38% / 18%; aspect-ratio: auto; max-width: none; max-height: calc(100vh - var(--safe-top) - var(--safe-bottom) - 100px); padding: 40px 26px 34px; }
  .powers-points { font-size: 14px; letter-spacing: .06em; }
  .powers-intro { font-size: 11px; }
  .power-tier { grid-template-columns: auto 1fr; gap: 6px 14px; }
  .tier-mark { display: none; }
  .power-tier .medal-text { grid-column: 2; }
  .medal-cost { grid-column: 1 / -1; text-align: left; margin-top: 16px; }
  .power-tier .tier-medals { grid-column: 1 / -1; gap: 26px 10px; }
  .tier-power { width: 68px; padding-bottom: 28px; }
  .tier-power .medallion { width: 58px; height: 58px; }
  .powers-tree::before { display: none; }
  /* The whole book fits with no scrolling (beta 2, major 7): the descriptions go (the tap on a medallion names its power below; aria still reads them) */
  .powers-tree { overflow: visible; gap: 4px; padding-bottom: 10px; }
  .power-tier .tier-medals { gap: 0 4px; }
  .powers-intro, .tier-power .medal-cost { display: none; }
  .power-tier { grid-template-columns: 1fr; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .powers-plaque h2 { font-size: 16px; }
  .powers-orb { border-radius: 40% / 50%; aspect-ratio: auto; max-width: none; width: min(720px, 100%); max-height: calc(100vh - var(--safe-top) - var(--safe-bottom) - 70px); padding: 22px 40px 30px; }
  .powers-tree { flex-direction: row; align-items: flex-start; gap: 18px; }
  .powers-tree::before { top: 36px; bottom: auto; left: 15%; right: 15%; width: auto; height: 2px; transform: none; background: linear-gradient(90deg, #ffb460, rgba(255, 180, 96, .2)); }
  .power-tier { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 4px; width: auto; flex: 1; }
  .tier-mark { display: none; }
  .power-tier .medal-text { grid-column: 1; margin-top: 24px; font-size: 11px; line-height: 1.3; }
  .medal-cost { margin-top: 0; font-size: 10px; line-height: 1.3; }
  .medallion { width: 70px; height: 70px; }
  .medallion .icon { width: 24px; height: 24px; margin-top: -8px; }
  .medallion .medal-name { bottom: 13px; font-size: 8px; }
  .powers-intro { display: none; }
  /* The whole book on one row, no scrolling and nothing clipped (beta 2, major 7: at 844 x 390 half the medallions sat below a 168 px scroll area). Every
     medallion is 52 px with its ring, over a 44 px tap target; the descriptions move to the status line (hover, focus) and to aria-describedby. */
  .powers-stage { width: min(calc(100vw - var(--safe-left) - var(--safe-right) - 24px), 860px); }
  .powers-orb { width: 100%; padding: 16px 22px 22px; border-radius: 34% / 44%; }
  .powers-points small { display: none; }
  .powers-tree { flex-direction: row; justify-content: center; align-items: flex-start; flex-wrap: nowrap; gap: 10px; overflow: visible; width: max-content; max-width: 100%; box-sizing: content-box; padding: 2px 10px 26px; margin-top: 8px; }
  .powers-tree::before { display: none; }
  .power-tier { display: block; flex: 0 0 auto; width: auto; }
  .power-tier .tier-medals { display: flex; flex-wrap: nowrap; gap: 4px; }
  .tier-power { width: 58px; padding-bottom: 6px; }
  .tier-power .medallion { width: 54px; height: 54px; }
  .tier-power .medal-cost, .power-tier .medal-text { display: none; }
  .tier-power .medal-name { bottom: 8px; font-size: 7px; }
  .medallion .icon { width: 20px; height: 20px; margin-top: -8px; }
  .powers-close { margin-top: -14px; }
}

/* Any big screen, tablet or desktop (beta 2 major 7; beta 6 item 9): BFME1 shows the whole tree, so the whole book sits in the orb with no scrolling and the
   descriptions go to the status line (hover, focus). */
@media (min-width: 701px) and (min-height: 541px) {
  .powers-tree { overflow: visible; gap: 6px; padding-bottom: 22px; }
  .powers-tree::before { top: 40px; bottom: 70px; }
  .power-tier { grid-template-columns: 1fr; justify-items: center; }
  .tier-mark { display: none; }
  .power-tier .tier-medals { grid-column: 1; gap: 0 18px; }
  .tier-power { width: 100px; padding-bottom: 30px; }
  .tier-power .medallion { width: 80px; height: 80px; }
  .tier-power .medal-cost, .power-tier .medal-text, .powers-intro { display: none; }
}
/* A 720-line screen (1280x720): the orb is 600 px tall, so the four tiers close up to stay clear of the Close plaque. */
@media (min-width: 701px) and (min-height: 541px) and (max-height: 820px) {
  .powers-orb { padding: 9% 8% 5%; }
  .powers-tree { gap: 2px; padding-bottom: 16px; }
  .tier-power { width: 92px; padding-bottom: 24px; }
  .tier-power .medallion { width: 70px; height: 70px; }
  .tier-power .medal-name { bottom: 9px; font-size: 8px; }
  .medallion .icon { width: 26px; height: 26px; }
  .powers-tree::before { top: 34px; bottom: 60px; }
}

/* Coarse pointers: keyboard hints go; every target is at least 44 px */
@media (pointer: coarse) {
  .sock kbd, .command-buttons kbd, .pbtn > kbd, .ability-btn kbd { display: none; }
  .desktop-hint { display: none; }
  .touch-hint { display: inline; }
  #hud .compact-btn, #cancelMode { min-height: 44px; }
  .bbtn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .platform-option, .powers-stage, .sock.armed, .medallion.ready { animation: none !important; }
}
@media (prefers-contrast: more) {
  #hud { --f-panel: #0b0805; --f-muted: #e6dccb; }
}

/* ---- Per-faction materials (ui.md §4) ---- */
/* Gondor: gilt bronze with engraved scrollwork, a steel-blue crystal */
#hud[data-faction="men"] {
  --m-hi: #f8e2a2; --m-mid: #c4964a; --m-lo: #6e4a19; --m-edge: #24170a; --m-glint: #fff7d8;
  --f-panel: rgba(18, 16, 14, .9); --f-panel-solid: #15120e; --f-accent: #f5dc9c; --f-icon: #f8f0da; --f-glow: rgba(150, 196, 255, .55);
  --glass-a: #b6d4f2; --glass-b: #23446c; --glass-c: #060c18; --paint-sky: #8ba7c8; --paint-earth: #1f2d42;
}
/* Rohan: pewter with knotwork, a socket chain around the crystal, a green-gold field */
#hud[data-faction="rohan"] {
  --m-hi: #e7ebe6; --m-mid: #9aa19c; --m-lo: #545b57; --m-edge: #1c201e; --m-glint: #ffffff;
  --f-panel: rgba(18, 22, 16, .9); --f-panel-solid: #141a12; --f-accent: #f2d98c; --f-icon: #fbf5e2; --f-glow: rgba(255, 214, 120, .5);
  --f-display: "Uncial Antiqua", "Cinzel", serif;
  --glass-a: #d8e7b8; --glass-b: #4c6a34; --glass-c: #0b1206; --paint-sky: #a8c07c; --paint-earth: #2d3a1a;
}
/* Mordor: blackened iron with spikes, rust and red */
#hud[data-faction="mordor"] {
  --m-hi: #8a6e62; --m-mid: #4a3833; --m-lo: #2a1d1a; --m-edge: #0b0605; --m-glint: #d9643c;
  --f-panel: rgba(14, 8, 7, .92); --f-panel-solid: #130b09; --f-text: #f1e2d8; --f-muted: #c5a394; --f-accent: #ff8a5a; --f-icon: #ffd9c2; --f-glow: rgba(255, 80, 30, .6);
  --f-display: "Pirata One", "Cinzel", serif;
  --glass-a: #ffb07a; --glass-b: #8a1d08; --glass-c: #120302; --paint-sky: #c25a34; --paint-earth: #2a0d06;
}
/* Isengard: plain dark iron and grey steel */
#hud[data-faction="isengard"] {
  --m-hi: #b9c0c6; --m-mid: #6c747b; --m-lo: #3a4045; --m-edge: #111416; --m-glint: #eef2f5;
  --f-panel: rgba(14, 16, 18, .92); --f-panel-solid: #121517; --f-accent: #e9edf0; --f-icon: #f4f5f2; --f-glow: rgba(255, 150, 70, .5);
  --f-display: "IM Fell English SC", "Cinzel", serif;
  --glass-a: #c9d0d6; --glass-b: #3a4249; --glass-c: #07090a; --paint-sky: #8e979e; --paint-earth: #24292d;
}

/* Faction ornaments: palantir surround, atlas bezel band and plaque band (our own SVG, generated once). */
#hud[data-faction="men"] {
  --orn-pal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M188 100L197 100' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M187.25 111.49L193.2 112.27' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M185 122.78L190.8 124.33' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M181.3 133.68L186.84 135.97' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M176.21 144L184 148.5' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M169.82 153.57L174.58 157.22' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M162.23 162.23L166.47 166.47' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M153.57 169.82L157.22 174.58' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M144 176.21L148.5 184' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M133.68 181.3L135.97 186.84' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M122.78 185L124.33 190.8' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M111.49 187.25L112.27 193.2' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M100 188L100 197' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M88.51 187.25L87.73 193.2' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M77.22 185L75.67 190.8' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M66.32 181.3L64.03 186.84' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M56 176.21L51.5 184' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M46.43 169.82L42.78 174.58' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M37.77 162.23L33.53 166.47' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M30.18 153.57L25.42 157.22' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M23.79 144L16 148.5' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M18.7 133.68L13.16 135.97' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M15 122.78L9.2 124.33' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M12.75 111.49L6.8 112.27' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M12 100L3 100' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M12.75 88.51L6.8 87.73' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M15 77.22L9.2 75.67' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M18.7 66.32L13.16 64.03' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M23.79 56L16 51.5' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M30.18 46.43L25.42 42.78' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M37.77 37.77L33.53 33.53' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M46.43 30.18L42.78 25.42' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M56 23.79L51.5 16' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M66.32 18.7L64.03 13.16' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M77.22 15L75.67 9.2' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M88.51 12.75L87.73 6.8' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M100 12L100 3' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M111.49 12.75L112.27 6.8' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M122.78 15L124.33 9.2' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M133.68 18.7L135.97 13.16' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M144 23.79L148.5 16' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M153.57 30.18L157.22 25.42' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M162.23 37.77L166.47 33.53' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M169.82 46.43L174.58 42.78' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M176.21 56L184 51.5' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M181.3 66.32L186.84 64.03' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M185 77.22L190.8 75.67' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cpath d='M187.25 88.51L193.2 87.73' stroke='%235a3b12' stroke-width='1.2' stroke-opacity='.75'/%3E%3Cg transform='translate(165.05 165.05) rotate(135)'%3E%3Cpath d='M0 -7C4 -3 4 3 0 7C-4 3 -4 -3 0 -7Z' fill='%23fff1c2' fill-opacity='.8' stroke='%236b4716' stroke-width='1'/%3E%3Cpath d='M-8 0C-5 -4 -2 -4 0 0C2 -4 5 -4 8 0' fill='none' stroke='%236b4716' stroke-width='1.2'/%3E%3C/g%3E%3Cg transform='translate(34.95 165.05) rotate(225)'%3E%3Cpath d='M0 -7C4 -3 4 3 0 7C-4 3 -4 -3 0 -7Z' fill='%23fff1c2' fill-opacity='.8' stroke='%236b4716' stroke-width='1'/%3E%3Cpath d='M-8 0C-5 -4 -2 -4 0 0C2 -4 5 -4 8 0' fill='none' stroke='%236b4716' stroke-width='1.2'/%3E%3C/g%3E%3Cg transform='translate(34.95 34.95) rotate(315)'%3E%3Cpath d='M0 -7C4 -3 4 3 0 7C-4 3 -4 -3 0 -7Z' fill='%23fff1c2' fill-opacity='.8' stroke='%236b4716' stroke-width='1'/%3E%3Cpath d='M-8 0C-5 -4 -2 -4 0 0C2 -4 5 -4 8 0' fill='none' stroke='%236b4716' stroke-width='1.2'/%3E%3C/g%3E%3Cg transform='translate(165.05 34.95) rotate(405)'%3E%3Cpath d='M0 -7C4 -3 4 3 0 7C-4 3 -4 -3 0 -7Z' fill='%23fff1c2' fill-opacity='.8' stroke='%236b4716' stroke-width='1'/%3E%3Cpath d='M-8 0C-5 -4 -2 -4 0 0C2 -4 5 -4 8 0' fill='none' stroke='%236b4716' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E");
  --orn-mm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%235a3b12' stroke-width='1.3' stroke-opacity='.8'%3E%3Cpath d='M194 100Q198.52 109.7 192.19 118.34Q185.17 125.84 186.84 135.97'/%3E%3Cpath d='M186.84 135.97Q187.31 146.67 178.16 152.22Q168.8 156.46 166.47 166.47'/%3E%3Cpath d='M166.47 166.47Q162.8 176.53 152.22 178.16Q141.95 178.49 135.97 186.84'/%3E%3Cpath d='M135.97 186.84Q128.74 194.74 118.34 192.19Q108.72 188.57 100 194'/%3E%3Cpath d='M100 194Q90.3 198.52 81.66 192.19Q74.16 185.17 64.03 186.84'/%3E%3Cpath d='M64.03 186.84Q53.33 187.31 47.78 178.16Q43.54 168.8 33.53 166.47'/%3E%3Cpath d='M33.53 166.47Q23.47 162.8 21.84 152.22Q21.51 141.95 13.16 135.97'/%3E%3Cpath d='M13.16 135.97Q5.26 128.74 7.81 118.34Q11.43 108.72 6 100'/%3E%3Cpath d='M6 100Q1.48 90.3 7.81 81.66Q14.83 74.16 13.16 64.03'/%3E%3Cpath d='M13.16 64.03Q12.69 53.33 21.84 47.78Q31.2 43.54 33.53 33.53'/%3E%3Cpath d='M33.53 33.53Q37.2 23.47 47.78 21.84Q58.05 21.51 64.03 13.16'/%3E%3Cpath d='M64.03 13.16Q71.26 5.26 81.66 7.81Q91.28 11.43 100 6'/%3E%3Cpath d='M100 6Q109.7 1.48 118.34 7.81Q125.84 14.83 135.97 13.16'/%3E%3Cpath d='M135.97 13.16Q146.67 12.69 152.22 21.84Q156.46 31.2 166.47 33.53'/%3E%3Cpath d='M166.47 33.53Q176.53 37.2 178.16 47.78Q178.49 58.05 186.84 64.03'/%3E%3Cpath d='M186.84 64.03Q194.74 71.26 192.19 81.66Q188.57 91.28 194 100'/%3E%3C/g%3E%3C/svg%3E");
  --orn-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='14'%3E%3Cpath d='M0 7C4 1 9 1 9 5S5 9 3 7M18 7C14 13 9 13 9 9S13 5 15 7M18 7C22 1 27 1 27 5S23 9 21 7M36 7C32 13 27 13 27 9S31 5 33 7' fill='none' stroke='%23fff0c4' stroke-opacity='.5' stroke-width='1.1'/%3E%3C/svg%3E");
}
#hud[data-faction="rohan"] {
  --orn-pal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Ccircle cx='100' cy='100' r='91' fill='none' stroke='%232b302d' stroke-width='5'/%3E%3Ccircle cx='100' cy='100' r='91' fill='none' stroke='%23c9cec9' stroke-width='1.4' stroke-dasharray='5 4'/%3E%3Ccircle cx='100' cy='9' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='100' cy='9' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3Ccircle cx='153.49' cy='26.38' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='153.49' cy='26.38' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3Ccircle cx='186.55' cy='71.88' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='186.55' cy='71.88' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3Ccircle cx='186.55' cy='128.12' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='186.55' cy='128.12' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3Ccircle cx='153.49' cy='173.62' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='153.49' cy='173.62' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3Ccircle cx='100' cy='191' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='100' cy='191' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3Ccircle cx='46.51' cy='173.62' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='46.51' cy='173.62' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3Ccircle cx='13.45' cy='128.12' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='13.45' cy='128.12' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3Ccircle cx='13.45' cy='71.88' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='13.45' cy='71.88' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3Ccircle cx='46.51' cy='26.38' r='8.5' fill='%233a403c' stroke='%23dfe3de' stroke-width='2'/%3E%3Ccircle cx='46.51' cy='26.38' r='4.5' fill='%230d100e' stroke='%237d847f' stroke-width='1'/%3E%3C/svg%3E");
  --orn-mm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke-width='2.2'%3E%3Cpath d='M194 100L196.7 105.07L196.8 110.17L193.91 114.87L189.93 119.12L187.42 123.42L187.44 128.41L188.77 134.07L188.91 139.59L186.28 143.96L181.41 147L176.46 149.65L173.35 153.3L172.21 158.48L171.38 164.27L168.94 168.94L164.27 171.38L158.48 172.21L153.3 173.35L149.65 176.46L147 181.41L143.96 186.28L139.59 188.91L134.07 188.77L128.41 187.44L123.42 187.42L119.12 189.93L114.87 193.91L110.17 196.8L105.07 196.7L100 194L95.23 191.04L90.52 190.17L85.46 191.77L80.03 193.96L74.77 194.18L70.32 191.36L66.7 186.75L63.12 182.83L58.61 181.23L53 181.41L47.26 181.21L42.79 178.74L40.16 173.89L38.48 168.33L36.01 163.99L31.67 161.52L26.11 159.84L21.26 157.21L18.79 152.74L18.59 147L18.77 141.39L17.17 136.88L13.25 133.3L8.64 129.68L5.82 125.23L6.04 119.97L8.23 114.54L9.83 109.48L8.96 104.77L6 100L3.3 94.93L3.2 89.83L6.09 85.13L10.07 80.88L12.58 76.58L12.56 71.59L11.23 65.93L11.09 60.41L13.72 56.04L18.59 53L23.54 50.35L26.65 46.7L27.79 41.52L28.62 35.73L31.06 31.06L35.73 28.62L41.52 27.79L46.7 26.65L50.35 23.54L53 18.59L56.04 13.72L60.41 11.09L65.93 11.23L71.59 12.56L76.58 12.58L80.88 10.07L85.13 6.09L89.83 3.2L94.93 3.3L100 6L104.77 8.96L109.48 9.83L114.54 8.23L119.97 6.04L125.23 5.82L129.68 8.64L133.3 13.25L136.88 17.17L141.39 18.77L147 18.59L152.74 18.79L157.21 21.26L159.84 26.11L161.52 31.67L163.99 36.01L168.33 38.48L173.89 40.16L178.74 42.79L181.21 47.26L181.41 53L181.23 58.61L182.83 63.12L186.75 66.7L191.36 70.32L194.18 74.77L193.96 80.03L191.77 85.46L190.17 90.52L191.04 95.23L194 100' stroke='%23e3e7e2' stroke-opacity='.85'/%3E%3Cpath d='M194 100L191.04 104.77L190.17 109.48L191.77 114.54L193.96 119.97L194.18 125.23L191.36 129.68L186.75 133.3L182.83 136.88L181.23 141.39L181.41 147L181.21 152.74L178.74 157.21L173.89 159.84L168.33 161.52L163.99 163.99L161.52 168.33L159.84 173.89L157.21 178.74L152.74 181.21L147 181.41L141.39 181.23L136.88 182.83L133.3 186.75L129.68 191.36L125.23 194.18L119.97 193.96L114.54 191.77L109.48 190.17L104.77 191.04L100 194L94.93 196.7L89.83 196.8L85.13 193.91L80.88 189.93L76.58 187.42L71.59 187.44L65.93 188.77L60.41 188.91L56.04 186.28L53 181.41L50.35 176.46L46.7 173.35L41.52 172.21L35.73 171.38L31.06 168.94L28.62 164.27L27.79 158.48L26.65 153.3L23.54 149.65L18.59 147L13.72 143.96L11.09 139.59L11.23 134.07L12.56 128.41L12.58 123.42L10.07 119.12L6.09 114.87L3.2 110.17L3.3 105.07L6 100L8.96 95.23L9.83 90.52L8.23 85.46L6.04 80.03L5.82 74.77L8.64 70.32L13.25 66.7L17.17 63.12L18.77 58.61L18.59 53L18.79 47.26L21.26 42.79L26.11 40.16L31.67 38.48L36.01 36.01L38.48 31.67L40.16 26.11L42.79 21.26L47.26 18.79L53 18.59L58.61 18.77L63.12 17.17L66.7 13.25L70.32 8.64L74.77 5.82L80.03 6.04L85.46 8.23L90.52 9.83L95.23 8.96L100 6L105.07 3.3L110.17 3.2L114.87 6.09L119.12 10.07L123.42 12.58L128.41 12.56L134.07 11.23L139.59 11.09L143.96 13.72L147 18.59L149.65 23.54L153.3 26.65L158.48 27.79L164.27 28.62L168.94 31.06L171.38 35.73L172.21 41.52L173.35 46.7L176.46 50.35L181.41 53L186.28 56.04L188.91 60.41L188.77 65.93L187.44 71.59L187.42 76.58L189.93 80.88L193.91 85.13L196.8 89.83L196.7 94.93L194 100' stroke='%238d938f' stroke-opacity='.85'/%3E%3C/g%3E%3C/svg%3E");
  --orn-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='14'%3E%3Cpath d='M0 7C6 -1 18 15 24 7M0 7C6 15 18 -1 24 7' fill='none' stroke='%23e9ede8' stroke-opacity='.55' stroke-width='1.6'/%3E%3Cpath d='M0 7C6 -1 18 15 24 7' fill='none' stroke='%23222724' stroke-opacity='.6' stroke-width='.6'/%3E%3C/svg%3E");
}
#hud[data-faction="mordor"] {
  --orn-pal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M185.67 92.53L195 100L185.67 107.47Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M184.97 113.25L197.09 123.93L181.4 127.76Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M179.33 133.2L184.12 144.15L172.39 146.43Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M169.08 151.22L174.85 166.31L159.17 162.41Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M154.82 166.26L153.97 178.18L142.52 174.75Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M137.37 177.46L135.46 193.5L123.39 182.76Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M117.74 184.15L111.45 194.31L102.91 185.95Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M97.09 185.95L87.95 199.27L82.26 184.15Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M76.61 182.76L66.31 188.83L62.63 177.46Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M57.48 174.75L43.19 182.3L45.18 166.26Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M40.83 162.41L28.89 163L30.92 151.22Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M27.61 146.43L11.45 146.47L20.67 133.2Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M18.6 127.76L7.76 122.73L15.03 113.25Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M14.33 107.47L0 100L14.33 92.53Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M15.03 86.75L7.76 77.27L18.6 72.24Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M20.67 66.8L11.45 53.53L27.61 53.57Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M30.92 48.78L28.89 37L40.83 37.59Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M45.18 33.74L43.19 17.7L57.48 25.25Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M62.63 22.54L66.31 11.17L76.61 17.24Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M82.26 15.85L87.95 0.73L97.09 14.05Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M102.91 14.05L111.45 5.69L117.74 15.85Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M123.39 17.24L135.46 6.5L137.37 22.54Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M142.52 25.25L153.97 21.82L154.82 33.74Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M159.17 37.59L174.85 33.69L169.08 48.78Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M172.39 53.57L184.12 55.85L179.33 66.8Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M181.4 72.24L197.09 76.07L184.97 86.75Z' fill='%232a1d1a' stroke='%238c2d1c' stroke-width='1.1' stroke-linejoin='round'/%3E%3Ccircle cx='100' cy='100' r='86' fill='none' stroke='%231a100e' stroke-width='3'/%3E%3Ccircle cx='100' cy='100' r='84' fill='none' stroke='%23b13a1f' stroke-opacity='.55' stroke-width='1'/%3E%3C/svg%3E");
  --orn-mm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M191.9 95.67L200 100L191.9 104.33Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M191.44 110.1L198.77 115.64L190.09 118.66Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M188.74 124.28L195.11 130.9L186.06 132.52Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M183.85 137.86L189.1 145.4L179.91 145.58Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M176.89 150.51L180.9 158.78L171.8 157.52Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M168.05 161.92L170.71 170.71L161.92 168.05Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M157.52 171.8L158.78 180.9L150.51 176.89Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M145.58 179.91L145.4 189.1L137.86 183.85Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M132.52 186.06L130.9 195.11L124.28 188.74Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M118.66 190.09L115.64 198.77L110.1 191.44Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M104.33 191.9L100 200L95.67 191.9Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M89.9 191.44L84.36 198.77L81.34 190.09Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M75.72 188.74L69.1 195.11L67.48 186.06Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M62.14 183.85L54.6 189.1L54.42 179.91Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M49.49 176.89L41.22 180.9L42.48 171.8Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M38.08 168.05L29.29 170.71L31.95 161.92Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M28.2 157.52L19.1 158.78L23.11 150.51Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M20.09 145.58L10.9 145.4L16.15 137.86Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M13.94 132.52L4.89 130.9L11.26 124.28Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M9.91 118.66L1.23 115.64L8.56 110.1Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M8.1 104.33L0 100L8.1 95.67Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M8.56 89.9L1.23 84.36L9.91 81.34Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M11.26 75.72L4.89 69.1L13.94 67.48Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M16.15 62.14L10.9 54.6L20.09 54.42Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M23.11 49.49L19.1 41.22L28.2 42.48Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M31.95 38.08L29.29 29.29L38.08 31.95Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M42.48 28.2L41.22 19.1L49.49 23.11Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M54.42 20.09L54.6 10.9L62.14 16.15Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M67.48 13.94L69.1 4.89L75.72 11.26Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M81.34 9.91L84.36 1.23L89.9 8.56Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M95.67 8.1L100 0L104.33 8.1Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M110.1 8.56L115.64 1.23L118.66 9.91Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M124.28 11.26L130.9 4.89L132.52 13.94Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M137.86 16.15L145.4 10.9L145.58 20.09Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M150.51 23.11L158.78 19.1L157.52 28.2Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M161.92 31.95L170.71 29.29L168.05 38.08Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M171.8 42.48L180.9 41.22L176.89 49.49Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M179.91 54.42L189.1 54.6L183.85 62.14Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M186.06 67.48L195.11 69.1L188.74 75.72Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3Cpath d='M190.09 81.34L198.77 84.36L191.44 89.9Z' fill='%233a2723' stroke='%237d2616' stroke-width='.8'/%3E%3C/svg%3E");
  --orn-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14'%3E%3Cpath d='M0 14L4 3L8 14ZM8 14L12 6L16 14Z' fill='%23140c0a' stroke='%239c2f1b' stroke-opacity='.7' stroke-width='.8'/%3E%3C/svg%3E");
}
#hud[data-faction="isengard"] {
  --orn-pal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Ccircle cx='100' cy='100' r='92' fill='none' stroke='%231d2124' stroke-width='2'/%3E%3Ccircle cx='185' cy='135.21' r='3.6' fill='%239aa1a8' stroke='%23202427' stroke-width='1.2'/%3E%3Ccircle cx='135.21' cy='185' r='3.6' fill='%239aa1a8' stroke='%23202427' stroke-width='1.2'/%3E%3Ccircle cx='64.79' cy='185' r='3.6' fill='%239aa1a8' stroke='%23202427' stroke-width='1.2'/%3E%3Ccircle cx='15' cy='135.21' r='3.6' fill='%239aa1a8' stroke='%23202427' stroke-width='1.2'/%3E%3Ccircle cx='15' cy='64.79' r='3.6' fill='%239aa1a8' stroke='%23202427' stroke-width='1.2'/%3E%3Ccircle cx='64.79' cy='15' r='3.6' fill='%239aa1a8' stroke='%23202427' stroke-width='1.2'/%3E%3Ccircle cx='135.21' cy='15' r='3.6' fill='%239aa1a8' stroke='%23202427' stroke-width='1.2'/%3E%3Ccircle cx='185' cy='64.79' r='3.6' fill='%239aa1a8' stroke='%23202427' stroke-width='1.2'/%3E%3C/svg%3E");
  --orn-mm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Ccircle cx='194' cy='100' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='181.41' cy='147' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='147' cy='181.41' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='100' cy='194' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='53' cy='181.41' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='18.59' cy='147' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='6' cy='100' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='18.59' cy='53' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='53' cy='18.59' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='100' cy='6' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='147' cy='18.59' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3Ccircle cx='181.41' cy='53' r='2.8' fill='%23a5acb2' stroke='%231d2124' stroke-width='1'/%3E%3C/svg%3E");
  --orn-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='14'%3E%3Ccircle cx='6' cy='7' r='1.9' fill='%23a5acb2' stroke='%2313171a' stroke-width='.8'/%3E%3Cpath d='M14 7H40' stroke='%2313171a' stroke-opacity='.6'/%3E%3C/svg%3E");
}

/* Gold over a fallen creep lair (ADR 006 phase 2): rises and fades over its spot (main.js popText). */
#popLayer { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.pop-text { position: absolute; left: 0; top: 0; font: 700 18px/1 var(--font-display, Georgia, serif); color: #f1d9a0; text-shadow: 0 1px 0 #2a1806, 0 0 8px rgba(0, 0, 0, .7); white-space: nowrap; letter-spacing: .02em; }
/* BFME1's floating "+N" income text (main.js floatCash, FloatText.js): the owner's colour, a black drop shadow one pixel down and right with the same alpha. */
#floatLayer { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.float-cash { position: absolute; left: 0; top: 0; font: 700 16px/1 var(--font-display, Georgia, serif); white-space: nowrap; letter-spacing: .02em; text-shadow: 1px 1px 0 rgba(0, 0, 0, var(--fa, 1)); will-change: transform, opacity; }
/* BFME1's small plain white "Building: NN%" over a structure going up (main.js placeBuildLabels). */
#buildLabelLayer { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.build-label { position: absolute; left: 0; top: 0; font: 600 11px/1 var(--font-display, Georgia, serif); color: #fff; text-shadow: 0 1px 1px #000, 0 0 4px rgba(0, 0, 0, .85); white-space: nowrap; letter-spacing: .03em; will-change: transform; }
.pop-text.mine { color: #ffd34a; font-size: 22px; text-shadow: 0 1px 0 #3a2204, 0 0 10px rgba(255, 196, 64, .55), 0 0 2px #000; }

/* ---- The real BFME1 art (task H1): only with a pack installed (body.real-ui, src/game/ui/RealHud.js). ----
   The button paintings, portraits and frame pieces come from the pack as `.ra` spans and `--rp-*` backgrounds (set on
   <body> per battle); the layout, hit targets and safe areas stay ours. Nothing here applies without a pack. */
.real-ui .ra { position: absolute; inset: 3px; border-radius: 50%; pointer-events: none; z-index: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55), inset 0 -5px 9px rgba(0, 0, 0, .35); }
.real-ui :is(.sock, .command-buttons > button, .pbtn, .ability-btn, .bbtn, .platform-option, .medallion):has(> .ra) > .icon,
.real-ui .ability-btn:has(> .ra) > .ability-glyph { display: none; }
.real-ui :is(.sock, .command-buttons > button, .pbtn, .ability-btn):has(> .ra) { background: #0b0805; }
.real-ui .ability-btn.locked .ra, .real-ui .ability-btn.cooling .ra { opacity: .55; }
.real-ui .sock kbd, .real-ui .pbtn > kbd, .real-ui .ability-btn kbd, .real-ui .command-buttons kbd { z-index: 2; }
.real-ui .ability-btn .ability-lock, .real-ui .pbtn .cd { z-index: 2; }
/* A socket's metal ring: the palantír's gold ring piece over the painting */
.real-ui .ra-ring { position: absolute; inset: -4px; border-radius: 50%; background: var(--rp-ring, none); pointer-events: none; z-index: 1; }
/* Build panel and plot ring: the construct buttons */
.real-ui .bbtn > .ra { position: relative; inset: auto; display: block; width: 52px; height: 52px; flex: none; box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-hi), 0 0 0 5px var(--m-edge), 0 3px 8px rgba(0, 0, 0, .6); }
.real-ui .bbtn:not(:disabled):hover > .ra { box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3.5px var(--m-glint), 0 0 0 5px var(--m-edge), 0 0 16px var(--f-glow); }
.real-ui .platform-option:has(> .ra) { background: rgba(8, 5, 3, .55); }
.real-ui .platform-option > .ra { inset: 4px; opacity: .92; }
.real-ui .platform-option:has(> .ra) > span:not(.ra) { position: relative; z-index: 1; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
/* The palantír: the unit's painted portrait under the crystal's highlights, inside the gold ring */
.real-ui .palantir .pal-glass { background: radial-gradient(circle at 50% 45%, #1b2638, #04070c 75%); }
.real-ui .pal-glass::after { left: 0; top: 0; width: 100%; height: 100%; border-radius: 50%; background: var(--rp-glass, none); transform: none; opacity: .9; z-index: 2; }
.real-ui .portrait .ra-portrait { inset: 0; border-radius: 50%; box-shadow: inset 0 0 18px rgba(0, 0, 0, .85); }
.real-ui .pal-ring { background: var(--rp-ring, none); inset: -7%; }
/* The atlas: the parchment disc under the map and the gold ring around it */
.real-ui #minimapWrap .mm-ring { background: var(--rp-ring, none); inset: -3%; z-index: 1; }
.real-ui #minimapWrap::before { content: ""; position: absolute; inset: 5%; border-radius: 50%; background: var(--rp-parchment, none); pointer-events: none; }
.real-ui #minimap { background: var(--rp-parchment, #d8c49a); } /* the palantír atlas's own parchment disc under the ink (beta 8 item 13; the cluster picture has an open hole there) */
/* Rim buttons: the faction crest (powers), the banner flag (outposts) and the key (objectives) */
.real-ui .rim-btn { background: #0b0805; }
.real-ui .rim-btn > .icon { opacity: 0; }
.real-ui .rim-btn::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; pointer-events: none; }
.real-ui .rim-a::before { background: var(--rp-keyGold, none); }
.real-ui .rim-b::before { background: var(--rp-crest, none); inset: -2px; }
.real-ui .rim-b:not(:disabled):hover::before { background: var(--rp-crest-lit, var(--rp-crest, none)); }
.real-ui .rim-c::before { background: var(--rp-flag, none); }
/* the evil Powers button is the One Ring (Palantir.apt geometry 209, in the PlayerMagic button), not a crest: it sits inside the round like the key and the flag */
.real-ui .rim-b.ring::before { inset: 6px; }
/* Hero icons (column and recruit sockets) */
.real-ui .ra.hero-crest { inset: 3px; width: auto; height: auto; }
.real-ui .hero-icon.reviving .ra { filter: grayscale(1) brightness(.55); }
.real-ui .sock.fallen .ra { filter: grayscale(.8); }
/* Tooltip: BFME's dark panel with a thin gold frame */
.real-ui .sock-tip { background: linear-gradient(180deg, rgba(20, 14, 8, .97), rgba(8, 5, 3, .97)); box-shadow: 0 0 0 1px #d8b46a, 0 0 0 2px #2a1a08, 0 8px 24px rgba(0, 0, 0, .6); }
/* The Powers screen: the orb, the header plaque, the medallion rings and the close tab */
.real-ui .powers-orb { background: var(--rp-ss-orb, none), radial-gradient(circle at 50% 42%, #2a120a 0%, #110604 55%, #050101 78%); box-shadow: 0 0 50px rgba(255, 110, 30, .45); }
.real-ui .powers-plaque { background: var(--rp-ss-header, none); box-shadow: none; padding: 14px 70px 18px; }
.real-ui .powers-close { background: var(--rp-ss-closeTab, none); box-shadow: none; width: 250px; height: 66px; padding: 26px 0 0; font-size: 13px; }
.real-ui .medallion:has(> .ra) { background: #0b0402; }
.real-ui .medallion > .ra { inset: 5px; }
.real-ui .medallion:has(> .ra)::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; background: var(--rp-ss-medalRing, none); pointer-events: none; z-index: 1; }
.real-ui .medallion.learned:has(> .ra)::before { background: var(--rp-ss-medalGold, var(--rp-ss-medalRing, none)); }
.real-ui .medallion:has(> .ra) .medal-name { z-index: 2; bottom: 6px; padding: 0 4px; border-radius: 6px; background: rgba(10, 4, 2, .7); color: #ffe9c0; }
.real-ui .medallion:has(> .ra) :is(.medal-state, kbd) { z-index: 2; }
@media (max-width: 700px) and (orientation: portrait) {
  .real-ui .powers-orb { background: var(--rp-ss-orb, none) center / contain no-repeat, radial-gradient(circle at 50% 42%, #2a120a 0%, #110604 55%, #050101 78%); }
}
@media (orientation: landscape) and (max-height: 540px) {
  .real-ui .powers-orb { background: var(--rp-ss-orb, none) center / contain no-repeat, radial-gradient(ellipse at 50% 50%, #2a120a 0%, #110604 55%, #050101 78%); }
  .real-ui .powers-plaque { padding: 8px 50px 12px; }
}

/* ---- BFME1's own bezel (body.real-frame: the pack's ui/hud.json, from apt/PalantirExport.big) ----
   One picture holds the atlas ring, the palantír ring and the resource plaque (art px; 384 x 256), so every piece is
   placed from its measured geometry (--rf-*, set by RealHud.frameVars) scaled by --k, CSS px per art px: the atlas
   keeps its --mm diameter. The glass of the atlas and the palantír sit under the picture (its rings overlap them), the
   buttons, the plaque text and the order ring over it. Desk layout only; without the pack the drawn bezel above stays. */
.rf-frame { display: none; }
:root:not([data-hud="arc"]) body.real-frame #hud {
  --k: calc(var(--mm) / (var(--rf-mmo) * 2));
  --mm-bottom: calc(var(--gy) + var(--k) * (var(--rf-h) - var(--rf-mmcy)) - var(--mm) / 2);
  --pal: calc(var(--k) * var(--rf-po) * 2);
  --pal-cx: calc(var(--gx) + var(--mm) / 2 + var(--k) * (var(--rf-pcx) - var(--rf-mmcx)));
  --pal-cy: calc(var(--mm-bottom) + var(--mm) / 2 - var(--k) * (var(--rf-pcy) - var(--rf-mmcy)));
  --rf-left: calc(var(--gx) + var(--mm) / 2 - var(--k) * var(--rf-mmcx));
  --rf-bottom: var(--gy);
  --rim-ring: #c9a85c;
}
:root:not([data-hud="arc"]) body.real-frame #hud:is([data-faction="mordor"], [data-faction="isengard"]) { --rim-ring: #8d8174; }
:root:not([data-hud="arc"]) body.real-frame .rf-frame {
  display: block; position: absolute; z-index: 3; pointer-events: none;
  left: var(--rf-left); bottom: var(--rf-bottom); width: calc(var(--k) * var(--rf-w)); height: calc(var(--k) * var(--rf-h));
  background: var(--rf-img) 0 0 / 100% 100% no-repeat; filter: drop-shadow(0 5px 9px rgba(0, 0, 0, .5));
}
/* The atlas: the map fills the open circle (a little under the ring) */
:root:not([data-hud="arc"]) body.real-frame #minimapWrap { z-index: auto; background: none; box-shadow: none; }
:root:not([data-hud="arc"]) body.real-frame #minimapWrap::before, :root:not([data-hud="arc"]) body.real-frame #minimapWrap::after, :root:not([data-hud="arc"]) body.real-frame .mm-ring { display: none; }
:root:not([data-hud="arc"]) body.real-frame #minimap {
  inset: auto; left: calc((1 - (var(--rf-mmr) + 3) / var(--rf-mmo)) * 50%); top: calc((1 - (var(--rf-mmr) + 3) / var(--rf-mmo)) * 50%);
  width: calc((var(--rf-mmr) + 3) / var(--rf-mmo) * 100%); height: calc((var(--rf-mmr) + 3) / var(--rf-mmo) * 100%); box-shadow: none; opacity: 1;
}
/* The three rim buttons sit on the ring's centre line at 11, 12 and 1 o'clock, over the picture */
:root:not([data-hud="arc"]) body.real-frame .mm-rim { --rim-r: calc((var(--rf-mmr) + var(--rf-mmo)) / (4 * var(--rf-mmo))); }
:root:not([data-hud="arc"]) body.real-frame .rim-btn { z-index: 5; box-shadow: 0 0 0 1.5px var(--rim-ring), 0 0 0 3px #1b1209, 0 3px 8px rgba(0, 0, 0, .65), inset 0 0 8px rgba(0, 0, 0, .6); }
/* Beta 12 item 12: the ring stands nearly level with the key and the flag (1.06's Isengard HUD, x4 crop: the ring's centre 2.5 source pixels above theirs, 2% of the bezel's width), not 19 px above */
:root:not([data-hud="arc"]) body.real-frame .rim-b { top: calc(var(--mm) * (.5 - var(--rim-r) * var(--rim-c) - .02) - 25px); }
:root:not([data-hud="arc"]) body.real-frame .rim-btn:not(:disabled):hover { box-shadow: 0 0 0 1.5px #ffe29a, 0 0 0 3px #1b1209, 0 0 14px var(--f-glow), inset 0 0 8px rgba(0, 0, 0, .4); }
/* The palantír: the picture draws its ring; the portrait fills the open circle */
:root:not([data-hud="arc"]) body.real-frame .palantir { background: none; box-shadow: none; }
:root:not([data-hud="arc"]) body.real-frame .pal-ring { display: none; }
:root:not([data-hud="arc"]) body.real-frame .pal-glass { inset: calc((1 - (var(--rf-pr) + 2) / var(--rf-po)) * 50%); box-shadow: inset 0 0 14px rgba(0, 0, 0, .75); }
:root:not([data-hud="arc"]) body.real-frame .nameplate {
  /* beta 8 item 13: BFME1 draws nothing over the palantír's glass (the rank and a bar sit inside it, no name), so the plate hangs under the picture, on the screen's foot */
  z-index: 4; bottom: calc(var(--safe-bottom) + 2px); width: calc(var(--k) * var(--rf-pr) * 1.55); min-height: 0; padding: 2px 8px 3px; border-radius: 9px;
  background: rgba(10, 7, 4, .8); box-shadow: 0 0 0 1px rgba(214, 178, 96, .7), 0 2px 8px rgba(0, 0, 0, .6);
}
:root:not([data-hud="arc"]) body.real-frame #selName { font-size: 13px; }
:root:not([data-hud="arc"]) body.real-frame #selSub { font-size: 10px; margin-top: 1px; }
:root:not([data-hud="arc"]) body.real-frame .hero-column::before {
  background: var(--rf-side, none) 0 0 / 44px auto repeat-y, linear-gradient(90deg, rgba(10, 6, 4, .78), rgba(24, 16, 10, .5)); box-shadow: 4px 0 12px rgba(0, 0, 0, .4); border-radius: 0 10px 10px 0;
}
/* The plaque: the picture's dark slot holds the gold, the command points and the power */
:root:not([data-hud="arc"]) body.real-frame #resWrap {
  z-index: 5; left: calc(var(--rf-left) + var(--k) * var(--rf-sx)); bottom: calc(var(--rf-bottom) + var(--k) * (var(--rf-h) - var(--rf-sy) - var(--rf-sh)));
  width: calc(var(--k) * var(--rf-sw)); height: calc(var(--k) * var(--rf-sh)); padding: 0 calc(var(--k) * 12); gap: 0;
  justify-content: space-between; border-radius: 0; background: none; box-shadow: none;
}
:root:not([data-hud="arc"]) body.real-frame .res { height: 100%; padding: 0; gap: 4px; border-radius: 0; background: none; box-shadow: none; }
:root:not([data-hud="arc"]) body.real-frame .res .icon { width: calc(var(--k) * 11); height: calc(var(--k) * 11); color: #e3c471; }
:root:not([data-hud="arc"]) body.real-frame .res > [id] { color: #f1dfaa; font-size: calc(var(--k) * 11); text-shadow: 0 1px 1px #000; }

/* ---- The order buttons and group chips of src/core/TouchBar.js (shared by both layouts) ---- */
.tb-btn { position: relative; width: 48px; height: 48px; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; pointer-events: auto; color: var(--f-icon); background: radial-gradient(circle at 50% 38%, var(--paint-sky), var(--glass-c) 75%); box-shadow: 0 0 0 2px var(--m-lo), 0 0 0 3px var(--m-mid), 0 0 0 4px var(--m-edge), 0 3px 8px rgba(0, 0, 0, .6); -webkit-touch-callout: none; touch-action: manipulation; }
.tb-btn .icon { width: 20px; height: 20px; stroke-width: 1.8; }
.tb-art { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; }
.real-ui .tb-art:has(> .ra) > .icon { display: none; }
.real-ui .tb-label { z-index: 2; }
.tb-label { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); padding: 0 4px; border-radius: 6px; background: rgba(10, 7, 4, .82); color: var(--f-text); font: 600 9px/1.4 var(--body); letter-spacing: .02em; white-space: nowrap; pointer-events: none; }
.tb-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--m-glint), 0 0 0 4px var(--f-accent), 0 0 14px var(--f-glow); }
.tb-btn[aria-pressed="true"] .tb-label { background: var(--f-accent); color: var(--m-edge); }
.tb-group { background: var(--f-panel); }
.tb-num { color: var(--f-accent); font: 700 18px/1 var(--f-display); }
.tb-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--m-mid); color: var(--m-edge); font: 700 10px/18px var(--body); text-align: center; }
.tb-count:empty { display: none; }
.tb-group.tb-empty { opacity: .62; }

/* ---- Desk: the order ring around the palantír (Desktop.dc.html; main.js updateArc sets data-ring and --a) ---- */
#orderRing button:not([data-ring]) { display: none; }
#orderRing [data-ring] { position: absolute; z-index: 3; width: var(--rb); height: var(--rb); left: calc(var(--pal-cx) + var(--ring-r) * cos(var(--a)) - var(--rb) / 2); bottom: calc(var(--pal-cy) - var(--ring-r) * sin(var(--a)) - var(--rb) / 2); }
#orderRing .sock { --paint-sky: #7c95b8; --paint-earth: #1d2433; }
#orderRing .ring-btn[data-ord="attackMove"] { --paint-sky: #d0583e; --paint-earth: #3a0d07; }
#orderRing #powersMain { --paint-sky: #9fc3e8; --paint-earth: #12294a; }
#orderRing #rallyBtn { --paint-sky: #e0b766; --paint-earth: #4a2c0e; }
#orderRing .tb-art { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; }
:root:not([data-hud="arc"]) #orderRing .tb-label { display: none; }
#orderRing .tb-art .icon, #orderRing .sock > .icon { width: 50%; height: 50%; stroke-width: 1.8; color: var(--f-icon); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .9)); }
/* The hotkey badge (BFME1's CommandMap keys): a light key cap at the lower right */
#orderRing [data-ring] kbd { left: auto; top: auto; right: -6px; bottom: -6px; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 4px; background: #efe3cc; box-shadow: 0 0 0 1px var(--m-edge); color: #150d0b; font: 700 10px/18px var(--body); z-index: 3; }
#orderRing .sock-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:root:not([data-hud="arc"]) #powersMain .arc-count:not(:empty) { display: block; position: absolute; right: -6px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #8d1d12; color: #fff3df; font: 700 12px/20px var(--body); text-align: center; box-shadow: 0 0 0 1.5px var(--m-hi); z-index: 3; }
.real-ui #orderRing .tb-art:has(> .ra) > .icon { display: none; }

/* ---- The thumb arc (touch, and every phone-sized screen; Main, PhoneHero, PhoneBuilding and Tablet.dc.html) ----
   Right thumb: one big main button in the bottom-right corner inside the safe area and a quarter circle of buttons
   around it whose contents follow the selection (main.js updateArc sets data-arc = slot or "main", and --a, the
   slot's angle: 180° level on the left, 270° straight up). Left thumb: the hero portraits. Between them: the
   selection card. Top: the glance row (resources, alerts as chips, control groups, menu, the round map). */
#hud .touch-only { display: none; }
:root[data-hud="arc"] #hud .touch-only:not(.hidden) { display: contents; }
:root[data-hud="arc"] #hud .desk-only, :root[data-hud="arc"] #hud::before { display: none; }
:root[data-hud="arc"] #hud .arc-only { display: grid; }
:root[data-hud="arc"] #hud {
  --am: 70px;                               /* main button */
  --ab: 48px;                               /* arc button */
  --ar: 128px;                              /* arc radius (centre to centre) */
  --am-gap: 12px;                           /* from the safe corner */
  --ax: calc(var(--safe-right) + var(--am-gap) + var(--am) / 2);   /* main centre, from the right */
  --ay: calc(var(--safe-bottom) + var(--am-gap) + var(--am) / 2);  /* main centre, from the bottom */
  --arc-w: calc(var(--am-gap) + var(--am) / 2 + var(--ar) + var(--ab) / 2); /* the arc's corner square */
  --sock: var(--ab); --mm: 76px; --hero: 52px; --gl: 44px; --pad: 8px;
  --a-bg: rgba(24, 15, 11, .94); --a-ring: rgba(200, 154, 78, .72); --a-on: #5a3f14; --a-hi: #f3d595; --a-gold: #e8c27a;
}
@media (min-width: 900px) and (min-height: 700px) {
  :root[data-hud="arc"] #hud { --am: 120px; --ab: 68px; --ar: 222px; --am-gap: 24px; --mm: 196px; --hero: 72px; --gl: 52px; --pad: 24px; }
}
/* The desktop pieces step aside */
:root[data-hud="arc"] #hud :is(.palantir, .nameplate, .sock-empty, .mm-rim, .mission, #controlHint) { display: none; }
:root[data-hud="arc"] #hud :is(.socket-tray, .command-buttons, #powersWrap) { display: contents; }
:root[data-hud="arc"] #hud :is(#cmdStrip > button, #orderRing button, #selBtns button, .command-buttons > button, #powersWrap > button):not([data-arc]) { display: none; }
:root[data-hud="arc"] #hud kbd { display: none; }

/* Arc buttons: a dark disc in a gold ring (the boards); the pack's paintings and ring when it is installed */
:root[data-hud="arc"] #hud [data-arc] {
  position: absolute; z-index: 6; top: auto; left: auto; margin: 0; transform: none;
  width: var(--ab); height: var(--ab); min-width: 44px; min-height: 44px;
  right: calc(var(--ax) - var(--ar) * cos(var(--a)) - var(--ab) / 2);
  bottom: calc(var(--ay) - var(--ar) * sin(var(--a)) - var(--ab) / 2);
  border-radius: 50%; display: grid; place-items: center; padding: 0; pointer-events: auto;
  color: #efe3cc; background: var(--a-bg); box-shadow: 0 0 0 2px var(--a-ring), 0 3px 8px rgba(0, 0, 0, .55);
  -webkit-touch-callout: none; touch-action: manipulation; animation: arc-in .14s ease-out both;
}
@keyframes arc-in { from { opacity: 0; transform: scale(.82); } }
:root[data-hud="arc"] #hud [data-arc] :is(.icon, .tb-art .icon) { width: calc(var(--ab) * .46); height: calc(var(--ab) * .46); stroke-width: 2; color: #efe3cc; filter: none; }
:root[data-hud="arc"] #hud [data-arc] .tb-art { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; }
:root[data-hud="arc"] #hud [data-arc]:not(:disabled):hover { box-shadow: 0 0 0 2px var(--a-hi), 0 0 14px rgba(243, 213, 149, .45); }
:root[data-hud="arc"] #hud [data-arc]:not(:disabled):active { transform: scale(.94); }
:root[data-hud="arc"] #hud [data-arc]:is([aria-pressed="true"], .active, .on, .tip-on) { background: var(--a-on); box-shadow: 0 0 0 3px var(--a-hi), 0 0 12px rgba(243, 213, 149, .6); }
:root[data-hud="arc"] #hud [data-arc]:disabled:not(.locked) { filter: grayscale(.8) brightness(.6); }
:root[data-hud="arc"] #hud [data-arc].locked { background: rgba(14, 9, 7, .9); box-shadow: 0 0 0 2px rgba(200, 154, 78, .3); opacity: .7; filter: none; }
:root[data-hud="arc"] #hud [data-arc].passive { box-shadow: 0 0 0 2px rgba(200, 154, 78, .35); }
:root[data-hud="arc"] #hud [data-arc].armed { background: #5a1a0e; box-shadow: 0 0 0 3px #ff6a3d, 0 0 16px rgba(255, 90, 42, .7); }
:root[data-hud="arc"] #hud [data-arc] .ability-glyph { font: 700 calc(var(--ab) * .3) / 1 var(--display); }
/* A word under the strip's icons (Stop, Path, Scatter) */
:root[data-hud="arc"] #hud [data-arc] .tb-label { bottom: -6px; padding: 0 5px; background: rgba(14, 9, 7, .92); box-shadow: 0 0 0 1px rgba(200, 154, 78, .5); color: #efe3cc; font: 700 9px/1.45 var(--display); letter-spacing: .04em; }
/* Corner badges: the price or level lock (bottom), the queued count (right), a hero ability's lock or seconds */
:root[data-hud="arc"] #hud [data-arc] .arc-badge:not(:empty) { display: block; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); min-width: 22px; height: 17px; padding: 0 4px; border-radius: 9px; background: #150d0b; box-shadow: 0 0 0 1px #c89a4e; color: var(--a-hi); font: 700 10px/17px var(--body); text-align: center; white-space: nowrap; z-index: 3; pointer-events: none; }
:root[data-hud="arc"] #hud [data-arc] .arc-badge.lock { color: #c9b796; }
:root[data-hud="arc"] #hud [data-arc] .ability-lock:not(:empty) { inset: auto; right: -6px; bottom: -4px; display: block; min-width: 20px; height: 18px; padding: 0 3px; border-radius: 9px; background: #150d0b; box-shadow: 0 0 0 1px #c89a4e; font: 700 10px/18px var(--body); text-align: center; }
:root[data-hud="arc"] #hud [data-arc] .ability-lock:empty { display: none; }
:root[data-hud="arc"] #hud [data-arc].cooling { background-color: rgba(14, 9, 7, .94); }
:root[data-hud="arc"] #hud [data-arc] .cd:not(:empty) { font-size: calc(var(--ab) * .26); }
:root[data-hud="arc"] #hud [data-arc]:is(.pbtn) .power-cost { display: none; }
/* Paging and the spell book's point count */
:root[data-hud="arc"] #hud #arcMore .arc-badge:not(:empty), :root[data-hud="arc"] #hud #bookBtn .arc-badge:not(:empty) { left: auto; right: -6px; transform: none; }
/* With the pack: the painting fills the disc and the palantír's gold ring sits on it */
:root[data-hud="arc"] .real-ui #hud [data-arc]:has(> .ra), :root[data-hud="arc"] .real-ui #hud [data-arc]:has(> .tb-art > .ra) { background: #0b0805; }

/* The main button: Attack-move (troops), Powers (a hero; nothing selected), Rally (a building), Back (a sub-page) */
:root[data-hud="arc"] #hud [data-arc="main"] {
  width: var(--am); height: var(--am); right: calc(var(--ax) - var(--am) / 2); bottom: calc(var(--ay) - var(--am) / 2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: radial-gradient(circle at 50% 35%, #5a4a22 0%, #2a2010 100%);
  box-shadow: 0 0 0 3px var(--a-gold), 0 0 0 5px #150d0b, 0 6px 14px rgba(0, 0, 0, .6);
}
:root[data-hud="arc"] #hud [data-arc="main"][data-cmd="attackMove"] { background: radial-gradient(circle at 50% 35%, #8a2a1c 0%, #4a120b 100%); }
:root[data-hud="arc"] #hud [data-arc="main"][data-cmd="attackMove"].finishing { background: radial-gradient(circle at 50% 35%, #6a5420 0%, #2e2208 100%); }
:root[data-hud="arc"] #hud #powersMain[data-arc="main"] { background: radial-gradient(circle at 45% 35%, #6d7fa8 0%, #22304f 55%, #0d1222 100%); box-shadow: 0 0 0 3px var(--a-gold), 0 0 0 5px #150d0b, 0 0 16px rgba(120, 150, 220, .5); }
:root[data-hud="arc"] #hud [data-arc="main"][aria-pressed="true"] { box-shadow: 0 0 0 3px var(--a-hi), 0 0 0 5px #150d0b, 0 0 18px rgba(243, 213, 149, .75); }
:root[data-hud="arc"] #hud [data-arc="main"] :is(.icon, .tb-art .icon) { width: calc(var(--am) * .34); height: calc(var(--am) * .34); }
:root[data-hud="arc"] #hud [data-arc="main"] .tb-art { width: auto; height: auto; }
:root[data-hud="arc"] #hud [data-arc="main"] :is(.tb-label, .arc-label) { position: static; display: block; transform: none; padding: 0; background: none; box-shadow: none; color: #efe3cc; font: 700 calc(var(--am) * .13) / 1.1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
:root[data-hud="arc"] #hud [data-arc="main"] .arc-count:not(:empty) { display: block; color: var(--a-hi); font: 700 calc(var(--am) * .21) / 1 var(--display); }
:root[data-hud="arc"] #hud [data-arc]:not([data-arc="main"]) .arc-count:not(:empty) { display: block; position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #8d1d12; color: #fff3df; font: 700 10px/18px var(--body); text-align: center; }
:root[data-hud="arc"] .real-ui #hud [data-arc="main"]:has(> .ra) > :is(.icon, .tb-art) { opacity: 0; position: absolute; }
:root[data-hud="arc"] .real-ui #hud [data-arc="main"] > .ra { inset: 5px; }
:root[data-hud="arc"] .real-ui #hud [data-arc="main"]:has(> .ra) :is(.tb-label, .arc-label, .arc-count) { position: relative; z-index: 3; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
/* The label sits on busy EA art (ATTACK over the sword painting): a dark plate behind it, gold-white type, so it reads at phone size */
:root[data-hud="arc"] .real-ui #hud [data-arc="main"]:is(:has(> .ra), :has(> .tb-art > .ra)) :is(.tb-label, .arc-label) { position: relative; inset: auto; z-index: 3; padding: 2px 7px 1px; border-radius: 9px; background: rgba(16, 9, 6, .82); box-shadow: 0 0 0 1px rgba(200, 154, 78, .55); color: #fbefd0; text-shadow: 0 1px 1px #000; font-size: max(10px, calc(var(--am) * .14)); }
/* Phone: the arc buttons are too close together for words under them (the boards show pictures, a price or a short
   code); the name is the aria-label and the long-press card. */
:root[data-hud="arc"] #hud [data-arc]:not([data-arc="main"]) .tb-label { display: none; }
/* Tablet: words under the arc buttons (Tablet.dc.html) */
@media (min-width: 900px) and (min-height: 700px) {
  :root[data-hud="arc"] #hud [data-arc]:not([data-arc="main"]) .tb-label { display: block; bottom: 6px; background: none; box-shadow: none; font-size: 10px; }
  :root[data-hud="arc"] #hud [data-arc]:not([data-arc="main"]) .tb-art { padding-bottom: 12px; }
}

/* Glance row: resources, alerts, groups, menu, the round map */
:root[data-hud="arc"] #hud #resWrap { left: calc(var(--safe-left) + var(--pad)); top: calc(var(--safe-top) + 8px); bottom: auto; width: auto; z-index: 2; height: calc(var(--gl) - 8px); gap: 14px; padding: 0 14px; border-radius: 20px; background: var(--a-bg); box-shadow: 0 0 0 1px rgba(200, 154, 78, .5); justify-content: flex-start; }
:root[data-hud="arc"] #hud .res { height: auto; padding: 0; gap: 6px; background: none; box-shadow: none; }
:root[data-hud="arc"] #hud .res > [id] { font: 700 calc(var(--gl) * .32) var(--body); }
:root[data-hud="arc"] #hud .power-resource > [id] { color: var(--a-gold); }
:root[data-hud="arc"] #hud #alerts { left: calc(var(--safe-left) + var(--pad)); top: calc(var(--safe-top) + var(--gl) + 10px); transform: none; align-items: flex-start; max-width: min(340px, 42vw); gap: 6px; }
:root[data-hud="arc"] #hud .alert { display: flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 20px; background: var(--a-bg); box-shadow: 0 0 0 1px rgba(200, 154, 78, .5); font: 700 13px/1.25 var(--body); text-align: left; }
:root[data-hud="arc"] #hud .alert.error { background: rgba(60, 16, 10, .92); box-shadow: 0 0 0 1px #d9553a; }
:root[data-hud="arc"] #hud .alert:not(.alert-chip) { pointer-events: none; } /* plain notices never catch a finger meant for the map */
:root[data-hud="arc"] #hud .alert-chip { min-height: 44px; pointer-events: auto; cursor: pointer; }
:root[data-hud="arc"] #hud .alert-chip::before { content: ""; width: 16px; height: 16px; margin-right: 8px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff9a7f' stroke-width='2.2'%3E%3Cpath d='M12 3l9 16H3z'/%3E%3Cpath d='M12 10v4M12 17v.5'/%3E%3C/svg%3E") center / contain no-repeat; }
:root[data-hud="arc"] #hud #groupBar { position: absolute; top: calc(var(--safe-top) + 6px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: row; gap: 6px; z-index: 5; pointer-events: none; }
:root[data-hud="arc"] #hud #groupBar.hidden { display: none; }
:root[data-hud="arc"] #hud:has(#modeHint:not(.hidden)) #groupBar { visibility: hidden; }
:root[data-hud="arc"] #hud .tb-group { width: var(--gl); height: var(--gl); border-radius: 8px; background: rgba(24, 15, 11, .88); box-shadow: inset 0 0 0 1px #c89a4e; color: #efe3cc; }
:root[data-hud="arc"] #hud .tb-group .tb-num { color: #efe3cc; font: 700 calc(var(--gl) * .36) / 1 var(--display); }
:root[data-hud="arc"] #hud .tb-group.tb-empty { opacity: 1; box-shadow: inset 0 0 0 1px rgba(200, 154, 78, .3); }
:root[data-hud="arc"] #hud .tb-group.tb-empty .tb-num { color: #8a7a62; }
:root[data-hud="arc"] #hud .tb-group.tb-current { background: var(--a-on); }
:root[data-hud="arc"] #hud .tb-group .tb-count { top: -5px; right: -5px; min-width: 16px; height: 16px; font-size: 9px; line-height: 16px; }
:root[data-hud="arc"] #hud #glanceMenuBtn { position: absolute; top: calc(var(--safe-top) + 8px); right: calc(var(--safe-right) + var(--pad) + var(--mm) + 11px); width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; place-items: center; background: var(--a-bg); box-shadow: 0 0 0 1px rgba(200, 154, 78, .6); color: #efe3cc; z-index: 5; }
:root[data-hud="arc"] #hud #glanceMenuBtn .icon { width: 18px; height: 18px; stroke-width: 2.2; }
/* beta 14 minor 2: 1.06's rim flag (Player Status) on the arc HUD: a round button beside the battle menu's, where the atlas' rim would carry it */
:root[data-hud="arc"] #hud #statusBtn { position: absolute; top: calc(var(--safe-top) + 8px); right: calc(var(--safe-right) + var(--pad) + var(--mm) + 11px + 52px); width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; place-items: center; background: var(--a-bg); box-shadow: 0 0 0 1px rgba(200, 154, 78, .6); color: #efe3cc; z-index: 5; }
:root[data-hud="arc"] #hud #statusBtn .icon { width: 18px; height: 18px; stroke-width: 2.2; }
:root[data-hud="arc"] #hud #statusBtn[aria-expanded="true"] { background: var(--a-on); box-shadow: 0 0 0 2px var(--a-hi); }
:root[data-hud="arc"] #hud #glanceMenuBtn[aria-expanded="true"] { background: var(--a-on); box-shadow: 0 0 0 2px var(--a-hi); }
:root[data-hud="arc"] #hud #glanceMenu { position: absolute; top: calc(var(--safe-top) + 58px); right: calc(var(--safe-right) + var(--pad)); width: min(320px, calc(100vw - 2 * var(--pad) - var(--safe-left) - var(--safe-right))); display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(14, 9, 7, .97); box-shadow: 0 0 0 1px var(--a-gold), 0 10px 26px rgba(0, 0, 0, .6); z-index: 30; pointer-events: auto; }
:root[data-hud="arc"] #hud #glanceMenu.hidden { display: none; }
.gm-objective { margin: 0; color: #efe3cc; font: 14px/1.35 var(--display); }
.gm-top #topbar { position: static; justify-content: space-between; padding: 0; background: none; box-shadow: none; }
.gm-top #mapTitle { display: block; max-width: 40%; }
.gm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-actions .compact-btn { display: inline-flex; align-items: center; gap: 6px; }
.gm-actions .icon { width: 16px; height: 16px; }
:root[data-hud="arc"] #hud #minimapWrap { left: auto; bottom: auto; top: calc(var(--safe-top) + 6px); right: calc(var(--safe-right) + var(--pad)); width: var(--mm); height: var(--mm); z-index: 5; box-shadow: 0 0 0 2px #150d0b, 0 4px 12px rgba(0, 0, 0, .6), inset 0 0 0 1px var(--m-glint); }
:root[data-hud="arc"] #hud #minimap { inset: 6%; width: 88%; height: 88%; }
/* The full atlas (a tap on the small map): centred over a dimmed field; the next tap moves the camera */
:root[data-hud="arc"] #hud.atlas-open #minimapWrap { position: fixed; top: 50%; left: 50%; right: auto; bottom: auto; width: min(86vh, 86vw, 560px); height: min(86vh, 86vw, 560px); transform: translate(-50%, -50%); z-index: 41; }
.atlas-scrim { position: fixed; inset: 0; z-index: 40; border: 0; padding: 0; background: rgba(8, 5, 3, .62); pointer-events: auto; }
.atlas-scrim.hidden { display: none; }

/* Left thumb: hero portraits with a health bar (fallen greyed); then the selection card */
:root[data-hud="arc"] #hud #thumbLeft { position: absolute; display: flex; align-items: flex-end; gap: 10px; left: calc(var(--safe-left) + var(--pad)); bottom: calc(var(--safe-bottom) + 12px); right: calc(var(--safe-right) + var(--arc-w) + 10px); z-index: 4; pointer-events: none; }
:root[data-hud="arc"] #hud .hero-column { position: static; flex: none; flex-direction: row; gap: 8px; left: auto; top: auto; }
:root[data-hud="arc"] #hud .hero-icon { width: var(--hero); height: var(--hero); background: #3c4a5c; box-shadow: 0 0 0 2px #c89a4e, 0 3px 8px rgba(0, 0, 0, .55); }
:root[data-hud="arc"] #hud .hero-icon.selected { box-shadow: 0 0 0 3px var(--a-hi), 0 0 12px rgba(243, 213, 149, .7); }
:root[data-hud="arc"] #hud .hero-icon :is(.hero-ring) { display: none; }
:root[data-hud="arc"] #hud .hero-icon .hero-hp { display: block; position: absolute; left: 18%; right: 18%; bottom: 7%; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #7fc46a calc(var(--hp, 100) * 1%), rgba(0, 0, 0, .6) 0); z-index: 2; }
:root[data-hud="arc"] #hud .hero-icon.low .hero-hp { background: linear-gradient(90deg, #e0563c calc(var(--hp, 100) * 1%), rgba(0, 0, 0, .6) 0); }
:root[data-hud="arc"] #hud .hero-icon:is(.reviving, .fallen) { background: #2a2420; box-shadow: 0 0 0 2px #6b5a44, 0 3px 8px rgba(0, 0, 0, .55); }
:root[data-hud="arc"] #hud .hero-icon:is(.reviving, .fallen) .hero-hp { display: none; }
.sel-card { display: none; }
:root[data-hud="arc"] #hud .sel-card:not(.hidden) { display: flex; }
:root[data-hud="arc"] #hud .sel-card { flex: 0 1 460px; min-width: 0; min-height: 56px; box-sizing: border-box; padding: 6px 8px 6px 10px; gap: 10px; align-items: center; border-radius: 12px; background: var(--a-bg); box-shadow: 0 0 0 1px rgba(200, 154, 78, .55), 0 4px 12px rgba(0, 0, 0, .45); pointer-events: auto; color: #efe3cc; }
.card-portrait { position: relative; flex: none; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: #3c4a5c; box-shadow: inset 0 0 0 1px #c89a4e; }
.card-portrait .icon, .card-portrait svg { width: 70%; height: 70%; color: #efe3cc; }
.card-portrait .hero-crest { width: 100%; height: 100%; }
.card-portrait .portrait-count { display: none; }
.real-ui .card-portrait .ra { inset: 0; border-radius: 8px; }
.sel-card[data-ctx="hero"] .card-portrait { border-radius: 50%; }
.card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.card-name { margin: 0; min-width: 0; overflow: hidden; color: #efe3cc; font: 700 13px/1.2 var(--display); letter-spacing: .02em; white-space: nowrap; text-overflow: ellipsis; }
.card-meta { flex: none; color: var(--a-gold, #e8c27a); font: 700 12px/1.2 var(--body); white-space: nowrap; }
.card-members { display: flex; gap: 2px; }
.card-members > span { flex: 1; height: 8px; border-radius: 2px; background: rgba(239, 227, 204, .18); }
.card-members > span.up { background: #7fc46a; }
.card-bar { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .55); overflow: hidden; }
.card-bar > span { display: block; height: 100%; background: #7fc46a; }
.card-bar.low > span { background: #e0563c; }
.card-bar.xp { height: 3px; background: rgba(239, 227, 204, .15); }
.card-bar.xp > span { background: #e8c27a; }
.card-queue { display: flex; gap: 6px; }
.card-q { position: relative; width: 40px; height: 32px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: #2a1c12; box-shadow: inset 0 0 0 1px rgba(200, 154, 78, .6); color: #efe3cc; font: 700 11px/1 var(--display); }
.card-q::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--q, 0) * 100%); background: rgba(127, 196, 106, .45); }
.card-q > span { position: relative; }
.card-q { cursor: pointer; touch-action: manipulation; -webkit-touch-callout: none; }
.card-x { display: none; position: absolute; top: 1px; right: 2px; z-index: 1; font: 700 10px/1 var(--body); font-style: normal; color: #efe3cc; text-shadow: 0 0 2px #000, 0 0 3px #000; }
@media (pointer: coarse) {
  .card-q { width: 44px; height: 40px; }
  .card-x { display: block; }
}
.real-ui .card-q .ra { inset: 2px; border-radius: 6px; }
.sel-card[data-ctx="building"] .card-portrait, .sel-card[data-ctx="hero"] .card-btn[data-cmd] { display: none; }
.sel-card[data-ctx="building"] .card-body { flex-direction: row; align-items: center; gap: 10px; }
.sel-card[data-ctx="building"] .card-head { flex-direction: column; align-items: flex-start; gap: 3px; min-width: 84px; }
.sel-card[data-ctx="building"] .card-bars { flex: 1; min-width: 0; }
.card-acts { flex: none; display: flex; gap: 6px; }
.card-acts:not(:has(.card-btn:not(.hidden))) { display: none; }
.card-btn { position: relative; min-width: 44px; height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: #2a1c12; box-shadow: inset 0 0 0 1px rgba(200, 154, 78, .6); color: #efe3cc; font: 700 12px/1 var(--body); white-space: nowrap; pointer-events: auto; -webkit-touch-callout: none; touch-action: manipulation; }
.card-btn.hidden { display: none; }
.card-btn[aria-pressed="true"] { background: var(--a-on, #5a3f14); box-shadow: inset 0 0 0 2px var(--a-hi, #f3d595); }
.card-btn.card-icon { display: grid; place-items: center; padding: 0; }
.card-btn .icon { width: 20px; height: 20px; stroke-width: 2; }
.card-btn:disabled { opacity: .55; }

/* Panels in the arc layout: placement and targeting at the top centre (the groups step aside), counsel under the
   glance row, the build panel between the left thumb and the arc */
:root[data-hud="arc"] #hud #modeHint { top: calc(var(--safe-top) + 8px); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: min(440px, calc(100vw - 2 * (var(--mm) + 70px) - var(--safe-left) - var(--safe-right))); padding: 4px 5px 4px 14px; border-radius: 22px; background: rgba(24, 15, 11, .96); box-shadow: 0 0 0 1px var(--a-gold); z-index: 8; }
:root[data-hud="arc"] #hud #modeHint > .icon { display: none; }
:root[data-hud="arc"] #hud #modeText { font: 700 13px/1.3 var(--body); }
:root[data-hud="arc"] #hud #cancelMode { border-radius: 20px; }
:root[data-hud="arc"] #hud #tipBox { top: calc(var(--safe-top) + var(--gl) + 14px); left: 50%; right: auto; transform: translateX(-50%); width: min(360px, 48vw); }
:root[data-hud="arc"] #hud #buildPanel { top: calc(var(--safe-top) + var(--gl) + 14px); bottom: calc(var(--safe-bottom) + 12px); left: calc(var(--safe-left) + var(--pad)); right: calc(var(--safe-right) + var(--arc-w) + 10px); width: auto; max-height: none; padding: 8px 10px; z-index: 7; }
:root[data-hud="arc"] #hud #buildBtns { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px 6px; }
:root[data-hud="arc"] #hud .compact-btn, :root[data-hud="arc"] #hud #cancelMode { min-height: 44px; }
:root[data-hud="arc"] #hud .bbtn { min-height: 44px; }
:root[data-hud="arc"] #hud .net-banner { top: calc(var(--safe-top) + var(--gl) + 14px); }
:root[data-hud="arc"] .desktop-hint { display: none; }

/* Phone, portrait: the groups take a second row; the card rides above the arc, the heroes beside it */
@media (orientation: portrait) {
  :root[data-hud="arc"] #hud #groupBar { top: calc(var(--safe-top) + var(--gl) + 10px); left: calc(var(--safe-left) + var(--pad)); transform: none; }
  :root[data-hud="arc"] #hud #alerts { top: calc(var(--safe-top) + 2 * var(--gl) + 18px); }
  :root[data-hud="arc"] #hud #tipBox { top: calc(var(--safe-top) + 2 * var(--gl) + 18px); left: calc(var(--safe-left) + var(--pad)); right: calc(var(--safe-right) + var(--pad)); width: auto; transform: none; }
  :root[data-hud="arc"] #hud #modeHint { top: calc(var(--safe-top) + var(--gl) + 10px); left: calc(var(--safe-left) + var(--pad)); right: calc(var(--safe-right) + var(--pad)); transform: none; width: auto; max-width: none; }
  :root[data-hud="arc"] #hud #thumbLeft { display: contents; }
  :root[data-hud="arc"] #hud .hero-column { position: absolute; left: calc(var(--safe-left) + var(--pad)); bottom: calc(var(--safe-bottom) + 12px); max-width: calc(100vw - var(--safe-left) - var(--safe-right) - var(--arc-w) - 24px); flex-wrap: wrap-reverse; z-index: 4; }
  :root[data-hud="arc"] #hud .sel-card { position: absolute; left: calc(var(--safe-left) + var(--pad)); right: calc(var(--safe-right) + var(--pad)); bottom: calc(var(--safe-bottom) + var(--arc-w) + 12px); z-index: 4; }
  :root[data-hud="arc"] #hud #buildPanel { top: calc(var(--safe-top) + 2 * var(--gl) + 18px); bottom: calc(var(--safe-bottom) + var(--arc-w) + 12px); right: calc(var(--safe-right) + var(--pad)); }
}
/* Tablet (Tablet.dc.html): the map bottom-left, heroes in a column above it, the card bottom-centre, the menu top-right */
@media (min-width: 900px) and (min-height: 700px) {
  :root[data-hud="arc"] #hud #minimapWrap { top: auto; right: auto; left: calc(var(--safe-left) + var(--pad)); bottom: calc(var(--safe-bottom) + var(--pad)); }
  :root[data-hud="arc"] #hud #glanceMenuBtn { right: calc(var(--safe-right) + var(--pad)); top: calc(var(--safe-top) + 20px); width: 56px; height: 56px; }
  :root[data-hud="arc"] #hud #statusBtn { right: calc(var(--safe-right) + var(--pad) + 64px); top: calc(var(--safe-top) + 20px); width: 56px; height: 56px; }
  :root[data-hud="arc"] #hud #glanceMenu { top: calc(var(--safe-top) + 86px); }
  :root[data-hud="arc"] #hud #resWrap { top: calc(var(--safe-top) + 20px); }
  :root[data-hud="arc"] #hud #groupBar { top: calc(var(--safe-top) + 20px); gap: 8px; }
  :root[data-hud="arc"] #hud #alerts { top: calc(var(--safe-top) + 84px); }
  :root[data-hud="arc"] #hud .alert { min-height: 48px; padding: 0 18px; border-radius: 24px; font-size: 16px; }
  :root[data-hud="arc"] #hud #thumbLeft { display: contents; }
  :root[data-hud="arc"] #hud .hero-column { position: absolute; left: calc(var(--safe-left) + var(--pad)); bottom: calc(var(--safe-bottom) + var(--pad) + var(--mm) + 20px); flex-direction: column-reverse; gap: 12px; z-index: 4; }
  :root[data-hud="arc"] #hud .sel-card { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + var(--pad)); width: min(560px, calc(100vw - 2 * var(--arc-w) - 40px)); min-height: 96px; padding: 12px 14px 12px 16px; gap: 14px; border-radius: 16px; }
  .card-portrait { width: 68px; height: 68px; border-radius: 10px; }
  .card-name { font-size: 18px; }
  .card-meta { font-size: 15px; }
  .card-members > span { height: 10px; }
  .card-bar { height: 8px; }
  .card-q { width: 52px; height: 48px; font-size: 13px; }
  .card-acts { flex-direction: column; }
  .card-btn { font-size: 14px; }
  :root[data-hud="arc"] #hud #modeHint { top: calc(var(--safe-top) + 84px); }
  :root[data-hud="arc"] #hud:has(#modeHint:not(.hidden)) #groupBar { visibility: visible; }
  :root[data-hud="arc"] #hud #tipBox { top: calc(var(--safe-top) + 84px); left: auto; right: calc(var(--safe-right) + var(--pad)); transform: none; width: 340px; }
  :root[data-hud="arc"] #hud #buildPanel { top: calc(var(--safe-top) + 84px); bottom: calc(var(--safe-bottom) + var(--pad) + 130px); left: calc(var(--safe-left) + var(--pad) + var(--mm) + 24px); right: calc(var(--safe-right) + var(--arc-w) + 24px); }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-hud="arc"] #hud [data-arc] { animation: none; }
  :root[data-hud="arc"] #hud [data-arc]:not(:disabled):active { transform: none; }
}

/* F9, BFME1's TOGGLE_CONTROL_BAR: the whole control bar (atlas, plaque, palantir, sockets, commands, powers) and the thumb arc go; the clock, alerts and on-map rings stay. */
:root[data-bar="off"] #console, :root[data-bar="off"] #orderRing, :root[data-bar="off"] #thumbLeft, :root[data-bar="off"] #sockTip { display: none !important; }

/* Beta 11 item 6: 1.06's QuitMenu and Options (src/game/ui/QuitMenu.js, AptMenu.js): the movie's shapes on a canvas that fills the screen, a real button over each of its buttons.
   The page behind is dimmed, as the engine's own `showBackground(2)` does, not blurred. */
/* Beta 12 item 6: the screens 1.06 lays over the battle sit on SFE_MENUOVERLAY (ShellWash.js, just under the modals); the Options screen then has no dim of its own */
.shell-wash { display: contents; }
.shell-wash[hidden] { display: none; }
.wash-dim { position: fixed; inset: 0; pointer-events: none; background: transparent; }
.wash-art { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; mix-blend-mode: plus-lighter; }
@supports not (mix-blend-mode: plus-lighter) { .wash-art { mix-blend-mode: screen; } }
.has-wash #optionsScreen.apt-pause, .has-wash #playerStatus.apt-pause, .has-wash #spellbook.node-tree.powers-screen { background: transparent; }
/* the Powers title: the movie's field `Spells` is gold (#f5b560) in a light titling face, not bold white-gold capitals */
.real-ui #spellbook.node-tree .powers-plaque h2 { color: #f5b560; font: 400 22px var(--apt-font); letter-spacing: .05em; text-transform: none; text-shadow: 0 1px 0 #2a0d03, 0 0 6px rgba(0, 0, 0, .6); }
#pause.apt-pause, #optionsScreen.apt-pause, #playerStatus.apt-pause { padding: 0; overflow: hidden; background: rgba(8, 4, 2, .6); backdrop-filter: none; -webkit-backdrop-filter: none; touch-action: none; }
#pause.apt-pause > .modal-card { display: none; }
.quit-host, .apt-host { position: absolute; inset: 0; }
.quit-host[hidden], .apt-host[hidden] { display: none; }
.apt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.apt-hits { position: absolute; inset: 0; pointer-events: none; }
.apt-items { position: absolute; inset: 0; pointer-events: none; }
.apt-item { position: absolute; box-sizing: border-box; pointer-events: auto; }
/* an APT button is a transparent hit area: the canvas under it draws the movie's `over` and `down` art. The page's own `button:not(:disabled):hover` (theme.css, style.css) is (0,2,1): these selectors are (0,3,1), so no hover or press paints a box over the art (beta 14 major 2) */
.apt-hit, button.apt-hit, button.apt-hit:hover, button.apt-hit:active, button.apt-hit:focus, button.apt-hit:not(:disabled):hover, button.apt-hit:not(:disabled):active { appearance: none; -webkit-appearance: none; background: transparent; background-color: transparent; box-shadow: none; border-color: transparent; }
.apt-hit { position: absolute; padding: 0; border: 0; border-radius: 0; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.apt-hit[hidden] { display: none; }
.apt-hit:focus, .apt-hit:focus-visible { outline: none; }
.apt-hit[aria-disabled="true"] { cursor: default; }
.apt-tip { position: absolute; left: 0; top: 0; max-width: 260px; padding: 7px 10px; border: 1px solid #b8893f; background: rgba(20, 11, 8, .94); color: #ecd9ae; font: 400 13px/1.3 var(--apt-font); pointer-events: none; z-index: 2; }
.apt-tip.hidden { display: none; }

/* Beta 11 item 9: 1.06's Powers tree (PowersTree.js). With the pack part the eight medallions stand on the movie's nodes inside a round orb (the tiers' rows are gone, at every size), the
   vines join them on a canvas behind, and the page behind the orb is the battle, dimmed, in red, not our field of rings. */
#spellbook.node-tree.powers-screen { background: rgba(28, 6, 2, .76); backdrop-filter: none; -webkit-backdrop-filter: none; }
#spellbook.node-tree.powers-screen::before { display: none; }
#spellbook.node-tree .powers-stage { width: min(96vw, calc(100vh - var(--safe-top) - var(--safe-bottom) - 130px), 820px); }
/* the plaque sits above the orb, not over its top medallions (the nodes start at a quarter of the orb's height); a short screen gives the orb the room the plaque took */
#spellbook.node-tree .powers-plaque { margin-bottom: 4px; }
@media (max-height: 540px) {
  #spellbook.node-tree .powers-stage { width: min(96vw, calc(100vh - var(--safe-top) - var(--safe-bottom) - 134px)); }
  #spellbook.node-tree .powers-close { margin-top: -10px; }
  #spellbook.node-tree .powers-points { top: 4%; font-size: clamp(9px, 3.2vmin, 12px); letter-spacing: .04em; white-space: nowrap; }
  #spellbook.node-tree .powers-points .powers-number { display: inline; margin: 0 0 0 .5em; font-size: 1.15em; }
}
#spellbook.node-tree .powers-orb { width: 100%; max-width: none; max-height: none; aspect-ratio: 1; border-radius: 50%; padding: 0; overflow: visible; display: block; }
#spellbook.node-tree .powers-points { position: absolute; left: 12%; right: 12%; top: 11%; z-index: 2; font-size: clamp(10px, 2.2vmin, 18px); letter-spacing: .08em; }
#spellbook.node-tree .powers-points small, #spellbook.node-tree .powers-intro { display: none; }
#spellbook.node-tree .powers-tree { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; box-sizing: border-box; display: block; margin: 0; padding: 0; gap: 0; overflow: visible; flex: none; }
#spellbook.node-tree .powers-vines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#spellbook.node-tree .power-node { position: absolute; width: max(12.6%, 46px); transform: translate(-50%, -50%); list-style: none; z-index: 1; }
#spellbook.node-tree .power-node .tier-power { width: 100%; padding: 0; }
#spellbook.node-tree .power-node .medallion { width: 100%; height: auto; aspect-ratio: 1; }
#spellbook.node-tree .power-node .medal-cost { display: none; }
#spellbook.node-tree #spellStatus { position: absolute; left: 9%; right: 9%; bottom: 3.5%; margin: 0; z-index: 2; font-size: clamp(9px, 1.9vmin, 13px); }

/* Beta 11 item 10, beta 12 item 5: 1.06's end of a battle (EndScreen.js). The end scene is drawn over the battle and under the HUD (the HUD stays, as in the recordings); the score
   screen is the dialog, on the shell's red backdrop. */
.end-wash { display: contents; } /* no box and no stacking context of its own: the light blends with the battle under it */
.end-wash[hidden] { display: none; }
.end-dim { position: fixed; inset: 0; z-index: 5; pointer-events: none; background: transparent; }
.end-art { position: fixed; inset: 0; z-index: 5; width: 100%; height: 100%; display: block; pointer-events: none; mix-blend-mode: plus-lighter; }
@supports not (mix-blend-mode: plus-lighter) { .end-art { mix-blend-mode: screen; } }
.end-word { position: fixed; z-index: 6; pointer-events: none; margin: 0; padding: 0; text-align: center; white-space: nowrap; overflow: visible; font-family: var(--apt-font); font-weight: 400; letter-spacing: 0; opacity: 0; } /* GuiFX's word (EndScreen.js END_WORD): 13 copies in three colours, the position, size and shadows are set by the script; Marcellus for Albertus MT */
#winLose.apt-end { padding: 0; overflow: hidden; background: #050201; backdrop-filter: none; -webkit-backdrop-filter: none; touch-action: none; }
#winLose.apt-end > .modal-card { display: none; }
.end-host { position: absolute; inset: 0; }
.end-host[hidden] { display: none; }
.end-score { position: absolute; inset: 0; }
.end-score.hidden { display: none; }
.end-bd { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

/* 1.06's message lines (ingameui.ini: MessagePosition X:-10 Y:10, white with a black drop, Albertus MT): at the top right, newest at the foot (GameMessages.js; beta 14 minor 8). Over the end scene too. */
.game-messages { position: fixed; z-index: 7; top: calc(var(--safe-top, 0px) + 10px); right: calc(var(--safe-right, 0px) + 10px); margin: 0; padding: 0; max-width: 60vw; pointer-events: none; text-align: right; font: 400 max(12px, 1.45vh)/1.25 var(--apt-font); color: #fff; text-shadow: 1px 1px 0 #000, 0 0 2px rgba(0, 0, 0, .8); }
.game-messages[hidden] { display: none; }
.game-messages p { margin: 0; white-space: nowrap; }
/* the arc HUD keeps its round map and buttons at the top right: the lines go under them */
:root[data-hud="arc"] .game-messages { top: calc(var(--safe-top, 0px) + var(--mm, 76px) + 22px); }
