/* Dice & Dominion — pixel-style home screen + world map. Scope everything to body[data-world="dnd"]. */
@import url('https://fonts.googleapis.com/css2?family=Jersey+15&display=swap');

/* pixel layers in the map SVG (also used by the mini-map) */
.px-map image.px, .px-mini image.px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ==========================================================================
   Tokens: only inside the pixel camp (.dpx) so shop / hero builder modals keep their own looks
   ========================================================================== */
body[data-world=dnd][data-screen=camp] .dpx {
  --px-ink: #120d09;           /* outlines */
  --px-panel: #2a221b;         /* panel fill: dark umber */
  --px-panel2: #352b21;
  --px-rim: #7a5c36;           /* frame rim */
  --px-rim-hi: #a8824c;
  --px-text: #f1e6cc;
  --px-muted: #bba98a;
  --px-gold: #f0c060;
  --px-blue: #3e68b0;          /* team trim */
  --px-blue-hi: #6a9ae0;
  --px-green: #8fd06a;
  --px-red: #e0664a;
  --px-head: 'Jersey 15', 'Inter', sans-serif;
  --font: 'Inter', system-ui, sans-serif;
  --title: 'Inter', system-ui, sans-serif; --title-color: #f6e2b0; --title-ls: .01em; --title-weight: 700;
  --radius: 0px; --btn-r: 0px; --field-r: 0px;
  --panel-bg: var(--px-panel2); --panel-border: 2px solid var(--px-ink); --panel-shadow: inset 0 0 0 1px #4a3a28;
  --btn-bg: linear-gradient(#4a3c2c 0 50%, #40342a 50%); --btn-bg-h: linear-gradient(#5a4834 0 50%, #4c3e30 50%);
  --btn-line: var(--px-ink); --btn-text: var(--px-text);
  --btn-shadow: inset 0 2px 0 rgba(255, 240, 200, .14), inset 0 -3px 0 rgba(0, 0, 0, .35);
  --btn-shadow-active: inset 0 3px 0 rgba(0, 0, 0, .35);
  --btn-clip: polygon(2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px), 0 2px);
  --pri-bg: linear-gradient(#e2b04a 0 50%, #cf9a36 50%); --pri-bg-h: linear-gradient(#f0c060 0 50%, #dca844 50%); --pri-line: var(--px-ink); --pri-text: #1e1408;
  --on-bg: linear-gradient(#3e68b0 0 50%, #355c9e 50%); --on-text: #fff;
  --field: #18120d; --field-line: #4a3a28; --card: #241d17; --card-on: #2e3a52;
  --accent: var(--px-gold); --gold: var(--px-gold); --text: var(--px-text); --muted: var(--px-muted); --dim: #8f7f66;
  --line: #4a3a28; --line2: #5e4a32; --panel: var(--px-panel2); --panel2: #30271f;
  font-family: var(--font);
  color: var(--px-text);
}
/* the pixel frame: outline, bevelled rim, inner line — as a 9-slice so it stays crisp at any size */
body[data-world=dnd] .dpx .dpx-frame {
  border: 8px solid transparent;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Cpath fill='%23120d09' d='M1 0h10v1h1v10h-1v1H1v-1H0V1h1z'/%3E%3Cpath fill='%237a5c36' d='M1 1h10v10H1z'/%3E%3Cpath fill='%23a8824c' d='M2 1h8v1H2zM1 2h1v8H1z'/%3E%3Cpath fill='%23503a22' d='M2 10h8v1H2zM10 2h1v8h-1z'/%3E%3Cpath fill='%23120d09' d='M2 2h8v1H2zM2 9h8v1H2zM2 2h1v8H2zM9 2h1v8H9z'/%3E%3Cpath fill='%232a221b' d='M3 3h6v6H3z'/%3E%3C/svg%3E") 4 fill / 8px / 0 stretch;
  image-rendering: pixelated;
  background: none;
}
/* the pixel display face is for headings only; body text stays a clean sans */
body[data-world=dnd] .dpx :is(.dpx-mhead h2, .dpx-sec h3, .party-head h2, .story-modal h2, .mq-log h3, .dpx-loc-body .setup > .row:first-child h2, .hero-card .name, .party-view h2, .result-banner h2) { font-family: var(--px-head); font-weight: 400; text-transform: none; letter-spacing: .01em; }
body[data-world=dnd] .dpx .party-head h2 { font-size: 34px; }
body[data-world=dnd] .dpx .party-modal .hero-card .name, body[data-world=dnd] .dpx .party-view h2 { font-size: 24px; }
body[data-world=dnd] .dpx .story-modal h2 { font-size: 32px; }
body[data-world=dnd] .dpx .result-banner h2 { font-size: 30px; }
/* hero portraits become the hero's pixel figure (dnd_home.js swaps the painted avatar for a canvas) */
.dpx .portrait.px-port { background: linear-gradient(#26324a 0 72%, #3a4a28 72% 78%, #2e3a20 78%) !important; overflow: hidden; position: relative; border-radius: 0; border: 2px solid #120d09; }
.dpx .portrait.px-port canvas { position: absolute; image-rendering: pixelated; }
.dpx .portrait.px-port .pbadge { z-index: 1; }

/* ==========================================================================
   Layout: top bar · full-bleed map · bottom HUD
   ========================================================================== */
body[data-world=dnd][data-screen=camp] #app { background: #16120f; }
body[data-world=dnd] .camp.dpx { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; position: relative; background: #16120f; }

.dpx .dpx-top {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; min-height: 52px; flex-wrap: nowrap;
  background: linear-gradient(#2e251d 0 50%, #282019 50%); border-bottom: 2px solid var(--px-ink);
  box-shadow: inset 0 -2px 0 #4a3a28, 0 2px 0 rgba(0, 0, 0, .3); position: relative; z-index: 5;
}
.dpx .dpx-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.dpx .dpx-logo { font-family: var(--px-head); font-weight: 400; font-size: 30px; color: #f6d68a; letter-spacing: .02em; white-space: nowrap;
  text-shadow: 2px 0 0 var(--px-ink), -2px 0 0 var(--px-ink), 0 2px 0 var(--px-ink), 0 -2px 0 var(--px-ink), 2px 2px 0 var(--px-ink), 0 4px 0 #6a4a20; }
.dpx .dpx-logo i { font-style: normal; color: var(--px-blue-hi); }
.dpx .dpx-mode { font: 600 11px/1 var(--font); padding: 4px 6px; background: var(--px-blue); color: #fff; border: 2px solid var(--px-ink); white-space: nowrap; }
.dpx .dpx-mode.mode-standard { background: #5a6a3a; }
.dpx .dpx-where {
  display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 6px; cursor: pointer; flex: none; color: var(--px-text);
  background: #1c1611; border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 1px #4a3a28; text-align: left; font: inherit;
}
.dpx .dpx-where:hover { box-shadow: inset 0 0 0 1px var(--px-gold); }
.dpx .dpx-where b { display: block; font: 400 20px/1 var(--px-head); color: #f6e2b0; }
.dpx .dpx-where small { display: block; font-size: 11px; color: var(--px-muted); }
.dpx .dpx-spr { image-rendering: pixelated; display: block; flex: none; }
.dpx .dpx-players { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.dpx .pchip { border-radius: 0; background: #1c1611; border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 1px #4a3a28; padding: 3px 8px; white-space: nowrap; }
.dpx .pchip.ready { box-shadow: inset 0 0 0 1px #5a9a4a; background: #1d2a18; }
.dpx .pchip .dot { border-radius: 0; }
.dpx .code { border-radius: 0; border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 1px var(--px-rim); background: #1c1611; font-family: var(--px-head); color: var(--px-gold); font-size: 21px; letter-spacing: .18em; padding: 4px 10px; }

/* icon buttons */
.dpx .dpx-ico { display: inline-block; width: 24px; height: 24px; flex: none; }
.dpx .dpx-ico.big { width: 30px; height: 30px; }
.dpx .dpx-ico svg { width: 100%; height: 100%; display: block; }
.dpx .dpx-ib {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 44px; height: 44px; padding: 4px 8px; cursor: pointer; color: var(--px-text);
  background: var(--btn-bg); border: 2px solid var(--px-ink); box-shadow: var(--btn-shadow); clip-path: var(--btn-clip);
  font: 400 14px/1 var(--px-head);
}
.dpx .dpx-ib:hover { background: var(--btn-bg-h); }
.dpx .dpx-ib:active { box-shadow: var(--btn-shadow-active); }
.dpx .dpx-ib.on { background: var(--on-bg); }
.dpx .dpx-ib em { position: absolute; top: 2px; right: 3px; font: 600 9px/1 var(--font); color: var(--px-muted); }
.dpx .dpx-badge { position: absolute; top: 2px; right: 2px; min-width: 14px; height: 14px; padding: 0 3px; background: var(--px-red); color: #fff; border: 2px solid var(--px-ink); font: 700 9px/10px var(--font); font-style: normal; animation: dpx-blink 1s steps(2) infinite; }
.dpx .dpx-badge[hidden] { display: none; }
@keyframes dpx-blink { 50% { transform: translateY(-2px); } }

/* the map fills everything between the bars */
.dpx .dpx-map.roster { position: relative; overflow: hidden; min-height: 0; }
.dpx .dpx-map > .wm-wrap { position: absolute; inset: 0; padding: 0; border: 0; border-radius: 0; background: #1e1a24; display: flex; }
.dpx .dpx-map > .wm-wrap > .wm-view { flex: 1 1 auto; aspect-ratio: auto; min-height: 0; height: 100%; border-radius: 0; background: #1e1a24; }

/* ---- the location card (floats over the map's right side) */
.dpx .dpx-loc {
  position: absolute; top: 12px; right: 64px; z-index: 4; width: min(380px, calc(100% - 90px));
  max-height: calc(100% - 24px); display: flex; flex-direction: column;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35));
}
.dpx .dpx-loc-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; border-bottom: 2px solid #120d09; box-shadow: 0 2px 0 #4a3a28; margin-bottom: 8px; }
.dpx .dpx-loc-head .dpx-spr.big { width: 36px; height: auto; }
.dpx .dpx-tabs { display: flex; gap: 4px; flex: 1; align-items: center; }
.dpx .dpx-kicker { font: 400 16px/1 var(--px-head); color: var(--px-muted); text-transform: uppercase; letter-spacing: .08em; }
.dpx .dpx-tab { font: 400 17px/1 var(--px-head); padding: 5px 10px; cursor: pointer; color: var(--px-muted); background: #1c1611; border: 2px solid var(--px-ink); clip-path: var(--btn-clip); position: relative; }
.dpx .dpx-tab.on { background: var(--px-blue); color: #fff; }
.dpx .dpx-dot { display: inline-block; width: 6px; height: 6px; background: var(--px-red); margin-left: 3px; vertical-align: middle; animation: dpx-blink 1s steps(2) infinite; }
.dpx .dpx-x { flex: none; width: 28px; height: 28px; cursor: pointer; color: var(--px-text); background: #3a2e24; border: 2px solid var(--px-ink); font: 700 13px/1 var(--font); clip-path: var(--btn-clip); }
.dpx .dpx-x:hover { background: #8a3a22; }
.dpx .dpx-loc-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 2px; min-height: 0; }
.dpx .dpx-loc-body .setup > .row:first-child h2 { font-size: 27px; font-weight: 400; color: #f6e2b0; }
.dpx .dpx-loc-body .wm-actions { margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.dpx .dpx-loc-body .wm-actions .btn { padding: 8px 12px; font: 400 19px/1.05 var(--px-head); white-space: normal; text-align: left; }
.dpx .dpx-loc-body .wm-where, .dpx .dpx-loc-body .wm-status, .dpx .dpx-loc-body .wm-services, .dpx .dpx-loc-body .wm-missions, .dpx .dpx-loc-body .war-panel,
.dpx .dpx-loc-body .mq-note, .dpx .dpx-loc-body [style*="background:#2a1f36"] { border-radius: 0 !important; border-width: 2px !important; }
.dpx .dpx-loc-body .wm-mission { border-radius: 0; }
.dpx .dpx-loc-body .kv { background: #1c1611; padding: 8px; border: 2px solid #120d09; box-shadow: inset 0 0 0 1px #3a2e22; }
.dpx .dpx-loc-body .arena-panel { background: none; border: 0; box-shadow: none; padding: 0; }
.dpx .dpx-loc-body .ar-team, .dpx .dpx-loc-body .ar-seat { border-radius: 0; }
/* the compact place card (worldmap.js dndLocationCardHTML) */
.dpx .lc { display: flex; flex-direction: column; gap: 10px; }
.dpx .lc-title { display: flex; flex-direction: column; gap: 5px; }
body[data-world=dnd][data-screen=camp] .dpx .lc-title h2 { font: 400 28px/1 var(--px-head); color: #f6e2b0; margin: 0; letter-spacing: .01em; text-shadow: 0 2px 0 #000; }
.dpx .lc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.dpx .lc-tag { font: 600 11px/1 var(--font); padding: 3px 6px; color: var(--px-text); background: #3a2e24; border: 2px solid var(--px-ink); white-space: nowrap; }
.dpx .lc-tag.red { background: #5a1f16; color: #ffc4b4; }
.dpx .lc-tag.blue { background: #22365c; color: #cfe0ff; }
.dpx .lc-tag.violet { background: #3c2258; color: #e2ccff; }
.dpx .lc-tag.gold { background: #4a3a14; color: var(--px-gold); }
.dpx .lc-tag.green { background: #22381c; color: #c8f0b0; }
.dpx .lc-tag.warn { background: #6a3418; color: #ffd8a0; }
.dpx .lc-actions { display: flex; flex-direction: column; gap: 6px; }
.dpx .lc-actions .btn.lc-main { width: 100%; padding: 8px 12px; font: 400 22px/1 var(--px-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.dpx .lc-sec { display: flex; flex-wrap: wrap; gap: 6px; }
.dpx .lc-sec .btn { flex: 1 1 auto; white-space: nowrap; }
.dpx .lc-note, .dpx .lc-ready { font-size: 12.5px; color: var(--px-muted); }
.dpx .lc-ready .ok { color: var(--px-green); }
.dpx .lc-missions { display: flex; flex-direction: column; gap: 4px; }
.dpx .lc-mission { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; background: #1c1611; border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 1px #3a2e22; }
.dpx .lc-mission .nm { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dpx .lc-desc { margin: 0; font-size: 13.5px; line-height: 1.5; color: #e6d8bc; }
.dpx .lc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dpx .lc-f { padding: 5px 8px 6px; background: #1c1611; border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 1px #3a2e22; min-width: 0; }
.dpx .lc-f.wide { grid-column: 1 / -1; }
.dpx .lc-f > span { display: block; font: 600 10px/1.2 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--px-muted); }
.dpx .lc-f b { display: block; font: 600 13.5px/1.35 var(--font); color: var(--px-text); margin-top: 1px; }
.dpx .lc-f b b { display: inline; margin: 0; font: inherit; }
.dpx .lc-f b .boss { color: #ff9d86; }
.dpx .lc-f b .gold, .dpx .lc-f b.gold { color: var(--px-gold); }
.dpx .lc-f b i { font-style: normal; font-size: 12px; }
.dpx .lc-f b i.warn { color: #ffb36b; }
.dpx .lc-f b i.dim { color: var(--px-muted); font-weight: 500; }
.dpx .lc-more { border-top: 2px solid var(--px-ink); box-shadow: inset 0 2px 0 #4a3a28; padding-top: 8px; }
.dpx .lc-more summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; }
.dpx .lc-more summary::-webkit-details-marker { display: none; }
.dpx .lc-more-l { font: 400 19px/1 var(--px-head); color: var(--px-gold); padding: 3px 9px 4px; background: var(--btn-bg); border: 2px solid var(--px-ink); box-shadow: var(--btn-shadow); clip-path: var(--btn-clip); }
.dpx .lc-more-l::after { content: ' ▸'; }
.dpx .lc-more[open] .lc-more-l::after { content: ' ▾'; }
.dpx .lc-more summary:hover .lc-more-l { background: var(--btn-bg-h); }
.dpx .lc-more-h { font-size: 11.5px; color: var(--px-muted); }
.dpx .lc-more-b { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 12.5px; }
.dpx .lc-more-b > * { margin: 0 !important; border-radius: 0 !important; }
.dpx .lc-more-b .wm-where, .dpx .lc-more-b .wm-status, .dpx .lc-more-b .wm-services, .dpx .lc-more-b .mq-note, .dpx .lc-more-b .lc-box, .dpx .lc-more-b .war-panel, .dpx .lc-more-b .wm-missions { padding: 6px 8px; border: 2px solid var(--px-ink) !important; box-shadow: inset 0 0 0 1px #3a2e22; background: #1c1611; line-height: 1.45; }
.dpx .lc-more-b .wm-status.must { background: #3a1812; }
.dpx .lc-more-b .mq-note.current { background: #2e1a46; }
.dpx .lc-more-b .wm-mission { border-radius: 0; }
.dpx .lc-more-b .kv { padding: 6px 8px; }
.dpx .dpx-loc-pill { position: absolute; top: 12px; right: 64px; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; cursor: pointer;
  background: var(--px-panel); color: var(--px-text); border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 2px var(--px-rim), 0 4px 0 rgba(0, 0, 0, .35); font: 400 18px/1 var(--px-head); }
.dpx .dpx-loc-pill .dpx-spr { width: 26px; height: auto; }

/* ---- battle result over the map */
.dpx .dpx-result { position: absolute; top: 44px; left: 12px; z-index: 4; width: min(560px, calc(100% - 480px)); min-width: 300px; max-height: 45%; overflow: auto; }
.dpx .dpx-result .result-banner { margin: 0; border-radius: 0; border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 2px var(--px-rim), 0 4px 0 rgba(0, 0, 0, .35); background: #2a221b; }
.dpx .dpx-result .result-banner h2 { font-family: var(--px-head); }

/* ---- chat (bottom-left over the map) */
.dpx .dpx-chat { position: absolute; left: 12px; bottom: 12px; z-index: 4; width: min(360px, calc(100% - 24px)); height: min(300px, 60%); display: flex; flex-direction: column; }
.dpx .dpx-chat[hidden] { display: none; }
.dpx .dpx-chat .panel.chat { flex: 1; min-height: 0; background: none; border: 0; box-shadow: none; display: flex; flex-direction: column; }
.dpx .dpx-chat .chat-log { flex: 1; min-height: 0; overflow-y: auto; font-size: 13px; }
.dpx .dpx-mhead { display: flex; align-items: center; gap: 10px; padding: 2px 2px 8px; margin-bottom: 8px; border-bottom: 2px solid #120d09; box-shadow: 0 2px 0 #4a3a28; }
.dpx .dpx-mhead.sm { padding-bottom: 4px; margin-bottom: 4px; font: 400 18px/1 var(--px-head); }
.dpx .dpx-mhead h2 { font-size: 32px; font-weight: 400; margin: 0; }

/* ---- map chrome in pixel dress */
.dpx .wm-ctrl { top: 12px; right: 12px; gap: 4px; }
.dpx .wm-ctrl .btn { width: 36px; height: 34px; background: var(--btn-bg); border: 2px solid var(--px-ink); color: var(--px-text); font: 700 16px/1 var(--font); }
.dpx .wm-zoomlvl { font: 400 14px/1 var(--px-head); color: var(--px-text); background: rgba(18, 13, 9, .75); padding: 2px 4px; }
.dpx .wm-progress { top: 12px; left: 12px; border-radius: 0; border: 2px solid var(--px-ink); background: rgba(28, 22, 17, .88); font: 500 11px/1.2 var(--font); padding: 4px 8px; }
.dpx .wm-mini { right: 12px; bottom: 12px; width: 176px; height: 99px; border: 2px solid var(--px-ink); border-radius: 0; box-shadow: inset 0 0 0 2px var(--px-rim), 0 4px 0 rgba(0, 0, 0, .35); outline: 2px solid var(--px-rim); outline-offset: -4px; }
.dpx .wm-hint { left: 12px; bottom: 12px; border-radius: 0; background: rgba(18, 13, 9, .7); font: 500 11px/1.3 var(--font); }
.dpx.chat-open .wm-hint { display: none; }
.dpx .war-legend, .dpx .mq-legend { border-radius: 0 !important; }
.dpx .mq-legend { top: 44px; left: 12px; border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 1px #8a6a24; }
.dpx .war-legend { bottom: 40px; left: 12px; }

/* map labels & markers */
.px-map .wm-region { font-family: 'Jersey 15', sans-serif; font-weight: 400; font-style: normal; fill: #f4e8cc; fill-opacity: .85; stroke: #16120f; stroke-width: 4px; paint-order: stroke; letter-spacing: .12em; text-transform: uppercase; font-size: 24px; }
.px-map .wm-region.big { font-size: 30px; }
.px-map .wm-label { font-family: 'Jersey 15', sans-serif; font-weight: 400; font-size: 16px; fill: #fbf2dc; stroke: #16120f; stroke-width: 3.4px; paint-order: stroke; letter-spacing: .02em; text-transform: none; }
.px-map .wm-lvl { font-family: 'Jersey 15', sans-serif; font-weight: 400; font-size: 13px; fill: #ffd66b; stroke: #16120f; stroke-width: 3px; paint-order: stroke; }
.px-map .px-node { cursor: pointer; }
.px-map .px-node.locked .wm-label { fill: #b8b0c4; }
.px-map .px-node:hover image.px { filter: brightness(1.18); }
.px-map .px-adj { fill: rgba(255, 214, 107, .18); stroke: #ffd66b; stroke-width: 2; stroke-dasharray: 4 3; animation: px-pulse 1.2s steps(2) infinite; }
.px-map .px-here { fill: rgba(106, 154, 224, .35); stroke: #6a9ae0; stroke-width: 2; }
.px-map .px-sel { stroke: #16120f; stroke-width: 6; fill: none; stroke-linecap: square; }
.px-map .px-sel-in { stroke: #ffd66b; stroke-width: 2.6; fill: none; stroke-linecap: square; animation: px-pulse 1s steps(2) infinite; }
.px-map .px-bang { animation: px-bob 1s steps(2) infinite; }
.px-map .px-node.conquered .px-bang { display: none; }
.px-map .wm-pulse, .px-map .wm-adj { display: none; }
@keyframes px-pulse { 50% { opacity: .45; } }
@keyframes px-bob { 50% { transform: translate(0, -3px); } }
.px-map .px-party.walking { animation: px-walk .32s steps(2) infinite; }
@keyframes px-walk { 50% { translate: 0 -2px; } }
.px-map.far .wm-label { font-size: 20px; }
.px-map.far .wm-node:not(.frontier):not(.sel):not(.here) .wm-label { display: none; }
.px-map.far .wm-node.frontier .wm-label, .px-map.far .wm-node.sel .wm-label { font-size: 24px; stroke-width: 4px; }

/* ==========================================================================
   The party HUD
   ========================================================================== */
.dpx .dpx-hud {
  display: flex; align-items: stretch; gap: 12px; padding: 6px 10px 8px; position: relative; z-index: 5;
  background: linear-gradient(#2e251d 0 50%, #282019 50%); border-top: 2px solid var(--px-ink); box-shadow: inset 0 2px 0 #4a3a28, 0 -2px 0 rgba(0, 0, 0, .3);
}
.dpx .dpx-party { display: flex; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; padding-bottom: 2px; }
.dpx .dpx-slot {
  position: relative; flex: none; width: 104px; padding: 0 0 5px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: #1c1611; border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 2px #3e3022; color: var(--px-text); font: inherit; text-align: center;
  clip-path: var(--btn-clip);
}
.dpx .dpx-slot:hover { box-shadow: inset 0 0 0 2px var(--px-rim-hi); }
.dpx .dpx-slot.mine { box-shadow: inset 0 0 0 2px var(--px-blue); }
.dpx .dpx-slot.on { box-shadow: inset 0 0 0 2px var(--px-gold); background: #2a2216; }
.dpx .dpx-slot.benched .dpx-fig { opacity: .45; filter: grayscale(.8); }
.dpx .dpx-fig { position: relative; display: block; width: 100%; height: 100px; overflow: hidden;
  background: linear-gradient(transparent 0 78%, #3a4a28 78% 82%, #2e3a20 82%); }
.dpx .dpx-slot.mine .dpx-fig { background: linear-gradient(#1e2638 0 78%, #3a4a28 78% 82%, #2e3a20 82%); }
.dpx .dpx-fig canvas { position: absolute; image-rendering: pixelated; pointer-events: none; }
.dpx .dpx-plus { display: grid; place-items: center; height: 100%; font: 400 40px/1 var(--px-head); color: var(--px-muted); }
.dpx .dpx-slot.add { border-style: dashed; }
.dpx .dpx-slot.add:hover .dpx-plus { color: var(--px-gold); }
.dpx .dpx-nm { font: 400 17px/1 var(--px-head); color: #f6e2b0; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dpx .dpx-lv { font-size: 10.5px; line-height: 1.1; color: var(--px-muted); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dpx .dpx-hp { width: 80px; height: 6px; background: #120d09; border: 1px solid #120d09; margin-top: 2px; display: block; }
.dpx .dpx-hp i { display: block; height: 100%; background: linear-gradient(#9fe070 0 50%, #6ab048 50%); }
.dpx .dpx-hp i.mid { background: linear-gradient(#f0d060 0 50%, #c8a838 50%); }
.dpx .dpx-hp i.low { background: linear-gradient(#f07a5a 0 50%, #c04a32 50%); }
.dpx .dpx-st { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; display: grid; place-items: center; font: 700 11px/1 var(--font); border: 2px solid var(--px-ink); }
.dpx .dpx-st.ok { background: #3e7a3a; color: #dfffd0; }
.dpx .dpx-st.warn { background: #e0a030; color: #1e1408; animation: dpx-blink 1s steps(2) infinite; }
.dpx .dpx-st.paused { background: #5a6070; color: #fff; }
.dpx .dpx-hud-r { display: flex; align-items: center; gap: 10px; flex: none; }
.dpx .dpx-btns { display: grid; grid-template-columns: repeat(2, auto); gap: 4px; }
.dpx .dpx-btns .dpx-ib { min-width: 76px; height: 50px; flex-direction: row; gap: 6px; justify-content: flex-start; font-size: 17px; }
.dpx .dpx-ready {
  display: flex; align-items: center; gap: 8px; height: 104px; padding: 0 16px; cursor: pointer; color: #1e1408;
  background: var(--pri-bg); border: 2px solid var(--px-ink); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .3), inset 0 -4px 0 rgba(0, 0, 0, .3); clip-path: var(--btn-clip);
}
.dpx .dpx-ready:hover { background: var(--pri-bg-h); }
.dpx .dpx-ready:active { box-shadow: inset 0 4px 0 rgba(0, 0, 0, .3); }
.dpx .dpx-ready .dpx-ico { width: 30px; height: 30px; }
.dpx .dpx-ready b { display: block; font: 400 28px/.9 var(--px-head); text-align: left; }
.dpx .dpx-ready small { display: block; font: 600 11px/1.4 var(--font); text-align: left; opacity: .8; }
.dpx .dpx-ready.on { background: linear-gradient(#7ac060 0 50%, #62a84a 50%); }

/* the hero popover (above the HUD) */
.dpx .dpx-pop { position: absolute; bottom: 136px; left: 12px; z-index: 8; width: min(400px, calc(100vw - 16px)); filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .4)); }
.dpx .dpx-pop .hero-card { background: none; border: 0; padding: 0; box-shadow: none; }
.dpx .dpx-pop .hero-card .name { font-family: var(--px-head); font-size: 23px; font-weight: 400; }
.dpx .dpx-pop .portrait { border-radius: 0; border: 2px solid var(--px-ink); }
.dpx .dpx-pop-foot { margin-top: 8px; padding-top: 8px; border-top: 2px solid #120d09; box-shadow: inset 0 2px 0 #4a3a28; gap: 6px; }
.dpx .xpbar { border-radius: 0; height: 6px; }
.dpx .xpbar > div { border-radius: 0; background: linear-gradient(#f0c060 0 50%, #c8962e 50%); }
.dpx .tag { border-radius: 0; border-width: 2px; border-color: var(--px-ink); background: #3a2e24; }
.dpx .tag.gold { background: #4a3a14; color: var(--px-gold); }
.dpx .tag.green { background: #22381c; }
.dpx .tag.red { background: #3e1a14; }
.dpx .tag.blue { background: #1e2c48; }

/* ==========================================================================
   Overlays: Journal (centre), Settings (right drawer), Party & story (shared markup)
   ========================================================================== */
.dpx .dpx-ovl { position: fixed; inset: 0; z-index: 900; background: rgba(12, 9, 7, .62); display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px 16px; }
.dpx .dpx-ovl.right { justify-content: flex-end; padding: 60px 12px 12px; }
.dpx .dpx-modal { width: min(640px, 100%); max-height: calc(100vh - 80px); display: flex; flex-direction: column; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .45)); }
.dpx .dpx-modal.settings { width: min(460px, 100%); max-height: calc(100vh - 72px); }
.dpx .dpx-mbody { overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 4px; display: flex; flex-direction: column; gap: 12px; }
.dpx .dpx-sec h3 { font-size: 22px; font-weight: 400; color: var(--px-gold); margin: 0 0 6px; }
.dpx .dpx-sec > .panel, .dpx .dpx-mbody > .panel { margin-bottom: 8px; padding: 10px; }
.dpx .dpx-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.dpx .dpx-stats span { padding: 4px 8px; background: #1c1611; border: 2px solid var(--px-ink); font-size: 13px; }
.dpx .dpx-stats b { font-family: var(--px-head); font-weight: 400; color: var(--px-gold); font-size: 20px; }
.dpx .dpx-players-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dpx .mq-log { padding: 12px; }
.dpx .mq-log h3 { font-size: 26px; font-weight: 400; }
.dpx .themes .theme { border-radius: 0; }
.dpx #skirmish summary b { font-family: var(--px-head); font-weight: 400; font-size: 19px; }
.dpx .challenge .chal-val { font: 400 19px/1 var(--px-head); color: var(--px-gold); }
.dpx input[type=range] { accent-color: var(--px-gold); }
.dpx .dpx-rec { font: 400 17px/1 var(--px-head); color: var(--px-gold); padding: 3px 8px; background: #1c1611; border: 2px solid var(--px-ink); }
.dpx .party-overlay, .dpx .story-overlay { background: rgba(12, 9, 7, .7); backdrop-filter: none; }
.dpx .party-modal { border-radius: 0; border: 8px solid transparent; background: none;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Cpath fill='%23120d09' d='M1 0h10v1h1v10h-1v1H1v-1H0V1h1z'/%3E%3Cpath fill='%237a5c36' d='M1 1h10v10H1z'/%3E%3Cpath fill='%23a8824c' d='M2 1h8v1H2zM1 2h1v8H1z'/%3E%3Cpath fill='%23503a22' d='M2 10h8v1H2zM10 2h1v8h-1z'/%3E%3Cpath fill='%23120d09' d='M2 2h8v1H2zM2 9h8v1H2zM2 2h1v8H2zM9 2h1v8H9z'/%3E%3Cpath fill='%232a221b' d='M3 3h6v6H3z'/%3E%3C/svg%3E") 4 fill / 8px / 0 stretch;
  image-rendering: pixelated; box-shadow: none; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .45)); }
.dpx .party-modal .card, .dpx .hero-card { border-radius: 0; border: 2px solid var(--px-ink); box-shadow: inset 0 0 0 1px #4a3a28; background: #30271f; }
.dpx .party-modal .portrait { border-radius: 0; }
.dpx .story-choice { border-radius: 0; }

/* ==========================================================================
   Narrow screens: the card becomes a bottom sheet, the HUD compacts
   ========================================================================== */
@media (max-width: 1100px) {
  .dpx .dpx-players { display: none; }
  .dpx .dpx-result { width: calc(100% - 24px); max-height: 30%; }
}
@media (max-width: 760px) {
  .dpx .dpx-top { gap: 6px; padding: 4px 6px; min-height: 46px; }
  .dpx .dpx-logo { font-size: 22px; }
  .dpx .dpx-mode { display: none; }
  .dpx .dpx-where { padding: 2px 6px 2px 4px; min-width: 0; flex: 1 1 auto; }
  .dpx .dpx-where .dpx-spr { width: 24px; height: auto; }
  .dpx .dpx-where b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dpx .dpx-where small { display: none; }
  .dpx .dpx-top .spacer { display: none; }
  .dpx .dpx-code { font-size: 15px; padding: 3px 5px; letter-spacing: .1em; }
  .dpx .dpx-top > .dpx-ib { min-width: 38px; height: 38px; padding: 4px; }
  .dpx .dpx-loc { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 58%; }
  .dpx .dpx-loc-pill { top: auto; bottom: 8px; right: 8px; }
  .dpx .wm-ctrl { top: 8px; right: 8px; }
  .dpx .wm-ctrl .btn { width: 34px; height: 32px; }
  .dpx .wm-progress, .dpx .wm-hint, .dpx .war-legend { display: none; }
  .dpx .wm-mini { right: auto; left: 8px; top: auto; bottom: 8px; width: 110px; height: 62px; }
  .dpx .dpx-hud { flex-direction: column; gap: 6px; padding: 4px 6px 6px; }
  .dpx .dpx-slot { width: 66px; }
  .dpx .dpx-fig { height: 60px; }
  .dpx .dpx-nm { font-size: 14px; max-width: 60px; }
  .dpx .dpx-lv { font-size: 9.5px; max-width: 60px; }
  .dpx .dpx-hp { width: 52px; }
  .dpx .dpx-hud-r { gap: 6px; }
  .dpx .dpx-ready { height: 46px; padding: 0 10px; flex: 1; }
  .dpx .dpx-ready b { font-size: 22px; }
  .dpx .dpx-btns { display: flex; gap: 4px; }
  .dpx .dpx-btns .dpx-ib { min-width: 46px; height: 46px; flex-direction: column; gap: 1px; font-size: 13px; padding: 3px; }
  .dpx .dpx-btns .dpx-ib .dpx-ico { width: 20px; height: 20px; }
  .dpx .dpx-btns .dpx-ib em { display: none; }
  .dpx .dpx-pop { bottom: 150px; }
  .dpx .dpx-chat { left: 8px; right: 8px; bottom: 8px; width: auto; }
  .dpx .dpx-result { left: 8px; top: 78px; width: calc(100% - 16px); min-width: 0; }
  .dpx .dpx-ovl, .dpx .dpx-ovl.right { padding: 8px; align-items: stretch; }
  .dpx .dpx-modal, .dpx .dpx-modal.settings { max-height: calc(100vh - 16px); width: 100%; }
}
/* big parties (8–10 heroes): slimmer hero cards so the whole party fits beside the buttons */
.dpx .dpx-party:has(> .dpx-slot:nth-child(8)) .dpx-slot { width: 84px; }
.dpx .dpx-party:has(> .dpx-slot:nth-child(8)) .dpx-slot .dpx-fig { height: 92px; }
