/* ============================================================
   Highkeep — slate and brass, around rendered artwork
   ============================================================ */
@property --ik { syntax: '<number>'; inherits: true; initial-value: 1; }
:root {
  --bg: #0d1017;
  --panel: #171c28;
  --panel2: #1f2636;
  --panel3: #2b3449;
  --line: #323b52;
  --line2: #4a5570;
  --text: #ece7d8;
  --muted: #98a1b4;
  --brass: #d8ad4f;
  --brass2: #f3d488;
  --brass3: #94702a;
  --good: #7fd39a;
  --bad: #ee7565;
  --blue: #73a4dc;
  --serif: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --sans: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; color: var(--text); }
img { -webkit-user-drag: none; user-select: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .2px; }
p { margin: 6px 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.grow { flex: 1; }
.r { text-align: right; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a445c; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #55617d; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- pictures ---------- */
/* a picture fills the box it is put in; the boxes that hold one are sized where they are used */
.pic { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; }
.r-ico, .n-ico, .u-ico, .m-icon { position: relative; }
.ico { height: 1.4em; width: auto; vertical-align: -.34em; flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.sym { width: 1em; height: 1em; fill: currentColor; vertical-align: -.14em; flex: none; }
/* a piece of art on its own tile of turf */
.stand { position: relative; display: block; flex: none; }
.stand img { position: absolute; max-width: none; }
.turf {
  position: absolute; background: linear-gradient(90deg, #7b5733 0 50%, #5c4026 50% 100%);
  clip-path: polygon(50% 0, 100% calc(50% - var(--lip) / 2), 100% calc(50% + var(--lip) / 2), 50% 100%, 0 calc(50% + var(--lip) / 2), 0 calc(50% - var(--lip) / 2));
}
.turf::before {
  content: ''; position: absolute; inset: 0 0 var(--lip) 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: linear-gradient(165deg, #8dbb59, #6f9f46 55%, #5f8f3c);
}

/* ---------- frame ---------- */
#app {
  display: grid; height: 100vh;
  grid-template-columns: 82px minmax(0, 1fr) 308px;
  grid-template-rows: 60px minmax(0, 1fr) 158px;
  grid-template-areas: "top top top" "nav main side" "nav chat side";
  background: radial-gradient(1200px 500px at 50% -120px, #1c2436, transparent 70%), var(--bg);
}
#topbar {
  grid-area: top; position: relative; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 0 14px; min-width: 0;
  background: linear-gradient(180deg, #252d40, #171c28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px rgba(0, 0, 0, .4);
}
#topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; opacity: .75;
  background: linear-gradient(90deg, transparent, var(--brass3) 10%, var(--brass) 50%, var(--brass3) 90%, transparent);
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.crest {
  position: relative; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none;
  background: radial-gradient(circle at 50% 30%, #9cc7e6, #4f7fae 55%, #2b4a70);
  box-shadow: 0 0 0 2px #171c28, 0 0 0 3.5px var(--brass), 0 3px 9px rgba(0, 0, 0, .55);
}
.crest::before { content: ''; position: absolute; left: -10%; right: -10%; bottom: -34%; height: 62%; border-radius: 50%; background: linear-gradient(180deg, #86b455, #5d8a3c); }
.crest img { position: absolute; left: -2px; top: 2px; width: 50px; height: auto; max-width: none; max-height: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b {
  font-family: var(--serif); letter-spacing: 3.5px; font-size: 16px;
  background: linear-gradient(180deg, #ffecb5, #c9973a); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text small { color: var(--muted); font-size: 11px; max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#resbar { display: flex; gap: 7px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
#resbar::-webkit-scrollbar { display: none; }
.res {
  display: flex; align-items: center; gap: 7px; padding: 3px 12px 3px 6px; border-radius: 11px; flex: none;
  background: linear-gradient(180deg, #121722, #1b2130); border: 1px solid #2c3449;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .04);
}
.r-ico { width: 34px; height: 34px; display: grid; place-items: center; flex: none; }
.r-ico .pic { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.r-txt { display: flex; flex-direction: column; line-height: 1.15; }
.r-txt b { font-size: 14px; font-variant-numeric: tabular-nums; }
.r-txt small { font-size: 10.5px; color: var(--good); font-variant-numeric: tabular-nums; }
.res.full b { color: var(--brass2); }
.res.neg small { color: var(--bad); }
#res-pop small { color: var(--muted); }
#topright { display: flex; align-items: center; gap: 8px; flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 99px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #121722, #1b2130); border: 1px solid #2c3449; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5);
}
.pill .ico { height: 22px; }
#truce { color: #cfe9ff; border-color: #3d5b78; }
#truce b { font-weight: 600; }
#powerPill { color: var(--brass2); font-weight: 600; }
.speed { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.speed button { padding: 6px 10px; font-size: 12.5px; background: var(--panel2); color: var(--muted); min-width: 34px; }
.speed button + button { border-left: 1px solid var(--line); }
.speed button.on { background: linear-gradient(180deg, var(--brass2), #c4973a); color: #241b06; font-weight: 700; }
.pause { display: inline-block; width: 9px; height: 11px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; vertical-align: -1px; }
.icon-btn { width: 33px; height: 33px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; }
.icon-btn:hover, .speed button:hover:not(.on) { background: var(--panel3); color: var(--text); }

/* ---------- nav ---------- */
#nav { grid-area: nav; background: linear-gradient(180deg, #171c28, #11151e); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: 10px 7px; }
.nav-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 6px;
  border-radius: 12px; color: var(--muted); border: 1px solid transparent; transition: background .12s, color .12s;
}
.nav-btn:hover { background: var(--panel2); color: var(--text); }
.nav-btn.on {
  background: linear-gradient(180deg, #303a52, #222a3c); color: var(--brass2); border-color: #55617d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 8px rgba(0, 0, 0, .35);
}
.nav-btn.on::before { content: ''; position: absolute; left: -8px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--brass); }
.n-ico { width: 48px; height: 40px; display: grid; place-items: center; }
.n-ico .pic { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55)); transition: transform .12s; }
.nav-btn:hover .n-ico .pic, .nav-btn.on .n-ico .pic { transform: translateY(-1px) scale(1.07); }
.n-lbl { font-size: 11px; letter-spacing: .2px; }
.badge { position: absolute; top: 3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #171c28; }
.nav-btn.alarm { animation: alarm 1s infinite; }
@keyframes alarm { 50% { background: #55231f; color: #ffd0c9; } }

/* ---------- main ---------- */
#main { grid-area: main; position: relative; min-width: 0; min-height: 0; }
.view { display: none; position: absolute; inset: 0; overflow: auto; }
.view.on { display: block; }
.page { padding: 22px 26px 40px; max-width: 1080px; margin: 0 auto; }
.page-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.page-h h2 { font-size: 28px; color: var(--brass2); }
.page-h p { margin: 0; }
.page-h .btn { margin-left: auto; }
.page h3 { margin: 22px 0 10px; font-size: 17px; }

/* ---------- the city ---------- */
#view-city { overflow: hidden; background: #638f40; cursor: grab; user-select: none; touch-action: none; }
#view-city.drag { cursor: grabbing; }
#cityStage { position: absolute; left: 0; top: 0; transform-origin: 0 0; transition: transform .16s ease-out, --ik .16s ease-out; will-change: transform; }
.drag #cityStage { transition: none; }
#cityGround { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.wallpic { position: absolute; max-width: none; pointer-events: none; }
.plot { position: absolute; width: 0; height: 0; }
.spr { position: absolute; max-width: none; pointer-events: none; transition: filter .12s; }
.hit { position: absolute; cursor: pointer; outline: none; }
.hit::after {                                       /* the ground the plot stands on lights up under the pointer */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--d); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: radial-gradient(closest-side, rgba(255, 236, 170, .7), rgba(255, 220, 130, .3)); opacity: 0; transition: opacity .12s;
}
.hit:hover::after, .hit:focus-visible::after { opacity: 1; }
.hit:hover ~ .spr, .hit:focus-visible ~ .spr { filter: brightness(1.14) drop-shadow(0 0 2px rgba(255, 244, 200, .95)) drop-shadow(0 0 7px rgba(255, 226, 140, .85)); }
.plot.empty .hit::after { opacity: .28; background: radial-gradient(closest-side, rgba(255, 255, 255, .5), rgba(255, 255, 255, .22)); }
.plot.empty .hit:hover::after, .plot.empty .hit:focus-visible::after { opacity: 1; background: radial-gradient(closest-side, rgba(255, 236, 170, .75), rgba(255, 220, 130, .4)); }
.plot.gate .hit::after { background: radial-gradient(closest-side, rgba(255, 236, 170, .5), rgba(255, 220, 130, 0)); }
.plot.gate.empty .hit::after { opacity: .5; background: radial-gradient(closest-side, rgba(255, 232, 160, .6), rgba(255, 220, 130, .25)); }
.plot.gate.empty .hit:hover::after { opacity: 1; }
.plus {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; z-index: 1;
  border: 1.5px solid rgba(255, 255, 255, .8); transform: scale(var(--ik)); opacity: .62; transition: opacity .12s;
  background: linear-gradient(#fff, #fff) center / 9px 1.5px no-repeat, linear-gradient(#fff, #fff) center / 1.5px 9px no-repeat, rgba(24, 36, 20, .45);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .35);
}
.hit:hover .plus { opacity: 1; border-color: #fff; background-color: #b98a2c; }

/* smoke, fires and lit windows */
.fx { position: absolute; width: 0; height: 0; pointer-events: none; }
.smoke b {
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(248, 247, 242, .85), rgba(240, 238, 232, 0));
  animation: puff 4.2s linear infinite; animation-delay: var(--dl, 0s);
}
@keyframes puff { 0% { transform: translate(0, 0) scale(.5); opacity: 0; } 12% { opacity: .85; } 100% { transform: translate(30px, -96px) scale(2.8); opacity: 0; } }
.fire::before, .glow::before {
  content: ''; position: absolute; border-radius: 50%; mix-blend-mode: screen; animation-delay: var(--dl, 0s);
}
.fire::before { left: -36px; top: -36px; width: 72px; height: 72px; background: radial-gradient(closest-side, rgba(255, 205, 120, .85), rgba(255, 140, 50, .3) 55%, rgba(255, 120, 40, 0)); animation: flick .42s ease-in-out infinite alternate; }
.glow::before { left: -30px; top: -30px; width: 60px; height: 60px; background: radial-gradient(closest-side, rgba(255, 215, 130, .6), rgba(255, 190, 90, 0)); animation: flick 2.6s ease-in-out infinite alternate; }
@keyframes flick { from { transform: scale(.82); opacity: .7; } to { transform: scale(1.1); opacity: 1; } }

/* labels over the scene: kept one size however far the view is zoomed */
.tag { position: absolute; width: 0; height: 0; z-index: 800; pointer-events: none; }
.tg {
  position: absolute; left: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; white-space: nowrap;
  transform: translateX(-50%) scale(var(--ik)); transform-origin: 50% 100%;
}
.tg.down { bottom: auto; top: 0; transform-origin: 50% 0; }
.lv {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center;
  font: 800 12px/1 var(--sans); color: #2a1e05; background: linear-gradient(180deg, #ffe9ac, #d9a93f);
  border: 1.5px solid #3a2a0a; box-shadow: 0 2px 5px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .65);
}
.nm {
  display: none; padding: 3px 11px 4px; border-radius: 8px; text-align: center; font: 600 14px/1.25 var(--serif); color: #fff3cf;
  background: rgba(13, 17, 25, .93); border: 1px solid rgba(243, 212, 136, .6); box-shadow: 0 5px 16px rgba(0, 0, 0, .55);
}
.nm small { display: block; font: 400 11px var(--sans); color: var(--muted); }
.tag.hot { z-index: 820; }
.tag.hot .nm { display: block; }
.pill-b, .tg .pill {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 4px 5px; border-radius: 99px;
  font: 700 11.5px var(--sans); color: #dcffe8; background: rgba(13, 17, 25, .92); border: 1px solid rgba(127, 211, 154, .75);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
}
.tg .pill .ico { height: 16px; }
.pbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .12); }
.pbar i { display: block; height: 100%; width: 0; background: var(--good); }
.plate {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 13px 5px; border-radius: 9px; font: 600 14px/1.25 var(--serif); color: #ffe7b0;
  background: linear-gradient(180deg, rgba(60, 44, 26, .96), rgba(38, 27, 16, .96)); border: 1.5px solid #8a6a3a; box-shadow: 0 4px 12px rgba(0, 0, 0, .55);
}
.plate b { font: 700 12px var(--sans); color: var(--brass2); }
.plate span { display: inline-flex; align-items: center; gap: 3px; font: 600 12px var(--sans); color: #e6efd6; }
.plate .ico { height: 18px; }
.plate.cta { color: #2a1e05; background: linear-gradient(180deg, var(--brass2), #c4973a); border-color: #6b4e14; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-3px); } }
.tag.hot .plate { border-color: var(--brass2); filter: brightness(1.1); }

#cityClouds { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#cityClouds i { position: absolute; left: -680px; top: 4%; width: 640px; height: 300px; border-radius: 50%; background: radial-gradient(closest-side, rgba(16, 34, 46, .2), rgba(16, 34, 46, 0)); animation: drift 84s linear infinite; }
#cityClouds i:nth-child(2) { top: 40%; width: 800px; height: 380px; animation-duration: 118s; animation-delay: -44s; }
#cityClouds i:nth-child(3) { top: 66%; animation-duration: 98s; animation-delay: -71s; }
@keyframes drift { to { transform: translateX(calc(100vw + 760px)); } }
#cityShade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, rgba(8, 14, 10, 0) 58%, rgba(8, 14, 10, .4) 100%); box-shadow: inset 0 10px 22px -10px rgba(0, 0, 0, .55); }
#cityHead {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; white-space: nowrap; padding: 8px 96px 11px;
  background: linear-gradient(90deg, rgba(10, 14, 20, 0), rgba(10, 14, 20, .66) 24%, rgba(10, 14, 20, .66) 76%, rgba(10, 14, 20, 0));
}
#cityHead::after { content: ''; position: absolute; left: 14%; right: 14%; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--brass), transparent); opacity: .85; }
#cityHead h2 { font-size: 27px; line-height: 1.2; color: #fff3cf; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); letter-spacing: .5px; }
#cityHead span { color: rgba(236, 240, 226, .85); font-size: 12.5px; }
#cityTools, #mapTools { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
#cityTools button, #mapTools button {
  width: 36px; height: 36px; border-radius: 10px; font-size: 18px; line-height: 1; color: var(--text);
  background: rgba(18, 23, 33, .92); border: 1px solid var(--line2); box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
}
#cityTools button:hover, #mapTools button:hover { border-color: var(--brass); color: var(--brass2); }

/* ---------- world map ---------- */
#view-world { overflow: hidden; background: #2d7396; }
#mapCanvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#mapCanvas:active { cursor: grabbing; }
#view-world::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, rgba(6, 14, 22, 0) 60%, rgba(6, 14, 22, .42) 100%); box-shadow: inset 0 10px 22px -10px rgba(0, 0, 0, .55); }
#tileInfo, #mapTools, #mapLegend { z-index: 2; }
#tileInfo { position: absolute; top: 12px; left: 12px; width: 306px; max-width: calc(100% - 24px); }
.ti {
  background: linear-gradient(180deg, rgba(31, 38, 54, .97), rgba(20, 25, 36, .97)); border: 1px solid var(--line2); border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.ti p { font-size: 13px; }
.ti-t { font-family: var(--serif); font-size: 17px; color: var(--brass2); }
.ti-h { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.ti-h b { font-family: var(--serif); font-size: 18px; display: block; color: #fff3cf; line-height: 1.2; }
.ti-h small { display: block; color: var(--muted); font-size: 12px; }
.ti-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 13px; }
.ti-row span { color: var(--muted); }
.ti-row small { color: var(--muted); font-weight: 400; }
.ti-acts { display: flex; gap: 8px; margin-top: 10px; }
.ti-acts .btn { flex: 1; }
#mapLegend {
  position: absolute; left: 12px; bottom: 10px; display: flex; gap: 6px 14px; flex-wrap: wrap; padding: 5px 12px; border-radius: 10px; max-width: calc(100% - 24px);
  background: rgba(18, 23, 33, .9); border: 1px solid var(--line); font-size: 12px; color: #c9cfdb; pointer-events: none;
}
#mapLegend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
#mapLegend .ico { height: 22px; }
#mapLegend small { color: var(--muted); }
.intel { background: rgba(115, 164, 220, .09); border: 1px solid rgba(115, 164, 220, .28); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.intel label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--blue); margin: 2px 0 5px; }
.intel .chips + label { margin-top: 8px; }

/* ---------- side panel ---------- */
#side { grid-area: side; background: linear-gradient(180deg, #171c28, #11151e); border-left: 1px solid var(--line); overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.card {
  background: linear-gradient(180deg, #1c2231, #171c28); border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 2px 8px rgba(0, 0, 0, .25);
}
.card-h { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.card-h > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.card-h .ico { height: 20px; }
.card.quest { border-color: #5b4a22; background: radial-gradient(260px 120px at 100% 0, rgba(216, 173, 79, .16), transparent 70%), linear-gradient(180deg, #2a2413, #1b1c1d); }
.card.quest > b { font-family: var(--serif); font-size: 17px; color: var(--brass2); }
.card.quest p { font-size: 13px; color: #d7d2c2; }
.card.quest.ready { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(216, 173, 79, .25), 0 0 22px rgba(216, 173, 79, .18); }
.reward { font-size: 12px; margin: 8px 0 2px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.card.alert { border-color: #7d3a32; background: linear-gradient(180deg, #33201c, #251614); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { border-color: var(--bad); box-shadow: 0 0 16px rgba(238, 117, 101, .3); } }
.idle { color: var(--muted); font-size: 12.5px; }
.q { padding: 5px 0; }
.q + .q { border-top: 1px solid rgba(255, 255, 255, .06); }
.q-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.q-top b { font-variant-numeric: tabular-nums; color: var(--brass2); flex: none; }
.q-l { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.q-l .ico { height: 22px; }
.q-sub { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .09); overflow: hidden; margin-top: 6px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b98a2c, var(--brass2)); border-radius: 3px; }
.bar.red i { background: var(--bad); }
.q.ally .bar i { background: var(--good); }

/* ---------- chat ---------- */
#chat { grid-area: chat; display: grid; grid-template-columns: 128px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 32px; background: #121620; border-top: 1px solid var(--line); min-height: 0; }
#chatTabs { grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-right: 1px solid var(--line); }
#chatTabs button { display: flex; align-items: center; gap: 7px; text-align: left; padding: 5px 9px; border-radius: 9px; color: var(--muted); font-size: 12.5px; }
#chatTabs button .ico { height: 20px; }
#chatTabs button:hover { color: var(--text); }
#chatTabs button.on { background: var(--panel3); color: var(--text); }
#chatLog { overflow-y: auto; padding: 7px 12px; font-size: 13px; min-height: 0; }
.cl { padding: 1.5px 0; word-break: break-word; }
.cl .ico { height: 17px; }
.ct { color: #5f6a80; font-size: 11px; font-variant-numeric: tabular-nums; margin-right: 3px; }
.cl.news { color: #e9c98a; }
.cl.news b { color: inherit; }
.cl.sys { color: #b9c3d6; }
#chatInput { margin: 0 10px 6px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); outline: none; min-width: 0; }
#chatInput:focus { border-color: var(--brass); }
#chatInput:disabled { opacity: .5; }

/* ---------- shared pieces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px; font-weight: 650; white-space: nowrap;
  background: linear-gradient(180deg, #ffe7a6, #d9aa42 55%, #bd8c2f); color: #241b06; border: 1px solid #7d5f20;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .55); text-shadow: 0 1px 0 rgba(255, 255, 255, .28);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .55); }
.btn .ico { height: 1.55em; margin: -.3em 0; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.big { padding: 13px 20px; font-size: 16px; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.ghost { background: linear-gradient(180deg, #333d55, #283044); color: var(--text); border-color: #4a5570; text-shadow: none; box-shadow: 0 2px 0 rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn.danger { background: linear-gradient(180deg, #e9796a, #b9483b); color: #fff; border-color: #7d2f26; text-shadow: none; }
.btn.disabled { filter: grayscale(.8); opacity: .5; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .09); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip .ico { height: 17px; }
.chip .sym { color: var(--muted); }
.chip.lack { color: var(--bad); border-color: rgba(238, 117, 101, .5); background: rgba(238, 117, 101, .1); }
.warn { color: #f0a45d; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.lvl { font: 600 12px var(--sans); color: var(--brass2); background: rgba(216, 173, 79, .14); border: 1px solid rgba(216, 173, 79, .35); padding: 1px 8px; border-radius: 99px; vertical-align: middle; }
.notice { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: 10px; padding: 11px 13px; margin: 10px 0; }
.notice.bad { border-left-color: var(--bad); }
.note { color: var(--muted); font-size: 12.5px; margin: 10px 0; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: linear-gradient(180deg, #222a3b, #1d2434); border: 1px solid var(--line); border-radius: 12px; text-align: left; width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.row.locked { opacity: .62; }
.u-ico { width: 78px; height: 62px; display: grid; place-items: center; flex: none; }
.u-ico.fig { width: 62px; }
.u-ico .pic { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); }
.u-main { flex: 1; min-width: 0; }
.u-main > b { font-size: 14.5px; }
.u-desc { color: var(--muted); font-size: 12.5px; margin: 2px 0 5px; }
.u-stats { display: flex; flex-wrap: wrap; gap: 4px 11px; font-size: 12px; color: #c9cfdb; margin-bottom: 5px; }
.u-stats span { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.u-stats .sym { color: #8f9bb3; }
.u-stats .ico { height: 15px; }
.u-cost { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.u-cost.order { margin-top: 5px; }
.o-lbl { min-width: 44px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.u-cost.order .o-lbl { color: var(--brass2); }
.u-why { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; color: var(--bad); font-size: 12.5px; line-height: 1.35; }
.u-why .sym { margin-top: .15em; }
.link { color: var(--brass2); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.u-act { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.u-act input { width: 70px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); outline: none; text-align: right; }
.u-act input:focus { border-color: var(--brass); }
button.row.report:hover { border-color: var(--brass); }
.row.report.unread { border-left: 3px solid var(--brass); }
.row.report.unread b { color: var(--brass2); }
.row.report .u-ico { width: 56px; height: 50px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.stat { flex: 1; min-width: 120px; background: linear-gradient(180deg, #222a3b, #1d2434); border: 1px solid var(--line); border-radius: 11px; padding: 8px 12px; }
.stat label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.stat b { font-size: 15.5px; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px; }
.stat.bad b { color: var(--bad); }
.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); padding: 9px 12px; background: var(--panel2); font-weight: 600; }
.tbl td { padding: 8px 12px; border-top: 1px solid rgba(255, 255, 255, .06); font-variant-numeric: tabular-nums; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tr.me td { background: rgba(216, 173, 79, .12); }
.tbl tr.dim td { opacity: .55; }
.tbl.mini td, .tbl.mini th { padding: 5px 9px; font-size: 13px; }
.tbl .ico { height: 20px; }
.rk { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; font-weight: 700; font-size: 12.5px; color: var(--muted); }
.rk1 { color: #2a1e05; background: linear-gradient(180deg, #ffe9ac, #d9a93f); }
.rk2 { color: #1c2230; background: linear-gradient(180deg, #eef2f8, #a9b3c4); }
.rk3 { color: #2a1505; background: linear-gradient(180deg, #f0b98a, #b9743f); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.tabs, .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 14px 0 12px; }
.tabs button, .seg button { padding: 7px 14px; background: var(--panel2); color: var(--muted); font-size: 13px; }
.tabs button + button, .seg button + button { border-left: 1px solid var(--line); }
.tabs button.on, .seg button.on { background: var(--panel3); color: var(--brass2); font-weight: 650; }
.tagc { font: 600 11px var(--sans); padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.tagc.good { color: var(--good); border-color: rgba(127, 211, 154, .45); }
.tagc.bad { color: var(--bad); border-color: rgba(238, 117, 101, .5); }

/* ---------- army ---------- */
.roster { --home: #e2b858; --away: #6ea6e6; --train: #86c46c; }
.roster td { padding: 3px 12px; vertical-align: middle; }
.roster th.r, .roster td.r { white-space: nowrap; width: 1%; padding-left: 20px; }
.rs-unit { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.rs-unit b { font-family: var(--serif); font-size: 17px; color: #fff3cf; }
.rs-art { position: relative; width: 40px; height: 44px; flex: none; }
.rs-art .pic { object-position: 50% 100%; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); }
.roster .rs-bar { width: 38%; min-width: 120px; padding-left: 6px; padding-right: 6px; }
.rs-track { display: flex; height: 16px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, .055); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
.rs-track i { display: block; min-width: 3px; height: 100%; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -2px 0 rgba(0, 0, 0, .16); }
.rs-track i + i { margin-left: 2px; }
.rs-track .home, .key.home { background: var(--home); }
.rs-track .away, .key.away { background: var(--away); }
.rs-track .train, .key.train { background: repeating-linear-gradient(135deg, var(--train) 0 5px, #5c9a47 5px 9px); }
.key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -.02em; }
.roster td.r { font-size: 16px; font-weight: 600; }
.roster td.zero { color: var(--muted); font-weight: 400; opacity: .6; }
.roster td.rs-total { font-size: 21px; font-weight: 700; color: var(--brass2); min-width: 86px; }
.roster td.rs-total.zero { color: var(--muted); font-weight: 400; }
.roster td.rs-plus { color: #a5d68c; }
.roster td.rs-plus.zero { color: var(--muted); }
.roster td.rs-act { padding-left: 14px; }
.roster tr.dim td.rs-act { opacity: 1; }
.roster tfoot td { border-top: 1px solid var(--brass3); background: var(--panel2); padding-top: 6px; padding-bottom: 6px; }
.roster tfoot .rs-art { height: 30px; }
.army-h { align-items: center; gap: 22px; }
.army-h .stat-row { flex: 1; margin: 0; }
.army-h .stat { min-width: 112px; padding: 6px 12px; }
.rs-march { white-space: nowrap; }
.rs-i { display: inline-block; width: 32px; margin-right: 8px; text-align: center; }
.rs-march .ico { height: 24px; }
.rs-march .lvl { margin-left: 6px; font-size: 11px; }
.tbl-x { overflow-x: auto; }
.facts th { white-space: nowrap; }
.facts th.r, .facts td.r { width: 1%; padding-left: 9px; padding-right: 9px; }
.facts td.good, .facts td.bad { font-size: 13px; }
.facts td.good { color: #a5d68c; }
.facts td.bad { color: #f0a79b; }
@media (min-width: 1500px) { .facts td.good, .facts td.bad { white-space: nowrap; } }
@media (max-width: 760px) { .roster .rs-bar { display: none; } }
.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .03); font-size: 12.5px; text-align: center; }
.stage b { font-family: var(--serif); font-size: 15px; color: #fff3cf; }
.stage.on { border-color: var(--brass); background: rgba(216, 173, 79, .1); box-shadow: 0 0 0 1px rgba(216, 173, 79, .2); }
.stage:not(.on) .stand { filter: saturate(.6) brightness(.82); }

/* ---------- alliance ---------- */
.al-flag {
  flex: none; width: 52px; height: 58px; display: grid; place-items: center; font: 800 13px var(--sans); letter-spacing: .5px; color: #10131a;
  background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .18)), var(--al, var(--brass));
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%); padding-bottom: 8px;
}
.al-flag.big { width: 68px; height: 76px; font-size: 16px; }
.al-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-color: color-mix(in srgb, var(--al) 55%, var(--line)); }
.al-main { flex: 1; min-width: 200px; }
.al-main h3 { margin: 0 0 2px; font-size: 21px; }
.al-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.card.found { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.card.found .ico { height: 18px; }

/* ---------- modal ---------- */
#modal { position: fixed; inset: 0; background: rgba(5, 7, 11, .7); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 18px; }
.modal-card {
  position: relative; width: min(740px, 100%); max-height: min(90vh, 880px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1c2231, #161b26); border: 1px solid var(--line2); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: rise .16s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-card.m-confirm, .modal-card.m-menu, .modal-card.m-found { width: min(480px, 100%); }
.modal-card.m-welcome { width: min(780px, 100%); }
.modal-card.m-welcome .modal-x { display: none; }
#modalHero:empty { display: none; }
#modalBody { overflow-y: auto; padding: 22px 24px 24px; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); z-index: 3; background: rgba(13, 17, 25, .4); }
.modal-x:hover { background: var(--panel3); color: var(--text); }
.m-hero {
  display: flex; align-items: center; gap: 20px; margin: -22px -24px 14px; padding: 16px 56px 14px 20px; border-radius: 15px 15px 0 0; border-bottom: 1px solid var(--line);
  background: radial-gradient(360px 190px at 126px 72%, rgba(255, 220, 140, .2), transparent 70%), linear-gradient(180deg, #2a3450, #1a2030);
}
.m-art { flex: none; }
.m-ht h2 { font-size: 27px; color: #fff3cf; }
.m-ht p { margin: 6px 0 0; color: #cfcaba; }
.m-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; padding-right: 30px; }
.m-icon { width: 84px; height: 72px; display: grid; place-items: center; flex: none; }
.m-icon .pic { filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .5)); }
.m-head h2 { font-size: 24px; color: #fff3cf; }
.m-head h2.good { color: var(--good); }
.m-head h2.bad { color: var(--bad); }
.m-head p { margin: 4px 0 0; color: #cfcaba; }
.m-head p .ico { height: 17px; }
.m-effect { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 12px 0; }
.m-effect > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.m-effect label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.upg { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(180deg, #22302a, #1b2620); border: 1px solid #36533f; margin: 12px 0 4px; flex-wrap: wrap; }
.upg .chips { margin-bottom: 2px; }
#modalBody h3 { margin: 20px 0 10px; font-size: 17px; }
#modalBody h3 .muted { font: 400 12.5px var(--sans); }
#modalBody h3 .ico { height: 20px; }
.qbox { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; margin-bottom: 10px; }
.m-foot { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.side-tbl label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.side-tbl > b { display: block; margin-bottom: 6px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.form input { padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); outline: none; font-size: 14px; }
.form input:focus { border-color: var(--brass); }
.menu { display: flex; flex-direction: column; }
.help h3 { margin: 16px 0 4px !important; }
.help p { color: #d2cdbd; margin: 0; }
.help p .ico { height: 22px; }

/* the title screen: a finished city above the name */
.showcase { position: relative; height: clamp(170px, 34vh, 330px); overflow: hidden; border-radius: 15px 15px 0 0; background: #638f40; }
.sc-stage { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; transform: scale(.272) translate(-1440px, -785px); }
.sc-ground { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.sc-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22, 27, 38, 0) 70%, #1b2130 100%); box-shadow: inset 0 0 70px rgba(0, 0, 0, .4); }
.welcome { text-align: center; }
.welcome h1 {
  font-size: 44px; letter-spacing: 9px; text-transform: uppercase; margin: -4px 0 2px; padding-left: 9px;
  background: linear-gradient(180deg, #fff0c0, #d9a93f 60%, #a87a25); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}
.welcome .lead { color: #d2cdbd; max-width: 560px; margin: 8px auto 4px; }
.welcome .form { text-align: left; max-width: 560px; margin-left: auto; margin-right: auto; }
.tips { text-align: left; color: #c5c0b0; font-size: 13px; padding-left: 18px; margin: 6px auto 14px; max-width: 560px; }
.tips li { margin: 3px 0; }
.welcome .btn { max-width: 560px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 80; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px 8px 12px; border-radius: 11px; background: linear-gradient(180deg, #2a3348, #1f2636); border: 1px solid #4a5570;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55); font-size: 13.5px; max-width: min(540px, 90vw); animation: tin .22s ease-out; transition: opacity .35s, transform .35s;
}
.toast .ico { height: 26px; }
.toast.good { border-color: rgba(127, 211, 154, .6); }
.toast.bad { border-color: rgba(238, 117, 101, .7); background: linear-gradient(180deg, #3a2420, #2b1a18); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* ---------- narrower windows ---------- */
@media (max-width: 1120px) {
  #app {
    grid-template-columns: 66px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto 108px;
    grid-template-areas: "top top" "nav main" "nav side" "nav chat";
  }
  .n-ico { width: 40px; height: 34px; }
  #cityHead { padding: 6px 60px 8px; }
  #cityHead h2 { font-size: 21px; }
  .card.quest p { margin: 3px 0; }
  #side .card.quest { min-width: 380px; max-width: 460px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-content: start; align-items: center; }
  #side .card.quest > .card-h, #side .card.quest > b, #side .card.quest > p { grid-column: 1 / -1; }
  #side .card.quest .card-h { margin-bottom: 3px; }
  #side .card.quest .reward { margin: 4px 0 0; }
  #side .card.quest .btn.wide { width: auto; margin-top: 4px; padding: 7px 14px; }
  #topbar { flex-wrap: wrap; padding: 8px 10px; row-gap: 8px; }
  #resbar { order: 3; flex-basis: 100%; }
  #topright { margin-left: auto; }
  #side { border-left: 0; border-top: 1px solid var(--line); flex-direction: row; overflow-x: auto; overflow-y: hidden; align-items: stretch; max-height: 204px; }
  #side .card { min-width: 250px; max-width: 290px; overflow-y: auto; flex: none; }
  .n-lbl { font-size: 10px; }
  .two { grid-template-columns: 1fr; }
  #chat { grid-template-columns: 108px minmax(0, 1fr); }
  .page { padding: 16px 14px 30px; }
}
@media (max-width: 640px) {
  .form { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .brand-text small { display: none; }
  #mapLegend { display: none; }
  .m-hero { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  #cityClouds i, .smoke b, .fire::before, .glow::before, .plate.cta { animation: none; }
  #cityStage { transition: none; }
}

/* ---------- lords: coats of arms, envoys, the court ---------- */
.arms { width: 46px; height: 55px; flex: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.arms.xs { width: 17px; height: 20px; vertical-align: -5px; margin-right: 6px; filter: none; }
.lnk { font-weight: 700; text-align: left; }
.lnk:hover { color: var(--brass2); }
.cl b.who { cursor: pointer; }
.cl b.who:hover { text-decoration: underline; }
.play { display: inline-block; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; vertical-align: -1px; }
.modal-card.m-envoy, .modal-card.m-court { width: min(660px, 100%); }
.lord-h {
  display: flex; gap: 18px; align-items: center; margin: -22px -24px 16px; padding: 18px 56px 16px 24px; border-radius: 15px 15px 0 0; border-bottom: 1px solid var(--line);
  background: radial-gradient(300px 170px at 64px 55%, rgba(255, 220, 140, .16), transparent 70%), linear-gradient(180deg, #2a3450, #1a2030);
}
.lord-h .arms { width: 80px; height: 96px; }
.lord-id { flex: 1; min-width: 0; }
.lord-id h2 { font-size: 25px; color: #fff3cf; }
.lord-id p { margin: 2px 0 7px; color: #cfcaba; }
.lord-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tagc.trait { color: var(--brass2); border-color: rgba(216, 173, 79, .5); cursor: help; }
.regard-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.regard { position: relative; flex: 1; max-width: 230px; height: 7px; border-radius: 4px; background: linear-gradient(90deg, #c4503f, #6f6a58 50%, #4fa873); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
.regard i { position: absolute; top: -4px; width: 5px; height: 15px; margin-left: -2.5px; border-radius: 2px; background: #fff3cf; box-shadow: 0 0 0 1px rgba(0, 0, 0, .65), 0 1px 3px rgba(0, 0, 0, .6); }
.lord-city { flex: none; }
.env-t { display: flex; align-items: center; gap: 8px; font: 600 20px var(--serif); color: var(--brass2); margin: 2px 0 10px; }
.env-t .ico { height: 26px; }
.speech { margin: 0 0 14px; padding: 13px 17px; border-radius: 4px 14px 14px 14px; background: linear-gradient(180deg, #2b2616, #211e14); border: 1px solid #5b4a22; font: italic 15.5px/1.55 var(--serif); color: #efe6cc; }
.speech::before { content: '\201C'; }
.speech::after { content: '\201D'; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 11px; background: linear-gradient(180deg, #2a3348, #222a3b); border: 1px solid var(--line2); box-shadow: 0 2px 0 rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .06); }
.opt:hover { border-color: var(--brass); background: linear-gradient(180deg, #343f5a, #293149); }
.opt:active { transform: translateY(1px); }
.opt > b { font-size: 14.5px; }
.opt > b::before { content: '\203A'; color: var(--brass); margin-right: 8px; font-size: 17px; line-height: 1; }
.opt-d { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding-left: 16px; }
.opt-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 2px 0 6px; }
.opt-l:first-child { margin-left: 0; }
.opt small { color: var(--muted); font-size: 12.5px; padding-left: 16px; }
.opt small.bad { color: var(--bad); }
.opt.off { opacity: .6; }
.opt.off:hover { border-color: var(--line2); background: linear-gradient(180deg, #2a3348, #222a3b); }
.env-you { color: var(--muted); margin: 0 0 8px; }
.env-you b { color: var(--text); }
.env-out { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.env-note { color: #d7d2c2; margin: 4px 0; }
.chip.gain { color: var(--good); border-color: rgba(127, 211, 154, .45); background: rgba(127, 211, 154, .08); }
.m-foot .muted { font-size: 12.5px; }
.m-foot .muted b { color: var(--brass2); font-variant-numeric: tabular-nums; }
.card.envoy { border-color: var(--brass3); background: radial-gradient(240px 110px at 0 0, rgba(216, 173, 79, .18), transparent 70%), linear-gradient(180deg, #2a2413, #1b1c1d); box-shadow: 0 0 0 2px rgba(216, 173, 79, .2), 0 0 20px rgba(216, 173, 79, .14); }
.env-c { display: flex; gap: 11px; align-items: center; margin-bottom: 8px; }
.env-c small { display: block; color: var(--muted); font-size: 11.5px; }
.env-c b { display: block; font: 600 16px/1.2 var(--serif); color: var(--brass2); }
.card.league { border-color: #7d3a32; background: linear-gradient(180deg, #2f1f1c, #1f1716); }
.lg-arms { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end; margin: 9px 0 2px; }
.lg-arms button { border-radius: 6px; padding: 3px; }
.lg-arms button:hover { background: rgba(255, 255, 255, .1); }
.lg-arms .arms { width: 25px; height: 30px; display: block; }
.lg-arms .lead .arms { width: 34px; height: 41px; }
.court-trait { color: #d7d2c2; margin: 0 0 10px; }
.facts-l { display: flex; flex-direction: column; gap: 6px; margin: 0 0 4px; }
.facts-l > div { display: flex; align-items: center; gap: 9px; padding: 7px 11px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; }
.facts-l > div > span { flex: 1; }
.facts-l .ico { height: 20px; }
.facts-l b { color: var(--brass2); font-variant-numeric: tabular-nums; }
.mem-r { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: baseline; padding: 5px 2px; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 13px; }
.mem-r:first-child { border-top: 0; }
.mem-r b { font-variant-numeric: tabular-nums; }
.mem-r small { color: var(--muted); }
.u-ico.court-i { width: 46px; height: 44px; }
.btn .gw { margin-left: 6px; font-weight: 800; color: #1c5c33; }
.q-l .lnk .arms { display: none; }
@media (max-width: 620px) { .lord-city { display: none; } .lord-h .arms { width: 60px; height: 72px; } }
