/* The HUD: dark instrument panels around the map, like the margin of a staff map.
   One look for every panel (.pane), condensed capitals for labels (.lbl), tabular figures.
   Colours: own = the selection cyan, enemy = red, support and aiming = amber.
   Layout is made for 1920 x 1080 and holds down to about 1280 wide. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../public/fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../public/fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../public/fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../public/fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../public/fonts/barlow-condensed-700.woff2") format("woff2"); }

:root {
  --ink: rgba(15, 20, 24, 0.92);
  --ink-soft: rgba(15, 20, 24, 0.8);
  --edge: rgba(255, 255, 255, 0.14);
  --rule: rgba(255, 255, 255, 0.1);
  --cell: #1c252c;
  --cell-hover: #263139;
  --cell-edge: #33414b;
  --well: #0b0f12;
  --text: #eef1f2;
  --soft: #c9d3d9;
  --muted: #9eabb3;
  --key-edge: #5b6b76;
  --own: #3ccfff;
  --own-fill: #173845;
  --foe: #e0412f;
  --foe-text: #ff8073;
  --amber: #ffb347;
  --ok: #62c370;
  --warn: #e0b341;
  --bad: #e8604f;
  --gap: 16px;
  /* the right column: the building card and the support pane under it (design C) */
  --side-w: 380px;
  /* the solid panels of the right column, the selection and the building card (design I) */
  --solid: rgba(13, 18, 23, 0.97);
  --solid-edge: #2a3640;
  --solid-rule: #22303a;
  --condensed: "Barlow Condensed", "Arial Narrow", sans-serif;
  /* The stacking order, bottom to top, here and nowhere else (no other z-index):
     the map (the canvas, with everything drawn in it), the map's labels (sector name
     tags, the attack target: they belong to the map and never cover a panel),
     the selection box, the HUD panels; inside the HUD the menu lies over the alerts.
     (The labels came after the HUD in the page and so drew over the group bar.) */
  --z-labels: 1;
  --z-selbox: 2;
  --z-hud: 3;
  --z-menu: 1; /* within the HUD */
}

