/* Generated by art/pixelforge/make-ui.mjs (npm run art:ui). Do not edit.
   Where each piece of the HUD sits on the game screen. Sizes are screen pixels (2 per art pixel). */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud .ui-button:empty:not([data-glyph]), .hud .ui-banner:empty { display: none; }   /* nothing to say yet (a button with only a glyph is not empty in that sense) */
/* top left: level, name and how far into the level; the health bar and the voice bar (the blue one skills spend), each with its numbers; the thin experience bar */
.hud-status { position: absolute; left: 12px; top: 12px; width: 448px; display: flex; align-items: center; gap: 10px; }
.hud-status-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hud-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.hud-row > .ui-bar { flex: 1; }
.hud-name { flex: 1; min-width: 0; padding-right: 2px; overflow: hidden; text-overflow: ellipsis; }   /* eight full-width characters fit; anything wider is cut with an ellipsis */
.hud-hp { min-width: 108px; text-align: right; }                   /* room for 1234/1234, so the bar keeps its length as the digits change */
.hud-target { position: absolute; left: 0; right: 0; top: 12px; width: 300px; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; text-align: center; }
/* the target is on a team (data-team on its name, set for the crowds of a world event): a patch of that team's color before the name; a team that is not listed gets none */
#target-name[data-team="faction_a"]::before, #target-name[data-team="faction_b"]::before, #target-name[data-team="faction_c"]::before { content: ''; display: inline-block; width: 12px; height: 12px; margin: 0 10px 0 2px; vertical-align: 1px; box-shadow: 0 0 0 2px var(--ui-line); }
#target-name[data-team="faction_a"]::before { background: #2f6fd0; }
#target-name[data-team="faction_b"]::before { background: #3fa86a; }
#target-name[data-team="faction_c"]::before { background: #ffffff; }
/* what is on the target for a limited time (stunned, swarmed): the same chips as under the status panel, hanging under the target panel, flush with its left edge */
.hud-target-buffs { position: absolute; left: -14px; top: calc(100% + 26px); display: flex; gap: 8px; }
.hud-target-buffs:empty { display: none; }
.hud-target-buffs { pointer-events: none; }                        /* only the chips take the pointer: the row itself can be wider or taller than what is in it */
.hud-target-buffs > * { pointer-events: auto; }
/* top right: the map box (banner over the mini-map), the test tools under it, the quests the player has taken under those.
   The corner stops short of the buttons at the bottom right: the quest list is the row that gives way.
   Only what is in the corner takes the pointer, not the gaps between.
   (Two columns still: the first one held a column of switches until they moved into the settings window. Nothing is in it now;
   the quest list, 300 wide and across both, is what gives it its width, and the map box keeps to the right in the second.) */
.hud-corner { position: absolute; right: 12px; top: 12px; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto minmax(0, 1fr); justify-content: end; align-items: start; column-gap: 10px; max-height: calc(100dvh - 124px); pointer-events: none; }
.hud-corner > * { pointer-events: auto; }
.hud-mapbox { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: center; }
.hud-map { z-index: 1; min-width: 132px; }
.hud-minimap { margin-top: -16px; }                                /* the banner hangs over its top edge */
.hud-minimap > canvas { display: block; width: 160px; height: 120px; margin: -6px; background: #1c2430; outline: 2px solid var(--ui-line); image-rendering: pixelated; }
.hud-cheats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 0; }
.hud-cheats > * { grid-column: 1 / -1; }
.hud-cheats > #hp-lock, .hud-cheats > #debug-give { grid-column: auto; }   /* the two test buttons share a row, under a select each (in the settings window's 測試工具 page since DS-316) */
.hud-cheats > #hp-lock[hidden] ~ #debug-gear { grid-column: auto; }   /* (the third, for gear, has a row of its own unless the first is away) */
/* the quests the player has taken, one card each:
   <div class="hud-quest ui-ghost" data-state="active|ready"><div class="hud-quest-name">…</div><div class="hud-quest-step" data-done="true|false">打倒 Lv.1 的怪 2/6</div>…</div>
   A step that is done is dimmed and ticked. When every step is done the quest is "ready": its last line says whom to go back to, in green.
   On a low window the cards that do not fit whole are left out (they wrap into a second column, which is cut off) rather than cut in the middle of a line. */
