/* Combat HUD: iron-and-brass frames (assets/ui/hud). Loaded after combat-deck.css and overrides it.
   Layering for bars: dark recessed track, clipped texture fill, frame overlay, live text.
   Frame art is decoration only: pseudo-elements, no pointer events. */
:root {
  --hud-frame: url("assets/ui/hud/health-frame.webp");
  --hud-slot: url("assets/ui/hud/ability-frame.webp");
  --hud-bezel: url("assets/ui/hud/fury-bezel.webp");
  --hud-red: #6e1414 url("assets/ui/hud/health-fill.webp") center / cover;
  --hud-teal: #1f6457 url("assets/ui/hud/energy-fill.webp") center / cover;
}

/* ---------- Nameplates ---------- */
.np { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; padding: 2px 8px 4px; background: none !important; }
.np-player { width: min(46%, 340px); left: 4px; top: 6px; }
.np-head { display: contents; }
.np-lv { grid-column: 1; grid-row: 1 / span 2; align-self: end; z-index: 2; position: relative; width: 38px; height: 38px; min-width: 0; padding: 0; border: 0; border-radius: 50%;
  background: radial-gradient(circle, #1b1311 0 60%, transparent 61%), var(--hud-bezel) center / 100% 100% no-repeat; box-shadow: 0 2px 6px #000c;
  color: #f1dcae; font: 600 14px/1 var(--title); text-shadow: 0 1px 2px #000; margin-bottom: -4px; }
.np-head h3 { grid-column: 2; grid-row: 1; padding: 0 6px 2px 8px; font-size: 16px; letter-spacing: .01em; }
.np-stats { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; padding-right: 4px; }
.np > .np-bar, .np > .np-bar + .np-bar, .np > .np-fx, .np > .np-cue { grid-column: 2; }
.np > .np-bar.health { grid-row: 2; margin-left: -6px; }
.np > .np-bar.energy { grid-row: 3; }
.np > .np-cue { grid-row: 3; }
.np > .np-fx { grid-row: 4; }

/* Mirrored for enemies: medallion on the right, name right-aligned. */
.np-enemy { grid-template-columns: minmax(0, 1fr) 38px; }
.np-enemy .np-lv { grid-column: 2; }
.np-enemy .np-head h3 { grid-column: 1; text-align: right; padding: 0 8px 2px 6px; }
.np-enemy > .np-bar, .np-enemy > .np-fx, .np-enemy > .np-cue { grid-column: 1; }
.np-enemy > .np-bar.health { margin: 0 -6px 0 0; }
.np-enemy .np-fx { justify-content: flex-end; }
.np-enemy .np-cue { text-align: right; }

/* The bar: the frame overlay sits outside the track (its opening is ~48% of its height and ~91% of its width). */
.np-bar { --h: 20px; position: relative; height: var(--h); overflow: visible; border: 0; border-radius: 0; background: none; box-shadow: none; }
.np-bar.health::after { content: ""; position: absolute; z-index: 1; top: calc(var(--h) * -.54); bottom: calc(var(--h) * -.54); left: -4.7%; right: -4.7%; background: var(--hud-frame) center / 100% 100% no-repeat; pointer-events: none; }
.np-track { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, #050303, #1a0f0e); box-shadow: inset 0 2px 5px #000;
  clip-path: polygon(0 50%, calc(var(--h) * .5) 0, calc(100% - var(--h) * .5) 0, 100% 50%, calc(100% - var(--h) * .5) 100%, calc(var(--h) * .5) 100%); }
.np-track > i { position: absolute; inset: 0 auto 0 0; }
.np-track .np-trail { background: linear-gradient(180deg, #e9c58a, #a3713c); transition: width .55s ease-in .3s; }
.np-track .np-fill { background: var(--hud-red); box-shadow: inset 0 1px 0 #ffffff24, inset -1px 0 0 #ff9a8040; transition: width .18s ease-out; }
.np-bar > b { z-index: 2; font: 600 13px/1 var(--title); letter-spacing: .03em; color: #f6eadb; }
.np-player .np-bar.health { --h: 22px; height: var(--h); }
.np-player .np-bar.health > b { font-size: 14px; }
.np-bar.energy { --h: 6px; height: 6px; margin: 7px 10px 0 4px; }
.np-bar.energy .np-track { clip-path: none; border-radius: 3px; background: #050505; box-shadow: inset 0 1px 2px #000, 0 0 0 1px #3a2d25; }
.np-bar.energy .np-fill { background: var(--hud-teal); }
.np-bar.energy .np-trail { display: none; }
.np-bar.is-low .np-fill { animation: np-low 1.1s ease-in-out infinite; }
.np-enemy.windup .np-bar { box-shadow: none; }
.np-enemy.windup .np-bar.health::after { filter: drop-shadow(0 0 5px #ff4a2c) brightness(1.15); }
.np.dead .np-bar > b { font-family: var(--title); }
.np.boss .np-lv { color: #ffd3b4; filter: hue-rotate(-12deg) saturate(1.3); }
.np-fx { margin-top: 6px; }
.np-cue { margin-top: 6px; }

/* Packs: narrower plates, smaller medallions. */
.np-enemies.pack .np { grid-template-columns: minmax(0, 1fr) 28px; padding: 2px 4px; }
.np-enemies.pack .np-lv { width: 28px; height: 28px; font-size: 11px; }
.np-enemies.pack .np-bar { --h: 15px; }
.np-enemies.pack .np-bar > b { font-size: 11px; }
.np-enemies.pack .np-head h3 { font-size: 12.5px; }

/* ---------- Control dock ---------- */
.dk { border: 16px solid transparent !important; border-image: url("assets/ui/hud/dock-panel.webp") 42 fill / 16px / 0 stretch !important; background: none !important; box-shadow: 0 10px 26px #000a !important; padding: 2px 4px 4px !important; }
.dk::before { display: none; }
.dk-label { color: #cdb48c; font-family: var(--title); text-shadow: 0 1px 2px #000; }
.dk-edit { border: 1px solid #8a6a3d !important; background: linear-gradient(180deg, #2a221b, #15100d) !important; color: #e2c999 !important; }

/* Ability slots: real icon, cooldown sweep, then the frame, then live labels. */
.dk .hot-cell { max-width: 74px; }
.dk .hot-slot { position: relative; border: 0 !important; border-radius: 9% !important; background: radial-gradient(circle at 50% 40%, #2a201b, #0c0908 75%) !important; box-shadow: 0 3px 8px #000b !important; overflow: visible !important; }
.dk .hot-slot::after { content: ""; position: absolute; inset: -1px; z-index: 3; background: var(--hud-slot) center / 100% 100% no-repeat; pointer-events: none; }
.dk .hot-slot .hot-icon { position: absolute; inset: 9%; display: grid; place-items: center; border-radius: 6%; overflow: hidden; background: radial-gradient(circle at 50% 35%, #3a2a22, #120d0b 80%); }
.dk .hot-slot .hot-icon svg { width: 62%; height: 62%; }
.dk .hot-slot .hot-key { z-index: 4; top: -5px; left: -5px; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid #8a6a3d; border-radius: 3px; background: linear-gradient(180deg, #2b231c, #110c0a); color: #ecd9b4; font: 600 11px/16px var(--title); box-shadow: 0 1px 3px #000; }
.dk .hot-slot .hot-cost { z-index: 4; right: 3px; bottom: 3px; left: auto; top: auto; min-width: 0; height: 16px; padding: 0 5px; border: 1px solid #3f8f80; border-radius: 8px; background: #071512e6; color: #9ff0de; font: 600 11px/14px var(--title); }
.dk .hot-slot .hot-cost::before { content: "ϟ"; margin-right: 1px; color: #6fe0c8; }
.dk .hot-slot .hot-rank { display: none; }
.dk .hot-slot .hot-timer { z-index: 2; font-family: var(--title); font-weight: 600; text-shadow: 0 2px 4px #000, 0 0 8px #000; }
.dk .hot-slot.is-ready .hot-icon { box-shadow: inset 0 0 14px #d8b46a33; }
.dk .hot-slot.is-fired::after { filter: brightness(1.5) drop-shadow(0 0 6px #ffcf7a); }
.dk .hot-slot.is-locked { opacity: 1; }
.dk .hot-slot.is-locked .hot-icon { filter: grayscale(.6) brightness(.7); }

/* Provision slots: smaller frames with a plain plus. */
.dk-cell { border: 0 !important; border-radius: 9% !important; background: radial-gradient(circle at 50% 40%, #221a16, #0b0807 75%) !important; box-shadow: 0 2px 6px #000a !important; }
.dk-cell::after { content: ""; position: absolute; inset: -1px; background: var(--hud-slot) center / 100% 100% no-repeat; pointer-events: none; }
.dk-cell .dk-hint { display: none; }
.dk-plus { color: #b08a58; font-size: 24px; font-weight: 400; text-shadow: 0 1px 2px #000; }
.dk-cell .dk-img { width: 70%; height: 70%; }
.dk-gem { background: linear-gradient(135deg, #f1d391, #8b6634) !important; box-shadow: 0 0 0 1px #000, 0 0 6px #d8b46a55 !important; }

/* Fury: crimson texture rising inside a circle, a gold progress arc, the bezel on top. */
.dk-orb { border: 0 !important; background: radial-gradient(circle, #120b0a 0 62%, transparent 63%) !important; box-shadow: 0 4px 12px #000c !important; overflow: visible !important; isolation: isolate; }
.dk-orb::before { content: ""; position: absolute; inset: 7%; z-index: 0; border-radius: 50%;
  background: conic-gradient(#e7c27a calc(var(--fury, 0) * 1%), transparent 0); -webkit-mask: radial-gradient(circle, transparent 0 80%, #000 81%); mask: radial-gradient(circle, transparent 0 80%, #000 81%); }
.dk-orb::after { content: ""; position: absolute; inset: -2px; z-index: 3; background: var(--hud-bezel) center / 100% 100% no-repeat; pointer-events: none; }
.dk-orb-liquid { inset: 13% !important; height: auto !important; border-radius: 50%; overflow: hidden; background: none !important; }
.dk-orb-liquid::before { display: none; }
.dk-orb-liquid::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--fill); background: var(--hud-red); box-shadow: inset 0 2px 0 #ff9a8055; transition: height .4s ease; }
.dk-orb b { z-index: 2; margin-top: 4px; font: 600 22px/1 var(--title); color: #fbeedd; }
.dk-orb small { z-index: 2; bottom: 22%; font-family: var(--title); letter-spacing: .22em; color: #ead2a8; }
.dk-orb-icon { z-index: 2; top: 18%; opacity: .55; }
.dk-orb.is-locked b { font-size: 15px; }

/* Energy: a slim framed bar with the teal texture. */
.dk-energy { padding: 6px 12px 0; }
.dk-energy .hot-energy { position: relative; height: 18px !important; border: 0 !important; border-radius: 0 !important; background: linear-gradient(180deg, #050404, #151010) !important; overflow: visible !important; box-shadow: inset 0 2px 4px #000 !important;
  clip-path: none; }
.dk-energy .hot-energy::after { content: ""; position: absolute; top: -10px; bottom: -10px; left: -4.7%; right: -4.7%; background: var(--hud-frame) center / 100% 100% no-repeat; pointer-events: none; z-index: 1; }
.dk-energy .hot-energy i { background: var(--hud-teal) !important; border-radius: 0 !important; clip-path: polygon(0 50%, 9px 0, 100% 0, 100% 100%, 9px 100%); }
.dk-energy .hot-energy span { z-index: 2; font: 600 12px/18px var(--title) !important; color: #effaf6 !important; text-shadow: 0 1px 2px #000, 0 0 4px #000 !important; }
.dk-energy .hot-swing { margin: 9px 6px 0 !important; height: 3px !important; }

@media (max-width: 620px) {
  .np { grid-template-columns: 32px minmax(0, 1fr); padding: 2px 4px 3px; }
  .np-enemy { grid-template-columns: minmax(0, 1fr) 32px; }
  .np-player { width: 47%; }
  .np-lv { width: 32px; height: 32px; font-size: 12.5px; }
  .np-head h3 { font-size: 14px; }
  .np-bar { --h: 17px; }
  .np-player .np-bar.health { --h: 19px; }
  .np-bar > b { font-size: 11.5px; }
  .np-player .np-bar.health > b { font-size: 12.5px; }
  .dk { border-width: 12px !important; border-image-width: 12px !important; }
  .dk .hot-cell { max-width: 64px; }
  .dk .hot-slot .hot-key { min-width: 16px; height: 16px; font-size: 11px; line-height: 14px; }
  .dk .hot-slot .hot-cost { height: 15px; font-size: 11px; line-height: 13px; padding: 0 4px; }
  .dk-orb b { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .np-track > i, .dk-orb-liquid::after { transition: none; } }

/* ---- Spacing pass after checking on a phone ---- */
.np-head h3 { margin-bottom: 9px; }
.np-lv { align-self: end; margin-bottom: -2px; }
.np > .np-bar.energy { margin-top: 10px; }
.dk-abilities { flex: 1; }
.dk .dk-abilities .dk-row { gap: 8px; }
.dk .hot-cell { flex: 1 1 0; max-width: 82px !important; }
.dk .hot-slot .hot-timer { font-size: 20px; }
.dk-energy .hot-energy::after { top: -7px; bottom: -7px; }
.dk-energy .hot-energy i { clip-path: polygon(0 50%, 7px 0, 100% 0, 100% 100%, 7px 100%); }
.dk-energy { padding-top: 8px; }
.dk-orb { width: 100px !important; height: 100px !important; }
@media (max-width: 620px) {
  .np-head h3 { margin-bottom: 7px; }
  .dk .hot-cell { max-width: 76px !important; }
  .dk-orb { width: 88px !important; height: 88px !important; }
  .dk .dk-abilities .dk-row { gap: 7px; }
}
.dk-top { justify-self: stretch; width: 100%; }
.dk-top .dk-abilities, .dk-top .dk-abilities .dk-row { width: 100%; }
/* Slimmer energy bar (closer to the concept) */
.dk-energy .hot-energy { height: 16px !important; }
.dk-energy .hot-energy::after { top: -5px; bottom: -5px; }
.dk-energy .hot-energy span { line-height: 16px !important; font-size: 11.5px !important; }
.dk .hot-slot .hot-icon svg { width: 66%; height: 66%; filter: drop-shadow(0 2px 3px #000); }
@media (min-width: 961px) {
  .dk-top { width: auto; }
  .dk-top .dk-abilities, .dk-top .dk-abilities .dk-row { width: auto; }
  .dk .hot-cell { flex: 0 0 62px !important; max-width: 62px !important; }
  .dk-cell { width: 54px; height: 54px; }
  .dk-orb { width: 92px !important; height: 92px !important; }
}

/* Painted ability art fills its tile wherever a skill is shown */
.ab-art { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.dk .hot-slot .hot-icon .ab-art { position: absolute; inset: 0; }
.dk .hot-slot.is-waiting .ab-art, .dk .hot-slot.is-cooling .ab-art { filter: saturate(.6) brightness(.75); }
.abx-glyph:has(.ab-art) { inset: 0; width: 100%; height: 100%; padding: 0; overflow: hidden; border-radius: inherit; }
.dk-orb-icon .ab-art { width: 34px; height: 34px; border-radius: 50%; }

/* Painted icons fill the frame's opening (about 7% in from each edge) at full brightness. */
.dk .hot-slot .hot-icon { inset: 7%; width: auto; height: auto; opacity: 1; filter: none; border-radius: 4%; background: #0c0908; }
.dk .hot-slot.is-waiting .hot-icon, .dk .hot-slot.is-low .hot-icon, .dk .hot-slot.is-cooling .hot-icon { opacity: 1; filter: none; }
.dk .hot-slot .ab-art { filter: none; }
.dk .hot-slot.is-cooling .ab-art { filter: saturate(.75) brightness(.8); }
.dk .hot-slot.is-low .ab-art, .dk .hot-slot.is-waiting .ab-art { filter: saturate(.8) brightness(.88); }
.dk .hot-slot.is-off .ab-art { filter: grayscale(1) brightness(.5); }
.dk .hot-slot .hot-sweep { inset: 7%; border-radius: 4%; background: conic-gradient(#000000a0 calc(var(--hot-cd) * 1turn), #0000 0); }

/* Dock layout follows the dock's own width, not the window's: one row (abilities, provisions, Fury) when
   there is room, otherwise provisions drop under the abilities with Fury beside both. The framed energy bar
   keeps its frame tips inside the panel. */
:where(*):has(> .dk) { container-type: inline-size; container-name: dock; }
@container dock (min-width: 520px) {
  .dk { max-width: 940px !important; margin-inline: auto !important; grid-template-columns: minmax(0, 1fr) auto !important; grid-template-areas: "top orb" "bottom orb" "energy energy" !important; column-gap: 14px !important; align-items: center !important; }
  .dk-bottom { justify-self: start !important; justify-content: flex-start !important; padding-left: 0 !important; border-left: 0 !important; }
  .dk-top { justify-self: start !important; }
  .dk-energy { padding: 10px 5.5% 2px !important; }
  .dk-energy .hot-swing { margin-inline: 0 !important; }
  .dk-orb { align-self: center; margin-right: 2px; }
}
@container dock (min-width: 900px) {
  .dk { grid-template-columns: auto auto minmax(0, 1fr) auto !important; grid-template-areas: "top bottom . orb" "energy energy energy orb" !important; column-gap: 22px !important; padding: 6px 14px 6px 8px !important; align-items: end !important; }
  .dk-bottom { padding-left: 18px !important; border-left: 1px solid #c8a26a33 !important; }
}

/* ---- Hunt: header button and dialog ---- */
.hunt-btn .hunt-pulse { position: relative; }
.hunt-btn .hunt-pulse::after { content: ""; position: absolute; top: -2px; right: -7px; width: 7px; height: 7px; border-radius: 50%; background: #7d6462; box-shadow: 0 0 0 2px #140e0d; }
.hunt-btn .hunt-pulse.live::after { background: #8fd06a; box-shadow: 0 0 0 2px #140e0d, 0 0 8px #8fd06a; animation: hunt-live 1.8s ease-in-out infinite; }
.hunt-btn .hunt-pulse.boss::after { background: #e0705a; box-shadow: 0 0 0 2px #140e0d, 0 0 8px #e0705a; }
@keyframes hunt-live { 50% { opacity: .45; } }
.dialog:has(.hunt-modal) { width: min(460px, calc(100vw - 24px)); }
.hunt-modal .hunt-overview { border: 0; background: none; box-shadow: none; padding: 0; }
.hunt-modal .hunt-overview-head h2 { font-size: 24px; }
@media (prefers-reduced-motion: reduce) { .hunt-btn .hunt-pulse.live::after { animation: none; } }

/* ---- Inventory: auto-salvage row and bag options ---- */
.inv-salvage { display: flex; gap: 8px; align-items: stretch; margin: 10px 0 8px; }
.inv-salvage-btn { flex: 1; min-width: 0; display: flex !important; align-items: center; gap: 10px; padding: 8px 10px !important; text-align: left; border: 1px solid #3a2b28 !important; border-radius: 10px !important; background: linear-gradient(180deg, #1d1514, #140e0d) !important; }
.inv-salvage.on .inv-salvage-btn { border-color: #6b5233 !important; box-shadow: inset 0 0 14px #d8b46a14; }
.inv-salvage-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #0c0808; }
.inv-salvage-ico .dust-icon { width: 24px; height: 24px; }
.inv-salvage-btn > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 1px; }
.inv-salvage-btn b { color: #efe2cf; font-size: 13px; }
.inv-salvage-btn small { color: #ad9c8c; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-salvage.on .inv-salvage-btn small { color: #d8bf8e; }
.inv-salvage-go { color: #8d7a68; font-size: 20px; }
.inv-salvage > button:not(.inv-salvage-btn) { flex: none; white-space: nowrap; }
.inv-more-list > button { display: grid !important; gap: 2px; text-align: left; padding: 10px 12px !important; }
.inv-more-list small { color: #ad9c8c; font-size: 12px; }
.inventory-selection .active { border-color: #8a6a3d !important; color: #f1dcae !important; }
.inventory-selection .inv-more { min-width: 34px; font-size: 16px; letter-spacing: 1px; }

/* Auto-salvage dialog */
.dialog:has(.sv) { width: min(560px, calc(100vw - 24px)); }
.sv h2 { margin: 2px 0 6px; font-family: var(--title); font-size: 24px; color: #f4e6d4; }
.sv-lead { margin: 0 0 14px; color: #bfae9d; font-size: 13.5px; line-height: 1.5; }
.sv-sub { margin: 14px 0 8px; color: #cdb48c; font: 600 11px/1 var(--title); letter-spacing: .16em; text-transform: uppercase; }
.sv-cuts { display: flex; flex-wrap: wrap; gap: 6px; }
.sv-cut { display: inline-flex !important; align-items: center; gap: 6px; padding: 7px 12px !important; border-radius: 999px !important; }
.sv-cut i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px #0008; }
.sv-cut.on { border-color: #c9a467 !important; background: linear-gradient(180deg, #3a2a1c, #221810) !important; color: #f6e3bd !important; }
.sv-rules.off { opacity: .45; pointer-events: none; }
.sv-toggle { display: flex !important; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 12px !important; text-align: left; border-radius: 10px !important; }
.sv-toggle b { display: block; color: #efe2cf; font-size: 14px; }
.sv-toggle small { display: block; margin-top: 2px; color: #ad9c8c; font-size: 12px; line-height: 1.4; }
.sv-switch { flex: none; position: relative; width: 36px; height: 20px; margin-top: 1px; border-radius: 10px; background: #2a201d; box-shadow: inset 0 0 0 1px #4a3834; }
.sv-switch i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8d7a68; transition: transform .18s, background .18s; }
.sv-toggle.on .sv-switch { background: #3b5a2c; box-shadow: inset 0 0 0 1px #6f9a52; }
.sv-toggle.on .sv-switch i { transform: translateX(16px); background: #d9f2b8; }
.sv-mods-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 14px 0 6px; }
.sv-mods-head b { color: #efe2cf; font-size: 13.5px; }
.sv-mods-head small { color: #ad9c8c; font-size: 12px; }
.sv-mods-head .link { padding: 0 !important; border: 0 !important; background: none !important; color: #d8b46a !important; text-decoration: underline; min-height: 0 !important; }
.sv-group { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: start; margin: 6px 0; }
.sv-group > span { padding-top: 6px; color: #8d7a68; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.sv-group > div { display: flex; flex-wrap: wrap; gap: 5px; }
.sv-chip { padding: 4px 10px !important; min-height: 0 !important; border-radius: 999px !important; font-size: 12px !important; }
.sv-chip.on { border-color: #c9a467 !important; background: #2d2116 !important; color: #f6e3bd !important; }
.sv-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #2e2220; }
.sv-foot > span { color: #ad9c8c; font-size: 12.5px; }
@media (max-width: 620px) { .sv-group { grid-template-columns: 1fr; gap: 4px; } .sv-group > span { padding-top: 0; } }

/* ---- Header: Hunt, Goals and Settings as painted square tiles with a name under each ---- */
.hunt-header-actions { gap: 10px !important; }
.hunt-header-actions .hunt-btn, .hunt-header-actions .goals-btn, .hunt-header-actions .hunt-mobile-settings {
  display: inline-flex !important; flex-direction: column; align-items: center; gap: 4px !important; width: auto !important; min-width: 0 !important; height: auto !important; min-height: 0 !important;
  padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
.hunt-header-actions .hunt-control-icon { position: relative; display: block; width: 42px; height: 42px; font-size: 0 !important; box-shadow: 0 2px 8px #000b; transition: filter .15s, transform .15s; }
.hdr-ico { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.hunt-header-actions .hunt-control-label { display: block !important; font: 600 11px/1 var(--title) !important; letter-spacing: .14em !important; text-transform: uppercase; color: #dcc8a4 !important; text-shadow: 0 1px 2px #000; }
.hunt-header-actions button:hover .hunt-control-icon, .hunt-header-actions button:focus-visible .hunt-control-icon { filter: brightness(1.18); transform: translateY(-1px); }
.hunt-header-actions button:focus-visible { outline: 2px solid #fae1a4; outline-offset: 3px; }
.hunt-header-actions .goals-btn.open .hunt-control-icon { box-shadow: 0 0 0 2px #c0393f, 0 2px 8px #000b; }
.hunt-header-actions .goals-badge { position: absolute; top: -7px; right: -7px; z-index: 2; }
.hunt-btn .hunt-pulse::after { top: -3px; right: -3px; z-index: 2; width: 9px; height: 9px; }
@media (max-width: 620px) {
  .hunt-header-actions { gap: 7px !important; }
  .hunt-header-actions .hunt-control-icon { width: 36px; height: 36px; }
  .hunt-header-actions .hunt-control-label { font-size: 11px !important; letter-spacing: .08em !important; }
}
/* Smaller header tiles: they sit beside the Grave title, not over it */
.hunt-header-actions { gap: 12px !important; align-items: flex-start !important; }
.hunt-header-actions .hunt-control-icon { width: 34px; height: 34px; box-shadow: 0 1px 4px #000a; }
.hunt-header-actions .hunt-control-label { font-size: 11px !important; letter-spacing: .1em !important; color: #cbb796 !important; }
.hunt-header-actions .goals-badge { top: -6px; right: -8px; min-width: 16px; height: 16px; font-size: 11px; line-height: 16px; padding: 0 4px; }
.hunt-btn .hunt-pulse::after { width: 7px; height: 7px; top: -2px; right: -2px; }
@media (max-width: 620px) {
  .hunt-header-actions { gap: 9px !important; }
  .hunt-header-actions .hunt-control-icon { width: 28px; height: 28px; }
  .hunt-header-actions .hunt-control-label { font-size: 11px !important; letter-spacing: .06em !important; }
}

/* ---- Painted navigation tiles (phone tab bar and sidebar) ---- */
.nav-art { display: block; width: 28px; height: 28px; flex: 0 0 28px; object-fit: cover; border-radius: 0; box-shadow: 0 1px 3px #000a; }
.nav-icon:has(.nav-art) { display: inline-grid !important; place-items: center; width: 28px !important; height: 28px !important; font-size: 0 !important; line-height: 0 !important; flex: 0 0 28px; }
.desktop-navigation .nav-art { width: 22px; height: 22px; flex-basis: 22px; }
.desktop-navigation .nav-icon:has(.nav-art) { width: 22px !important; height: 22px !important; flex-basis: 22px; }
.mobile-navigation button:not(.active) .nav-art { filter: saturate(.65) brightness(.8); }
.side-art { box-shadow: none !important; filter: none !important; }
.mobile-navigation button.active .nav-art { box-shadow: 0 0 0 1px #d8b46a, 0 0 8px #d8b46a66; }

/* ---- XP strip under the header: character (gold) over weapon mastery (green) ---- */
.xp-strip { display: grid; gap: 2px; margin: -1px 0 8px; padding: 0; }
.xps-bar { position: relative; height: 4px; overflow: hidden; background: #0d0808; box-shadow: inset 0 1px 1px #000; }
.xps-bar > i { position: absolute; inset: 0 auto 0 0; transition: width .5s ease-out; }
.xps-bar.char > i { background: linear-gradient(90deg, #8f6a32, #f1d391); box-shadow: 0 0 6px #f1d39155; }
.xps-bar.mast > i { background: linear-gradient(90deg, #3f6a36, #a8d68c); box-shadow: 0 0 6px #a8d68c44; }
.xps-bar.mast { height: 3px; }
@media (prefers-reduced-motion: reduce) { .xps-bar > i { transition: none; } }
/* Labelled XP rows: tag + level, bar, percent and totals. Side by side on wide screens, stacked on phones. */
.xp-strip { grid-template-columns: 1fr 1fr; gap: 4px 18px; margin: 2px 0 10px; padding: 0 2px; }
.xps-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.xps-tag { color: #b9a68c; font: 600 11px/1 var(--title); letter-spacing: .14em; white-space: nowrap; }
.xps-tag b { color: #f3e3c4; letter-spacing: .02em; font-size: 11px; }
.xps-row.char .xps-tag { color: #d8b46a; }
.xps-row.mast .xps-tag { color: #9fc98a; }
.xps-row .xps-bar { height: 6px; border-radius: 3px; box-shadow: inset 0 1px 2px #000, 0 0 0 1px #3a2b24; }
.xps-row .xps-bar > i { border-radius: 3px; }
.xps-row.mast .xps-bar { height: 6px; }
.xps-num { color: #ab9886; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xps-num b { color: #f3e3c4; font-weight: 700; margin-right: 3px; }
@media (max-width: 620px) {
  .xp-strip { grid-template-columns: 1fr; gap: 4px; margin-bottom: 8px; }
  .xps-row { gap: 6px; grid-template-columns: 78px minmax(0, 1fr) auto; }
  .xps-tag { font-size: 11px; letter-spacing: .1em; }
  .xps-num { font-size: 11px; }
}
.xps-row.char .xps-bar > i { background: linear-gradient(90deg, #8f6a32, #f1d391); box-shadow: 0 0 6px #f1d39155; }
.xps-row.mast .xps-bar > i { background: linear-gradient(90deg, #3f6a36, #a8d68c); box-shadow: 0 0 6px #a8d68c44; }
.xp-strip { padding: 0 12px; }
@media (max-width: 620px) { .xp-strip { padding: 0 10px; } .xps-row { grid-template-columns: 74px minmax(0, 1fr) auto; } }

/* ---- Guild hall ---- */
.gh-head h3 { margin: 0; }
.gh-tabs { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.gh-tabs button { flex: none; padding: 7px 12px !important; border-radius: 999px !important; font-size: 13px; }
.gh-tabs button.active { border-color: #c9a467 !important; background: linear-gradient(180deg, #3a2a1c, #221810) !important; color: #f6e3bd !important; }
.gh-meter { position: relative; height: 10px; margin: 8px 0; border-radius: 5px; overflow: hidden; background: #0d0808; box-shadow: inset 0 1px 3px #000, 0 0 0 1px #3a2b24; }
.gh-meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: linear-gradient(90deg, #8f6a32, #f1d391); transition: width .5s; }
.gh-meter.green > i { background: linear-gradient(90deg, #3f6a36, #a8d68c); }
.gh-meter.red > i { background: linear-gradient(90deg, #6e1414, #e0574a); }
.gh-perks { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.gh-perks span { padding: 6px 10px; border-radius: 8px; background: #1a1210; border: 1px solid #3a2b24; font-size: 13px; }
.gh-perks b { color: #f1d391; }
.gh-board { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.gh-board li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "r n v" "r s s"; gap: 0 8px; padding: 7px 10px; border-radius: 8px; background: #160f0e; }
.gh-board li.self { box-shadow: inset 0 0 0 1px #8a6a3d; }
.gh-rank { grid-area: r; align-self: center; color: #d8b46a; font: 600 14px/1 var(--title); }
.gh-board b { grid-area: n; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-board li > span:not(.gh-rank) { grid-area: v; color: #f3e3c4; font-variant-numeric: tabular-nums; }
.gh-board small { grid-area: s; color: #9d8b79; }
.gh-contract { margin-top: 10px; padding: 12px; border-radius: 10px; border: 1px solid #3a2b24; background: #160f0e; }
.gh-contract.done { border-color: #5f8a5a; }
.gh-contract p { margin: 4px 0; }
.gh-claimed { color: #9fc98a; font-weight: 600; }
.gh-chests { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gh-chest { display: grid; gap: 6px; padding: 10px; border-radius: 10px; border: 1px solid #3a2b24; background: #160f0e; }
.gh-chest.open { border-color: #8a6a3d; }
.gh-chest small { color: #ad9c8c; }
.gh-gold { color: #f1d391; font: 600 18px/1 var(--title); }
.gh-upgrade { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #2a201d; }
.gh-upgrade p { margin: 3px 0 0; }
.gh-roles { margin: 0 2px 8px; }
.gh-tabs { flex-wrap: wrap; overflow: visible; }
.gh-boss h4, .gh-level h4, .panel h4 { margin: 14px 0 6px; color: #cdb48c; font: 600 11px/1 var(--title); letter-spacing: .16em; text-transform: uppercase; }

/* ---- Merchant ---- */
.mc-stall { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 12px; border: 1px solid #5a3f2c; border-radius: 12px;
  background: radial-gradient(120% 140% at 0 0, #3a2418 0, #1a110e 55%, #120c0b 100%); box-shadow: inset 0 0 24px #d8b46a14, 0 8px 22px #0008; }
.mc-portrait { width: 72px; height: 72px; object-fit: cover; box-shadow: 0 0 0 1px #8a6a3d, 0 4px 12px #000b; }
.mc-stall h2 { margin: 2px 0; font-family: var(--title); font-size: 26px; color: #f4e6d4; }
.mc-stall p { margin: 0; color: #bfae9d; font-style: italic; font-size: 13px; }
.mc-purse { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid #6b5233; background: #120c0b; color: #f1d391; font: 600 16px/1 var(--title); white-space: nowrap; }
.mc-coin { width: 18px; height: 18px; vertical-align: -4px; }
.mc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mc-tabs button, .mc-qty button { padding: 7px 13px !important; border-radius: 999px !important; font-size: 13px; }
.mc-tabs button.active, .mc-qty button.active { border-color: #c9a467 !important; background: linear-gradient(180deg, #3a2a1c, #221810) !important; color: #f6e3bd !important; }
.mc-qty { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.mc-qty > span { margin-right: 4px; color: #9d8b79; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.mc-group { margin: 16px 0 6px; color: #cdb48c; font: 600 11px/1 var(--title); letter-spacing: .16em; text-transform: uppercase; }
.mc-list { display: grid; gap: 6px; }
.mc-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid #33251f; background: linear-gradient(180deg, #1a1210, #140e0d); }
.mc-row.daily { border-color: #6b5233; box-shadow: inset 0 0 16px #d8b46a10; }
.mc-row.locked { opacity: .5; }
.mc-art { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #2a1f1a, #0c0908 80%); box-shadow: 0 0 0 1px #4a3626; }
.mc-img, .mc-svg { width: 40px; height: 40px; }
.mc-info { min-width: 0; }
.mc-name { display: flex; align-items: center; gap: 6px; }
.mc-name b { color: #f0e5d3; font-size: 14.5px; }
.mc-deal { padding: 1px 6px; border-radius: 4px; background: #3b5a2c; color: #d9f2b8; font-size: 11px; font-weight: 700; }
.mc-info p { margin: 2px 0 3px; color: #ad9c8c; font-size: 12.5px; line-height: 1.35; }
.mc-info small { color: #9d8b79; font-size: 12px; }
.mc-info small b { color: #f3e3c4; }
.mc-actions { display: flex; align-items: center; gap: 6px; }
.mc-fav { min-width: 36px; padding: 6px !important; color: #8d7a68 !important; font-size: 17px !important; line-height: 1; }
.mc-fav.on { color: #f1d391 !important; border-color: #8a6a3d !important; }
.mc-buy { min-width: 120px; white-space: nowrap; }
.mc-note { margin: 6px 2px 8px; color: #ad9c8c; font-size: 13px; }
@media (max-width: 620px) {
  .mc-stall { grid-template-columns: auto minmax(0, 1fr); padding: 12px; gap: 10px; }
  .mc-portrait { width: 56px; height: 56px; }
  .mc-stall h2 { font-size: 21px; }
  .mc-purse { grid-column: 1 / -1; justify-self: start; }
  .mc-row { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  .mc-art { width: 44px; height: 44px; } .mc-img, .mc-svg { width: 34px; height: 34px; }
  .mc-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---- The Exchange (marketplace) ---- */
.mk-refresh { margin-left: auto; min-width: 36px; }
.mk-search { display: flex; gap: 8px; margin-bottom: 8px; }
.mk-search input { flex: 1; min-width: 0; }
.mk-filters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-bottom: 8px; }
.mk-list { display: grid; gap: 6px; }
.mk-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; border: 1px solid #33251f; background: linear-gradient(180deg, #1a1210, #140e0d); }
.mk-art { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #2a1f1a, #0c0908 80%); box-shadow: 0 0 0 1px var(--rc, #4a3626); overflow: hidden; }
.mk-art img, .mk-art svg, .mk-img { width: 38px; height: 38px; object-fit: contain; }
.mk-info { min-width: 0; display: grid; gap: 2px; }
.mk-info b { color: #f0e5d3; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-info small { color: #9d8b79; font-size: 12px; }
.mk-details summary { cursor: pointer; color: #c9a467; font-size: 12px; }
.mk-price { display: grid; justify-items: end; text-align: right; }
.mk-price b { color: #f1d391; font: 600 16px/1.1 var(--title); font-variant-numeric: tabular-nums; }
.mk-price b.up { color: #9fe0a0; }
.mk-price small { color: #9d8b79; font-size: 11px; white-space: nowrap; }
.mk-act button { min-width: 78px; }
.mk-pages { margin-top: 8px; }
.mk-sell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 12px; align-items: start; }
.mk-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 520px; overflow-y: auto; padding: 2px; }
.mk-tile { position: relative; display: grid !important; justify-items: center; gap: 4px; padding: 8px 4px !important; border-radius: 10px !important; text-align: center; }
.mk-tile small { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #cdbda8; }
.mk-tile em { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: 11px; font-weight: 700; color: #f3e3c4; text-shadow: 0 1px 2px #000; }
.mk-tile.on { border-color: #c9a467 !important; box-shadow: inset 0 0 0 1px #c9a467, 0 0 10px #d8b46a33; }
.mk-form { position: sticky; top: 8px; display: grid; gap: 10px; }
.mk-lot { display: flex; align-items: center; gap: 10px; }
.mk-lot > div { display: grid; gap: 2px; min-width: 0; }
.mk-lot p { margin: 0; }
.mk-inline { display: flex; gap: 6px; }
.mk-inline input { flex: 1; min-width: 0; }
.mk-total { margin: 0; color: #cdbda8; } .mk-total b { color: #f1d391; }
.mk-hist .mk-info b { white-space: normal; }
@media (max-width: 760px) {
  .mk-sell { grid-template-columns: 1fr; }
  .mk-form { position: static; }
  .mk-pick { max-height: 300px; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
}
@media (max-width: 620px) {
  .mk-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; }
  .mk-art { width: 44px; height: 44px; }
  .mk-act { grid-column: 1 / -1; justify-self: end; }
}

/* ---- The Exchange: browse layout ---- */
.merchant-page:has(.mk-stall) { max-width: 1240px; margin-inline: auto; }
.mk-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 2px 2px 10px; color: #9d8b79; font-size: 13px; }
.mk-stats b { color: #f3e3c4; font-variant-numeric: tabular-nums; }
.mk-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-bottom: 12px; }
.mk-cat { display: grid !important; justify-items: center; gap: 4px; padding: 10px 6px !important; border-radius: 10px !important; text-align: center; background: linear-gradient(180deg, #1c1412, #130d0c) !important; }
.mk-cat b { font-size: 12.5px; color: #e9dcc8; line-height: 1.15; }
.mk-cat small { color: #9d8b79; font-size: 11px; }
.mk-cat.active { border-color: #c9a467 !important; box-shadow: inset 0 0 0 1px #c9a467, 0 0 12px #d8b46a2a; }
.mk-cat-ico { display: grid; place-items: center; width: 40px; height: 40px; }
.mk-cat-ico img, .mk-cat-ico svg { width: 36px; height: 36px; object-fit: contain; }
.mk-browse { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.mk-side { display: grid; gap: 10px; position: sticky; top: 8px; }
.mk-side .panel { margin: 0; padding: 12px; }
.mk-side h4 { margin: 0 0 8px; color: #cdb48c; font: 600 11px/1 var(--title); letter-spacing: .16em; text-transform: uppercase; }
.mk-quick { display: grid; gap: 4px; margin-bottom: 8px; }
.mk-quick-row { display: grid !important; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 8px !important; text-align: left; border-radius: 8px !important; }
.mk-quick-row .mk-art { width: 36px; height: 36px; } .mk-quick-row .mk-img { width: 28px; height: 28px; }
.mk-quick-row b { display: block; font-size: 13px; color: #efe2cf; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-quick-row small { color: #9d8b79; font-size: 11px; }
.mk-quick-row em { font-style: normal; color: #d8b46a; font-size: 12px; font-weight: 700; }
.mk-link { width: 100%; font-size: 12.5px; }
.mk-rates { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mk-rates li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "i n p" "i n s"; align-items: center; gap: 0 8px; padding: 4px 2px; border-bottom: 1px solid #241a17; }
.mk-rates li:last-child { border-bottom: 0; }
.mk-art.sm { grid-area: i; width: 30px; height: 30px; } .mk-art.sm img, .mk-art.sm svg { width: 24px; height: 24px; }
.mk-rates li > span:nth-child(2) { grid-area: n; font-size: 12.5px; color: #e0d3c0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-rates b { grid-area: p; justify-self: end; color: #f1d391; font: 600 13px/1 var(--title); }
.mk-rates small { grid-area: s; justify-self: end; color: #8d7a68; font-size: 11px; }
.mk-empty { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; border: 1px dashed #4a3626; border-radius: 12px; text-align: center; background: radial-gradient(60% 80% at 50% 0, #2a1c1433, transparent); }
.mk-empty-ico img, .mk-empty-ico svg { width: 48px; height: 48px; opacity: .8; }
.mk-empty h3 { margin: 0; font-family: var(--title); color: #f0e5d3; }
.mk-empty p { margin: 0; max-width: 420px; color: #ad9c8c; }
@media (max-width: 980px) { .mk-browse { grid-template-columns: 1fr; } .mk-side { position: static; } }
@media (max-width: 620px) { .mk-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mk-cat { padding: 8px 4px !important; } .mk-cat b { font-size: 11.5px; } }
@media (max-width: 620px) {
  .mk-cats { display: flex; overflow-x: auto; scrollbar-width: none; gap: 6px; padding-bottom: 2px; }
  .mk-cat { flex: 0 0 92px; padding: 7px 4px !important; }
  .mk-cat-ico { width: 30px; height: 30px; } .mk-cat-ico img, .mk-cat-ico svg { width: 28px; height: 28px; }
  .mk-row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "a i i" "a p b"; row-gap: 4px; }
  .mk-row > .mk-art { grid-area: a; align-self: start; } .mk-info { grid-area: i; } .mk-price { grid-area: p; justify-items: start; text-align: left; } .mk-act { grid-area: b; grid-column: auto; }
  .mk-stats { font-size: 12px; gap: 4px 12px; }
}

/* ---- Mastery page ---- */
.am-page { max-width: 1180px; }
.am-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; margin-bottom: 12px; border: 1px solid #5a3f2c; border-radius: 12px;
  background: radial-gradient(120% 150% at 100% 0, #3a1d1a 0, #1a110e 55%, #120c0b 100%); box-shadow: inset 0 0 24px #d8b46a12, 0 8px 22px #0008; }
.am-head h2 { margin: 2px 0 4px; font-family: var(--title); font-size: 28px; color: #f4e6d4; }
.am-head p { margin: 0; max-width: 62ch; color: #bfae9d; font-size: 13px; line-height: 1.45; }
.am-total { display: grid; justify-items: center; gap: 6px; text-align: center; }
.am-total small { color: #9d8b79; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.4; }
.am-total .am-ring { width: 74px; height: 74px; }
.am-total .am-ring b { font-size: 18px; }
.am-ring { --p: 0; position: relative; display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: conic-gradient(#d8ac5c calc(var(--p) * 1%), #2c2220 0); box-shadow: 0 0 0 1px #6b5233, 0 3px 8px #000a; }
.am-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #2a1c16, #120c0b); }
.am-ring b { position: relative; color: #f3dfb6; font: 700 14px/1 var(--title); }
.am-ring.max { background: conic-gradient(#f0cf7a 100%, #f0cf7a 0); box-shadow: 0 0 0 1px #f0cf7a, 0 0 14px #e8b85a66; }
.am-sums { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.am-sums .am-sum { display: grid !important; gap: 2px; justify-items: start; text-align: left; padding: 10px 14px !important; border-radius: 10px !important; }
.am-sum span { color: #cdb48c; font: 600 11px/1 var(--title); letter-spacing: .14em; text-transform: uppercase; }
.am-sum b { color: #f4e6d4; font: 700 22px/1.1 var(--title); }
.am-sum small { color: #9d8b79; font-size: 11.5px; }
.am-sum.active { border-color: #c9a467 !important; background: linear-gradient(180deg, #3a2a1c, #1c1410) !important; box-shadow: inset 0 -2px 0 #d8ac5c; }
.am-soon { margin-bottom: 12px; padding: 10px 12px; border: 1px solid #3a2c24; border-radius: 10px; background: #140e0c; }
.am-soon h4 { margin: 0 0 8px; color: #cdb48c; font: 600 11px/1 var(--title); letter-spacing: .16em; text-transform: uppercase; }
.am-soon > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.am-soon-item { display: flex; gap: 10px; align-items: center; min-width: 0; }
.am-soon-item b { display: block; color: #eadbc8; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-soon-item small { color: #c9a467; font-size: 11.5px; }
.am-count { align-items: baseline; margin: 4px 0 6px; }
.am-count h3 { margin: 0; font-family: var(--title); color: #eadbc8; }
.am-tools { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-bottom: 10px; }
.am-tools .mc-qty { flex-wrap: wrap; margin: 0; }
.am-fresh { margin-left: auto; padding: 7px 13px !important; border-radius: 999px !important; font-size: 13px; }
.am-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.am-card { display: grid; gap: 7px; align-content: start; padding: 12px; border: 1px solid #3a2c24; border-radius: 12px; background: linear-gradient(180deg, #1c1411, #130d0b); box-shadow: 0 6px 16px #0007; min-width: 0; }
.am-card.fresh { opacity: .62; }
.am-card.fresh .am-art { filter: grayscale(.7) brightness(.8); }
.am-card.maxed { border-color: #c9a467; box-shadow: 0 0 0 1px #c9a46744, 0 6px 18px #e8b85a1c; }
.am-card.founder { border-color: #5a2a26; }
.am-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.am-art { display: grid; place-items: center; flex: none; width: 48px; height: 48px; overflow: hidden; border-radius: 10px; border: 1px solid #4a372a; background: radial-gradient(circle at 50% 40%, #2a1d17, #0f0a09); }
.am-art.sm { width: 36px; height: 36px; border-radius: 8px; }
.am-art img, .am-art .am-img { width: 100%; height: 100%; object-fit: cover; }
.am-glyph { color: #c9a467; font-size: 22px; }
.am-title { display: grid; gap: 2px; flex: 1; min-width: 0; }
.am-title b { color: #f0e2cf; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-title small { color: #9b8b80; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.am-track i { position: relative; height: 16px; border-radius: 4px; background: #241b18; border: 1px solid #33271f; display: grid; place-items: center; font-style: normal; }
.am-track i span { color: #7d6d61; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.am-track i.on { background: linear-gradient(180deg, #b5883f, #7a5626); border-color: #d8ac5c; }
.am-track i.on span { color: #1a110c; }
.am-now { margin: 0; color: #d9c7b2; font-size: 12.5px; }
.am-next { margin: 0; color: #9d8b79; font-size: 12px; }
.am-next b { color: #e6c37a; font-weight: 600; }
.am-next.done { color: #f0cf7a; font: 600 12px/1 var(--title); letter-spacing: .14em; text-transform: uppercase; }
.am-xp { color: #7f6f64; font-size: 11px; }
@media (max-width: 640px) {
  .am-head { grid-template-columns: 1fr auto; padding: 12px; }
  .am-head h2 { font-size: 22px; }
  .am-head p { font-size: 12px; }
  .am-total .am-ring { width: 56px; height: 56px; }
  .am-sums { gap: 6px; }
  .am-sums .am-sum { padding: 8px 10px !important; }
  .am-sum b { font-size: 18px; }
  .am-sum small { display: none; }
  .am-grid { grid-template-columns: 1fr; }
  .am-fresh { margin-left: 0; }
}
.am-track { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 640px) {
  .am-tools { display: grid; gap: 6px; }
  .am-chips { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .am-chips::-webkit-scrollbar { display: none; }
  .am-chips button { flex: none; }
  .am-fresh { justify-self: start; }
}

/* ---- Shared page header: framed banner + stat tiles (Mastery, Bestiary, Covenant, Build) ---- */
.pg-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 18px; margin-bottom: 12px; border: 1px solid #5a3f2c; border-radius: 12px;
  background: radial-gradient(120% 150% at 100% 0, #3a1d1a 0, #1a110e 55%, #120c0b 100%); box-shadow: inset 0 0 24px #d8b46a12, 0 8px 22px #0008; }
.pg-head h2 { margin: 2px 0 4px !important; font-family: var(--title); font-size: 28px; letter-spacing: .5px; color: #f4e6d4; }
.pg-head p { margin: 0; max-width: 64ch; color: #bfae9d; font-size: 13px; line-height: 1.45; }
.pg-tiles { display: flex; gap: 8px; }
.pg-tiles > div { display: grid; justify-items: center; align-content: center; gap: 3px; min-width: 92px; padding: 9px 12px; border: 1px solid #4a372a; border-radius: 10px; background: linear-gradient(180deg, #221813, #130d0b); box-shadow: inset 0 1px 0 #ffffff08; }
.pg-tiles b { color: #f3dfb6; font: 700 20px/1 var(--title); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-tiles b small { color: #8e7776; font-size: 12px; }
.pg-tiles span { color: #9d8b79; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.pg-tiles > div.hot { border-color: #c9a467; background: linear-gradient(180deg, #3a2a1c, #1c1410); box-shadow: 0 0 12px #e8b85a2a; }
.pg-tiles > div.hot b { color: #ffe3a0; }
.pg-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.pg-legend > span:first-child { margin-right: 2px; color: #9d8b79; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.pg-legend > span:not(:first-child) { padding: 3px 10px; border: 1px solid #3a2c24; border-radius: 999px; background: #140e0c; color: #8e7f76; font-size: 11.5px; }
.pg-legend b { color: #e6c37a; font-weight: 600; }
/* Bestiary: the old header pieces now live in the shared banner */
.bx-head.pg-head { align-items: center; }
/* Covenant: sections read as framed panels like the rest of the game */
.covenant-page .cv-section { margin-top: 12px; padding: 12px 14px; border: 1px solid #3a2c24; border-radius: 12px; background: linear-gradient(180deg, #17100e, #110b0a); }
.covenant-page .cv-head h3, .covenant-page .q-chapter-head h3 { color: #cdb48c; font: 600 12px/1.2 var(--title); letter-spacing: .16em; }
.covenant-page .cv-chapters .q-chapter { margin-bottom: 12px; }
.covenant-page .cv-chapters .q-chapter:last-child { margin-bottom: 0; }
.covenant-page .cv-chapters .q-chapter-head h3 { color: #eadbc8; font-size: 13px; }
.cv-rewards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.q-card .q-action:empty { display: none; }
/* Build hero: stats on the right, links below them */
.bd-hero-side { display: grid; gap: 8px; justify-items: end; }
.bd-hero-links { display: flex; gap: 6px; }
.bd-hero-links button { min-height: 32px; }
@media (max-width: 900px) {
  .pg-head { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .pg-head h2 { font-size: 23px; }
  .pg-head p { font-size: 12px; }
  .pg-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
  .pg-tiles > div { min-width: 0; padding: 8px 4px; }
  .pg-tiles b { font-size: 17px; }
  .pg-tiles span { font-size: 11px; letter-spacing: .06em; white-space: normal; text-align: center; }
  .bd-hero-side { grid-column: 1 / -1; justify-items: stretch; }
  .bd-hero-links button { flex: 1; }
  .cv-rewards { grid-template-columns: 1fr; }
  .covenant-page .cv-section { padding: 10px; }
}
.bd-hero { border-color: #5a3f2c; background: radial-gradient(120% 150% at 0 50%, #3a1d1a 0, #1a110e 55%, #120c0b 100%); box-shadow: inset 0 0 24px #d8b46a12, 0 8px 22px #0008; }
.pg-tiles > div.txt b { font-size: 15px; line-height: 20px; }
@media (max-width: 640px) { .pg-legend { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .pg-legend::-webkit-scrollbar { display: none; } .pg-legend > span { flex: none; } }
/* Covenant: the Ready tile doubles as Claim all */
.pg-tiles > button.pg-tile { display: grid; justify-items: center; align-content: center; gap: 3px; min-width: 92px; padding: 9px 12px !important; border: 1px solid #c9a467 !important; border-radius: 10px !important; background: linear-gradient(180deg, #4a321c, #22170f) !important; box-shadow: 0 0 14px #e8b85a33; cursor: pointer; }
.pg-tiles > button.pg-tile:hover { background: linear-gradient(180deg, #5a3d20, #2a1c12) !important; }
.pg-tiles > button.pg-tile b { color: #ffe3a0; }
.pg-tiles > button.pg-tile span { color: #e6c37a; }
@media (max-width: 900px) { .pg-tiles > button.pg-tile { min-width: 0; padding: 8px 4px !important; } }
/* Welcome back: Waiting for you */
.wt-box { margin: 4px 0 14px; padding: 12px; border: 1px solid #8a6d3a; border-radius: 12px; background: linear-gradient(180deg, #2a1f12, #15100d); box-shadow: inset 0 0 18px #e8b85a14; }
.wt-box header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin-bottom: 8px; }
.wt-box header .eyebrow { color: #e6c37a; }
.wt-box header small { color: #b9a998; font-size: 12px; }
.wt-list { display: grid; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.wt-list li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border: 1px solid #3a2c24; border-radius: 9px; background: #140e0c; }
.wt-ico { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 2px 4px #000); }
.wt-list b { display: block; color: #f0e2cf; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-list small { color: #9d8b79; font-size: 12px; }
.wt-list em { display: inline-flex; align-items: center; gap: 4px; color: #f1d391; font-style: normal; font-weight: 600; font-size: 13px; }
.wt-coin { width: 15px; height: 15px; vertical-align: -3px; }
.wt-claim { width: 100%; min-height: 42px; font-size: 15px; }
.wt-claim b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 6px; border-radius: 11px; background: #f1ebe433; }

/* ---- Founder plates: phase marks, phase line, signature cast bar ---- */
.np-track .np-mark { position: absolute; top: -1px; bottom: -1px; width: 2px; margin-left: -1px; background: #f6e3bd; opacity: .75; box-shadow: 0 0 0 1px #0009; z-index: 2; }
.np-phase { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: #e6c37a; font: 600 11px/1.2 system-ui, sans-serif; letter-spacing: .04em; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-phase-pips { display: inline-flex; gap: 2px; flex: none; }
.np-phase-pips i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid #c9a467; background: #1a110c; }
.np-phase-pips i.on { background: #e8b85a; box-shadow: 0 0 5px #e8b85a99; }
.np-cast { position: relative; height: 16px; margin-top: 4px; border-radius: 3px; overflow: hidden; border: 1px solid #000; background: #2a0b0b; box-shadow: 0 0 0 1px #ff6a3d88, 0 0 12px #ff4a2a66; animation: np-cast-glow .6s ease-in-out infinite alternate; }
.np-cast i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #8f1912, #ff8a3d); animation: np-cast-fill 1.6s linear forwards; }
.np-cast b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff4e0; font: 700 11px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 1px 2px #000; }
@keyframes np-cast-fill { to { width: 100%; } }
@keyframes np-cast-glow { to { box-shadow: 0 0 0 1px #ffb36a, 0 0 18px #ff4a2aaa; } }
.np-enemy.boss.windup { filter: none; }
/* ---- Prepare for the founder ---- */
.fp h2 { margin: 2px 0 4px; font-family: var(--title); font-size: 26px; color: #f4e6d4; }
.fp-threat { margin: 0 0 6px; color: #bfae9d; font-size: 13px; }
.fp-warn { margin: 0 0 8px; padding: 6px 10px; border: 1px solid #8a2a24; border-radius: 8px; background: #2a0f0e; color: #f0b7a8; font-size: 12.5px; }
.fp-label { display: block; margin: 0 0 4px; color: #cdb48c; font: 600 11px/1.2 var(--title); letter-spacing: .16em; text-transform: uppercase; }
.fp-sig { margin: 10px 0; padding: 10px 12px; border: 1px solid #a0402a; border-radius: 10px; background: linear-gradient(90deg, #3a1210, #160d0c 80%); box-shadow: inset 0 0 18px #ff4a2a1a; }
.fp-sig > b { display: block; color: #ffd3b0; font: 600 18px/1.2 var(--title); }
.fp-sig p { margin: 4px 0; color: #e2cfbd; font-size: 13px; }
.fp-sig small { color: #a8938a; font-size: 11.5px; }
.fp-phases { display: grid; gap: 4px; margin: 0 0 12px; padding: 0; list-style: none; }
.fp-phases li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding: 6px 8px; border-left: 2px solid #5a3f2c; background: #140e0c; font-size: 12.5px; }
.fp-phases b { color: #e6c37a; font-weight: 600; }
.fp-phases span { color: #bfae9d; }
.fp-list { display: grid; gap: 6px; margin: 0 0 4px; padding: 0; list-style: none; }
.fp-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #3a2c24; border-radius: 9px; background: #140e0c; }
.fp-list li.ok { border-color: #3f5a33; }
.fp-list li.miss { border-color: #6a4a24; }
.fp-mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; font-size: 13px; }
.fp-list li.ok .fp-mark { background: #23361c; color: #b6e08f; }
.fp-list li.miss .fp-mark { background: #3a2a12; color: #f1c46a; }
.fp-row b { display: block; color: #f0e2cf; font-size: 13.5px; }
.fp-row small { color: #a8998c; font-size: 12px; }
@media (max-width: 640px) { .fp-phases li { grid-template-columns: 1fr; gap: 2px; } .fp-list li { grid-template-columns: 24px minmax(0, 1fr); } .fp-list li > button { grid-column: 2; justify-self: start; } }
.np > .np-phase, .np > .np-cast { grid-column: 2; grid-row: 3; }
.np-enemy > .np-phase, .np-enemy > .np-cast { grid-column: 1; }
.np-enemy > .np-phase { justify-content: flex-end; }
.np-enemy > .np-cast { margin-right: 4px; }
.np > .np-phase, .np > .np-cast { position: relative; z-index: 2; margin-top: 12px; }
.np-cast b { display: block; padding: 0 4px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
@media (max-width: 640px) { .np-cast b { font-size: 11px; letter-spacing: .02em; } .np-phase { font-size: 11px; } }
@media (max-width: 640px) { .np-phase-more { display: none; } }

/* ---- First hour: next-step strip, Fresh blood tag, Stronger prey card ---- */
.ns-strip, .obj-chip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin: 6px 0 2px; padding: 4px 6px 4px 10px; min-height: 44px; border: 1px solid #5a3f2c; border-radius: 10px; background: linear-gradient(90deg, #2a1c14, #140e0c 70%); box-shadow: 0 4px 12px #0006; }
.obj-chip.obj-level { border-color: #3b2a28; background: #150f0f; box-shadow: none; }
.obj-chip .obj-text { min-width: 0; }
.obj-chip .obj-text b { display: block; color: #f0e2cf; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obj-chip .obj-go { min-height: 44px; }
.obj-chip button.ns-close { min-height: 44px; min-width: 44px; }
.ns-strip.ns-prey, .obj-chip.obj-prey { border-color: #6f9d55; background: linear-gradient(90deg, #1d2a17, #120e0c 70%); }
.ns-tag { padding: 3px 8px; border-radius: 999px; background: #3a2a1c; color: #e6c37a; font: 600 11px/1.2 var(--title); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.ns-prey .ns-tag, .obj-prey .ns-tag { background: #2a3d22; color: #b6e08f; }
.ns-text { min-width: 0; }
.ns-text b { display: block; color: #f0e2cf; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-text small { display: block; color: #a8998c; font-size: 11.5px; line-height: 1.3; }
.ns-strip > button { white-space: nowrap; }
button.ns-close { min-height: 24px; min-width: 24px; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; color: #8e7f76; }
.ns-strip.ns-prey, .obj-chip.obj-prey { grid-template-columns: auto minmax(0, 1fr) auto; }
.obj-chip.obj-level { grid-template-columns: auto minmax(0, 1fr); }
.hg-badge.better { background: #3d5e2c; color: #e6ffd4; }
.hg-card.is-better { border-color: #6f9d55 !important; box-shadow: 0 0 0 1px #6f9d5555, 0 0 12px #6f9d5533; }
@media (max-width: 640px) {
  .ns-strip { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 8px; margin: 6px 0 2px; }
  .ns-strip .ns-tag { display: none; }
  .ns-strip.ns-prey { grid-template-columns: minmax(0, 1fr) auto; }
  .ns-text small { font-size: 11px; }
}

/* ---- Item levels: infusion on the item card ---- */
.eqd-infuse { margin: 10px 20px; padding: 10px 12px; border: 1px solid #4a372a; border-radius: 10px; background: linear-gradient(180deg, #1c1411, #130d0b); }
.eqd-infuse .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.eqd-infuse b { color: #e6c37a; font: 600 12px/1.2 var(--title); letter-spacing: .12em; text-transform: uppercase; }
.eqd-infuse small { color: #bfae9d; }
.eqd-infuse-bar { height: 6px; margin: 7px 0 6px; border-radius: 4px; overflow: hidden; background: #2a1f1a; }
.eqd-infuse-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7a5626, #e8b85a); }
.eqd-infuse.full { border-color: #c9a467; }
.eqd-infuse.full .eqd-infuse-bar i { background: #f0cf7a; }
.eqd-infuse p { margin: 0 0 6px; }
@media (max-width: 640px) { .eqd-infuse { margin: 10px 14px; } }
/* ---- Dungeons (world map) ---- */
.wm-floors { margin: 8px 0; padding-left: 18px; color: #d9c7b2; font-size: 13px; }
.wm-floors li { margin: 2px 0; }
.wm-floors b { color: #e6c37a; font-weight: 600; margin-right: 4px; }
/* Swing and gathering bars: driven by timers.mjs as a compositor animation. */
@keyframes ng-timer-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* Guild store and Artisans */
.gs-list{display:grid;gap:8px;grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
.gs-item{display:grid;grid-template-columns:40px 1fr auto;gap:10px;align-items:center;padding:8px 10px;border:1px solid #3a2a26;border-radius:10px;background:#1a1212}
.gs-item b{display:block;font-size:14px}.gs-item small{color:#9c8b7a}
.gs-img{width:36px;height:36px;object-fit:contain}
.gs-artisan{font:600 11px/1 var(--ui,inherit);letter-spacing:.06em;text-transform:uppercase;color:#e0a64a;border:1px solid #e0a64a66;border-radius:999px;padding:3px 7px;margin-left:6px;vertical-align:middle}
.co-town{color:#e0a64a;font-weight:600}.co-row.is-town{border-color:#5a4426}
.co-fill small{display:block;font-size:11px;opacity:.85}
.co-h{margin:4px 0 10px}
/* Realm bar: admin announcement and realm events (app-realm.mjs). Static strip above everything; the game
   moves down by its height so nothing is covered. */
body.realm-on{--realm-h:34px}
html body.realm-on #app{margin-top:var(--realm-h)!important;height:calc(100dvh - var(--realm-h))!important}
#realm-bar{position:fixed;z-index:70;top:0;left:0;right:0;height:var(--realm-h,34px);display:flex;align-items:center;overflow:hidden;
 border-bottom:1px solid #8a5a2b;background:linear-gradient(90deg,#1a0b0c 0%,#4a1316 30%,#6b1a1c 50%,#4a1316 70%,#1a0b0c 100%);box-shadow:0 2px 14px #b3262a55,inset 0 -1px 0 #f3c56b33;color:#ecdcc4;font-size:12.5px}
#realm-bar.live::before{content:'';position:absolute;inset:0;background:linear-gradient(100deg,transparent 35%,#ffd88a2e 50%,transparent 65%);background-size:250% 100%;animation:rb-sheen 4.5s linear infinite;pointer-events:none}
#realm-bar.live::after{content:'';position:absolute;left:0;right:0;bottom:0;height:2px;background:linear-gradient(90deg,transparent,#f3c56b,#ff8a3d,#f3c56b,transparent);animation:rb-glow 2.4s ease-in-out infinite;pointer-events:none}
@keyframes rb-sheen{from{background-position:150% 0}to{background-position:-100% 0}}
@keyframes rb-glow{0%,100%{opacity:.45}50%{opacity:1}}
#realm-bar .rb-track{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;gap:22px;padding:0 40px;white-space:nowrap;overflow:hidden}
#realm-bar .rb-item{display:inline-flex;align-items:baseline;gap:8px;min-width:0}
#realm-bar .rb-item+.rb-item{padding-left:22px;border-left:1px solid #f3c56b33}
#realm-bar .rb-tag{font-family:var(--title,serif);font-size:11px;letter-spacing:2.2px;text-transform:uppercase;color:#e9a85c}
#realm-bar .rb-title{font-family:var(--title,serif);font-size:14px;letter-spacing:1px;color:#ffe2a8;text-shadow:0 0 10px #ff9b4a88}
#realm-bar .rb-mult{font-family:var(--title,serif);font-size:18px;font-weight:700;line-height:1;color:#ffd27e;text-shadow:0 0 12px #ffb24d,0 0 2px #fff3}
#realm-bar .rb-item:not(.on) .rb-mult,#realm-bar .rb-item:not(.on) .rb-title{text-shadow:none;color:#d9c3a0}
#realm-bar .rb-what{color:#ecdcc4;overflow:hidden;text-overflow:ellipsis}
#realm-bar .rb-time{color:#b9a68c;font-size:11.5px;font-variant-numeric:tabular-nums}
#realm-bar .rb-close{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:26px;height:26px;min-height:0;padding:0;border:0;background:none;color:#cdb79a;font-size:13px;z-index:1}
@media(max-width:760px){body.realm-on{--realm-h:30px}#realm-bar{font-size:11.5px}#realm-bar .rb-track{justify-content:flex-start;padding:0 34px 0 10px;gap:14px}#realm-bar .rb-item+.rb-item{padding-left:14px}#realm-bar .rb-tag,#realm-bar .rb-time{display:none}#realm-bar .rb-item{display:none;flex:1;min-width:0}#realm-bar .rb-item.cur{display:inline-flex}#realm-bar .rb-item+.rb-item{border:0;padding-left:0}#realm-bar .rb-what{flex:1;min-width:0;white-space:nowrap}#realm-bar .rb-title{font-size:12.5px}#realm-bar .rb-mult{font-size:15px}}
@media(prefers-reduced-motion:reduce){#realm-bar.live::before,#realm-bar.live::after{animation:none}}
.ops-form{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:6px 0}.ops-form input:not([type=number]){flex:1 1 180px;min-width:0}.ops-form input[type=number]{width:84px}.ops-form label{display:flex;gap:4px;align-items:center;font-size:12px}
.ops-chat{list-style:none;padding:0;margin:0}.ops-chat li{padding:3px 0;border-bottom:1px solid #ffffff10;font-size:12.5px}
.ops-bk{padding:8px 0;border-top:1px solid #ffffff12}.ops-bk:first-of-type{border-top:0}.ops-bk header small{display:block;color:#8e7f76}.ops-bk.open header b{color:#f0a96b}
.ops-bk blockquote,#modal blockquote{margin:6px 0;padding:6px 10px;border-left:2px solid #8a5a2b;background:#ffffff08;color:#e5d6c0}

/* Update bar (app-realm.mjs): a newer deploy is live, or an admin asked every page to reload. */
#update-bar { position: fixed; z-index: 9000; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); width: min(560px, calc(100vw - 24px)); box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; border: 1px solid #cd3039; border-radius: 10px; background: #1b1112; color: #ddd3bb; box-shadow: 0 12px 32px #000a; }
#update-bar .ub-text { flex: 1 1 240px; display: grid; gap: 2px; min-width: 0; }
#update-bar .ub-text small { color: #bfae98; }
#update-bar button { min-height: 44px; padding: 0 16px; }
@media (max-width: 760px) { #update-bar { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.hg-badge.danger { background: #7a4a12; color: #ffe8c2; }


.xps-row.xps-cap { display: flex; flex-wrap: wrap; font-size: .875rem; gap: .35rem .75rem; }
.xps-cap button { margin-left: auto; }

/* A defeat leaves one useful explanation beside the combat controls. */
.combat-review { padding: .8rem; margin: .5rem 0; border: 1px solid #70523e; border-radius: .5rem; background: #201712; font-size: .875rem; overflow-wrap: anywhere; }
.combat-review h3 { margin: .25rem 0; font-size: 1rem; }
.combat-review p { margin: .5rem 0; }
.combat-review summary { cursor: pointer; padding: .65rem 0; font-size: .875rem; }
.cr-numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: .75rem 0; }
.cr-numbers dt, .cr-numbers small { font-size: .875rem; color: #c6b6a3; }
.cr-numbers dd { margin: .2rem 0; font-size: 1.1rem; color: #f1e2ce; }
@media (max-width: 620px) { .cr-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); } .combat-review button { min-height: 2.5rem; } }

.item-build{margin-left:.25em;color:var(--gold,#c3a98b);font-size:.85em}
.dp-rules { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; line-height: 1.45; color: #cdbfae; }
.dp-rules li { margin: 4px 0; }
/* Phase 1: header buttons are at least 44px tall (wins over the compact header rule above) */
.hunt-header-actions .hunt-btn, .hunt-header-actions .goals-btn, .hunt-header-actions .hunt-mobile-settings { min-height: 44px !important; min-width: 44px !important; }
.obj-chip button { margin: 0; }