html, body { margin: 0; height: 100%; overflow: hidden; background: #cfd8de; }
body { font: 14px/1.35 "Barlow", system-ui, sans-serif; color: var(--text); }
canvas { display: block; }
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #33424d; font-size: 15px; }
#loading small { font-size: 12px; opacity: 0.8; }
#selbox { position: fixed; z-index: var(--z-selbox); border: 1px solid var(--own); background: rgba(60, 207, 255, 0.12); pointer-events: none; display: none; }

/* every panel takes the pointer: a hover or a click on one never reaches the map (the
   objective, the strength bar and the clock let it through before, and a click there
   selected what lay under them) */
#hud { position: relative; z-index: var(--z-hud); user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; }
#hud [hidden] { display: none !important; }
.pane { background: var(--ink); border: 1px solid var(--edge); border-radius: 3px; box-sizing: border-box; }
.lbl { font: 600 12px/1.2 var(--condensed); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.lbl.hi { color: var(--text); }
.num { font-variant-numeric: tabular-nums; }
kbd { min-width: 16px; height: 16px; box-sizing: border-box; padding: 0 3px; display: grid; place-items: center; border: 1px solid var(--key-edge);
      border-radius: 2px; font: 600 11px/1 "Barlow", system-ui, sans-serif; color: var(--soft); }
/* a bar in a dark well: HP, capacity */
.bar { display: block; height: 6px; background: var(--well); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); }
.bar.warn i { background: var(--warn); }
.bar.bad i { background: var(--bad); }

/* --- the Ghost style (design D, the owner's choice 2026-11-21) for the top, the alerts and
   the groups: text straight on the map, no boxes, a shadow under every letter and a soft
   shade along the top and the left edge, so it reads over white blocks. Two fixed
   gradients, drawn under the HUD's blocks (z-index -1 inside #hud) and never in the
   pointer's way. (Dark panes for each block, design C, before.) The selection panel,
   the building card and the menu stay solid. --- */
#hud::before, #hud::after { content: ""; position: fixed; z-index: -1; pointer-events: none; }
#hud::before { left: 0; right: 0; top: 0; height: 190px; background: linear-gradient(180deg, rgba(6, 10, 14, 0.62), rgba(6, 10, 14, 0.3) 45%, rgba(6, 10, 14, 0)); }
#hud::after { left: 0; top: 0; bottom: 0; width: 340px; background: linear-gradient(90deg, rgba(6, 10, 14, 0.55), rgba(6, 10, 14, 0.25) 60%, rgba(6, 10, 14, 0)); }
#objective, #balance, #topright, #alerts, #groupbar { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.7), 0 0 18px rgba(0, 0, 0, 0.45); }

/* --- top left: the objective, a line of capitals over the goal --- */
#objective { position: fixed; left: calc(var(--gap) + 6px); top: calc(var(--gap) + 4px); max-width: 420px; display: flex; flex-direction: column; gap: 2px; }
#objective .line { font: 600 12px/1.2 var(--condensed); letter-spacing: 0.12em; text-transform: uppercase; color: #d4dee5; white-space: nowrap; }
#objective .goal { font: 600 26px/1.1 var(--condensed); }
#objective.done .goal { color: var(--ok); }

/* --- top centre: both sides' strength, two numbers and a hairline --- */
#balance { position: fixed; left: 50%; top: calc(var(--gap) + 4px); transform: translateX(-50%); height: 40px; display: flex; align-items: center; gap: 12px; }
#balance b { font: 300 34px/1 var(--condensed); }
#balance b[data-side="own"] { color: #5ccfff; }
#balance b[data-side="foe"] { color: #ff7a6c; }
#balance .lbl { font-size: 11px; }
#balance .lbl.own { color: var(--own); }
#balance .lbl.foe { color: var(--foe-text); }
#balance .split { width: 260px; height: 2px; display: flex; }
#balance .split i { display: block; height: 100%; background: #5ccfff; }
#balance .split i + i { flex: 1; background: #ff5f50; }

/* --- top right: cash, clock, speed, view, menu: text and underlines --- */
#topright { position: fixed; right: calc(var(--gap) + 6px); top: var(--gap); height: 46px; display: flex; align-items: center; gap: 18px; }
#cashclock { display: flex; align-items: center; gap: 18px; }
#cashclock .coin { display: none; }
#cash { font: 600 17px/1 "Barlow", system-ui, sans-serif; color: #ffd27f; }
#clock { font: 300 38px/1 var(--condensed); letter-spacing: 0.02em; }
.seg { display: flex; gap: 2px; }
.seg button { min-width: 30px; height: 30px; padding: 0 6px; display: grid; place-items: center; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
              background: transparent; color: #b9c7d0; font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { border-bottom-color: #5ccfff; color: var(--text); }
/* the speed reached when the battle is too big for the speed asked (src/gameclock.js):
   amber, under the buttons, out of the flow (nothing in the row moves when it shows) */
#speed { position: relative; }
#speed-lag { position: absolute; right: 0; top: calc(100% + 3px); font-size: 12px; font-weight: 600; color: #ffd27f; white-space: nowrap; cursor: help; }
/* the setup phase (src/setup.js): "Setup" where the clock is, the speed buttons off, and
   Start the brightest thing on screen: the own colour as a solid fill, the only one */
body.setup #clock { color: var(--own); font-size: 22px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.seg button:disabled { color: #c4d0d8; opacity: 0.5; cursor: default; }
.seg button:disabled:hover { color: #c4d0d8; }
/* (under the strength bar, in the middle: in the top right row it pushed the clock under
   the strength bar at 1366 wide; while an aim's hint shows there, the hint has the place) */
#start { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); height: 50px; padding: 0 16px 0 20px; display: flex; align-items: center; gap: 10px; background: var(--own); border-color: var(--own); color: #06121a;
         font: 700 22px/1 var(--condensed); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
         box-shadow: 0 0 0 3px rgba(60, 207, 255, 0.28), 0 4px 18px rgba(60, 207, 255, 0.35); }
#start:hover { background: #7fe0ff; }
body.aiming #start { display: none; }
#start svg { width: 12px; height: 14px; fill: currentColor; }
#start svg .lock, #start.locked svg .go { display: none; }
#start.locked svg .lock { display: inline; }
/* not ready (docs/muster.md): dark, a cyan hairline, a lock; a click still answers (the
   list under it flashes and the first platoon it names is selected). Ready: lit, breathing. */
#start.locked { background: rgba(6, 10, 14, 0.6); border-color: rgba(92, 207, 255, 0.45); color: #c4d0d8; box-shadow: none; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
#start.locked:hover { background: rgba(6, 10, 14, 0.75); }
#start.locked kbd { border-color: rgba(255, 255, 255, 0.3); color: #c4d0d8; }
#start:not(.locked) { animation: start-ready 2.4s ease-in-out infinite; }
@keyframes start-ready { 50% { box-shadow: 0 0 0 6px rgba(60, 207, 255, 0.14), 0 4px 26px rgba(60, 207, 255, 0.5); } }
#start.deny { animation: start-deny 0.42s ease-in-out; }
@keyframes start-deny { 20% { transform: translateX(calc(-50% - 7px)); } 40% { transform: translateX(calc(-50% + 6px)); } 60% { transform: translateX(calc(-50% - 4px)); } 80% { transform: translateX(calc(-50% + 2px)); } }
@media (prefers-reduced-motion: reduce) { #start:not(.locked), #start.deny { animation: none; } }
/* under Start in setup: the four steps of the muster, then what blocks Start, a line each
   (a click goes there), or the summary once nothing does. Ghost style: text on the shade. */
/* (a soft dark oval behind it: the shade along the top ends above it, and over white blocks
   the lines did not read) */
#ready { position: fixed; left: 50%; top: 128px; transform: translateX(-50%); padding: 8px 40px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px;
         background: radial-gradient(ellipse closest-side, rgba(6, 10, 14, 0.62), rgba(6, 10, 14, 0.38) 60%, rgba(6, 10, 14, 0)); color: var(--text);
         text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.7), 0 0 18px rgba(0, 0, 0, 0.45); }
body.aiming #ready { display: none; }
#ready .steps { margin: 0; padding: 0; list-style: none; display: flex; align-items: center; gap: 10px; }
#ready .steps li { display: flex; align-items: center; gap: 6px; font: 600 12px/1 var(--condensed); letter-spacing: 0.1em; text-transform: uppercase; color: #b9c7d0; white-space: nowrap; }
#ready .steps li + li::before { content: ""; width: 18px; height: 1px; margin-right: 4px; background: rgba(255, 255, 255, 0.35); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
#ready .steps i { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.5); font: 700 11px/1 "Barlow", system-ui, sans-serif;
                  font-style: normal; text-shadow: none; background: rgba(6, 10, 14, 0.5); }
#ready .steps li.done { color: #9be4ff; }
#ready .steps li.done i { border-color: #5ccfff; color: #5ccfff; }
#ready .steps li.now { color: var(--text); }
#ready .steps li.now i { border-color: #5ccfff; background: #5ccfff; color: #06121a; box-shadow: 0 0 0 3px rgba(92, 207, 255, 0.25); }
#ready .issues { display: flex; flex-direction: column; align-items: center; gap: 1px; }
#ready .issues button { display: flex; align-items: center; gap: 7px; padding: 2px 4px; background: transparent; border: 0; font-size: 14px; cursor: pointer; }
#ready .issues button:hover { text-decoration: underline; text-underline-offset: 3px; }
#ready .issues i { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; font: 700 11px/1 "Barlow", system-ui, sans-serif; font-style: normal; text-shadow: none; }
#ready .issues .block i { background: #ffb347; color: #11161a; }
#ready .issues .advice { font-size: 13px; color: #c4d0d8; }
#ready .issues .advice i { color: #ffd27f; }
#ready .issues kbd { margin-left: 2px; border-color: rgba(255, 255, 255, 0.35); text-shadow: none; }
#ready .issues .ok { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: #a6efb4; }
#ready .issues .ok i { background: var(--ok); color: #11161a; }
#ready.flash .issues .block { animation: issue-flash 0.9s ease-out; }
@keyframes issue-flash { 0%, 40% { color: #ffd27f; transform: scale(1.06); } 100% { color: inherit; transform: none; } }
#start kbd { border-color: rgba(6, 18, 26, 0.45); color: #06121a; font-size: 10px; letter-spacing: 0; text-transform: none; }
#menu-btn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; background: transparent; border: 0; color: var(--text); cursor: pointer;
            filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85)); }