.hud-quests { grid-column: 1 / -1; grid-row: 3; justify-self: end; align-self: stretch; width: 300px; min-height: 0; margin-top: 10px; display: flex; flex-flow: column wrap; align-content: flex-start; gap: 8px 40px; overflow: hidden; pointer-events: none; }
.hud-quests:empty { display: none; }
.hud-quests::before { content: ''; width: 100%; height: 0; margin-bottom: -8px; }   /* the first thing in a column never wraps: this takes that place, so even the first card goes when it does not fit */
.hud-quest { width: 100%; display: flex; flex-direction: column; pointer-events: auto; }
.hud-quest-name { color: #ffd23f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-quest-step { position: relative; padding-left: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-quest-step::before { content: ''; position: absolute; left: 6px; top: 10px; width: 6px; height: 6px; background: currentColor; box-shadow: 0 0 0 2px var(--ui-line); }   /* a square bullet */
.hud-quest-step[data-done="true"] { color: #a9b6ad; }
.hud-quest-step[data-done="true"]::before { left: 2px; top: 7px; width: 14px; height: 12px; background: #7dff6a; box-shadow: none;
  -webkit-mask: url(glyph-check.png) center / 100% 100% no-repeat; mask: url(glyph-check.png) center / 100% 100% no-repeat; }
.hud-quest[data-state="ready"] > .hud-quest-step:last-child { color: #7dff6a; }
/* bottom right: the buttons wrap into rows, and each row fills the width */
.hud-actions { position: absolute; right: 12px; bottom: 12px; width: 360px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 10px; }
.hud-actions > .ui-button { flex: 1 1 auto; }
.hud-actions > .ui-button.ui-square { flex: none; }                /* the glyph buttons keep their size; the lettered ones share what is left of the row */
/* bottom middle: the hot bar, eight slots on keys 1 to 8 */
.hud-hotbar { position: absolute; left: 0; right: 0; bottom: 12px; width: max-content; margin: 0 auto; display: flex; gap: 4px; }
.hud-hotbar > .ui-slot { margin: -6px 0; }                         /* the panel's border is wider than the bar wants: the slots reach into it */
.hud-hotbar > .ui-slot:first-child { margin-left: -6px; }
.hud-hotbar > .ui-slot:last-child { margin-right: -6px; }
.hud-fallen { position: absolute; left: 0; right: 0; top: max(216px, 30%); width: max-content; margin: 0 auto; }
/* news for everyone, one line on a banner for a few seconds (data-phase picks the cloth): top middle, in the strip under the status panel
   and the target panel, 64 pixels above the banner for having fallen. It drops in each time it stops being hidden. */
.hud-notice { position: absolute; left: 0; right: 0; top: max(152px, calc(30% - 64px)); z-index: 1; width: max-content; max-width: calc(100vw - 24px); margin: 0 auto;
  overflow: hidden; text-overflow: ellipsis; animation: hud-notice-in 0.25s steps(5) both; }
.hud-notice::before { content: ''; display: inline-block; width: 18px; height: 14px; margin-right: 8px; vertical-align: -2px; background: currentColor;
  -webkit-mask: url(glyph-megaphone.png) center / 100% 100% no-repeat; mask: url(glyph-megaphone.png) center / 100% 100% no-repeat; }
@keyframes hud-notice-in { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hud-notice { animation: none; } }
/* under the status panel: what is on the player for a limited time, then (test mode) the debug line, which wraps rather than reach under the news */
.hud-under { position: absolute; left: 12px; top: 152px; max-width: min(46%, 420px); display: flex; align-items: center; gap: 10px; }
.hud-buffs { display: flex; gap: 8px; }
.hud-buffs:empty { display: none; }
.hud-debug { min-width: 0; }
/* That line wraps into several rows and makes this row as tall. Centred in a row that tall, the chips before it stand some
   30 px lower: on the team panel, which begins where the row ends for everybody else. While the line shows, the row hangs
   from its top. Only on a desktop: a phone does not show the line (ui-mobile.mjs), and its row is laid out by other rules. */
@media (min-width: 760.02px) and (min-height: 520.02px) { .hud-under:has(> .hud-debug:not([hidden])) { align-items: flex-start; } }
/* what is going on in the world, or about to: a card under that row, one event in two lines (a lamp, its name and the time left; where it is).
   <div class="hud-event-row" data-phase="soon|active" data-here="true|false"><span class="hud-event-name">…</span><span class="hud-event-place">…</span><span class="hud-event-time">12:34</span></div>
   The lamp is lit and the time yellow while it is going on; the place is yellow when it is on the map the player is on. */
.hud-event { position: absolute; left: 12px; top: 196px; width: 300px; display: flex; flex-direction: column; gap: 6px; }
.hud-event:empty { display: none; }
.hud-event-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; column-gap: 8px; align-items: center; white-space: nowrap; }
.hud-event-row::before { content: ''; grid-column: 1; grid-row: 1; width: 14px; height: 14px; background: url(lamp-off.png); }
.hud-event-row[data-phase="active"]::before { background-image: url(lamp-on.png); }
.hud-event-name { grid-column: 2; grid-row: 1; overflow: hidden; text-overflow: ellipsis; }
.hud-event-time { grid-column: 3; grid-row: 1; text-align: right; }
.hud-event-row[data-phase="active"] > .hud-event-time { color: #ffd23f; }
.hud-event-place { grid-column: 2 / -1; grid-row: 2; overflow: hidden; text-overflow: ellipsis; color: #c5ccd8; }
.hud-event-row[data-here="true"] > .hud-event-place { color: #ffd23f; }
.hud-hotbar > .ui-slot, .bag-grid > .ui-slot, .skill-row > .ui-slot { touch-action: none; }   /* these can be dragged, with a finger too */
/* once the backpack is longer than what shows (hud/bag.ts marks the grid), a finger moving up or down on its slots scrolls it - the
   browser then ends the drag (hud/drag.ts, pointercancel), so from then on a finger drags sideways only; to the hot bar there is the
   button beside what the thing is. While everything fits, nothing changes: a finger drags a drink down to the hot bar as before. */
.bag-grid[data-scrolls="true"] > .ui-slot { touch-action: pan-y; }
/* bottom left: the chat log over its input line */
.hud-chat { position: absolute; left: 12px; bottom: 12px; width: 400px; display: flex; flex-direction: column; gap: 6px; }
.chat-log { display: flex; flex-direction: column; max-height: 172px; overflow-y: auto; scrollbar-width: none; }
.chat-log:empty { display: none; }
.chat-line { overflow-wrap: anywhere; }
.chat-tag { margin-right: 4px; }
.chat-system { color: #ffd23f; }
.chat-party { color: #ffb3d1; }
.chat-world { color: #9ad7ff; }
.chat-mine .chat-name { color: #aaffaa; }
.chat-input { width: 100%; padding-left: 68px; }
.chat-channel { position: absolute; left: 0; bottom: 0; width: 64px; height: 40px; }
/* layers, bottom to top: the HUD 10; the four windows 20 to 29, in the order they were opened or pressed (hud/windows.ts sets it on each);
   the two that ask a question (a name, where to travel) 30; the cover while changing maps 35; what is being dragged 40 */
.name-window { position: fixed; left: 0; right: 0; top: 28%; z-index: 30; width: min(380px, calc(100vw - 40px)); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.name-row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.name-row > .ui-mini { margin-right: auto; }                       /* the hot bar toggle of the backpack keeps to the left, away from Discard */
/* the backpack: a window at the right, above the buttons; what the picked item is and does opens to its left */
.bag-window { position: fixed; right: 12px; bottom: 106px; z-index: 20; display: flex; flex-direction: column; gap: 8px; }
/* what to show: everything, what can be worn, what can be used. The slots keep their places; a page that has less just ends earlier */
.bag-tabs, .shop-tabs { display: flex; gap: 6px; }
.bag-tabs > .ui-button, .shop-tabs > .ui-button { flex: 1 1 0; height: 32px; min-width: 0; padding: 0 6px; }
/* the backpack holds 200 things (the Owner, 2026-10-08): five rows are in sight and the grid scrolls. Every slot is there from the
   start; the ones past what is needed are [hidden] (hud/bag.ts shows whole rows, always one free slot more than is used).
   No scroll bar is drawn (a phone shows none until the list moves, and room kept for one puts the grid off-centre): what says there
   is more is a strip of the sixth row under the fifth - the grid is 20 px higher than five rows, which only shows once a sixth exists.
   The box that scrolls reaches 4 px past the slots on every side (padding, taken back by the margin so that nothing moves): the ring
   round the selected slot is drawn 4 px outside it, and a box exactly as wide as its slots cut it off in the first and last column. */
.bag-tabs { flex-wrap: wrap; }
.bag-tabs > .bag-gear-filter { flex: 1 0 100%; width: 100%; min-height: 36px; font: inherit; }
.bag-gear-filter[hidden] { display: none; }
.bag-grid { display: grid; grid-template-columns: repeat(6, 48px); gap: 4px; align-content: start; max-height: 280px;
  padding: 4px; margin: -4px; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
.bag-grid > .ui-slot[hidden] { display: none; }
.bag-grid > .ui-slot { scroll-margin: 4px; }                          /* scrolled into sight (hud/bag.ts), the ring keeps its room */
.bag-foot { display: flex; align-items: center; gap: 6px; color: #b9770a; }
/* selling from the backpack (DS-285; hud/bag.ts): 賣東西 at the end of the foot turns the slots into ticks — a ticked slot has the ring of a
   picked one and a green tick at its corner, what no one buys (the skill books) is pale — and the bar under the foot counts them and sells */
.bag-grid > .ui-slot[data-picked="true"]::before { content: ''; position: absolute; inset: -4px; background: url(slot-on.png) center / 100% 100% no-repeat; pointer-events: none; }
.ui-pick { position: absolute; right: 0; top: 0; z-index: 5; width: 20px; height: 20px; border: 2px solid #1c1422; background: var(--ui-good); }
.ui-pick::after { content: ''; display: block; width: 100%; height: 100%; background: white; -webkit-mask: url(glyph-check.png) center / 14px 12px no-repeat; mask: url(glyph-check.png) center / 14px 12px no-repeat; }
.bag-window[data-selling="true"] .bag-grid > .ui-slot[data-unsellable="true"] > .ui-icon { opacity: 0.35; filter: grayscale(1); }
.bag-sell[hidden] { display: none; }
.bag-sell { display: flex; flex-direction: column; gap: 4px; flex: none; width: 0; min-width: 100%; }   /* (width 0, at least all: the bar takes the width the slots give and folds its line; the long question once made the window wider, over the hot bar of a phone on its side) */
.bag-sell-sum { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }   /* how many and for how much, or the question before selling */
.bag-sell-row { display: flex; gap: 4px; }
.bag-sell-row > .ui-button:last-child { margin-left: auto; }          /* 賣出 keeps to the right, away from the two that pick */
.bag-sell-row > .ui-button[data-sure="true"] { outline: 2px solid #c93a2a; outline-offset: -2px; }   /* pressed once and asking, as on a stall */
.bag-sell:has(> .bag-sell-row > .ui-button[data-sure="true"]) > .bag-sell-sum { color: #c93a2a; }
.bag-room { margin-left: auto; color: var(--ui-dim); }                 /* how many of its slots are used: "37／200 格" */
.bag-room[data-full="true"] { color: #c93a2a; }
.bag-detail { position: absolute; right: calc(100% + 8px); bottom: 0; width: 300px; display: flex; flex-direction: column; gap: 6px; }
/* a piece of gear in the detail (of the backpack, and of the character window): what it is and who can wear it, then a line for each number,
   with how it compares to what is worn in that place */
.gear-kind[data-bad="true"] { color: #c93a2a; }
/* how rare a thing is (data/items.json: rarity; nothing = ordinary): data-rarity="rare" blue, "epic" purple. The colour of its name wherever
   the name stands as the title of something (the darker --ui-rare / --ui-epic, to be read on the paper); in its slot a frame two art pixels
   wide inside the slot's own dark rim and a faint tint of the paper behind the icon, both brighter (DS-284: the thin frame on the rim was
   not seen). In the chat, which lies on the game, lighter. */
.ui [data-rarity="rare"] { color: var(--ui-rare); }
.ui [data-rarity="epic"] { color: var(--ui-epic); }
.ui-slot[data-rarity]::after { content: ''; position: absolute; inset: 2px; border: 4px solid var(--ui-rare-frame, #2f7bff); pointer-events: none; }
.ui-slot[data-rarity="epic"]::after { border-color: var(--ui-epic-frame, #a24bff); }
.ui-slot[data-rarity="rare"] { background: linear-gradient(var(--ui-rare-tint, rgba(70, 140, 255, 0.3)), var(--ui-rare-tint, rgba(70, 140, 255, 0.3))) 2px 2px / 44px 44px no-repeat, url(slot.png); }
.ui-slot[data-rarity="epic"] { background: linear-gradient(var(--ui-epic-tint, rgba(170, 80, 255, 0.28)), var(--ui-epic-tint, rgba(170, 80, 255, 0.28))) 2px 2px / 44px 44px no-repeat, url(slot.png); }
.chat-line[data-rarity="rare"] { color: #8fd0ff; }
.chat-line[data-rarity="epic"] { color: #dcb0ff; }
/* a set (data/sets.json), under what a piece gives, in the backpack's panel and in the character window's:
   <div class="set-box"><div class="set-name">颱風假（穿了 2 件）</div>
     <div class="set-step" data-on="true">2 件：血量上限 +25</div><div class="set-step">4 件：防禦 +2、閃避 +2</div>
     <div class="set-pieces"><span data-on="true">浴帽</span>、<span>輕便雨衣</span>…</div></div>
   What the set gives comes before its pieces: on an upright phone only the first lines of the block are in sight without scrolling.
   What is worn and what has been reached are lit; the rest is dim. A reached step is also heavier (the doubled strokes of .ui-bold):
   its green and the dim brown are about as light as each other. A piece's name is never broken in the middle, and a step breaks
   only after a "、" (hud/sets.ts keeps the words of one bonus together with no-break spaces). */
.set-box { display: flex; flex-direction: column; padding-top: 6px; border-top: 2px solid #ddc28c; }
.set-name { color: var(--ui-title); }
.set-pieces { color: var(--ui-dim); }
.set-pieces > span { white-space: nowrap; }
.set-pieces > [data-on="true"] { color: var(--ui-ink); }
.set-step { color: var(--ui-dim); word-break: keep-all; }
.set-step[data-on="true"] { color: var(--ui-good); text-shadow: 2px 0 0 currentColor; }
.gear-lines { display: flex; flex-direction: column; color: #2f8f3a; }
.gear-lines > div { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.gear-lines [data-way="up"] { color: #2f8f3a; }
.gear-lines [data-way="down"] { color: #c93a2a; }
/* the settings: where the backpack goes (opening one closes the other), right over the gear button that opens it. One window for what
   used to be a column of switches at the top right and a window of its own. Since DS-316 it is three pages under a row of tabs (the
   backpack's), and it always opens on the first:
     一般 — music and sound effects, each switch beside its volume (the bar is the slider: click or drag it); under 聊天 the switch for
       the system lines in the chat; at the foot, full screen (on a phone only) and signing out;
     自動打怪 — three sliders of the same kind, four switches the width of the window, the two skips side by side, what to do when a
       player hits you, and a line of small print beside the button that brings this page's defaults back (the tab, and 聊天 on the
       first page, stay hidden until the server has said what the settings are);
     測試工具 — the test tools (#hud-cheats, which was under the map), for the accounts the server lists; the others have no such tab.
   The three pages lie in one cell of a grid, so the window is as high as the highest of them whichever is showing; only the pages
   scroll, the title and the tabs stay. The window is part of the page (#settings-window, hidden until the gear is pressed), not built
   when it opens: the sound switches and the sign-out button are bound once, when the game starts. */
.settings-window { position: fixed; right: 12px; bottom: 106px; z-index: 20; width: 400px; max-height: calc(100dvh - 118px); display: flex; flex-direction: column; gap: 8px; }
.settings-body { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ui-line) transparent; }
.settings-tabs { flex: none; }
.settings-pages { display: grid; min-height: 0; overflow-y: auto; }
.settings-page { grid-area: 1 / 1; min-width: 0; overflow: visible; }
.settings-page #hud-cheats-title { display: none; }
.settings-preferences { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 6px; }   /* (the same two as hud/settingsPreferences.css, where the game builds these switches) */
.settings-preferences .ui-button { box-sizing: border-box; width: 100%; min-width: 0; white-space: normal; }
.settings-head { margin-top: 6px; }
.settings-head:first-child { margin-top: 0; }
.settings-chat { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }   /* 聊天 and its switch: one block, hidden together until the server has said; spaced as a heading of the page's own */
.settings-sound { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 8px 12px; }
.settings-sound > .ui-button { justify-content: flex-start; }      /* the two labels start at the same place, whichever is on */
.settings-sound > .ui-bar { cursor: pointer; touch-action: none; }
.settings-auto { display: flex; flex-direction: column; gap: 8px; }
.settings-foot { display: flex; gap: 18px; margin-top: 4px; padding-top: 10px; border-top: 2px solid #1c142226; }   /* a line over what is about the account, not the game; the gap takes the lamp on the corner of the full-screen switch */
.settings-foot > .ui-button { flex: 1 1 0; }
.settings-foot > #cookie-settings { display: none; }   /* the phone's entry; a desktop keeps the floating Cookie button */
.auto-row { display: flex; align-items: center; gap: 8px; min-height: 26px; white-space: nowrap; }
.auto-row > .ui-bar { flex: 1; cursor: pointer; touch-action: none; }
.auto-row > :last-child { min-width: 60px; text-align: right; }    /* the number: room for 100% and for 20 tiles, so the bar keeps its length as it changes */
.auto-switches { display: flex; gap: 18px; margin-top: 4px; }       /* the gap takes the lamp on the corner of the left switch */
.auto-switches > .ui-button { flex: 1 1 0; }
.auto-foot { display: flex; align-items: center; gap: 10px; }
.auto-foot > .ui-dim { flex: 1; min-width: 0; }
/* the character window: at the left, under the status panel and as wide; attributes on the left, what they add up to on the right */
.char-window { position: fixed; left: 12px; top: 196px; z-index: 20; width: 448px; display: flex; flex-direction: column; gap: 8px; }
.char-head { position: relative; display: flex; align-items: center; gap: 6px; }
/* (the right-hand column starts 26 lower than the left one, 22 with the poll: it once made room for the slots that hung under the head.
   Since DS-301 they are on a page of their own; the room stays, so that with the poll the two columns still end together) */
.char-stats { margin-top: 26px; }
.char-who > .ui-dim { font-size: 18px; }
/* two pages, 能力 and 裝備 (DS-301). The eight slots beside the name left it 184 px — a name of eight characters had to be drawn tighter —
   and their second row split class and experience in two lines: with a name of eight characters the window was 460 high and ran 18 over
   the hot bar on a 720-pixel window. The slots are on the 裝備 page now. Its two buttons are the backpack's tabs at the right end of the
   head's second line, not a row of their own (that is some 40 higher): the head is as high as the face, 72, on both pages, the window
   428, and it ends 14 above the hot bar whatever the name. */
.char-tabs { width: 154px; }
/* the 裝備 page, as big as the 能力 page (416 x 264): the character in the middle and five slots on each side, top to bottom head, body,
   trinket, trinket, shoes | costume, costume, costume, weapon, mount, each with its name on the character's side. The second and third
   costume slots only hold the place of costumes to come (they are not in EQUIP_SLOTS, nor in the save): disabled, paler than an empty one. */
.char-gear { position: relative; height: 264px; flex: none; display: grid; grid-template-columns: 94px 1fr 94px; grid-template-rows: repeat(5, 48px); gap: 6px 0; }
.char-gear-row { display: flex; align-items: center; gap: 4px; font-size: 18px; white-space: nowrap; }
.char-gear-row[data-side="right"] { justify-content: flex-end; }
.char-gear-row > .ui-slot { flex: none; }
.char-gear-row > .ui-slot[data-empty="true"] > .ui-icon { opacity: 0.22; }
.char-gear-row > .ui-slot:disabled { opacity: 0.5; }
/* the character as the game draws it standing, facing the screen: its look, the costume it wears behind and in front of it (the first step
   of the costume's light, still) and the game's shadow under its feet; never the mount. In the costumes' 64 x 64 cell with the feet on the
   costume's anchor, the middle 48 x 48, four times as big: every class and look with every costume falls inside x 8-55, y 10-54 there.
   hud/paperDoll.ts lays the pictures in the game; dollSample() below does the same for these pages. */
.char-doll { grid-column: 2; grid-row: 1 / 6; border: 2px solid #d7c49d; border-radius: 6px; background: linear-gradient(#fff8e5, #efe1bb); display: grid; place-items: center; }
.char-doll-image { position: relative; width: 192px; height: 192px; overflow: hidden; image-rendering: pixelated; }
.char-doll-layer { position: absolute; inset: 0; background-repeat: no-repeat; image-rendering: pixelated; }
.char-doll-shadow { position: absolute; background: rgba(16, 18, 26, .4); border-radius: 50%; transform: translate(-50%, -50%); }
/* the piece that was pressed: over the character, between the two columns of slots (all ten stay in sight, and another can be pressed),
   from the top of the page down to its bottom at the most. A longer one — a piece of a set is some 170 px taller (DS-096), the tallest
   378 — scrolls inside, its button held at the bottom. */
.char-tip { position: absolute; left: 54px; right: 54px; top: 0; z-index: 1; display: flex; flex-direction: column; gap: 4px;
  max-height: 100%; overflow-y: auto; scrollbar-width: none; }
.char-tip > * { flex: none; }
.char-tip > .name-row { position: sticky; bottom: 0; background: #fff6dc; }
.char-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.char-who > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; white-space: nowrap; }
.char-who > .ui-dim > span { display: flex; gap: 6px; }
/* a name wider than its line is drawn tighter (hud/character.ts measures it and sets data-long): each character 3 px closer, its strokes
   not doubled — doubled, 3 px closer ran the characters into each other. Since DS-301 the line has 338 px on a desktop and a name of
   eight characters (208) fits with its level: this is for a narrower screen. */
.char-who [data-long="true"] { letter-spacing: -3px; text-shadow: none; }
.char-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; }
.char-attributes, .char-stats { display: flex; flex-direction: column; gap: 4px; }
.char-stats > .char-row { min-height: 26px; }                      /* no button on these rows: eight of them stay clear of the hot bar on a 720-pixel window */
.char-row { display: flex; align-items: center; gap: 8px; min-height: 32px; white-space: nowrap; }
.char-row > :nth-child(2) { flex: 1; text-align: right; }          /* the number, right against the plus button or the edge */
/* the skill window: beside the character window, so both can be open; one row per skill of the class, learned or not.
   A skill that is on the hot bar wears the number of its key; the small button puts it on the bar or takes it off. */
.skill-window { position: fixed; left: clamp(12px, calc(100vw - 792px), 472px); top: 196px; z-index: 20; width: 420px; display: flex; flex-direction: column; gap: 8px; }   /* beside the character window when there is room; in a narrower window it slides left, clear of the backpack at the right */
/* a long list scrolls inside its window instead of running into the hot bar: 196 down to the window, about 84 of banner and border around the list, 100 kept for the hot bar */
.skill-list, .shop-list { max-height: calc(100dvh - 380px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ui-line) transparent;
  padding-bottom: 1px; }   /* the last line of lettering hangs one pixel below its box: without this a list that fits still gets a scroll bar */
.skill-list { display: flex; flex-direction: column; gap: 10px; }
.skill-row { display: flex; align-items: flex-start; gap: 12px; }
.skill-row > .ui-slot { margin-top: 4px; }
.skill-row[data-state="locked"] > .ui-slot > .ui-icon { opacity: 0.35; filter: grayscale(1); }   /* not learned yet */
.skill-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.skill-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; column-gap: 4px; min-height: 32px; white-space: nowrap; }
.skill-head > :nth-child(2) { flex: 1 0 auto; text-align: right; }   /* what it costs, or what it takes to learn: under the name when a long name leaves no room beside it, never cut short */
.skill-row:not([data-state="locked"]) .skill-head { padding-right: 40px; }   /* the small button keeps its place at the top right whichever way the line breaks */
.skill-head > .ui-button { position: absolute; right: 0; top: 0; }
.skill-versus { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }   /* 對玩家: what the skill does to a player, under what it does to a monster */
.skill-versus-tag { flex: none; white-space: nowrap; color: var(--ui-foe); }   /* the red tag (the same red as an enemy's name); the words after it wrap if they must */
.skill-versus-text { min-width: 0; }
.skill-foot { margin-top: 2px; }   /* under the list and not in it: the list scrolls, this line stays in view */
/* the shop window: where the character window goes (opening one closes the other), so the backpack at the right stays in view while buying.
   One row per thing on sale; the price sits right against the Buy button, and the foot says what is in the purse.
   There is more around this list than around the skill window's (the purse at the foot, and the two pages' buttons at a stall
   that also buys), so it is the window that is told where to stop — 196 down to it, 100 kept for the hot bar, which stands right
   under it in a window narrower than 1200 — and the list takes what is left. */
.shop-window { position: fixed; left: 12px; top: 196px; z-index: 20; width: 448px; max-height: calc(100dvh - 296px); display: flex; flex-direction: column; gap: 8px; }
.shop-list { display: flex; flex-direction: column; gap: 10px; min-height: 0; max-height: none; }
.shop-row { display: flex; align-items: flex-start; gap: 12px; }
.shop-row > .ui-slot { margin-top: 4px; }
.shop-head > .ui-mini { min-width: 44px; margin-right: -4px; }           /* ten at once, for what comes in stacks */
.shop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-head { display: flex; align-items: center; gap: 8px; min-height: 32px; white-space: nowrap; }
.shop-price { flex: 1; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 4px; color: #b9770a; }
.shop-row[data-state="poor"] .shop-price { color: inherit; opacity: 0.55; }   /* cannot afford it */
/* a + piece asks once more before it is sold: the line under its name says so in the colour of danger. The button keeps its words and
   its width - a wider one pushes the price over the tail of the name. */
.shop-row[data-sure="true"] > .shop-text > .ui-dim, .shop-head > .ui-button[data-sure="true"] { color: #c93a2a; }
.shop-head > .ui-button[data-sure="true"], .enchant-row > .ui-button[data-sure="true"] { outline: 2px solid #c93a2a; outline-offset: -2px; }   /* armed: seen where the pointer is */
/* its name is longer by the "+N ": with no room for all of it the name ends in an ellipsis, the price is never drawn over it */
.shop-row[data-plus] .shop-head > .ui-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.shop-row[data-plus] .shop-price { flex: 1 0 auto; }
.shop-row[data-plus] .shop-head > .ui-button { flex: none; }
.shop-row[data-state="known"] > .ui-slot > .ui-icon { opacity: 0.35; filter: grayscale(1); }   /* a book for a skill already learned */
.shop-foot { display: flex; align-items: center; gap: 6px; color: #b9770a; }
/* the enchant window (過爐): at the left like the shop window, so the backpack beside it stays in view. The scroll at the top with how
   many are left; under its name a hint, which the outcome of the last try replaces (data-kind). Then every piece the scroll can be used
   on - what is worn first. A piece below its safe value is certain; from there on its row says so in the colour of danger, and its
   button asks once more (data-sure) without changing its width. */
.enchant-window { position: fixed; left: 12px; top: 196px; z-index: 20; width: 448px; max-height: calc(100dvh - 296px); display: flex; flex-direction: column; gap: 8px; }
.enchant-head { display: flex; align-items: center; gap: 12px; }
.enchant-result { color: var(--ui-dim); }
.enchant-result[data-kind="ok"] { color: #2f8f3a; }
.enchant-result[data-kind="broken"] { color: #c93a2a; }
.enchant-list { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ui-line) transparent; }
.enchant-list > .ui-dim:not(:first-child) { margin-top: 6px; padding-top: 8px; border-top: 2px solid #ddc28c; }
.enchant-row { display: flex; align-items: center; gap: 12px; }
.enchant-row > .ui-slot { flex: none; }
.enchant-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.enchant-text > .ui-bold, .enchant-odds { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enchant-text > .ui-dim { word-break: keep-all; }                  /* a long list of numbers breaks after a comma, not inside a word */
.enchant-odds[data-risk="true"] { color: #c93a2a; }
.enchant-row > .ui-button { flex: none; width: 88px; }
.enchant-row > .ui-button[data-sure="true"] { color: #c93a2a; }
/* the camp window (the counsellor on the starter island): at the left like the shop window. The counsellor's face and a line of talk;
   under it either how many monsters are still to go, or one card per class to choose from (face, name, a line about it, its first
   skill) and the button that settles it. The chosen card wears the same outline as the chosen class when a character is made. */
.camp-window { position: fixed; left: 12px; top: 12px; z-index: 20; width: 620px; display: flex; flex-direction: column; gap: 10px; }   /* taller than the other windows: it starts at the top, over the status panel (nobody needs their health while choosing in the safe camp), so all four cards show at once and the hot bar stays clear */
.camp-talk { display: flex; align-items: flex-start; gap: 12px; }
.camp-say { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.camp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: calc(100dvh - 318px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ui-line) transparent; padding: 4px; margin: -4px; }   /* in a low window the cards scroll; the padding keeps the chosen card's outline from being cut */
.camp-card { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 10px; align-items: center;
  margin: 0; background: none; color: var(--ui-ink); font: inherit; text-align: left; cursor: pointer; outline: none; }
.camp-card > .ui-portrait { grid-row: 1 / 4; }
.camp-card-skill { display: flex; align-items: center; gap: 6px; min-width: 0; }
.camp-card:hover, .camp-card:focus-visible { filter: brightness(1.05); }
.camp-card[aria-checked="true"] { outline: 4px solid #f08a2c; outline-offset: -2px; border-radius: 12px; }
.camp-card[aria-checked="true"] > .camp-card-name { text-shadow: 2px 0 0 currentColor; }
.camp-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.camp-foot > .ui-dim { flex: 1; min-width: 0; }
/* talking to someone in town: a panel right over the hot bar — the portrait, who is speaking, what they say, what a quest asks for and gives
   (when the talk is about one), and the answers as buttons, the one that goes ahead in green and last. It is one of the windows (hud/windows.ts). */
.npc-dialog { position: fixed; left: 0; right: 0; bottom: 104px; z-index: 20; width: min(600px, calc(100vw - 24px)); margin: 0 auto; display: flex; align-items: flex-start; gap: 12px; }
body:has(> .npc-dialog) .hud-chat { visibility: hidden; }          /* the chat steps aside while someone is talking, as on the sample the Owner chose */
.npc-dialog-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.npc-dialog-text { min-height: 52px; }                             /* two lines, so a short answer does not make the panel jump */
.npc-dialog-quest { display: flex; flex-direction: column; padding-top: 6px; border-top: 2px solid #1c142226; }
.npc-dialog-reward { display: flex; flex-wrap: wrap; gap: 0 14px; color: #b9770a; }           /* <span>獎勵</span><span>經驗 20</span><span><span class="ui-coin"></span>30</span>… one span per thing, so a line never breaks inside one */
.npc-dialog-reward > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.npc-dialog-note { color: var(--ui-foe); }                         /* why an answer was refused (too far, no room in the backpack): the chat is hidden while the panel is up, so it has to say it here */
.npc-dialog-note:empty { display: none; }
.npc-dialog-options { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.travel-menu { position: fixed; left: 0; right: 0; bottom: 8%; z-index: 30; width: min(440px, calc(100vw - 40px)); max-height: 72dvh; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.travel-destinations { max-height: min(360px, 48dvh); }
.travel-overlay { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: #10121ae6; }
.travel-error { inset: auto 16px 20%; background: none; gap: 8px; }
@media (max-width: 1240px) { .hud-target-buffs { left: calc(100% + 22px); top: -14px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 32px); gap: 6px; } }   /* the events are right under the target panel then: its chips stand beside it, two to a column */
@media (max-width: 1240px) { .hud-target { left: 12px; right: auto; top: 192px; margin: 0; } .hud-event { top: 280px; } }   /* no room between the status panel and the top right corner: the target goes under the status panel, and the events under the target */
@media (max-height: 619px), (max-width: 1240px) and (max-height: 779px) { .hud-event-row:nth-child(n+3) { display: none; } }   /* on a low window the chat is close under the events: two fit, a third one waits its turn */
@media (max-width: 1240px) { .hud-notice { left: 320px; right: auto; top: max(282px, calc(30% + 44px)); margin: 0; max-width: calc(100vw - 332px); } }   /* the strip between the status panel and the switches gets too short for a line of news: it goes beside the events, under the switches (and under the banner for having fallen on a tall window) */
@media (max-width: 1040px) {                                                                     /* the banner for having fallen would reach the switches and the target: it goes beside the events too, and news that comes at that moment steps down under it */
  .hud-fallen { left: 320px; right: auto; top: max(270px, 30%); margin: 0; }
  .hud-fallen:not([hidden]) + .hud-notice { top: calc(max(270px, 30%) + 44px); }
}
@media (max-width: 1279px) { .hud-chat { bottom: 96px; } .npc-dialog { left: 12px; right: auto; margin: 0; width: min(600px, calc(100vw - 384px)); } body:has(> .npc-dialog) .hud-event { visibility: hidden; } }   /* no room beside the hot bar: the chat goes above it, and the talk panel takes that side (the event card steps aside with the chat); the panel stops short of the top right corner's column (348 wide), where the quest list is */
@media (max-width: 1199px) { .hud-hotbar { left: 12px; right: auto; margin: 0; } }               /* the hot bar moves to the left, clear of the buttons */
@media (max-width: 825px) { .hud-actions { bottom: 96px; } .hud-chat { bottom: 200px; width: min(400px, calc(100vw - 24px)); } .hud-corner { max-height: calc(100dvh - 208px); } }   /* everything stacks over the hot bar */
.hud-marquee { position: absolute; z-index: 5; top: 205px; left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); overflow: hidden; white-space: nowrap; pointer-events: none; }
.hud-marquee span { display: inline-block; min-width: 100%; animation: gm-marquee-scroll 12s linear forwards; }
@keyframes gm-marquee-scroll { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
@media (max-width: 700px) { .hud-marquee { top: 170px; width: calc(100vw - 32px); } }

/* DS-113: guest-only text controls add the third action row when either social entry is shown. */
@media (min-width: 760.01px) and (min-height: 520.01px) {
  body:has(.hud-actions > #team-button:not([hidden])):has(.hud-actions > #name-button:not([hidden]):not(:empty)):has(.hud-actions > #class-switch:not([hidden]):not(:empty)) > .bag-window,
  body:has(.hud-actions > #party-button:not([hidden])):has(.hud-actions > #name-button:not([hidden]):not(:empty)):has(.hud-actions > #class-switch:not([hidden]):not(:empty)) > .bag-window,
  body:has(.hud-actions > #team-button:not([hidden])):has(.hud-actions > #name-button:not([hidden]):not(:empty)):has(.hud-actions > #class-switch:not([hidden]):not(:empty)) > .settings-window,
  body:has(.hud-actions > #party-button:not([hidden])):has(.hud-actions > #name-button:not([hidden]):not(:empty)):has(.hud-actions > #class-switch:not([hidden]):not(:empty)) > .settings-window { bottom: 154px; }
}

/* DS-100: map window and the walking strip. */
.map-window { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1040px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 24px)); z-index: 20; display: flex; flex-direction: column; gap: 10px; }
.map-window > .ui-banner { display: flex; align-items: center; gap: 14px; flex: none; min-width: 0; padding-right: 36px; }
.map-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-title, .map-levels { flex: none; }
.map-body { display: flex; gap: 12px; flex: 1; min-height: 0; }
.map-view { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; background: #1c2430; touch-action: none; cursor: grab; border: 2px solid var(--ui-line); }
.map-view[data-dragging="true"] { cursor: grabbing; }
.map-layer { position: absolute; left: 0; top: 0; }
.map-canvas { display: block; image-rendering: pixelated; }
.map-pin { position: absolute; width: 26px; height: 32px; margin: 0; padding: 0; border: 0; background: transparent center / 26px 32px no-repeat; transform: translate(-50%, -100%); cursor: pointer; font: inherit; outline: none; }
.map-pin[data-kind="npc"] { background-image: url(pin-npc.png); }
.map-pin[data-kind="dungeon"] { background-image: url(pin-dungeon.png); }
.map-pin[data-kind="stairs"] { background-image: url(pin-stairs.png); }
.map-pin[data-kind="station"] { background-image: url(pin-station.png); }
.map-pin[data-kind="port"] { background-image: url(pin-port.png); }
.map-pin[data-kind="airport"] { background-image: url(pin-airport.png); }
.map-pin[data-kind="exit"] { background-image: url(pin-exit.png); }
.map-pin[data-kind="goal"] { background-image: url(pin-goal.png); }
.map-pin[data-on="true"] { transform: translate(-50%, calc(-100% - 2px)); filter: drop-shadow(0 0 2px #fff); z-index: 1; }
.map-self { position: absolute; width: 10px; height: 10px; margin: -7px 0 0 -7px; border: 2px solid #1c1422; background: #ffffff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); z-index: 2; pointer-events: none; }   /* where the player stands: above the pins */
.map-pin-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); color: #fff; text-shadow: var(--ui-outline); white-space: nowrap; pointer-events: none; }
.map-window:is([data-zoom="1"], [data-zoom="2"]) .map-pin[data-group="npc"]:not([data-on="true"]) > .map-pin-label { display: none; }   /* stalls stand next to each other: their names would lie on one another (they are in the list) */
.map-tools { position: absolute; bottom: 12px; left: 12px; display: flex; gap: 8px; }
.map-side { width: 264px; flex: none; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.map-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; flex: none; }
.map-filters > .ui-button { padding-inline: 4px; }
.map-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ui-line) transparent; }
.map-group { margin: 8px 0 4px; }
.map-row { width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 0 6px; align-items: center; border: 0; background: transparent; color: inherit; padding: 6px 0; text-align: left; font: inherit; cursor: pointer; }
.map-row:hover, .map-row:focus-visible { outline: 2px solid var(--ui-line); outline-offset: -2px; }
.map-row-icon { grid-column: 1; grid-row: 1 / 3; width: 20px; height: auto; image-rendering: pixelated; }
.map-row-name { grid-column: 2; grid-row: 1; overflow-wrap: anywhere; }
.map-row-levels { grid-column: 2; grid-row: 2; }
.map-row-note { grid-column: 3; grid-row: 1 / 3; white-space: nowrap; }
.map-tip { flex: none; }
.hud-minimap { cursor: pointer; }
.hud-minimap:hover, .hud-minimap:focus-visible { filter: brightness(1.12); }
.hud-walk { grid-column: 2; grid-row: 1; align-self: end; justify-self: center; z-index: 2; display: flex; align-items: center; gap: 8px; width: 168px; max-width: 168px; height: 26px; background: #10121ab8; background-clip: padding-box; }
.hud-walk-text { flex: 1; min-width: 0; max-width: 168px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-walk > .ui-close { position: relative; inset: auto; flex: none; }
.bigmap-stage > .map-window { position: absolute; }
.bigmap-pins { display: flex; flex-wrap: wrap; gap: 24px; padding: 24px; }
.bigmap-pins > span { display: inline-flex; gap: 8px; align-items: center; }
.bigmap-pins img { width: 26px; height: 32px; }

/* DS-102: standalone party windows and cards; these selectors do not change the live HUD. */
.party-emblem { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border: 2px solid var(--ui-line); border-radius: 6px; padding: 0; }
.party-emblem[data-faction="faction_a"] { background-color: #2f6fd0; }
.party-emblem[data-faction="faction_b"] { background-color: #3fa86a; }
.party-emblem[data-faction="faction_c"] { background-color: #ffffff; }
.party-emblem[data-size="small"] { width: 32px; height: 32px; border-radius: 4px; }
.party-emblem[data-size="small"] > .ui-icon { transform: scale(0.63636); }
.ui-icon[data-image] { background-size: 44px 44px; background-position: 0 0; image-rendering: pixelated; }
.party-emblem-controls, .party-emblem-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.party-emblem-box { width: 100%; }
.party-emblem-box[hidden] { display: none; }
.party-emblem-preview { display: flex; flex-direction: column; align-items: center; }
.party-emblem-actions { display: flex; gap: 8px; }
/* 上傳確認框一列一樣：說明、兩個預覽、兩顆按鈕、小字（DS-260 審核：原本預覽跟按鈕擠在同一列） */
.party-emblem-box > :first-child, .party-emblem-actions, .party-emblem-note { flex-basis: 100%; }
.party-body > .party-emblems { display: flex; flex-direction: column; align-self: stretch; gap: 8px; padding: 0; }
.party-review-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button.party-emblem { cursor: pointer; }
.party-emblem[data-on="true"] { outline: 4px solid var(--ui-title); outline-offset: 2px; }
.party-emblem:focus-visible { outline: 4px solid var(--ui-title); }
.party-window { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, calc(100vw - 24px)); height: min(560px, calc(100dvh - 24px)); z-index: 20; display: flex; flex-direction: column; gap: 8px; }
.party-window > .ui-banner { margin: -6px 0 0; flex: none; }
.party-tabs { display: flex; gap: 6px; flex: none; overflow-x: auto; padding: 4px 0; scrollbar-width: thin; }
.party-tabs > .ui-button { flex: 1 0 auto; height: 32px; }
.party-tabs [data-dot="true"]::after { content: ''; position: absolute; right: 2px; top: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--ui-foe); }
.party-body { flex: 1; min-height: 0; min-width: 0; position: relative; }
.party-body > [role="tabpanel"] { height: 100%; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--ui-line) transparent; padding: 4px; display: flex; flex-direction: column; gap: 8px; }
.party-body > [role="tabpanel"] > * { flex-shrink: 0; }
.party-home-head, .party-merit, .party-funds, .party-donation-controls, .party-donation-edit, .party-upgrade, .party-notice-edit, .party-create-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.party-who { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.party-home-head .party-count { margin-left: auto; }
.party-merit > .ui-bar { flex: 1; min-width: 80px; }
.party-merit-value { white-space: nowrap; }
.party-donation { margin-left: auto; max-width: 100%; }
.party-donation-edit .ui-field { width: 150px; }
.party-upgrade { justify-content: flex-end; }
.party-upgrade-need { flex-basis: 100%; text-align: right; }
.party-notice { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.party-notice > .ui-title { grid-area: 1 / 1; }
.party-notice-text, .party-notice-edit { grid-area: 2 / 1 / 3 / -1; overflow-wrap: anywhere; }
.party-notice > .ui-button { grid-area: 1 / 2; }
.party-notice-edit > .ui-field { flex: 1; width: 0; }
.party-foot { display: flex; justify-content: flex-end; align-items: flex-end; gap: 8px; margin-top: auto; min-height: 40px; }
.party-foot > .ui-button { max-width: 100%; height: auto; min-height: 40px; padding-block: 2px; white-space: normal; text-align: right; }
.party-leave-box { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.party-leave-text { text-align: left; overflow-wrap: anywhere; }
.party-leave-actions { display: flex; justify-content: flex-end; gap: 8px; }
.party-leave-note { color: var(--ui-foe); overflow-wrap: anywhere; }
/* DS-123: the button to go back after a rally, over the two rows of buttons at the right (the action rows are 40 px high, 8 px apart) */
.party-return { position: fixed; right: 12px; bottom: 108px; z-index: 25; }
@media (max-width: 825px) { .party-return { bottom: 192px; } }
.party-summon { display: flex; flex-direction: column; gap: 6px; }
.party-summon-modes { display: flex; gap: 8px; }
.party-summon-modes > .ui-button { flex: 1 1 0; min-width: 0; }
.party-window [data-sure="true"] { color: var(--ui-foe); }
.party-member { border-bottom: 2px solid #1c142226; padding: 4px 0 8px; }
.party-member[data-online="false"] { opacity: 0.55; }
.party-member-head { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: 4px 8px; align-items: center; }
.party-member-head[role="button"] { cursor: pointer; }
.party-rank { grid-column: 1; }
.party-member-name { grid-column: 2; overflow-wrap: anywhere; }
.party-member-class { grid-column: 3; }
.party-member-status { grid-column: 4; }
.party-member-merit { grid-column: 2 / -1; text-align: right; }
.party-member-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.party-skills .party-skill { min-height: 64px; }
.party-skills .party-skill[data-skill="rally"] { min-height: 128px; }
.party-skill[data-state="locked"] { opacity: 0.5; }
.party-skills .party-skill .skill-text .skill-head { padding-right: 0; gap: 4px 8px; }
.party-skill .skill-head > .ui-button { position: static; min-width: 48px; margin-left: auto; }
.party-skill .skill-head > .party-skill-note { flex: 1; white-space: normal; }
.party-skill[data-skill="rally"] .skill-head > .ui-button { width: 144px; height: 64px; }
.party-skill .skill-desc { overflow-wrap: anywhere; }
.party-request, .party-entry { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 2px solid #1c142226; }
.party-entry-level, .party-entry-count { white-space: nowrap; }
.party-entries { display: flex; flex-direction: column; gap: 6px; }
.party-create-name .ui-field { width: 160px; }
.party-emblems { display: grid; grid-template-columns: repeat(6, 48px); gap: 16px; padding: 8px; align-self: flex-start; }
.party-create-error { min-height: 26px; }
.party-create > [data-action="create"] { align-self: flex-end; min-width: 120px; }
.party-card { position: fixed; left: 50%; top: 210px; transform: translateX(-50%); width: 460px; z-index: 30; display: flex; flex-direction: column; gap: 8px; animation: party-card-in 180ms ease-out; }
.party-card[hidden], .party-window[hidden] { display: none !important; }
.party-card[data-resumed="true"] { animation: none; }
.party-card-head { display: flex; align-items: center; gap: 10px; }
.party-card-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.party-card-actions { display: flex; justify-content: flex-end; gap: 8px; }
.party-card-actions > [data-on="true"] { flex: 1; }
.party-countdown { display: flex; align-items: center; gap: 12px; }
.party-countdown > .ui-bar { flex: 1; }
.party-phone.ui-glyph[data-glyph="phone"] { width: 36px; height: 36px; animation: party-phone-ring 700ms ease-in-out infinite; }
@keyframes party-card-in { from { translate: 0 -20px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes party-phone-ring { 0%, 100% { rotate: -12deg; } 50% { rotate: 12deg; } }
@media (prefers-reduced-motion: reduce) { .party-card, .party-phone.ui-glyph[data-glyph="phone"] { animation: none; } }
/* DS-155: the party war tab, and the strip on the home page that goes to it (hidden with the [hidden] rule of .ui) */
.party-war { display: flex; flex-direction: column; gap: 12px; }
.party-war-state { display: flex; flex-direction: column; gap: 8px; }
.party-war-head { display: flex; align-items: center; gap: 12px; }
.party-war-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.party-war-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.party-war-targets { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 2px solid #1c142226; }
.party-war-targets-head { display: flex; flex-direction: column; gap: 2px; }
.party-war-short { color: var(--ui-foe); }
.party-war-target-list { display: flex; flex-direction: column; gap: 6px; }
.party-war-target { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 2px solid #1c142226; }
.party-war-target-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.party-war-target-name { overflow-wrap: anywhere; }
.party-war-target-level, .party-war-target-count { white-space: nowrap; }
.party-war-strip { width: 100%; height: auto; min-height: 40px; padding-block: 2px; white-space: normal; text-align: left; }
/* Only the new preview sections use these containment rules. */
.party-sample { height: 680px; padding-top: 12px; box-sizing: border-box; }
.party-sample > h2 { height: 28px; margin: 0 16px 8px; }
.party-sample .stage > .party-window, .party-sample .stage > .party-card { position: absolute; }
.party-sample .stage > .party-return { position: absolute; right: 12px; bottom: 12px; }
.party-emblem-sample { display: flex; flex-direction: column; gap: 24px; padding: 40px; }
.party-emblem-sample > div { display: flex; gap: 20px; flex-wrap: wrap; }

/* DS-123: the menu on a player; it opens by the point clicked and is placed by playerMenu.ts. */
.player-menu { position: fixed; z-index: 30; width: 176px; max-width: 100vw; max-height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.player-menu-head { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.player-menu > .ui-button { flex: none; }
/* DS-155: the war button asks once before it is sent (the second press within three seconds) */
.player-menu [data-sure="true"] { color: var(--ui-foe); }
/* the war button's text is the longest, so it may take two lines (the menu is 176 wide) */
.player-menu > .player-menu-war { height: auto; min-height: 40px; white-space: normal; padding-block: 2px; line-height: 1.1; }
/* Samples: the menus are held inside their own box, as in the game they lie over the screen. */
.player-menu-sample .stage { position: relative; height: 272px; }   /* tall enough for the menu with all three choices: 16 + 248 (DS-143) */
.player-menu-sample .stage > .player-menu { position: absolute; }

/* DS-140: player against player. The switch leads the row of states under the status panel; a player on the target panel has no monster's red. */
.hud-pvp { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
.hud-pvp[hidden], .pvp-safe[hidden], .char-poll[hidden] { display: none; }
.pvp-mode { min-width: 112px; }
.hud-nearby-players { position: absolute; left: 12px; width: min(248px, 44%); display: flex; flex-direction: column; gap: 6px; padding: 8px; overflow: hidden; font-size: 18px; line-height: 22px; }
.hud-nearby-players[hidden] { display: none; }
.hud-nearby-players[data-expanded="false"] { width: max-content; max-width: 44%; padding: 0; border: 0; border-image: none; background: none; }
.nearby-title { flex: none; min-height: 36px; width: 100%; padding: 2px 6px; font-size: 16px; line-height: 20px; text-align: left; }
.hud-nearby-players[data-compact="true"] .nearby-list { max-height: 138px; }
.hud-nearby-players[data-compact="true"] .nearby-player { min-height: 44px; font-size: 16px; line-height: 18px; }
.nearby-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 4px; }
.nearby-player { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: 52px; padding: 2px 6px; width: 100%; text-align: left; }
.nearby-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nearby-meta { flex: none; font-size: 12px; line-height: 14px; text-align: right; }
.nearby-player:disabled { opacity: 0.55; }
.pvp-mode[data-state="fight"], .pvp-mode[data-state="locked"] { border-image-source: url(button-danger.png); color: #fff; text-shadow: var(--ui-outline); }   /* a red face of its own, lettered in white like the green "on" face */
.pvp-mode[data-state="fight"]:active { border-image-source: url(button-danger-pressed.png); }
.pvp-lock { margin-right: 6px; vertical-align: -1px; }
.pvp-safe { display: inline-flex; align-items: center; gap: 4px; color: var(--ui-good); white-space: nowrap; }
#target-name[data-kind="player"] { color: var(--ui-ink); }
#target-name[data-kind="player"][data-tone="aggressor"] { color: #b8620a; }
#target-name[data-kind="player"][data-tone="red"] { color: var(--ui-foe); }
.target-party { color: var(--ui-dim); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.target-party[hidden] { display: none; }
.target-party::before { content: ''; display: inline-block; width: 12px; height: 12px; margin: 0 8px 0 2px; vertical-align: 1px; box-shadow: 0 0 0 2px var(--ui-line); }
.target-party[data-faction="faction_a"]::before { background: #2f6fd0; }
.target-party[data-faction="faction_b"]::before { background: #3fa86a; }
.target-party[data-faction="faction_c"]::before { background: #ffffff; }
/* the poll is one more row at the top of the column of figures. A row is one line of text, 26 high, and cannot be lower: with nine
   of them the gaps go from 4 to 1, and the column starts 22 under the head and not 26 (4 clear of the slots that hang there, not 8).
   9 x 26 + 8 x 1 + 22 = 264, the height of the left column: the window is exactly as tall as without the poll. (In the head, as a
   line, a bar and a note, the poll made the window 48 taller, and its corner lay over the first slot of the hot bar on a 1280 x 720
   window. The line above the figures is not free either: the slots cover three quarters of it.) The note is the row's tooltip, as
   the hints of the attributes are; a phone has no tooltip and room to scroll, and shows it under the row. */
.char-stats[data-poll="true"] { margin-top: 22px; gap: 1px; }
.char-poll-red { margin-left: 8px; }
.char-poll[data-red="true"] .char-poll-value { color: var(--ui-foe); }
.char-poll-note { display: none; white-space: normal; }
/* DS-142: what a player does when another player hits him on the auto-hunt. The title and the note of the choice on one line (26 high), and
   three buttons of one width under it (the summon row of the party window): 26 + 6 + 40 = 72, and 80 with the gap above it. */
.auto-react { display: flex; flex-direction: column; gap: 6px; }
.auto-react-head { display: flex; align-items: center; gap: 8px; min-height: 26px; white-space: nowrap; }
.auto-react-head > span:first-child { flex: none; }
.auto-react-note { margin-left: auto; text-align: right; }
.auto-react-modes { display: flex; gap: 8px; }
.auto-react-modes > .ui-button { flex: 1 1 0; min-width: 0; }
/* DS-143: the debate. Its shelf sits after the switch on the row under the status panel: the offer, the wait, the countdown, or the time left with yield. */
.hud-debate { display: flex; align-items: center; gap: 8px; flex: none; }
.hud-debate[hidden] { display: none; }
.debate-offer[hidden], .debate-label[hidden], .debate-yield[hidden] { display: none; }
.debate-label { display: inline-flex; align-items: center; height: 40px; box-sizing: border-box; padding: 0 10px; white-space: nowrap; }
/* the megaphone on the card's head: twice the size of the one on a button, as the party card's phone is */
.debate-card .debate-card-glyph.ui-glyph { width: 36px; height: 28px; }
/* the row keeps its room for the shelf: up to the corner of the minimap (x 968 on a 1280 screen), and it does not go down a row */
.hud-under:has(> .hud-debate:not([hidden])) { max-width: calc(100% - 336px); }
/* the line that says a map has no fighting, or a safe zone, is wrong while a debate runs (it can be fought in the city): it goes, and it takes 230 */
.hud-under:has(> .hud-debate:not([hidden])[data-state="countdown"]) .pvp-safe,
.hud-under:has(> .hud-debate:not([hidden])[data-state="on"]) .pvp-safe { display: none; }
/* the debate card takes the place of the party card (the same class, the same motion); with a party card on the same screen it goes under it */
:is(body, .stage):has(> .party-card:not(.debate-card):not([hidden])) > .debate-card { top: 404px; }
/* preview only: the cards stand in their stage, as the party cards do on the party sample page */
#pvp-debate-stage > .party-card, #pvp-debate-stack-stage > .party-card { position: absolute; }

/* preview only: the samples stand on their own shelf */
.pvp-sample .hud-target { position: relative; top: auto; left: auto; right: auto; width: 300px; margin: 0; }
.pvp-sample .char-poll { width: 280px; }
.pvp-sample .auto-react { width: 368px; }

/* DS-101: no existing HUD block moves unless its HUD has data-team. */
.hud-team { position: absolute; left: 12px; top: 196px; width: 236px; display: flex; flex-direction: column; gap: 4px; }
.team-row { position: relative; display: flex; align-items: center; gap: 8px; width: 236px; height: 44px; flex: none; margin: 0; padding: 2px; border-width: 2px; background: none; font: inherit; text-align: left; cursor: pointer; }
.team-row .ui-portrait, .team-member .ui-portrait, .team-card .ui-portrait { width: 32px; height: 32px; border: 2px solid var(--ui-line); background: none; }
.team-row .ui-portrait > img, .team-member .ui-portrait > img, .team-card .ui-portrait > img { left: 0; top: 0; width: 100%; height: 100%; }
.team-body, .team-member-body { flex: 1; min-width: 0; }
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.team-name { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.team-label { overflow: hidden; text-overflow: ellipsis; }
.team-level, .team-dead, .team-leader { flex: none; }
.team-crown { color: #ffd43a; }
.team-bars { display: flex; gap: 4px; margin-top: 2px; }
.team-row .team-hp { width: 120px; flex: none; }
.team-row .team-mp { width: 60px; flex: none; }
.team-state { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-state:empty { display: none; }
.team-row[data-state="here"] .team-state, .team-row[data-state="dead"] .team-state { display: none; }
.team-row[data-state="away"] .team-bars, .team-row[data-state="offline"] .team-bars { display: none; }
.team-row[data-state="offline"], .team-member[data-state="offline"] { opacity: 0.5; }
.team-row[data-state="dead"] .ui-portrait, .team-member[data-state="dead"] .ui-portrait { filter: grayscale(1); }
.team-member[data-state="dead"] .team-state { color: var(--ui-foe); }
.team-member[data-state="away"] .team-bars { opacity: 0.35; }
.hud[data-team="1"] .hud-event { top: 252px; }
.hud[data-team="2"] .hud-event { top: 300px; }
.hud[data-team="3"] .hud-event { top: 348px; }
.hud[data-team="4"] .hud-event { top: 396px; }
/* Four peers leave only 120 px above the chat at 1280x720: keep both events, without their 6 px inter-row gap. */
.hud[data-team="4"] .hud-event { gap: 0; }
@media (max-width: 1240px) {
  .hud[data-team] .hud-team { top: 280px; }
  .hud[data-team="1"] .hud-event { top: 336px; }
.hud[data-team="2"] .hud-event { top: 384px; }
.hud[data-team="3"] .hud-event { top: 432px; }
.hud[data-team="4"] .hud-event { top: 480px; }
}
.team-window { position: fixed; left: 12px; top: 196px; width: 448px; z-index: 20; max-height: calc(100dvh - 208px); display: flex; flex-direction: column; gap: 8px; }
.team-window > :not(.team-list) { flex: none; }
.team-count { margin-left: 12px; }
.team-list { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ui-line) transparent; }
.team-member { display: flex; align-items: center; gap: 8px; flex: none; min-height: 68px; }
.team-member .ui-portrait, .team-card .ui-portrait { width: 44px; height: 44px; }
.team-member .team-hp { flex: 2; min-width: 0; }
.team-member .team-mp { flex: 1; min-width: 0; }
.team-value { position: absolute; inset: 2px 0 0; text-align: center; color: white; text-shadow: var(--ui-outline); }
.team-controls { display: flex; flex: none; flex-direction: column; gap: 4px; }
.team-controls > .ui-button { width: 88px; height: 32px; font-size: 12px; line-height: 14px; }
.team-kick[data-sure="true"], .team-leave[data-sure="true"] { color: var(--ui-foe); }
.team-loot { display: flex; align-items: center; gap: 8px; }
.team-loot > .ui-button { flex: 1; min-width: 0; }
.team-foot { display: flex; justify-content: flex-end; }
.team-leave { width: 160px; }
.team-card { position: fixed; left: 50%; top: 210px; transform: translateX(-50%); width: 420px; z-index: 30; display: flex; flex-direction: column; gap: 8px; animation: team-card-in 0.25s steps(5) both; }
.team-card-head { display: flex; align-items: center; gap: 12px; }
.team-card-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.team-countdown { display: flex; align-items: center; gap: 8px; }
.team-countdown > .ui-bar { flex: 1; }
.team-seconds { min-width: 42px; text-align: right; }
.team-card-actions { display: flex; gap: 8px; }
.team-card-actions > .ui-button { flex: 1; }
@keyframes team-card-in { from { margin-top: -20px; opacity: 0; } to { margin-top: 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .team-card { animation: none; } }
/* Samples use the same boxes, held inside their own game screen. (The menu on a player is its own module: ui-player-menu.mjs.) */
.stage.team-stage { height: 720px; }
.team-stage > .team-window, .team-stage > .team-card { position: absolute; }
.team-stage > .team-window { max-height: 512px; }

/* DS-175: the ferry. The chip stands in the row under the status panel, after the switch to fighting: a boat, and one line of text,
   on a solid dark frame (the tip of a tooltip) so that its light lettering reads over the road. As tall as the switch beside it. */
.hud-ferry { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; max-width: 300px; height: 40px; padding: 0 6px; pointer-events: none; }
.hud-ferry[hidden] { display: none; }
.hud-ferry-text { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; }
.ferry-sails, .ferry-status { margin: 0; }
.ferry-sails { margin-bottom: 2px; }
.ferry-status[data-open="true"] { color: var(--ui-good); }
.ferry-status[data-open="false"] { color: var(--ui-dim); }
.ferry-stage { height: 300px; }

/* DS-188: the election. The board stands under the minimap in the corner, the cast bar over the hot bar, the revive countdown where the fallen banner is. */
.hud-election { grid-column: 1 / -1; grid-row: 2; justify-self: end; align-self: start; width: 300px; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; pointer-events: none; }
.hud-election[hidden], .hud-cast[hidden], #hud-revive[hidden] { display: none; }
.hud:has(#hud-revive:not([hidden])) #hud-fallen { display: none; }
.election-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; white-space: nowrap; }
.election-board-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; line-height: 14px; }
.election-sides { display: flex; flex-direction: column; gap: 2px; }
.election-side { display: flex; align-items: center; gap: 8px; min-width: 0; height: 26px; padding: 0 6px; border: 2px solid transparent; }
.election-side[data-mine="true"] { border-color: var(--ui-title); }
.election-side-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.election-side-votes { flex: none; font-variant-numeric: tabular-nums; }
.election-side[data-lead="true"] .election-side-votes { color: var(--ui-title); }
.election-side-flag { flex: none; }
.election-side[data-flag="true"] .election-side-name { color: var(--ui-title); }
.election-role { white-space: normal; }
.election-board-more { flex: none; white-space: nowrap; }
.election-role[data-role="runner"] { color: var(--ui-foe); }
/* with the test tools open (on a desktop only: a phone keeps its own board) the board is the compact one: a side is 18 high (12 px letters, 14 of line),
   no line of the role — six sides and the tools fit in 720 */
@media (min-width: 761px) and (min-height: 521px) {
  .hud-corner:has(> .hud-cheats:not([hidden])) > #hud-election { gap: 3px; padding: 4px 6px; }
  .hud-corner:has(> .hud-cheats:not([hidden])) > #hud-election .election-sides { gap: 2px; }
  .hud-corner:has(> .hud-cheats:not([hidden])) > #hud-election .election-side { height: 18px; font-size: 12px; line-height: 14px; }
  .hud-corner:has(> .hud-cheats:not([hidden])) > #hud-election .election-role { display: none; }
}
.hud-cast { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); width: 260px; padding: 8px 12px; pointer-events: none; }
/* DS-188 round 4: the plant button stands where the cast bar does, over the hot bar and centred; the line under it wraps and is not cut. It is not
   shown while the cast bar is (the one takes the other's place) */
.hud-plant { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); width: 260px; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.hud-plant[hidden], #hud-cast:not([hidden]) ~ .hud-plant { display: none; }
.hud-plant-button { min-width: 200px; height: 44px; pointer-events: auto; }
/* the line under a dimmed button has a dark ground of its own: on the road it was too faint to read */
.hud-plant-note { max-width: 100%; padding: 2px 6px; text-align: center; white-space: normal; color: #fff6dc; background: #10121ae6; background-clip: padding-box; }
/* a desktop narrower than 1200: the hot bar sits at the left and the chat stands over it, and the action buttons take the right, so there is no room
   under the middle of the screen for the button. It stands over the chat, at its left edge (the chat's bottom is 96 up, its log at most 172 high). */
@media (min-width: 761px) and (min-height: 521px) and (max-width: 1199px) {
  .hud-plant { left: 12px; right: auto; transform: none; bottom: 300px; width: 260px; align-items: flex-start; }   /* (the line under it on one row; the event card is above it) */
}
.hud-cast-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hud-cast > .ui-bar { width: 100%; margin: 6px 0; }
.party-emblem[data-faction="none"] { background-color: #5a5f6b; }
.party-election { display: flex; flex-direction: column; gap: 10px; }
.election-section { display: flex; flex-direction: column; gap: 4px; }
.election-run { font-size: 1.1em; }
.election-action { align-self: flex-start; min-width: 200px; }
.election-action[data-sure="true"] { color: var(--ui-foe); }
.election-entry, .election-seat-ruler { display: flex; align-items: center; gap: 8px; min-width: 0; }
.election-seat { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 36px; }
.election-tag { color: var(--ui-title); }
.election-stage { height: 360px; }

/* Bulk enchant controls and direct-access game features. */
.enchant-bulk { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 2px solid var(--ui-line); padding-top: 8px; }
.enchant-bulk label { display: flex; align-items: center; gap: 4px; }
.enchant-bulk input { width: 4em; }
.enchant-bulk .enchant-mixed { flex: 1 1 100%; font-size: 14px; }
.enchant-bulk .enchant-mixed input { width: auto; }
.enchant-bulk > span { flex: 1 1 100%; }
.enchant-quantity { flex: none; width: 3em; min-width: 0; }
.feature-window { position: fixed; z-index: 20; left: 50%; top: 12%; transform: translateX(-50%); width: min(480px, calc(100vw - 16px)); max-height: 76dvh; overflow-y: auto; box-sizing: border-box; }
.wanted-list { display: flex; flex-direction: column; gap: 8px; }
.wanted-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; padding: 8px 0; border-top: 1px solid #ddc28c; }
.wanted-row > .ui-dim, .wanted-bonus { grid-column: 1 / -1; }
.wanted-bonus { color: #b23d18; }
.black-market-product, .black-market-rename { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.black-market-product > p, .black-market-product > strong:first-child { flex: 1 1 100%; }
.black-market-rename input { flex: 1 1 140px; min-width: 0; }
@media (max-width: 520px) { .enchant-window { left: 8px; width: calc(100vw - 16px); top: 100px; max-height: calc(100dvh - 190px); box-sizing: border-box; } .enchant-row { gap: 6px; } .enchant-row > .ui-button { width: 64px; } .feature-window { top: 8%; max-height: 80dvh; } }
.feature-window { display: flex; flex-direction: column; overflow: visible; }
.feature-window > .ui-banner { margin: -6px -8px 8px; flex: none; }
.feature-content { min-height: 0; overflow-y: auto; overflow-x: hidden; }
@media (max-width: 760px), (max-height: 520px) { .hud .hud-actions:has(> .feature-button) { width: calc(var(--sw) - 12px); max-width: 100%; min-width: 0; grid-column: 1 / -1; justify-self: stretch; } }
@media (max-height: 520px) {
  body > .enchant-window { left: 8px; top: 8px; width: min(560px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); transform: none; box-sizing: border-box; }
  .enchant-bulk { gap: 4px; }
}
@media (max-height: 520px) {
  .enchant-list > .ui-dim, .enchant-row .enchant-text > .ui-dim { display: none; }
}

/* Keep bulk-enchant results from anchoring or scrolling the game page. */
body > .enchant-window { overflow: hidden; overscroll-behavior: contain; }
.enchant-list { flex: 1 1 auto; overflow-anchor: none; overscroll-behavior: contain; touch-action: pan-y; }
.enchant-result { height: 1.3em; min-height: 1.3em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enchant-bulk [role="status"] { min-height: 1.3em; }
.black-market-faction { display:flex; flex-wrap:wrap; gap:8px; }

@media (max-height: 520px) { .enchant-bulk > span:last-child { display: none; } .enchant-bulk [role=status] { font-size: 16px; } }

.enchant-window > .ui-banner { margin: -6px -8px 8px; }
