/* BROWNOUT's other screens: the map, the party panel. They speak the HUD's language: the palette,
   faces, sizes and timings are custom properties (src/data/hud.js, src/data/ui2.js), state arrives as data-* attributes
   and the hidden attribute, and nothing is set under 0.875rem, so the smallest label is 14px or more at any window size.
   The map is a canvas with a DOM chrome over it; the party panel reuses the HUD's sheet. */

/* ── map ─────────────────────────────────────────────────────────────────────────────────────── */
/* The map has the whole frame: the HUD would show through its header and key. */
html[data-view='map'] #hud { visibility: hidden; }
.map { position: absolute; inset: 0; overflow: hidden; background: var(--sheet); outline: none; pointer-events: auto; }
.map-canvas, .map-over { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.map-canvas { cursor: grab; touch-action: none; }
.map-canvas[data-drag='1'] { cursor: grabbing; }
.map-over, .map-marks { pointer-events: none; }
.map-marks { position: absolute; inset: 0; overflow: hidden; }

/* The chrome is a grid of its own: the head above, the probe under it, the key below, so nothing overlaps in a half-screen window. */
.map-chrome {
  position: absolute; inset: var(--edge);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; row-gap: 1rem;
  pointer-events: none;
  text-shadow: 0 0 .5em var(--shade), 0 0 .15em var(--shade);
}
.map-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.2rem; }
.map-where { display: flex; flex-direction: column; min-width: 0; }
/* The map's name and the place the player is in are labels (the system's: small capitals, tracked, dim), not headings. */
.map-label { font: var(--weight-label) var(--size-label) / var(--label-lead) var(--font-text); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-dim); overflow-wrap: anywhere; }