#menu-btn:hover { color: #5ccfff; }
#menu-btn svg { width: 20px; height: 20px; fill: currentColor; }
#menu { position: fixed; right: var(--gap); top: 70px; width: 340px; padding: 14px 16px 16px; z-index: var(--z-menu); background: #0f1418; /* opaque: it lies over the alerts */
  max-height: calc(100vh - 70px - var(--gap)); overflow-y: auto; overscroll-behavior: contain; } /* (the key list grew past a 1080 px window: the sound row below it could not be reached, scripts/shot-audio.mjs) */
#menu h2 { margin: 0 0 8px; font: 700 22px/1.1 var(--condensed); }
#menu dl { margin: 10px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
#menu dt { color: var(--muted); }
#menu dd { margin: 0; }
#menu .stats { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--soft); }
/* sound, in the menu: mute and volume (src/audio/control.js; M mutes). While the sound is
   off the menu button carries an amber dot, so it shows with the menu closed. */
#menu .snd { display: block; margin-top: 14px; }
#sound { margin-top: 8px; display: flex; align-items: center; gap: 12px; }
#sound button { flex: none; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; background: var(--cell); border: 1px solid var(--cell-edge);
                border-radius: 2px; cursor: pointer; }
#sound button:hover { background: var(--cell-hover); }
#sound button svg { width: 20px; height: 20px; fill: var(--text); }
#sound button svg path + path { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
#sound button .cross, #sound button.off .waves { display: none; }
#sound button.off .cross { display: inline; stroke: var(--amber); }
#sound input { flex: 1; min-width: 0; height: 6px; margin: 0; -webkit-appearance: none; appearance: none; cursor: pointer;
               background: linear-gradient(to right, var(--own) var(--v, 80%), var(--well) var(--v, 80%)); }
#sound input::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 20px; border-radius: 2px; background: var(--text); }
#sound input::-moz-range-thumb { width: 10px; height: 20px; border: 0; border-radius: 2px; background: var(--text); }
#sound .num { width: 26px; text-align: right; font-size: 13px; color: var(--soft); }
body.muted #sound input { opacity: 0.45; }
body.muted #menu-btn { position: relative; }
body.muted #menu-btn::after { content: ""; position: absolute; right: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }

/* --- what the mouse does while an ability is aimed --- */
#aimhint { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); max-width: calc(100vw - 2 * var(--gap)); padding: 9px 14px; display: flex;
           align-items: center; gap: 12px; border-color: var(--amber); white-space: nowrap; }
#aimhint b { font: 700 15px/1 var(--condensed); letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); }
#aimhint span + span, #aimhint button ~ span { color: var(--muted); }
/* a wall's keys while it is drawn (main.js wallHint): Build and Undo, as Enter and Backspace */
#aimhint button { height: 26px; padding: 0 9px 0 5px; display: flex; align-items: center; gap: 6px; background: var(--cell); border: 1px solid var(--cell-edge);
                  border-radius: 2px; font: 600 13px/1 "Barlow", system-ui, sans-serif; cursor: pointer; }
#aimhint button:hover { background: var(--cell-hover); }
#aimhint button:disabled { opacity: 0.45; cursor: default; }
#aimhint button:disabled:hover { background: var(--cell); }

/* --- alerts, under the clock: a click goes there --- */
/* (Ghost: a line each, right-aligned, the newest on top and the older ones dimmer) */
#alerts { position: fixed; right: calc(var(--gap) + 6px); top: 72px; width: 360px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
/* with the building card or the panel open the alerts stand left of it, below the aim hint's line */
body:is(.card-open, .panel-open) #alerts { right: calc(var(--gap) + var(--side-w) + 12px); top: 116px; }
#alerts button { max-width: 100%; display: flex; align-items: center; gap: 7px; padding: 3px 0; background: transparent; border: 0; text-align: right; cursor: pointer;
                 font-size: 14px; transition: opacity 0.6s; }
#alerts button + button { opacity: 0.72; }
#alerts button:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
#alerts button.old { opacity: 0; }
#alerts .ic { flex: none; width: 15px; height: 15px; display: grid; place-items: center; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85)); }
#alerts .ic svg { width: 15px; height: 15px; fill: var(--text); }
#alerts .txt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#alerts .txt b { font-weight: 600; }
#alerts .txt span { margin-left: 4px; color: #c4d0d8; }
/* the kind's colour on the icon only (cyan or amber text over white blocks read badly) */
#alerts .loss svg { fill: #ff7a6c; }
#alerts .support svg { fill: #ffd27f; }
#alerts .own svg { fill: #5ccfff; }
#alerts .good svg { fill: #7fdc8c; }

/* --- bottom left: the plotter minimap (design J; src/minimap.js draws the grey map and its
   1 km grid): a white hairline frame; north centred over its top edge; ticks every half
   grid on its bottom and right edges, outside the map; the km under the bottom ticks, so the
   grid itself is the scale. Nothing on the map: units and zones show there (the owner's
   call, 2026-11-22: a north chip and a scale bar sat in two corners of it before, and the
   data credit took a line under it; that is in the menu now). No pane round it. --- */
/* (240 px wide: 320 took too much of the screen, the owner's call) */
#minimap { position: fixed; left: var(--gap); bottom: calc(var(--gap) - 4px); width: 240px; padding: 17px 0 21px; }
#minimap .map { position: relative; width: 240px; cursor: crosshair; outline: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
#minimap canvas { width: 240px; }
#minimap canvas + canvas { position: absolute; left: 0; top: 0; }
#minimap .map::before, #minimap .map::after { content: ""; position: absolute; pointer-events: none; }
#minimap .map::before { left: 0; right: 0; bottom: -7px; height: 6px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 1px, transparent 1px calc(var(--grid-px, 58px) / 2)); }
#minimap .map::after { top: 0; bottom: 0; right: -7px; width: 6px; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0 1px, transparent 1px calc(var(--grid-px, 58px) / 2)); }
#minimap .north, #minimap .km { position: absolute; pointer-events: none; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6); }
#minimap .north { left: 50%; top: -17px; transform: translateX(-50%); display: flex; align-items: center; gap: 3px; font: 700 11px/1 var(--condensed); letter-spacing: 0.04em; }
#minimap .north svg { width: 8px; height: 10px; fill: currentColor; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8)); }
#minimap .km { left: 0; right: 0; top: calc(100% + 8px); height: 12px; }
#minimap .km span { position: absolute; top: 0; transform: translateX(-50%); font: 600 10px/12px var(--condensed); }
#minimap .km span:first-child { transform: none; }
#minimap .km small { margin-left: 1px; font-size: 9px; color: #d6dde1; }
#menu .credits { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
#menu .credits a { color: var(--text); }

/* --- left, between the objective and the minimap: the own groups (src/groupbar.js) ---
   Its top and its room come from the blocks around it (--obj-h, --mm-h, set by main.js);
   the list scrolls when the groups do not fit. */
/* (design I, the owner's choice 2026-11-21: a 32 px row per group, 20 fit at 1080 high;
   in the Ghost style on the left edge's shade: no box, the text with a shadow. A light
   dark wash, before) */
#groupbar { position: fixed; left: var(--gap); top: calc(var(--gap) + var(--obj-h, 60px) + 14px); width: 280px; box-sizing: border-box;
            max-height: calc(100vh - 2 * var(--gap) - var(--obj-h, 60px) - var(--mm-h, 250px) - 28px); display: flex; flex-direction: column; }
#groupbar .head { flex: none; height: 24px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; }
#groupbar .head .lbl { color: #d4dee5; }
#groupbar .head i { font-style: normal; color: #c4d0d8; }
#groupbar .head i.full { color: #ffd27f; }
#groupbar .list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; }
#groupbar .grp { flex: none; height: 32px; padding: 0 10px; display: grid; grid-template-columns: 20px minmax(0, 1fr) 48px 30px; align-items: center; gap: 8px;
                 text-align: left; background: transparent; border: 0; border-left: 2px solid transparent; cursor: pointer; }
#groupbar .grp:hover { background: rgba(255, 255, 255, 0.08); }
#groupbar .grp.on { background: rgba(60, 207, 255, 0.2); border-left-color: var(--own); }
#groupbar .grp kbd { border-color: transparent; padding: 0; justify-content: start; font-size: 12px; color: #c4d0d8; }
#groupbar .grp.on kbd { color: var(--own); }
#groupbar .grp .who { min-width: 0; display: flex; align-items: center; gap: 8px; }
#groupbar .grp .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
#groupbar .grp .name { min-width: 0; font: 600 17px/1 var(--condensed); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#groupbar .grp .bar { height: 2px; background: rgba(255, 255, 255, 0.22); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
#groupbar .grp .str { text-align: right; font-size: 12px; font-weight: 600; color: #d4dee5; }
/* the mode: a dot colour each, so the bar reads at a glance */
#groupbar .mode-deploy .dot { background: var(--own); }
#groupbar .mode-contact .dot { background: var(--amber); }
#groupbar .mode-clear .dot { background: var(--ok); }
/* stretched or more (groups.status().org): the count in amber, red when overstretched */
#groupbar .grp.stretched .str { color: var(--warn); }
#groupbar .grp.overstretched .str { color: var(--foe-text); }
/* a stalled group, or one past its loss limit: red, and it stays red until it moves on */
#groupbar .grp.alarm { border-left-color: var(--bad); }
#groupbar .grp.alarm .dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(232, 96, 79, 0.3); }
#groupbar .grp.alarm .name { color: var(--foe-text); }
/* setup (docs/muster.md): a platoon still a plan, and the New platoon button under the list.
   A plan's dot is hollow amber and what it lacks stands where the strength bar goes. The
   button is a dashed slot, the next platoon's place; with no platoon at all it is the
   brightest thing on the left, filled cyan (the first step of the muster). */
#groupbar .grp.plan .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--amber); }
#groupbar .grp .lack { justify-self: start; font: 600 11px/1 var(--condensed); letter-spacing: 0.1em; text-transform: uppercase; color: #ffd27f; white-space: nowrap; }
#groupbar .raise { flex: none; margin: 6px 0 0; height: 36px; padding: 0 10px; display: flex; align-items: center; gap: 8px; background: rgba(6, 10, 14, 0.35);
                   border: 1px dashed rgba(255, 255, 255, 0.45); border-radius: 3px; color: var(--text); cursor: pointer; text-shadow: inherit; }
#groupbar .raise:hover { border-style: solid; border-color: #5ccfff; background: rgba(60, 207, 255, 0.16); }
#groupbar .raise .plus { width: 18px; font: 600 20px/1 "Barlow", system-ui, sans-serif; color: #5ccfff; text-align: center; }
#groupbar .raise b { flex: 1; text-align: left; font: 700 15px/1 var(--condensed); letter-spacing: 0.06em; text-transform: uppercase; }
#groupbar .raise i { font-style: normal; font-size: 13px; font-weight: 600; color: #ffd27f; }
#groupbar .raise kbd { border-color: rgba(255, 255, 255, 0.35); color: #d4dee5; }
#groupbar .raise.off { opacity: 0.5; }
#groupbar.empty .raise { height: 44px; border: 0; background: var(--own); color: #06121a; text-shadow: none;
                         box-shadow: 0 0 0 3px rgba(60, 207, 255, 0.28), 0 4px 18px rgba(60, 207, 255, 0.35); animation: raise-pulse 2.4s ease-in-out infinite; }