.map-probe {
  grid-row: 2; align-self: start; justify-self: start;
  max-width: var(--probe-w); padding-left: .9rem;
  border-left: 1px solid var(--ink-faint);
}
.map-probe p { margin: 0; overflow-wrap: anywhere; }
.p-title { font-size: 1.05rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.p-note { font-size: 1rem; color: var(--ink-dim); }

/* The foot stands on the bottom of the frame: where the legend wraps, the hints do not float up the map beside it. */
.map-foot { display: flex; flex-wrap: wrap; align-items: flex-end; align-content: flex-end; justify-content: space-between; gap: .6rem 2rem; }
/* The keys at the foot, as a sheet's foot has them (sheet.css): each its key drawn and then its word, in the label's face, wrapping onto more rows where the room is short. The chrome takes no pointer, so the ones that act (Centre, Close) take it back. */
.hints {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--foot-gap-y) var(--foot-gap-x);
  font: var(--weight-label) var(--size-label) / var(--label-lead) var(--font-text); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-dim);
}
.map-key { display: inline-flex; align-items: center; gap: var(--key-gap); }
button.map-key { margin: 0; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; pointer-events: auto; transition: color var(--warm); }
button.map-key:hover:not(:disabled), button.map-key:focus-visible:not(:disabled) { background: none; color: var(--ink); }
button.map-key:focus-visible { outline: 1px solid var(--ink-dim); outline-offset: var(--key-gap); }
.legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem;
  margin: 0; padding: 0; list-style: none;
  font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim);
}
.lg { display: flex; align-items: center; gap: .55rem; }
.sw { display: block; width: 1.3rem; height: .85rem; border: 1px solid var(--rule); }
/* The ground, as the map paints it: lit is the warm white of a lamp, fading an ember that breathes, gone a cold lavender with the hatch; and cut off, the red dashes round it. */
.lg[data-kind='lit'] .sw { background: var(--ground-lit); border-color: transparent; }
.lg[data-kind='fading'] .sw { background: color-mix(in srgb, var(--ground-fading) 65%, transparent); border-color: transparent; animation: glow var(--breathe) ease-in-out infinite alternate; }
.lg[data-kind='gone'] .sw {
  background: repeating-linear-gradient(135deg, var(--ground-gone) 0 2px, transparent 2px .35rem), color-mix(in srgb, var(--ground-gone) 24%, transparent);
  border-color: transparent;
}
.lg[data-kind='cut'] .sw { background: transparent; border: 2px dashed var(--ground-cut); }
@keyframes glow { from { opacity: .45; } to { opacity: 1; } }
.lg[data-kind='line'] .sw { height: 0; width: 1.2rem; border-top: 2px solid var(--ink); background: transparent; }
/* Wire within the dark's reach: the wire with the bars the map crosses it by (UI2.map.cable.reach), in the map's ink. */
.lg[data-kind='reach'] .sw { width: 1.2rem; height: .7rem; border: 0; background: linear-gradient(var(--ink), var(--ink)) 0 50% / 100% 2px no-repeat, repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px .4rem); }
/* The markers the map draws, as they are drawn: a device, you, someone else, a hostile, a body. */
.lg[data-kind='device'] .sw { width: .7rem; background: transparent; border: 2px solid var(--ink); }
.lg[data-kind='you'] .sw { width: 1.1rem; height: 1.1rem; border: 0; background: var(--you); clip-path: polygon(50% 0, 100% 100%, 50% 72%, 0 100%); }
.lg[data-kind='door'] .sw { width: .9rem; height: 1rem; background: transparent; border: 2px solid var(--amber); border-bottom: 0; }
.lg[data-kind='job'] .sw { width: 1rem; height: 1rem; border: 2px solid var(--amber); border-radius: 50%; background: radial-gradient(circle, var(--amber) 0 .14rem, transparent .15rem); }
.lg[data-kind='camp'] .sw { width: .8rem; height: .8rem; margin: 0 .1rem; background: transparent; border: 2px solid var(--ink); transform: rotate(45deg); }
.lg[data-kind='lamp'] .sw { width: .75rem; height: .75rem; border: 0; border-radius: 50%; background: var(--ground-lamp); }
.lg[data-kind='string'] .sw { height: .5rem; border: 0; background: radial-gradient(circle, var(--ground-lamp) 0 .13rem, transparent .14rem) 0 50% / .43rem .5rem repeat-x; }
.lg[data-kind='other'] .sw { width: .7rem; height: .7rem; border: 2px solid var(--ink); border-radius: 50%; background: var(--ink); }
.lg[data-kind='hostile'] .sw { width: .7rem; height: .7rem; border: 0; background: var(--red); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.lg[data-kind='body'] .sw { width: .6rem; height: .6rem; border: 2px solid var(--red); transform: rotate(45deg); }

/* People are markers positioned by transform; the player's carries a ring that opens and fades, slowly. */
.mark { position: absolute; left: 0; top: 0; will-change: transform; }
.mark i {
  display: block; width: var(--dot); height: var(--dot);
  margin: calc(var(--dot) / -2) 0 0 calc(var(--dot) / -2);
  border: 2px solid var(--ink); border-radius: 50%; background: var(--ink);
  box-shadow: 0 0 0 2px var(--shade);
}
.mark[data-kind='neutral'] i { border-color: var(--ink-dim); background: transparent; }
.mark[data-kind='hostile'] i { border: 0; border-radius: 0; background: var(--red); box-shadow: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.mark[data-kind='body'] i { border-color: var(--red); border-radius: 0; background: transparent; transform: rotate(45deg); }
/* The player: a big cyan arrow edged in black (the shadow is of the whole mark, for the arrow itself is clipped), a soft disc under it, a ring that opens and fades, and a fan of the way it looks,
   as wide as the camera's own view across (--fan is that, set by the map); the fan turns with the arrow. Nothing else on the map is cyan. */
.mark[data-kind='you'] { z-index: 2; filter: drop-shadow(0 0 .14rem #000) drop-shadow(0 0 .07rem #000); }
.mark[data-kind='you'] i {
  width: var(--mark); height: var(--mark);
  margin: calc(var(--mark) / -2) 0 0 calc(var(--mark) / -2);
  border: 0; border-radius: 0; background: var(--you); box-shadow: none;
  clip-path: polygon(50% 0, 100% 100%, 50% 72%, 0 100%);
}
.mark b {
  position: absolute; left: calc(var(--cone) * var(--fan, 2) / -2); top: calc(var(--cone) * -1);
  width: calc(var(--cone) * var(--fan, 2)); height: var(--cone); transform-origin: 50% 100%;
  background: linear-gradient(to top, color-mix(in srgb, var(--you) 50%, transparent), transparent);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}
.mark[data-kind='you']::before {
  content: ''; position: absolute;
  left: calc(var(--halo) / -2); top: calc(var(--halo) / -2); width: var(--halo); height: var(--halo);
  border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--you) 55%, transparent), transparent 68%);
}
.mark[data-kind='you']::after {
  content: ''; position: absolute;
  left: calc(var(--mark) / -2); top: calc(var(--mark) / -2); width: var(--mark); height: var(--mark);
  border: 3px solid var(--you); border-radius: 50%;
  animation: ping var(--breathe) ease-out infinite;
}
@keyframes ping { from { transform: scale(.8); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }
/* Where the player is, when the map is looking elsewhere: a cyan pointer at the edge of the room, toward them. */
.finder { position: absolute; left: 0; top: 0; width: 2.2rem; height: 2.2rem; margin: -1.1rem 0 0 -1.1rem; filter: drop-shadow(0 0 .14rem #000) drop-shadow(0 0 .07rem #000); }
.finder i { display: block; width: 100%; height: 100%; background: var(--you); clip-path: polygon(50% 0, 100% 100%, 50% 74%, 0 100%); }
.mark .who {
  position: absolute; left: calc(var(--dot) / 2 + .35rem); top: 0; transform: translateY(-50%);
  white-space: nowrap; font-size: 1rem; letter-spacing: .1em; text-transform: uppercase;
  text-shadow: 0 0 .5em var(--shade), 0 0 .15em var(--shade);
}
.mark[data-kind='neutral'] .who { color: var(--ink-dim); }

/* ── the helpers (#334, ui/party.js; the picture is design-313's `sheet-helpers`) ──────────────────────────────────────────────────────────────────────────────────────────
   One sheet in the frame (sheet.css `the frame`). At its side the frame's list, each line with the rank small at its right; its body is the chosen person's page: groups, each a label and rows (a name, what stands small under it, a figure), the
   thin bars of a rank and of a skill, and the perks on offer as rows the pointer or the keys choose (the lamp's rule and faint ground, the frame's rows, only on the row in focus). The lamp is the chosen line's and nothing else's; red is the body's
   (the limbs a called shot took, a scar). Nothing here is a length, a colour or a time of its own: the HUD's tokens (data/hud.js `HUD.tokens`), the frame's rows (data/sheet.js) and the rows of `PARTY_LOOK` (data/party.js), which party.js sets on
   the page as custom properties (tests/party.sheet.test.mjs holds this rule: no number with a unit, no colour, no color-mix between the two lines that mark this part). */
.helpers-screen:not([hidden]) { display: grid; }
.sheet-line .party-rank { margin-left: auto; font-size: var(--size-label); color: var(--ink-faint); white-space: nowrap; }
.party-page { display: grid; gap: var(--party-gap); align-content: start; min-width: 0; }
.party-grp { display: grid; gap: var(--party-cap-gap); margin: 0; }
.party-cap, .party-who { margin: 0; font: var(--weight-label) var(--size-label) / var(--sheet-label-lead) var(--font-text); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-faint); }
.party-who { color: var(--ink-dim); }
.party-text { margin: 0; font: var(--weight-read) var(--size-read) / var(--party-text-lead) var(--font-text); color: var(--ink-dim); }
.party-lost, .party-row[data-bad='true'] .party-nm { color: var(--harm); }
.party-rows { margin: 0; padding: 0; list-style: none; }
/* a row: a name (and what stands small under it) and a figure; a perk on offer is a button of the same look */
.party-row, .party-offer {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--party-row-gap);
  box-sizing: border-box; width: 100%; min-height: var(--party-row-h); margin: 0; padding: var(--party-row-pad-y) var(--party-row-pad-r) var(--party-row-pad-y) var(--party-row-pad-l);
  border: 0; border-bottom: var(--party-edge) solid var(--rule); border-left: var(--sheet-rule) solid transparent; border-radius: 0; background-color: transparent;
  font: var(--weight-say) var(--size-read) / var(--sheet-label-lead) var(--font-text); letter-spacing: normal; text-transform: none; text-align: left; color: var(--ink);
  transition: color var(--warm), background-color var(--warm), border-color var(--warm);
}
.party-nm { min-width: 0; overflow-wrap: anywhere; }
.party-sub { display: block; font: var(--weight-read) var(--size-label) / var(--party-sub-lead) var(--font-text); letter-spacing: normal; text-transform: none; color: var(--ink-dim); }
.party-item > .party-row + .party-bar { margin-top: var(--party-bar-air); }
.party-sub::first-letter { text-transform: uppercase; }
.party-fig { font: var(--weight-label) var(--size-say) / 1 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.party-offer:hover:not(:disabled), .party-offer:focus-visible:not(:disabled) { border-left-color: var(--lamp); background-color: var(--sheet-line-wash); color: var(--ink); outline: none; }
.party-bar { height: var(--party-bar-h); margin-bottom: var(--party-bar-air); background-color: var(--dark-veil); box-shadow: 0 0 0 var(--party-edge) var(--ink-faint); }
.party-bar > i { display: block; height: 100%; background-color: var(--ink); transform-origin: left; }
/* ── the end of the helpers ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