#groupbar.empty .raise:hover { background: #7fe0ff; }
#groupbar.empty .raise :is(.plus, i) { color: #06121a; }
#groupbar.empty .raise kbd { border-color: rgba(6, 18, 26, 0.45); color: #06121a; }
@keyframes raise-pulse { 50% { box-shadow: 0 0 0 6px rgba(60, 207, 255, 0.12), 0 4px 22px rgba(60, 207, 255, 0.45); } }
@media (prefers-reduced-motion: reduce) { #groupbar.empty .raise { animation: none; } }
/* "No group" and "Fleet": a line of text under the groups (Ghost) */
#groupbar .extra { flex: none; display: flex; gap: 16px; padding: 8px 10px 0; }
#groupbar .extra button { height: 24px; padding: 0; display: flex; align-items: center; gap: 6px; background: transparent; border: 0; border-bottom: 2px solid transparent;
                          color: #d4dee5; cursor: pointer; }
#groupbar .extra button:hover { color: var(--text); }
#groupbar .extra button.on { border-bottom-color: var(--own); color: var(--text); }
#groupbar .extra button b { font: 600 12px/1 var(--condensed); letter-spacing: 0.1em; text-transform: uppercase; }
#groupbar .extra button i { font-style: normal; font-size: 12px; color: #c4d0d8; }
#groupbar .extra button:disabled { cursor: default; opacity: 0.45; }

/* --- right, under the cash pane: what is selected (design I, the owner's choice
   2026-11-21: a solid panel, one column, its orders as a strip at its foot). The panel and
   the building card (#card) take the same place and never show together: a building opens
   the card, anything else the panel. It scrolls when it is taller than the screen.
   (Bottom centre in two columns, with the order tiles in the bottom right, before.) --- */
:is(#panel, #card, #orders) { background: var(--solid); border-color: var(--solid-edge); }
:is(#panel, #card) { box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4); }
#selection { position: fixed; right: var(--gap); top: calc(var(--gap) + 46px + 8px); width: var(--side-w); max-height: calc(100vh - 2 * var(--gap) - 46px - 8px);
             display: flex; flex-direction: column; pointer-events: none; }
#selection > * { pointer-events: auto; }
/* the close button in the corner of the panel and the card: as Esc */
:is(#panel, #card) .close { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; padding: 0; background: transparent; border: 0; border-radius: 2px;
                            color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
:is(#panel, #card) .close:hover { background: var(--cell-hover); color: var(--text); }

#panel { position: relative; display: none; flex: 0 1 auto; min-height: 0; flex-direction: column; overflow-y: auto; scrollbar-width: thin; }
#panel .sum { flex: none; box-sizing: border-box; padding: 14px 44px 12px 16px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--solid-rule); }
/* a group's head: its key, name and mode (the key is after the name in the page) */
#panel .ghd { display: flex; align-items: center; gap: 10px; min-width: 0; }
#panel .ghd .title { min-width: 0; font-size: 26px; line-height: 1; }
#panel .ghd .gkey { order: -1; flex: none; width: 26px; height: 26px; border: 0; background: var(--own); color: #06121a; font-size: 13px; }
#panel .tag { flex: none; padding: 3px 7px; border: 1px solid currentColor; border-radius: 2px; font: 600 11px/1 var(--condensed); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
#panel .tag.alarm { color: var(--foe-text); background: rgba(224, 65, 47, 0.16); }
#panel .hp .row { display: flex; justify-content: space-between; gap: 10px; }
#panel .hp .row b { font-weight: 600; color: var(--text); }
/* a group's counts: a grid of figures over their names */
#panel .stats { margin: -12px -16px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--solid-rule); }
#panel .stats div { padding: 10px 16px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
#panel .stats div:nth-child(3n) { border-right: 0; }
#panel .stats b { font: 600 22px/1 var(--condensed); }
#panel .stats span { font-size: 11.5px; color: var(--muted); }
#panel .sec { display: flex; flex-direction: column; gap: 10px; }
#panel .muster + .stats { margin-top: 0; }
#panel .tag.plan { color: #ffd27f; }
#panel .why.plan { font-size: 14px; line-height: 1.35; min-height: 2.7em; color: var(--soft); } /* (two lines whatever the step: no shift below it) */
#panel .tag.plan.ready { color: var(--ok); }

/* a platoon's composition in setup (docs/muster.md; panel.js musterBlock): the men against
   the cap as a bar split by type (foot cyan, vehicles steel), the templates while it is
   empty, a row per unit type with − count +, the modifier keys and the cost */
#panel .muster { margin: -12px -16px 0; padding: 12px 16px 10px; display: flex; flex-direction: column; border-bottom: 1px solid var(--solid-rule); }
#panel .muster .mhead { display: flex; justify-content: space-between; align-items: baseline; }
#panel .muster .cap { font-size: 12px; color: var(--muted); }
#panel .muster .cap b { font: 600 18px/1 var(--condensed); color: var(--text); }
#panel .capbar { margin: 8px 0 10px; height: 6px; display: flex; gap: 2px; }
#panel .capbar i { display: block; min-width: 2px; border-radius: 1px; transition: flex-grow 0.18s ease-out; }
#panel .capbar .foot { background: var(--own); }
#panel .capbar .veh { background: #a9c4d6; }
#panel .capbar .free { background: var(--well); box-shadow: inset 0 0 0 1px var(--rule); }
#panel .capbar.full i:not(.free) { box-shadow: 0 0 6px rgba(60, 207, 255, 0.5); }
/* the note line: always there and one line high (the click keys, or why the last buy
   stopped short), so nothing under it moves when a note comes or goes */
#panel .mline { height: 28px; margin: -2px 0 10px; padding: 0 9px; box-sizing: border-box; display: flex; align-items: center; border-radius: 2px; border: 1px solid transparent;
                font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
#panel .mline > span { overflow: hidden; text-overflow: ellipsis; }
#panel .mline kbd { display: inline-grid; margin: 0 2px; font-size: 10px; }
#panel .mline.warn { background: rgba(255, 179, 71, 0.12); border-color: rgba(255, 179, 71, 0.4); font-size: 12.5px; color: #ffd27f; }
#panel .tpls { margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
#panel .tgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#panel .tgrid button { padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 8px; text-align: left; background: var(--cell);
                       border: 1px solid var(--cell-edge); border-radius: 3px; cursor: pointer; }
#panel .tgrid button:hover { border-color: #5ccfff; background: var(--cell-hover); }
#panel .tgrid b { font: 700 16px/1.1 var(--condensed); }
#panel .tgrid span { grid-row: 2; font-size: 12px; color: var(--muted); }
#panel .tgrid i { grid-row: span 2; align-self: center; font-style: normal; font-size: 13px; font-weight: 600; color: #ffd27f; }
#panel .tgrid button.off { opacity: 0.45; }
#panel .tgrid button.off:hover { border-color: var(--cell-edge); background: var(--cell); }
#panel .muster .rows { display: flex; flex-direction: column; }
#panel .mrow { height: 44px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-top: 1px solid var(--rule); }
#panel .mrow .ic { width: 24px; height: 24px; fill: var(--muted); }
#panel .mrow.has .ic { fill: var(--text); }
#panel .mrow .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#panel .mrow .what b { font: 600 15px/1.1 var(--condensed); letter-spacing: 0.02em; }
#panel .mrow .what span { font-size: 12px; color: #ffd27f; }
#panel .mrow:not(.has) .what b { color: var(--soft); }
#panel .step { display: flex; align-items: center; gap: 4px; }
#panel .step b { min-width: 30px; text-align: center; font: 600 17px/1 var(--condensed); }
#panel .mrow:not(.has) .step b { color: var(--muted); }
#panel .step button { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; background: var(--cell); border: 1px solid var(--cell-edge); border-radius: 3px;
                      font: 500 19px/1 "Barlow", system-ui, sans-serif; color: var(--text); cursor: pointer; }
#panel .step button:hover { background: var(--cell-hover); }
#panel .step .add:hover { border-color: #5ccfff; color: #5ccfff; }
#panel .step .sub:hover { border-color: var(--foe-text); color: var(--foe-text); }
#panel .step button:active { transform: translateY(1px); }
#panel .step button:disabled, #panel .step button.off { opacity: 0.3; cursor: default; }
#panel .step button:disabled:hover, #panel .step button.off:hover { background: var(--cell); border-color: var(--cell-edge); color: var(--text); }
#panel .mfoot { margin-top: 8px; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); }
#panel .mfoot kbd { display: inline-grid; margin: 0 2px; font-size: 10px; }
#panel .mfoot b { font-size: 14px; color: #ffd27f; }
/* (the building card, right, shares these with the panel: src/buildingcard.js) */
:is(#panel, #card) .title { font: 700 22px/1.1 var(--condensed); overflow-wrap: anywhere; }
/* an asset's panel: the colour its building takes on the map */
#panel .title .swatch { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: 1px; border-radius: 2px; border: 1px solid rgba(0, 0, 0, 0.45); }
#panel .title.big { font-size: 28px; line-height: 1; }
:is(#panel, #card) .type { font-size: 13px; color: var(--muted); }
:is(#panel, #card) .type .own { color: var(--own); }
:is(#panel, #card) .type .foe { color: var(--foe-text); }
:is(#panel, #card) .hp { display: flex; flex-direction: column; gap: 4px; }
:is(#panel, #card) .hp span { font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
#panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; }
#panel dt { color: var(--muted); }
#panel dd { margin: 0; overflow-wrap: anywhere; }
#panel .main { flex: none; min-width: 0; box-sizing: border-box; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
:is(#panel, #card) .ghead { display: flex; align-items: center; gap: 12px; }
:is(#panel, #card) .ghead b { font: 700 18px/1 var(--condensed); font-variant-numeric: tabular-nums; white-space: nowrap; }
:is(#panel, #card) .ghead .note { font-size: 13px; color: var(--muted); white-space: nowrap; }
:is(#panel, #card) .slots { flex: 1; display: flex; gap: 2px; }
:is(#panel, #card) .slots i { flex: 1; height: 6px; background: var(--cell-edge); }
:is(#panel, #card) .slots i.in { background: var(--own); }
:is(#panel, #card) .slots.foe i.in { background: var(--foe); }
:is(#panel, #card) .hint { font-size: 13px; color: var(--muted); }
#panel .hint .own { color: var(--own); }
/* unit cards: grouped by type, a label over each group */
:is(#panel, #card) .types { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; } /* the starting force of 13 fits on one row */
:is(#panel, #card) .grp { display: flex; flex-direction: column; gap: 5px; }
:is(#panel, #card) .grp .lbl { height: 14px; line-height: 14px; letter-spacing: 0.08em; }
:is(#panel, #card) .cards { display: flex; gap: 4px; }
:is(#panel, #card) .cards { flex-wrap: wrap; }
:is(#panel, #card) .card { position: relative; width: 38px; height: 50px; box-sizing: border-box; border-radius: 2px; background: var(--cell); border: 1px solid var(--cell-edge);
               cursor: pointer; }
:is(#panel, #card) .card:hover { background: var(--cell-hover); }
:is(#panel, #card) .card.sel { border-color: var(--own); background: var(--own-fill); } /* the selection colour (SELECT_COLOR in units.js) */
:is(#panel, #card) .card.coming { opacity: 0.6; border: 1px dashed var(--muted); background: transparent; }
:is(#panel, #card) .card .ic { position: absolute; left: 5px; top: 5px; width: 26px; height: 26px; fill: var(--text); }
:is(#panel, #card) .card .st { position: absolute; right: 2px; top: 2px; width: 9px; height: 9px; fill: var(--amber); }
:is(#panel, #card) .card .hpb { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 4px; background: var(--well); overflow: hidden; }
:is(#panel, #card) .hpb i { display: block; height: 100%; background: var(--ok); }
:is(#panel, #card) .hpb.warn i { background: var(--warn); }
:is(#panel, #card) .hpb.bad i { background: var(--bad); }
:is(#panel, #card) .more { font-size: 13px; color: var(--muted); }
:is(#panel, #card) .cards .more { align-self: center; padding-left: 4px; white-space: nowrap; }

/* --- right, under the cash pane: the building card (src/buildingcard.js, design C's
   content in design I's solid panel), where the panel is; it scrolls past the screen's foot --- */
#card { position: fixed; right: var(--gap); top: calc(var(--gap) + 46px + 8px); width: var(--side-w); box-sizing: border-box;
        max-height: calc(100vh - 2 * var(--gap) - 46px - 8px); overflow-y: auto; scrollbar-width: thin;
        padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
#card .head { display: flex; flex-direction: column; gap: 6px; padding-right: 28px; }
#card .title { font-size: 24px; line-height: 1.05; }
#card > .lbl { margin-top: 2px; }
/* a special building: what it can become */
#card > .note { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #2a2112; border: 1px solid #6b4f1c; border-radius: 3px; font-size: 13px; color: #ffcf8a; }
#card > .note svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--amber); stroke-width: 2; }
#card > .alert { font-size: 13px; color: var(--foe-text); }
#card .row { box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; text-align: left; background: var(--cell);
             border: 1px solid var(--cell-edge); border-radius: 3px; color: var(--text); }
#card button.row { cursor: pointer; }
#card button.row:hover { background: var(--cell-hover); border-color: var(--amber); }
#card .row .ic { flex: none; width: 22px; height: 22px; }
#card .row .what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#card .row .what b { font: 700 17px/1 var(--condensed); }
#card .row .what > span { font-size: 12.5px; color: var(--soft); }
#card .row .price { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
#card .row .price b { font-weight: 600; color: var(--amber); }
#card .row .price i { font-style: normal; font-size: 12px; color: var(--foe-text); white-space: nowrap; }
/* short of money, or refused: greyed, the reason in words */
#card .row:is(.need, .refused) { background: #161d22; }
#card .row:is(.need, .refused) .ic { opacity: 0.45; }
#card .row:is(.need, .refused) .price b { color: #8a96a0; }
#card .row.refused .what > * { color: var(--muted); }
/* the current type (or fortify done): its building colour round the row */
#card .row:is(.current, .enemy, .building) { border-color: var(--kind); background: #13202a; }
#card .row.enemy b { color: var(--foe-text); }
#card .row .bar { height: 5px; }
#card .sell { flex: none; padding: 6px 8px; background: transparent; border: 1px solid var(--cell-edge); border-radius: 2px; font-size: 12.5px; color: var(--soft); cursor: pointer; white-space: nowrap; }
#card .sell:hover { background: var(--cell-hover); color: var(--text); }
#card .ghead { margin-top: 4px; }
/* one unit: a big icon beside its name */
#panel .unitcard { display: flex; gap: 12px; align-items: flex-start; }
#panel .unitcard .ic.big { flex: none; width: 52px; height: 52px; padding: 6px; box-sizing: border-box; border-radius: 2px; background: var(--cell);
                           border: 1px solid var(--cell-edge); fill: var(--text); }
#panel .unitcard .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#panel .unitcard .title { font-size: 22px; }
/* a group: its mode, its reason in words, what it needs, its units by type, its loss limit
   (the mode colours also serve one unit's group line, .member) */
:is(#panel, #card) .mode-deploy { color: var(--own); }
:is(#panel, #card) .mode-contact { color: var(--amber); }
:is(#panel, #card) .mode-clear { color: var(--ok); }
:is(#panel, #card) .mode-stalled { color: var(--foe-text); }
/* one unit's platoon (panel.js memberLine): its key and name as a button that selects it,
   its mode, its reason in two lines at most, then the unit's kills. In the unit panel and
   in a building's card (a unit picked by its card; only #panel had these until 2026-11-22,
   and the button showed as a blank white box there) */
:is(#panel, #card) .member { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
:is(#panel, #card) .member .row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--soft); }
:is(#panel, #card) .member button { height: 26px; padding: 0 9px 0 5px; display: flex; align-items: center; gap: 6px; background: var(--cell); border: 1px solid var(--cell-edge);
                        border-radius: 2px; color: var(--text); cursor: pointer; }
:is(#panel, #card) .member button:hover { background: var(--cell-hover); border-color: var(--own); }
:is(#panel, #card) .member button b { font: 700 15px/1 var(--condensed); letter-spacing: 0.02em; }
:is(#panel, #card) .member .none { color: var(--muted); }
#card .member .row { width: auto; padding: 0; background: none; border: 0; } /* (not a buy row: #card .row) */
:is(#panel, #card) .member .gkills { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--text); }
:is(#panel, #card) .member .gwhy { font-size: 12px; line-height: 1.3; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#panel .why { font-size: 15px; line-height: 1.35; color: var(--text); }
#panel .why.alarm { color: var(--foe-text); }
#panel .needs { margin-top: -4px; font-size: 13px; color: var(--warn); }
#panel .org { font-size: 13px; color: var(--soft); }
#panel .org.stretched { color: var(--warn); }
#panel .org.overstretched { color: var(--foe-text); }
/* a platoon's units (panel.js showGroup): a card each, by type; the cards and the +N of a
   very large platoon (a button: selects that type) */
#panel .units { display: flex; flex-direction: column; gap: 8px; }
#panel .units .uhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
#panel .units .uhint { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
#panel .cards button.more { height: 50px; padding: 0 8px; border: 1px dashed var(--cell-edge); border-radius: 2px; background: transparent; color: var(--soft); font: 600 13px/1 "Barlow", system-ui, sans-serif; cursor: pointer; }
#panel .cards button.more:hover { border-color: var(--own); color: var(--text); }
/* a unit inside a building: a small building outline at the card's top left */
:is(#panel, #card) .card .in { position: absolute; left: 2px; top: 2px; width: 9px; height: 9px; fill: var(--soft); }
#panel .loss { display: flex; align-items: center; gap: 10px; }
#panel .loss .seg { padding: 0; gap: 2px; }
#panel .loss .seg button { min-width: 44px; height: 26px; border: 1px solid var(--cell-edge); background: var(--cell); font-size: 13px; }
#panel .loss .seg button.on { background: var(--text); border-color: var(--text); color: #11161a; }
#panel .loss .note { font-size: 12px; color: var(--muted); }
#panel .loss .note.bad { color: var(--foe-text); }

/* --- bottom, right of the minimap: the support rail (design J, the owner's choice
   2026-11-21). A family each (Air, Guns, Works) with its label over a row of square keys:
   icon, hotkey or count in the corner, a cooldown line along the foot. The key under the
   pointer shows its card above the rail (#railtip, src/railtip.js). It holds a dozen keys
   in one row before it meets the right column. No pane round it: the keys are the panel.
   (Design C's support pane in the bottom right, with 72 px named tiles, before.) --- */
#rail { position: fixed; left: calc(var(--gap) + 240px + 24px); bottom: var(--gap); display: flex; align-items: flex-end; gap: 14px; }
#rail .fam { display: flex; flex-direction: column; gap: 6px; }
#rail .fam > .lbl { color: var(--text); font-size: 11px; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.9); }
#rail > .fam:first-child > .lbl { color: var(--amber); }
#rail .keys { display: flex; gap: 4px; }
#buildbar { display: contents; }
#rail button { position: relative; width: 50px; height: 50px; padding: 0; overflow: hidden; display: grid; place-items: center; background: var(--ink-soft);
               border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 2px; color: var(--text); cursor: pointer; }
#rail button:hover, #rail button:focus-visible { background: var(--cell-hover); border-color: var(--amber); }
#rail button svg { width: 22px; height: 22px; fill: var(--text); }
#rail button kbd { position: absolute; left: 3px; top: 3px; min-width: 0; height: auto; padding: 0; border: 0; font-size: 10px; color: var(--soft); }
#rail button .left { position: absolute; right: 3px; top: 2px; font: 600 11px/1 var(--condensed); font-style: normal; color: var(--soft); }
#rail button.off, #rail button.cooling { cursor: default; border-color: rgba(255, 255, 255, 0.12); }
#rail button:is(.off, .cooling) svg { opacity: 0.3; }
#rail button.on, #rail button.aiming { background: #4a3a1c; border: 2px solid var(--amber); }
.ability { border-color: var(--amber); }
.ability::before { content: ""; width: 24px; height: 24px; background: var(--amber); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.ability:is(.cooling, .off)::before { opacity: 0.25; }
.ability .cd { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--amber); pointer-events: none; }
.ability .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ability .left { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: grid; place-items: center; font: 700 17px/1 var(--condensed); font-variant-numeric: tabular-nums; }
.ability[data-id="airstrike"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2 6 7 4v2l-7-2 -1 5 3 2v2l-4-1-4 1v-2l3-2-1-5-7 2v-2l7-4z'/%3E%3C/svg%3E"); }
/* the selection's orders: a strip of text buttons at the panel's foot, one frame with it (design I) */
#orders { flex: none; margin-top: -1px; border: 1px solid var(--solid-edge); border-radius: 0 0 3px 3px; overflow: hidden; }
#orders:empty { display: none; }
#orders .grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
#orders button { height: 44px; padding: 0 8px; display: flex; align-items: center; justify-content: center; gap: 7px; background: transparent; border: 0;
                 border-left: 1px solid var(--solid-rule); cursor: pointer; }
#orders button:first-child { border-left: 0; }
#orders button:hover { background: var(--cell-hover); }
#orders button .name { min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#orders button kbd { flex: none; border-color: transparent; color: var(--muted); }
/* orders wait while an ability is aimed (the aim takes the mouse) */
body.aiming #orders .grid { opacity: 0.4; pointer-events: none; }
/* the rail's card: name, price and key, what it does, its state (src/railtip.js); fixed,
   its left and bottom set from the key */
#railtip { position: fixed; width: 280px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; background: #0f1418; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); pointer-events: none; }
#railtip .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
#railtip .head b { font: 700 19px/1.1 var(--condensed); }
#railtip .head span { font-size: 12px; font-weight: 600; color: var(--amber); white-space: nowrap; }
#railtip p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--soft); }
#railtip .state { font: 600 11px/1.3 var(--condensed); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok); }
#railtip .state.bad { color: var(--warn); }
/* beside the cursor while placing: green may, red may not, and why */
#placetip { position: fixed; left: 0; top: 0; padding: 4px 8px; border-radius: 2px; background: var(--ink); border: 1px solid var(--ok); color: var(--text);
            font: 600 13px/16px "Barlow", system-ui, sans-serif; white-space: nowrap; pointer-events: none; z-index: 2; }
#placetip.bad { border-color: var(--bad); color: var(--foe-text); }
/* an asset's panel */
#panel .type .unguarded { color: var(--amber); }
#panel .why.state-building { color: var(--amber); }

/* --- on the map: the sector name tags and the attack target ---
   All in the labels layer (--z-labels), under the HUD, and never in the pointer's way.
   (The garrison badges over held roofs went: a building's colour says it now.) */
#sectortags, #target { z-index: var(--z-labels); }
/* the name tag on each own sector (src/sectorview.js): a click selects its group (src/main.js) */
#sectortags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#sectortags .sectortag { position: absolute; left: 0; top: 0; padding: 2px 7px; border-radius: 2px; background: rgba(15, 20, 24, 0.72); color: var(--own);
                         pointer-events: auto; cursor: pointer;
                         font: 700 13px/16px var(--condensed); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
#sectortags .sectortag.sel { background: var(--own); color: #11161a; }
#target { position: fixed; left: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 5px 9px; pointer-events: none; white-space: nowrap; }
#target[hidden] { display: none; } /* (outside #hud now: its [hidden] rule does not reach it) */
#target > i { width: 8px; height: 8px; border-radius: 50%; background: var(--foe); }
#target b { font-size: 13px; font-weight: 600; }
#target .bar { width: 44px; height: 4px; }
#target .lbl { color: var(--foe-text); }

/* (the strength bar went at 1340 px before the cash pane joined the clock: it now meets
   the top right row under 1500 px) */
/* (the Ghost top is narrower than the panes were: the strength meets the top right row
   only under 1,280 px now, 1,500 before) */
@media (max-width: 1500px) { :root { --side-w: 340px; } #balance .split { width: 170px; } }
@media (max-width: 1280px) { #balance { display: none; } }
@media (max-width: 1180px) { #objective { max-width: 280px; } #alerts { width: 240px; } }