/* WAR-SLG prototype client. Direction B: faceted low-poly art (assets/), flat interface, system fonts only.
   No permanent animation, no blur: the page is idle when nothing changes. */
:root {
  --bg: #14181a; --panel: #1b2225; --card: #242d31; --line: #3a4747; --text: #e8ebe4; --dim: #a9b3ae;
  --self: #2bb5a0; --ally: #4d8fe0; --enemy: #e2603a; --neutral: #9aa0a0; --gold: #e0b23a;
  --food: #d9b85f; --steel: #8fa3b8; --credits: #a78bfa;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden; overflow-wrap: anywhere; -webkit-text-size-adjust: 100%; touch-action: manipulation;
}
[hidden] { display: none !important; }
h1, h2, .hero-name { font-family: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .04em; }
h1 { margin: 0 0 4px; font-size: 34px; line-height: 1; }
h2 { margin: 4px 0 8px; font-size: 22px; }
h3 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
h4 { margin: 10px 0 4px; font-size: 15px; }
p { margin: 6px 0; }

button {
  min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--line);
  border-bottom-width: 3px; border-bottom-color: #1a2224; background: linear-gradient(160deg, #36444a 0 55%, #2e3a3e 55%); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
/* PRESS-TRANSLATE-1118: the press moves with `translate`, never `transform`: a button centred by its own transform (the raid '!',
   translateX(-50%)) jumped half its width on mouse-down, the release landed on the map and the click was lost (Phil 18/11 17:18) */
button:not(:disabled):active { translate: 0 2px; border-bottom-width: 1px; margin-bottom: 2px; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(160deg, #3fd0b9 0 55%, #2bb5a0 55%); color: #04211c; border-color: transparent; border-bottom-color: #14705f; }
button.primary:disabled { background: linear-gradient(160deg, #3b494c 0 55%, #343f42 55%); color: #93a4a6; border-color: var(--line); border-bottom-color: #1a2224; opacity: .7; }
button.credit { background: linear-gradient(160deg, #47397a 0 55%, #3b2f63 55%); border-color: #7a63d6; border-bottom-color: #2a2148; }
button.danger { border-color: #9a4f38; color: #ffc9b6; }
button.small { padding: 0 10px; font-weight: 500; }
button.on { outline: 2px solid #fff; outline-offset: 1px; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
input, select {
  min-height: 44px; min-width: 0; font: inherit; font-size: 16px; background: #10151a; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
}
input[type=number] { width: 84px; }
input.tag-input { width: 84px; text-transform: uppercase; }

.dim { color: var(--dim); }
.small-text { font-size: 13px; }
.big { font-size: 18px; }
.err-text { color: #ffb39c; min-height: 1.4em; }
.short { color: #ffcf9c; }
.rel-self { color: var(--self); } .rel-ally { color: #8db9f2; } .rel-enemy { color: #ff9d7c; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { text-align: right; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
/* PUBLIC-STRIPE 15/11: the credit bundles sit as an even 2-column grid (3 on a wide screen), price on the right of each */
.store-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.store-row > button { justify-content: flex-start; white-space: nowrap; gap: 5px; padding-left: 10px; padding-right: 10px; }
.store-row > button > :first-child { display: none; }  /* the + glyph: the price says it is a purchase */
.store-row > .has-alliance-gift { flex-wrap: wrap; }
.store-row .alliance-gift { flex-basis: 100%; display: flex; align-items: center; gap: 4px; font-size: .78em; color: var(--gold); }
.store-row .price { margin-left: auto; font-variant-numeric: tabular-nums; }
.card { background: linear-gradient(155deg, #29343a 0 38%, var(--card) 38%); border: 1px solid #2f3b3f; border-radius: 4px; padding: 10px 12px; margin: 8px 0; }
.card.hostile { border-color: var(--enemy); }
.card.objective { border-color: #6f5a1f; }
.cd { font-variant-numeric: tabular-nums; font-weight: 700; }
.lvl { font-weight: 700; background: #10151a; border-radius: 6px; padding: 2px 8px; margin-left: auto; }
.state, .role { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: #10151a; border-radius: 6px; padding: 2px 6px; }
.role.leader { color: var(--gold); } .role.officer { color: #8db9f2; }
.bar { height: 8px; background: #10151a; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--self); }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; background: var(--neutral); }
.swatch.food { background: var(--food); } .swatch.steel { background: var(--steel); }
.swatch.credits { background: var(--credits); border-radius: 50%; } .swatch.objective { background: var(--gold); }
.credit-text { color: #cdbcff; font-weight: 700; }
/* Troop types differ by shape first: block, wedge, tall bar. */
.glyph { width: 16px; height: 16px; background: #d5dbd3; flex: none; }
.glyph.strider { clip-path: polygon(0 100%, 100% 50%, 0 0); }
.glyph.slinger { width: 6px; height: 18px; }
.glyph.seer { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.glyph.carpenter { border-radius: 50%; width: 14px; height: 14px; }
.notice { padding: 8px 12px; border-radius: 8px; margin: 6px 10px; font-size: 14px; }
.notice.warn { background: #45370f; border: 1px solid #b08a2a; color: #ffe9ad; }
.notice.danger { background: #47211a; border: 1px solid var(--enemy); color: #ffd3c6; }
.view > .notice { margin: 8px 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 7px 0; border-bottom: 1px solid #2a3437; font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.legend-item { display: inline-flex; gap: 6px; align-items: center; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
table.grid td, table.grid th { text-align: right; padding: 2px 4px; font-weight: 400; }
table.grid th { color: var(--dim); }
table.grid td:first-child, table.grid th:first-child { text-align: left; }
.part { border-top: 1px solid #323d40; margin-top: 8px; padding-top: 6px; }
button.report { display: block; width: 100%; text-align: left; font-weight: 400; padding: 10px 12px; }
button.report.victory { border-color: #1f7f70; border-bottom-color: #14564c; } button.report.defeat { border-color: #9a4f38; border-bottom-color: #6b3524; }
/* A notice line is a div, not a button: it needs the same red edge (shield ended, rally that did not leave). */
.report.note.defeat { border-color: #9a4f38; border-bottom-color: #6b3524; }
button.report > span { display: flex; } button.report > span.small-text { display: block; margin-top: 2px; }
button.report .dim { margin-left: auto; }
strong.victory { color: var(--self); } strong.defeat { color: #ff9d7c; }
.wounded { border-top: 1px solid #323d40; padding-top: 8px; }
.heal-range { flex: 1 1 90px; min-width: 70px; height: 32px; accent-color: #39b8a6; touch-action: pan-y; }
.heal-live { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pick-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.pick-name { flex: 1 1 auto; min-width: 0; }
.chat-log { height: 200px; overflow-y: auto; background: #10151a; border-radius: 8px; padding: 8px 10px; }
.msg { margin: 3px 0; } .msg.mine strong { color: var(--self); }
.chat-form { display: flex; gap: 8px; margin-top: 8px; } .chat-form input { flex: 1 1 auto; }
.form input[type=text] { flex: 1 1 140px; }

.center-card { max-width: 420px; margin: 0 auto; padding: 10vh 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.center-card.login { padding-top: 0; max-width: 520px; max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
.key-art { margin: 0 -20px 6px; aspect-ratio: 16 / 9; background: #0d1112 url(assets/backdrop-key.webp) center / cover; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
@media (orientation: landscape) and (max-height: 520px) { .key-art { aspect-ratio: 16 / 3.2; } }
.tagline { color: var(--dim); margin: 0; }
.login-btns { margin-top: 10px; } .login-btns button { flex: 1; }
.google-btn { display: flex; justify-content: center; min-height: 44px; margin: 2px 0 2px; }
.google-btn[hidden] { display: none; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; margin-top: 6px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or-sep[hidden] { display: none; }
#login input[type=password] { width: 100%; }
.dev-label { background: #45370f; border: 1px solid #b08a2a; color: #ffe9ad; border-radius: 8px; padding: 8px 12px; }

/* ---- layout of record: phone portrait. top / notices / map (World tab only) / panel / tab bar */
#app {
  height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "top" "notices" "map" "panel" "tabs" "dock";
}
#top { grid-area: top; background: var(--panel); padding: 4px 10px 6px; border-bottom: 1px solid var(--line); padding-top: max(4px, env(safe-area-inset-top)); }
.who { display: flex; align-items: center; gap: 8px; }
.who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.who #logout { margin-left: auto; flex: none; }
.who .dim { white-space: nowrap; font-size: 13px; }
.res-bar { display: flex; gap: 6px; margin-top: 4px; }
/* header chips take the width of what they hold (12/11: three equal thirds cut the food chip, "+888/h" read "+888/l" at
   390 px) and share what is left; a rate is never cut: if the row ever runs short, the stock number is the part that yields */
.chip { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 5px; background: #10151a; border-radius: 4px; padding: 4px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.chip-label { color: var(--dim); font-size: 12px; }
.chip b { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip small { flex: none; }
#chip-food-rate { font-size: 11px; }   /* FOOD-RATE-10PX (18/11): <small> drew it at 10.8 px, Phil's floor is 11 px */
.chip .ico { flex: none; }
#notices { grid-area: notices; }
#panel { grid-area: panel; overflow-y: auto; overflow-x: hidden; padding: 8px 12px 28px; -webkit-overflow-scrolling: touch; }
#map-pane { grid-area: map; position: relative; display: flex; flex-direction: column; background: #101413; overflow: hidden; height: 50vh; height: 50dvh; min-height: 200px; border-bottom: 1px solid var(--line); }
body:not([data-tab="world"]) #map-pane { display: none; }
#map { display: block; width: 100%; flex: 1 1 0; min-height: 0; touch-action: none; cursor: grab; }
/* Phones: the zoom buttons sit in their own strip so they never cover a tile. */
.map-btns { display: flex; gap: 6px; padding: 4px 8px; justify-content: flex-end; background: var(--panel); }
.map-btns button { padding: 0; width: 56px; }
#tabs { grid-area: tabs; display: flex; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabs button {
  flex: 1 1 0; min-width: 0; min-height: 52px; padding: 0 2px; border: 0; border-radius: 0; background: transparent;
  font-size: 12px; font-weight: 500; color: var(--dim); position: relative; border-top: 3px solid transparent;
}
#tabs button[aria-current="page"] { color: #fff; font-weight: 700; border-top-color: var(--self); background: #232c30; }
.badge { position: absolute; top: 1px; right: 2px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: var(--enemy); color: #fff; font-size: 11px; font-weight: 700; padding: 0 4px; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #20282c; border-top: 3px solid var(--gold);
  border-radius: 14px 14px 0 0; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); max-height: 60vh; max-height: 60dvh;
  overflow-y: auto; box-shadow: 0 -8px 30px rgba(0, 0, 0, .55);
}
.sheet-head { justify-content: space-between; flex-wrap: nowrap; }
.sheet-head strong { font-size: 17px; }
.sheet-info > div { margin: 3px 0; }
/* a resource site: what is left / full stands beside its glyph in the title line; the troops sent stand at the right of the action line */
.sheet-head .node-left { font-size: 16px; font-weight: 700; margin-left: 2px; font-variant-numeric: tabular-nums; }
.sheet-est { margin-left: auto; } .sheet-est > p { margin: 0; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); top: 8px; z-index: 50; display: flex; flex-direction: column; gap: 6px; width: min(92vw, 420px); align-items: center; pointer-events: none; }
.toast { background: #1f3040; border: 1px solid var(--ally); padding: 6px 12px; border-radius: 16px; max-width: 100%; font-size: 13px; line-height: 1.25; pointer-events: auto; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.toast.err { background: #47211a; border-color: var(--enemy); }
.toast.warn { background: #45370f; border-color: #b08a2a; color: #ffe9ad; }

/* ---- phone landscape: tab rail on the left, panel and map side by side */
@media (orientation: landscape) and (max-height: 520px) {
  #app {
    grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "tabs top top" "tabs notices notices" "tabs panel map" "tabs dock map";
  }
  body:not([data-tab="world"]):not([data-tab="city"]) #app { grid-template-areas: "tabs top top" "tabs notices notices" "tabs panel panel" "tabs dock dock"; }
  .dock { padding: 3px 8px; } .sq-face { width: 40px; height: 40px; }
  #city-pane { height: auto; min-height: 0; border-bottom: 0; border-left: 1px solid var(--line); }
  #top { display: flex; align-items: center; gap: 10px; padding: 2px 10px; }
  .who { flex: 0 1 auto; min-width: 0; } .who #logout { margin-left: 0; }
  .res-bar { flex: 1 1 auto; margin-top: 0; }
  #tabs { flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding-bottom: 0; padding-left: env(safe-area-inset-left); overflow-y: auto; }
  #tabs button { min-height: 44px; flex: 1 0 44px; border-top: 0; border-left: 3px solid transparent; font-size: 13px; }
  #tabs button[aria-current="page"] { border-left-color: var(--self); }
  #map-pane { height: auto; min-height: 0; border-bottom: 0; border-left: 1px solid var(--line); }
  .sheet { left: 84px; right: auto; top: 0; bottom: 0; width: min(430px, 52vw); max-height: none; border-radius: 0; border-top: 0; border-right: 3px solid var(--gold); }
  .chat-log { height: 130px; }
}

/* ---- desktop: panel on the left, map always visible on the right (same features, more columns) */
@media (min-width: 900px) and (min-height: 521px) {
  #app {
    grid-template-columns: 460px minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    grid-template-areas: "top map" "notices map" "tabs map" "panel map" "dock map";
  }
  body #app #map-pane { display: flex; height: auto; border-bottom: 0; border-left: 1px solid var(--line); }
  body[data-tab="city"] #app #map-pane { display: none; }
  body[data-tab="city"] #app #city-pane { display: flex; height: auto; border-bottom: 0; border-left: 1px solid var(--line); }
  .city-bar { position: absolute; left: 0; top: 0; right: 64px; border-right: 2px solid var(--gold); border-radius: 0 0 8px 0; }
  .map-btns { position: absolute; right: 8px; top: 8px; flex-direction: column; padding: 0; background: none; }
  .map-btns button { width: 44px; background: rgba(27, 34, 37, .92); }
  #tabs { border-top: 0; border-bottom: 1px solid var(--line); }
  #tabs button { border-top: 0; border-bottom: 3px solid transparent; font-size: 13px; min-height: 46px; }
  #tabs button[aria-current="page"] { border-bottom-color: var(--self); }
  .sheet { left: auto; right: 70px; bottom: 16px; width: 400px; max-height: 80vh; border: 2px solid var(--gold); border-radius: 14px; }
}

/* ---- art (assets/ are generated at development time; sizes are fixed so nothing shifts while they load) */
.ico { width: 20px; height: 20px; object-fit: contain; flex: none; }
.face { width: 34px; height: 34px; border-radius: 4px; object-fit: cover; flex: none; border: 1px solid #55666a; background: #10151a; }
.face.big { width: 52px; height: 52px; }
.face.tiny { width: 22px; height: 22px; vertical-align: middle; }
.part-cmd { gap: 3px; margin-right: 6px; }
.with-thumb { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.with-thumb > .thumb { grid-row: 1 / span 6; width: 64px; height: 64px; object-fit: contain; align-self: center; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.with-thumb > .thumb.tall { height: 84px; }
.with-thumb > :not(.thumb) { grid-column: 2; }
.troop.locked > .thumb { filter: grayscale(1) brightness(.6); }
.spire-thumb { width: 26px; height: 40px; object-fit: contain; flex: none; }
.beast-thumb { width: 34px; height: 34px; object-fit: contain; flex: none; vertical-align: middle; }   /* WORLD-BEASTS-1: a wild camp in its sheet */
.hero {
  position: relative; display: grid; --hero-w: clamp(140px, 44%, 230px); grid-template-columns: var(--hero-w) minmax(0, 1fr); gap: 0 12px; min-height: 156px; margin: 4px 0 8px;
  border: 1px solid #3a4747; border-radius: 4px; overflow: hidden;
  background: linear-gradient(90deg, rgba(20, 24, 26, .25), rgba(20, 24, 26, .9) 62%), #1b2225 url(assets/backdrop-city-m.webp) left center / cover;
}
.hero-portrait { width: 116px; height: 100%; min-height: 156px; object-fit: cover; object-position: 50% 12%; display: block; }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 8px 10px 8px 0; min-width: 0; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.hero-name { font-size: 28px; line-height: 1; }
.hero-title { font-size: 13px; color: var(--dim); }
.hero-line { font-size: 13px; margin: 2px 0 6px; }
.cmd-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.cmd-pick p { grid-column: 1 / -1; margin: 0; }
button.cmd-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-height: 66px; text-align: left; font-weight: 400; }
button.cmd-opt span { display: flex; flex-direction: column; min-width: 0; }
#top { background: linear-gradient(170deg, #222b2f 0 50%, var(--panel) 50%); }
#tabs button[aria-current="page"] { background: linear-gradient(170deg, #2a363b 0 50%, #232c30 50%); }

/* the panel enters from the side of the tab you went to; one short pass, then still */
@keyframes enter-r { from { transform: translateX(18px); opacity: 0; } }
@keyframes enter-l { from { transform: translateX(-18px); opacity: 0; } }
.view.enter-r { animation: enter-r .16s ease-out; } .view.enter-l { animation: enter-l .16s ease-out; }
@media (prefers-reduced-motion: reduce) { .view.enter-r, .view.enter-l { animation: none; } button:not(:disabled):active { translate: none; } }

.hero-bonus, .cmd-bonus { color: var(--self); font-weight: 600; }
.hero-bonus { font-size: 13px; margin-bottom: 6px; }
button.cmd-opt:disabled { opacity: .45; }
/* phone portrait: the key art takes the free height, the form sits in the thumb zone */
@media (orientation: portrait) and (max-width: 560px) {
  .center-card.login { height: 100vh; height: 100dvh; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .key-art { flex: 1 1 0; aspect-ratio: auto; min-height: 180px; background-image: url(assets/backdrop-key-m.webp); background-position: 50% 40%; }
}

/* ---- city scene (own city or a read-only visit): same slot as the world map, never both at once */
#city-pane { grid-area: map; position: relative; display: flex; flex-direction: column; background: #101413; overflow: hidden; height: 48vh; height: 48dvh; min-height: 220px; border-bottom: 1px solid var(--line); }
body:not([data-tab="city"]) #city-pane { display: none; }
#city { display: block; width: 100%; flex: 1 1 0; min-height: 0; touch-action: none; cursor: grab; }
.city-bar { flex: none; z-index: 4; background: rgba(27, 34, 37, .94); border-bottom: 2px solid var(--gold); padding: 6px 10px 8px; }
.city-bar .btn-row { margin-top: 6px; }
.city-bar-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
/* edit mode with nothing picked: three glyphs on one row. While a preview is up the two-line layout stays: its height must not change under the finger. */
.city-bar.one-row:not([hidden]) { display: flex; align-items: center; gap: 12px; }
.city-bar.one-row .btn-row { margin-top: 0; margin-left: auto; }
.city-bar.one-row .city-bar-text { flex-direction: row; align-items: center; gap: 12px; }
/* CITY-B step 2: the two turn glyphs beside the building preview (the scene sets left / top to their centre on every draw) */
#city-pane .city-rot { position: absolute; z-index: 4; width: 46px; height: 46px; min-height: 46px; min-width: 46px; padding: 0; margin: 0; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(20, 26, 28, .92); border: 2px solid var(--gold);
  color: #ffe08a; box-shadow: 0 3px 12px rgba(0, 0, 0, .55); touch-action: manipulation; }
#city-pane .city-rot svg { width: 26px; height: 26px; }
#city-pane .city-rot:active { background: #3a3220; }
#city-pane .city-rot[hidden] { display: none; }
/* repair 13/11: on a phone the two turn buttons sit in the bar beside Confirm and Cancel (nothing rides on the small scene) */
#city-pane .city-rot.in-bar { position: static; transform: none; flex: none; }
@media (orientation: portrait) and (max-width: 560px) {
  /* while placing or moving, the scene takes the room of the panel under it: the preview is framed bigger (cityscene aimAtGhost) */
  #city-pane.editing { height: min(66vh, calc(100vw + 150px)); height: min(66dvh, calc(100vw + 150px)); }
}
@media (orientation: landscape) and (max-height: 520px) {
  /* on its side the bar is one row (text left, buttons right) so the scene keeps its height */
  /* (a placement's Confirm carries its price and is wider: then the buttons wrap under the text instead of squeezing it) */
  #city-pane .city-bar:not(.one-row):not([hidden]) { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 8px; }
  #city-pane .city-bar:not(.one-row) .btn-row { margin-top: 0; margin-left: auto; flex: 0 0 auto; flex-wrap: nowrap; }
  #city-pane .city-bar:not(.one-row) .city-bar-text { flex: 1 1 140px; min-width: 140px; }
}
.city-ctx { position: absolute; z-index: 6; width: 166px; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #20282c; border: 2px solid var(--gold); border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .6); }
.ok-text { color: #7fe6d4; } .bad-text { color: #ffb39c; font-weight: 600; }
.city-head h2 { margin: 0; }
.city-head { margin: 2px 0 6px; flex-wrap: nowrap; }
.strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
button.strip-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 62px; min-height: 62px; padding: 4px 2px; font-size: 11px; font-weight: 500; }
.strip-thumb { width: 38px; height: 34px; object-fit: contain; }
.card.built { opacity: .6; }
.card.visit { border-color: var(--gold); }
/* buildings without generated art: a flat block in the building's colour (missing art is listed in A-FAIRE.md) */
.noart { display: block; border-radius: 4px; border: 2px solid #12181a; background: #9aa0a0; position: relative; }
.thumb.noart { width: 56px; height: 48px; margin: 8px 4px; }
.strip-thumb.noart { width: 30px; height: 26px; margin: 4px; }
.noart.lab { background: linear-gradient(160deg, #9c88f0 0 50%, #7a63d6 50%); }
.noart.hospital { background: linear-gradient(#c0392b, #c0392b) center / 26% 70% no-repeat, linear-gradient(#c0392b, #c0392b) center / 70% 26% no-repeat, #d9dedb; }
.noart.alliance_hall { background: linear-gradient(160deg, #6aa5ee 0 50%, #4d8fe0 50%); }

/* ---- Icon vocabulary (js/icons.js). A glyph replaces a label; the words live in aria-label and in the tip bubble. */
.gi { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.stat { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat .ico, .cost .ico { width: 16px; height: 16px; }
.stat .glyph { transform: scale(.75); }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; margin-top: 4px; }
.stats.big-stats { font-size: 15px; gap: 4px 18px; }
.stats.next { color: var(--gold); }
.cost { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-part { display: inline-flex; gap: 3px; align-items: center; }
.bld .stats .cost { flex-wrap: wrap; max-width: 100%; }
.cost.short { color: #ffcf9c; }
p.stat { display: flex; }
button.ib { padding: 0; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.ib.with-text { padding: 0 12px; }
button.ib .gi { width: 20px; height: 20px; }
button.ib .ico { width: 18px; height: 18px; }
button.ib .cost { gap: 6px; }
/* RECALL-SYMBOL-NO-WORD (20/11): a round symbol with ONE word under it (the Recall of a march in the World lists). The word comes
   from data-word, drawn here like the word under a tab glyph (#tabs button::after). The button is the finger target (48 x 50),
   the disc is the picture. */
button.ib.sym-word { flex: none; flex-direction: column; gap: 2px; width: 52px; min-width: 52px; height: 52px; min-height: 52px; padding: 0; margin: 0 0 0 auto;
  background: none; border: 0; box-shadow: none; color: var(--text, #e8ebe4); }
button.ib.sym-word .gi { box-sizing: border-box; width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: #33424a; border: 1.5px solid #6f8791; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
button.ib.sym-word::after { content: attr(data-word); font-size: 11px; line-height: 1.1; font-weight: 600; letter-spacing: .2px; text-shadow: 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, .8); }
button.ib.sym-word:not(:disabled):active { translate: 0 1px; margin-bottom: 0; }
.march-row { display: flex; align-items: center; gap: 8px; }
.march-body { flex: 1 1 auto; min-width: 0; }
ul.plain li:has(> .sym-word) { display: flex; align-items: center; gap: 5px; padding: 2px 0; }
ul.plain li:has(> .sym-word) > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-btns button.ib { min-width: 0; }
#tip { position: fixed; z-index: 1000; max-width: min(280px, 92vw); background: #0b0f12; color: #fff; border: 1px solid var(--gold); border-radius: 4px; padding: 6px 9px; font-size: 13px; line-height: 1.3; pointer-events: none; white-space: normal; }
#tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 10px; letter-spacing: .02em; }
#tabs .tab-ico { width: 26px; height: 26px; }
#tabs button { min-height: 46px; }
#who-power { display: inline-flex; align-items: center; gap: 4px; }
.pick-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* WALL-ICONS-1116: a wall block's actions = separate round symbols over the block, no frame; the price under each as glyphs */
.city-ctx.wall-bub { width: auto; flex-direction: row; align-items: flex-start; gap: 12px; padding: 0; background: none; border: 0; box-shadow: none; }
.wall-bub .wb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wall-bub .wb button { flex: none; width: 46px; min-width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 50%; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.wall-bub .wb button.off { opacity: .78; filter: saturate(.4); }
.wall-bub .wb-price { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; white-space: nowrap; pointer-events: none; }
.wall-bub .wb-lv { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 3px; box-sizing: border-box; border-radius: 9px; background: var(--gold); color: #171a1c; font-size: 11px; line-height: 18px; text-align: center; font-weight: 800; pointer-events: none; }
/* CROP-ICONS-1123: the seeds of a bare field = one picture each (a tap plants it), the last one planted ringed in gold */
.wall-bub .seed-grid { display: grid; grid-template-columns: repeat(var(--cols, 5), 42px); gap: 6px; justify-content: center; }
.wall-bub .wb .seed-grid button { position: relative; width: 42px; min-width: 42px; height: 42px; min-height: 42px; display: flex; align-items: center; justify-content: center; background: #2d3639; border: 1.5px solid #56666c; }
.wall-bub .wb .seed-grid button.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 2px 8px rgba(0, 0, 0, .6); }
.wall-bub .wb .seed-grid button.locked { opacity: .6; filter: grayscale(.75); }
.wall-bub .seed-lock { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: #171a1c; display: flex; align-items: center; justify-content: center; }
.wall-bub .seed-lock .ico { width: 11px; height: 11px; }
.wall-bub .crop-badge { width: 46px; height: 46px; border-radius: 50%; background: #2d3639; border: 1.5px solid #56666c; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.crop-img { display: block; pointer-events: none; }
.city-ctx .btn-row { margin-top: 0; flex-wrap: nowrap; }
.city-ctx .btn-row button { flex: 1 1 0; }
@media (min-width: 900px) and (min-height: 521px), (orientation: landscape) and (max-height: 520px) { #tabs button { font-size: 10px; } }
.stats.none { display: none; }

/* ---- help folded into a glyph, legend marks, small building thumbs, notices away from the header */
.hint { color: var(--dim, #9aa7a3); cursor: help; }
.hint .gi { width: 18px; height: 18px; }
.legend-item { cursor: help; }
.legend-item .gi, .legend-item .ico { width: 16px; height: 16px; }
.swatch.ring { box-shadow: 0 0 0 2px #fff; border-radius: 50%; }
.swatch.tri { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.mini-thumb { width: 24px; height: 22px; object-fit: contain; }
.mini-thumb.noart { width: 18px; height: 16px; margin: 3px; border-width: 1px; }
.unlocks .stat.dim .mini-thumb { filter: grayscale(1) brightness(.7); }
#toasts { top: auto; bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) and (min-height: 521px), (orientation: landscape) and (max-height: 520px) { #toasts { bottom: 16px; } }

/* ---- my shield in the header: dome + time left, a tap opens the Shop */
/* the button is a 44 px touch target; the visible pill inside stays small so the header keeps its height */
.shield-chip, .event-chip { display: inline-flex; align-items: center; flex: none; min-height: 44px; margin: -11px 0; padding: 0 2px; background: none; border: 0; box-shadow: none; }
.shield-chip .pill, .event-chip .pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; font-size: 12px; font-variant-numeric: tabular-nums; border-radius: 999px; white-space: nowrap; }
.shield-chip .pill { color: #bfe9ff; background: #12303d; border: 1px solid #3f8fb0; }
.shield-chip .gi, .event-chip .gi { width: 14px; height: 14px; }
/* ---- themed event: header chip (same shape) + card on the Alliance tab */
.event-chip .pill { color: #f3dc9a; background: #33290f; border: 1px solid #8a6f24; }
.event-chip.ready .pill { color: #1d1603; background: var(--gold); border-color: #fff0b8; }
.card.event { border-color: #6f5a1f; }
.ev-strip { display: flex; gap: 6px; align-items: stretch; }
.ev-day { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--dim); }
.ev-day .gi { width: 18px; height: 18px; }
.ev-day.now { flex: 1; justify-content: flex-start; color: #1d1603; background: var(--gold); border-color: transparent; font-weight: 700; font-variant-numeric: tabular-nums; }
.ev-day.now .cd { margin-left: auto; }
.ev-mine { margin-top: 10px; }
.ev-mine .big { font-size: 20px; font-weight: 700; color: var(--gold); }
.ev-mine .big .gi { width: 20px; height: 20px; }
.ev-bar i { background: var(--gold); }
button.chest { flex: 1 1 0; justify-content: center; min-width: 0; padding-left: 4px; padding-right: 4px; gap: 4px; white-space: nowrap; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
button.chest .gi { flex: none; width: 16px; height: 16px; }
button.chest { font-size: 13px; }
button.chest .chest-gain { font-size: 11px; }
button.chest:disabled[data-state="claimed"] { color: #7fe6d4; }
.chest-gain { display: inline-flex; align-items: center; gap: 1px; margin-left: 2px; font-size: 12px; opacity: .85; white-space: nowrap; }
.chest-gain .ico { width: 13px; height: 13px; }
.ev-prev { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ev-prev button.chest { flex: 0 1 auto; }
.ev-rank { margin-top: 10px; border-top: 1px solid var(--line); }
.ev-row { padding: 5px 0; border-bottom: 1px solid #2b3538; flex-wrap: nowrap; }
.ev-row.mine { color: var(--gold); }
.ev-row .dim { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ev-pos { width: 1.4em; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
/* narrow phone: the chip keeps theme + points; the time left is on the card (with a shield chip beside it the name was crushed) */
@media (max-width: 520px) { .event-chip .cd { display: none; } }

/* commander level and experience */
.hero-level { margin: 2px 0 0; }
.stat.lvl { color: #f2c94c; font-weight: 700; }
.bar.xp { height: 5px; margin: 4px 0 6px; width: 220px; max-width: 100%; flex: none; }
.bar.xp i { background: #f2c94c; }
button:disabled.credit { opacity: .45; }

/* rarity, skills, medals, free draw */
.gem { display: inline-flex; vertical-align: -3px; margin-right: 4px; }
.gem .gi { width: 14px; height: 14px; fill: currentColor; fill-opacity: .35; }
.eyebrow { display: inline-flex; align-items: center; }
.card.skills { padding: 4px 10px; }
.skill { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid #2f3b3f; }
.skill:first-child { border-top: 0; }
.skill.off .skill-fx { color: var(--dim); }
.skill-fx { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-weight: 600; color: var(--self); }
.skill-fx .stats.next { margin: 0; font-weight: 400; gap: 4px; }
.skill-fx .stats.next .gi { width: 12px; height: 12px; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 7px; height: 12px; background: #36444a; transform: skewX(-14deg); }
.pips i.on { background: #f2c94c; }
.skill button.ib { min-height: 44px; gap: 8px; }
.skill { min-height: 52px; }
.stat.medal { font-weight: 700; }
.stat.medal .gi { width: 18px; height: 18px; }
.medal-row, .draw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.draw-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid #2f3b3f; gap: 6px 12px; }
button.ib.xchg { min-width: 44px; min-height: 44px; padding: 0 5px; font-size: 11px; gap: 2px; color: var(--dim); }
.medal-row { gap: 6px 5px; }
button.ib.xchg .gi { width: 12px; height: 12px; }
.stats.odds { margin: 0; gap: 4px 10px; font-size: 12px; }
.stats.odds .gi { width: 12px; height: 12px; fill: currentColor; fill-opacity: .35; }
button.cmd-opt strong { display: flex; align-items: center; }
button.cmd-opt strong .gem { flex-direction: row; margin-right: 4px; }
.report.note .dim { margin-left: auto; }
/* Reports in glyphs: the troop glyph needs a box inside a table cell; the second line of a report keeps its gaps. */
td > .glyph { display: inline-block; vertical-align: middle; }
button.report > span.small-text.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }

.none .stat { opacity: .75; }
h3.sec, h2.sec { display: flex; align-items: center; gap: 6px; }
h3.sec .gi { width: 18px; height: 18px; }
h2.sec .gi { width: 24px; height: 24px; }
.sec-row { align-items: center; gap: 10px; margin: 16px 0 6px; }
.sec-row h3 { margin: 0; }
.state.stat { padding: 2px 5px; }
.sheet-head strong .gi, .sheet-head strong .ico { width: 22px; height: 22px; }
.role.stat { display: inline-flex; align-items: center; }

/* skills of any commander: one face per commander above the skills card */
.skill-tabs { display: flex; gap: 6px; margin: 8px 0 4px; }
button.skill-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; min-width: 48px; min-height: 48px; opacity: .55; background: transparent; }
button.skill-tab.on { opacity: 1; background: #1c262b; box-shadow: inset 0 -3px 0 currentColor; }
button.skill-tab .stat { font-size: 12px; }
.stat.pair { gap: 6px; white-space: nowrap; }

/* commander not recruited yet: face kept, greyed, with a lock */
.cmd-opt.locked, .skill-tab.locked { filter: grayscale(1); opacity: .5; }
.cmd-opt.locked { cursor: default; }
.draw-row .sure { color: var(--gold); }

/* ---- narrow phone header: the alliance tag sits under the name, so the name is not cut by the shield and event chips */
.who strong .nm { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) {
  .who strong { display: flex; flex-direction: column; line-height: 1.15; }
  .who strong .tg { font-size: 11px; font-weight: 600; color: var(--dim); }
  .who { gap: 6px; }
}


/* ---- squads dock + one menu button (bottom right), chat toggle (centre of the left edge) — 11/11 */
.dock { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--panel); border-top: 1px solid var(--line); }
.squads { display: flex; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.squads::-webkit-scrollbar { display: none; }
.sq-face { position: relative; flex: none; width: 50px; height: 50px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%;
  border: 2px solid var(--rar, var(--line)); background: #10151a; overflow: visible; display: inline-flex; align-items: center; justify-content: center;
  -webkit-touch-callout: none; user-select: none; touch-action: manipulation; }
.sq-face.small { width: 40px; height: 40px; }
.sq-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; pointer-events: none; }
.sq-lv { position: absolute; left: -3px; bottom: -3px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: #10151a;
  border: 1px solid var(--gold); color: var(--gold); font-size: 11px; font-weight: 700; text-align: center; padding: 0 3px; }
.sq-out { position: absolute; right: -4px; top: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--self); color: #06110f;
  display: flex; align-items: center; justify-content: center; } .sq-out svg { width: 13px; height: 13px; }
.sq-out.post { background: var(--ally); color: #fff; }
.sq-add { border-style: dashed; border-color: var(--gold); color: var(--gold); background: rgba(224, 178, 58, .08); }
.sq-add svg { width: 24px; height: 24px; }
.sq-add.off { opacity: .45; filter: saturate(.2); border-color: currentColor; }
.sq-lock { color: var(--dim); border-style: dotted; opacity: .7; }
.menu-btn { position: relative; flex: none; width: 56px; height: 50px; min-width: 0; padding: 0; display: none; align-items: center; justify-content: center; gap: 0;
  border-color: var(--self); }
.menu-btn .tab-ico { width: 24px; height: 24px; }
.menu-btn .menu-lines svg { width: 12px; height: 12px; opacity: .7; }
.sq-menu { position: fixed; z-index: 40; min-width: 200px; background: #20282c; border: 1px solid var(--gold); border-radius: 8px; padding: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
.sq-menu.sq-release-menu { min-width: 0; padding: 0; background: transparent; border: 0; box-shadow: none; }
.sq-release { width: 42px; min-width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; background: #20282c; box-shadow: 0 3px 14px rgba(0, 0, 0, .7); }
.sq-menu-head { gap: 8px; margin-bottom: 6px; } .sq-menu-head .face { width: 32px; height: 32px; border-radius: 50%; }
.sq-menu-list { display: flex; flex-direction: column; gap: 4px; }
.sq-item { display: flex; align-items: center; gap: 10px; justify-content: flex-start; min-height: 42px; font-weight: 500; text-align: left; }
.sq-item svg { width: 20px; height: 20px; flex: none; }
.sq-sec { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.sq-sec svg { width: 16px; height: 16px; }
.sq-pick, .sq-choose { display: flex; gap: 6px; flex-wrap: wrap; }
.sq-cand { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; padding: 6px; width: 72px; font-size: 11px; font-weight: 500; }
.sq-cand.small { width: 60px; padding: 4px; }
.sq-cand .face { width: 40px; height: 40px; border-radius: 50%; }
.sq-cand.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.sq-cand.locked { opacity: .45; }
.sq-cand-tag { font-size: 11px; color: var(--gold); } .sq-cand-tag svg { width: 12px; height: 12px; }
.sq-trow { justify-content: space-between; }
#squad-sheet select, #squad-sheet input[type=number] { width: 100%; }
#squad-sheet .pick-row input[type=number] { width: 72px; }
.occupants { gap: 6px; margin: 6px 0; flex-wrap: wrap; }
.talk-btn { position: fixed; z-index: 30; left: 0; top: calc(50% - 28px); transform: none !important; margin: 0 !important; width: 34px; height: 56px; min-width: 0; padding: 0;
  border-radius: 0 10px 10px 0; border-left: 0; padding-left: env(safe-area-inset-left); display: flex; align-items: center; justify-content: center; opacity: .92; }
.talk-btn svg { width: 22px; height: 22px; }
.talk-btn.on { border-color: var(--self); color: var(--self); }
.talk-btn .badge { top: 2px; right: 2px; }
.talk-box { position: fixed; z-index: 29; left: calc(46px + env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); width: min(78vw, 360px);
  height: min(52vh, 440px); height: min(52dvh, 440px); display: flex; flex-direction: column; gap: 6px; background: rgba(27, 34, 37, .97);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
.talk-box[hidden] { display: none; }
.talk-head { justify-content: space-between; flex-wrap: nowrap; }
.talk-tabs { display: flex; gap: 4px; }
.talk-tab { min-width: 44px; padding: 0 8px; } .talk-tab.on { border-color: var(--self); color: var(--self); }
.talk-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; max-height: none; }
.talk-name { display: inline; min-height: 0; min-width: 0; padding: 0; border: 0; background: none; color: var(--ally); font-weight: 700; cursor: pointer; }
.msg.mine .talk-name { color: var(--self); }
.talk-peer { display: flex; align-items: center; gap: 8px; width: 100%; margin: 3px 0; justify-content: flex-start; }
.talk-box .chat-form { display: flex; gap: 6px; } .talk-box .chat-form input { flex: 1 1 auto; min-width: 0; }

/* wide / landscape: the tab bar stays as it is; the dock is the last row under the panel */
#dock { grid-area: dock; min-width: 0; }
/* phone portrait: the six areas fold into the menu button; the bottom row = squads + menu */
@media (orientation: portrait) and (max-width: 560px) {
  #app { grid-template-areas: "top" "notices" "map" "panel" "dock"; }
  #app { grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
  #dock { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .menu-btn { display: inline-flex; }
  #tabs { position: fixed; z-index: 35; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); flex-direction: column; width: 76px;
    border: 1px solid var(--self); border-radius: 12px; padding: 4px 0; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); display: none; }
  body.menu-open #tabs { display: flex; }
  #tabs button { flex: none; min-height: 52px; border-top: 0; border-left: 3px solid transparent; }
  #tabs button[aria-current="page"] { border-left-color: var(--self); }
  .sheet { bottom: 0; z-index: 36; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .talk-btn { left: calc(84px + env(safe-area-inset-left)); } .talk-box { left: calc(130px + env(safe-area-inset-left)); }
}

/* ---- UX pass 11/11 14h: the chat glyph never covers a card or a sheet */
/* the panel keeps a left gutter as wide as the glyph (34 px + air): no button of a card sits under it, on any tab or size */
#panel { padding-left: 42px; }
.talk-box { left: calc(38px + env(safe-area-inset-left)); }
@media (orientation: landscape) and (max-height: 520px) { .talk-box { left: calc(122px + env(safe-area-inset-left)); } }
/* phone: the squad sheet takes the screen; the glyph and the chat step aside until it closes (their state is kept) */
@media (orientation: portrait) and (max-width: 560px), (orientation: landscape) and (max-height: 520px) {
  body:has(#squad-sheet:not([hidden])) .talk-btn, body:has(#squad-sheet:not([hidden])) .talk-box { display: none; }
}
/* landscape phone: the tile sheet is a full-height side panel over the glyph's edge: step aside there too */
@media (orientation: landscape) and (max-height: 520px) {
  body:has(#sheet:not([hidden])) .talk-btn, body:has(#sheet:not([hidden])) .talk-box { display: none; }
}
/* CHAT-OVER-SHEET-1118 (Phil 18/11 08:18, phone, a tile tapped: "why i cant see the chat buttom"): portrait phone, the tile sheet
   is at most 60dvh from the bottom, so the glyph climbs just above that line (never under the sheet, whatever its height) and
   the chat opens above it, its bottom on that same line. */
@media (orientation: portrait) and (max-width: 560px) {
  body:has(#sheet:not([hidden])) .talk-btn { top: calc(40dvh - 66px); }
  body:has(#sheet:not([hidden])) .talk-box { top: calc(40dvh - 8px); transform: translateY(-100%); height: min(calc(40dvh - 70px), 440px); }
}
/* phone portrait: the city is a flat diamond (about half as tall as wide); a pane of half the screen left wide empty bands
   above and below it. The pane now follows the width (whole city still in view, the fit is width/height), the panel gets the rest. */
@media (orientation: portrait) and (max-width: 560px) {
  #city-pane { height: min(48vh, calc(64vw + 62px)); height: min(48dvh, calc(64vw + 62px)); min-height: 220px; }
}

/* ---- UX pass 2, 11/11 14h40 */
/* empty lists: glyph + the sentence on screen (it was in a long-press tip only) */
.none { display: flex; align-items: flex-start; gap: 8px; line-height: 1.35; }
.none .none-text { font-size: 13px; color: var(--dim); max-width: 46ch; }
li.none { list-style: none; }
/* phone: a notice bubble answering a sheet or the open menu sat at the bottom, ON the sheet, for ~3 s. While a sheet or the
   menu is open the bubbles go to the top of the screen (under the header's notch inset), out of the hand's way. */
@media (orientation: portrait) and (max-width: 560px) {
  body:has(#sheet:not([hidden])) #toasts, body:has(#squad-sheet:not([hidden])) #toasts, body.menu-open #toasts {
    top: calc(8px + env(safe-area-inset-top)); bottom: auto; }
}
/* phone landscape: the sheet is the left half of the screen; the bubbles go to the right half while it is open */
@media (orientation: landscape) and (max-height: 520px) {
  body:has(#sheet:not([hidden])) #toasts, body:has(#squad-sheet:not([hidden])) #toasts {
    left: auto; right: calc(12px + env(safe-area-inset-right)); transform: none; width: min(40vw, 360px); }
}
/* Squad sheet: OK / Disband always in reach at the bottom of the phone sheet, the rest scrolls above (11/11 pass 3). */
#squad-sheet > .btn-row:last-child { position: sticky; bottom: calc(-14px - env(safe-area-inset-bottom)); z-index: 1; background: #20282c;
  margin: 6px -14px calc(-14px - env(safe-area-inset-bottom)); padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .08); }

/* pass 4 (11/11): a dim sentence that says in words what a glyph row or a greyed button means */
.why-text { font-size: 12px; line-height: 1.35; color: var(--dim); margin: 6px 0 0; max-width: 60ch; }

/* B1 (11/11): a refusal's unlock as a chip (building thumb + star + level, resource + missing, builder busy), sentence under it in .why-text */
.need-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; }
.need-row > .why-text { margin: 0; flex: 1 1 14ch; }
.need-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 2px 8px 2px 4px; border-radius: 16px; font-size: 13px; font-weight: 600;
  color: #ffcf9c; background: rgba(255, 207, 156, .1); border: 1px solid rgba(255, 207, 156, .45); }
button.need-chip { cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
button.need-chip:hover, button.need-chip:focus-visible { background: rgba(255, 207, 156, .2); }
.need-chip .gi { width: 16px; height: 16px; }
.need-chip .ico { width: 18px; height: 18px; }
.need-thumb { width: 28px; height: 26px; object-fit: contain; }
.need-thumb.noart { width: 22px; height: 18px; margin: 3px; border-width: 1px; }

/* Roads (11/11): a building works only beside a road joined to the Command Post */
.warn-text { color: #ffc24a; }
.city-bar .road-off { display: flex; align-items: center; gap: 6px; white-space: normal; min-width: 0; }
.city-bar .road-off.off { visibility: hidden; }
.city-bar .road-off .why-text { margin: 0; font-size: 12px; color: #ffd98a; white-space: normal; min-width: 0; flex: 1 1 auto; }
.off-road { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 8px; border-radius: 8px;
  background: rgba(226, 96, 58, .12); border: 1px solid rgba(255, 138, 102, .4); }
.off-road > .stat .gi { width: 20px; height: 20px; }
.off-road .need-row { margin-top: 0; flex: 1 1 auto; }
.need-chip.road { padding: 2px 10px; }

/* ---- commander crates (11/11): header chip, crate cards, odds sheet, pity bar, reveal */
.gift-chip { display: inline-flex; align-items: center; flex: none; min-height: 44px; margin: -11px 0; padding: 0 2px; background: none; border: 0; box-shadow: none; }
.gift-chip .pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; font-size: 12px; font-weight: 700; border-radius: 999px; color: #1d1603; background: var(--gold); border: 1px solid #fff0b8; }
.gift-chip .gi { width: 14px; height: 14px; }
.gift-chip .pill.full { box-shadow: 0 0 0 2px rgba(232, 162, 58, .45), 0 0 12px rgba(232, 162, 58, .7); }
.crates { margin-top: 4px; }
.card.gift.ready { border-color: var(--gold); background: linear-gradient(155deg, #3a3217 0 38%, #2a2716 38%); }
.gift-head { color: var(--gold); }
.gift-head .gi { width: 20px; height: 20px; }
.gift-next { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 4px 0 8px; color: var(--dim); font-size: 13px; }
.gift-next .why-text { margin: 0; flex: 1 1 100%; }
.gift-soon { padding: 3px 8px; border: 1px dashed var(--line); border-radius: 999px; }
/* state of a crate / box card = corner brackets (four L corners, straight), never a coloured side stripe:
   bright in the crate's colour when some are in stock, dim when none */
.card.crate { --bk: var(--crate); border-radius: 0; background-color: var(--card);
  background-image: linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(155deg, #29343a 0 38%, var(--card) 38%);
  background-repeat: no-repeat;
  background-size: 16px 2px, 2px 16px, 16px 2px, 2px 16px, 16px 2px, 2px 16px, 16px 2px, 2px 16px, 100% 100%;
  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%, 0 0; }
.card.crate[data-n="0"] { --bk: #46565a; }
.box-cards { font-size: 12px; color: var(--dim); }
.box-cards .gi { width: 12px; height: 12px; }
button.ib.qmark { font-size: 18px; font-weight: 800; color: var(--gold); }
.box-face { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.box-face .odds-face .face { width: 34px; height: 34px; border-radius: 4px; }
.box-face .odds-face:not(.owned) .face { filter: saturate(.85); }
.box-face.medals { gap: 14px; }
/* featured pack (12/11): the big art of its commanders side by side, cropped on the face; frame = rarity colour (all four
   sides, straight corners); a tapped commander takes the room, the others give it (the width says who is read) */
.pack-face { --h: 168px; display: flex; gap: 4px; height: var(--h); margin: 8px 0 2px; }
.pack-hero { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; height: 100%; padding: 0; overflow: hidden; border-radius: 0; background: #10151a;
  border: 2px solid #0b0f11; box-shadow: none; transition: flex-grow .28s cubic-bezier(.2, .7, .2, 1); }
/* the bust: --z times the frame height (wider when the frame is wider than that, so it always covers), moved so its face
   (--fx, --fy) sits at the middle / 40 % of the frame, clamped so no edge of the picture ever shows (cq units = the frame) */
.pack-hero { container-type: size; isolation: isolate; }
.pack-hero .pack-art { position: absolute; left: 0; top: 0; width: max(calc(var(--z, 1.5) * 75cqh), 100cqw); height: auto; aspect-ratio: 3 / 4; max-width: none;
  transform: translate(clamp(calc(100cqw - 100%), calc(50cqw - var(--fx, .5) * 100%), 0px), clamp(calc(100cqh - 100%), calc(40cqh - var(--fy, .24) * 100%), 0px));
  transition: filter .28s; }
.pack-hero.on { flex-grow: 2.4; }
.pack-face:not([data-on=""]) .pack-hero:not(.on) .pack-art { filter: saturate(.55) brightness(.75); }
.pack-plate { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 14px 3px 4px;
  background: linear-gradient(180deg, rgba(10, 14, 16, 0), rgba(10, 14, 16, .92) 55%); color: #fff; font-size: 11px; font-weight: 700; line-height: 1.1; }
.pack-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-own { position: absolute; top: 4px; right: 4px; display: inline-flex; padding: 2px; background: #14181a; border: 1px solid var(--self); color: var(--self); }
.pack-own .gi { width: 13px; height: 13px; }
.pack-say { margin: 4px 0 0; min-height: 2.6em; }
@media (min-width: 900px) { .pack-face { --h: 200px; } .pack-plate { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .pack-hero, .pack-hero .pack-art { transition: none; } }
.box-medal { display: inline-flex; align-items: center; gap: 3px; color: var(--r); font-weight: 700; font-variant-numeric: tabular-nums; }
.box-medal .gi { width: 30px; height: 30px; }
.odds-each { display: block; font-size: 11px; font-variant-numeric: tabular-nums; }
.rv-pager { display: flex; align-items: center; justify-content: center; gap: 14px; }
.rv-page-n { min-width: 4.5em; text-align: center; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); }
.reveal.paged .rv-grid { flex: 0 0 auto; overflow: visible; }
.rv-grid.fwd { animation: rv-in-fwd .22s ease-out 1; } .rv-grid.back { animation: rv-in-back .22s ease-out 1; }
@keyframes rv-in-fwd { from { transform: translateX(28px); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes rv-in-back { from { transform: translateX(-28px); opacity: .2; } to { transform: none; opacity: 1; } }
.rv-sum { display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 1px solid var(--line); background: #1a2124; overflow-y: auto; min-height: 0; }
.rv-sum[hidden], .rv-grid[hidden], .rv-card[hidden] { display: none; }
.rv-sum-new { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-sum-face { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 62px; min-width: 0; min-height: 0; height: auto; padding: 0; border: 0; background: none; box-shadow: none; color: inherit; }
.rv-sum-face .face { width: 52px; height: 52px; border-radius: 4px; border: 2px solid var(--r); }
.rv-sum-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px solid #2b3538; color: var(--r); font-variant-numeric: tabular-nums; }
.rv-sum-row:last-child { border-bottom: 0; }
.rv-sum-name { flex: 1; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .rv-grid.fwd, .rv-grid.back { animation: none; } }
.crate-head { flex-wrap: nowrap; align-items: center; }
.crate-head .grow { min-width: 0; }
.crate-head strong { display: block; }
.crate .odds { gap: 2px 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.crate .odds .gi { width: 12px; height: 12px; }
.crate-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.crate-art { position: relative; flex: none; width: 46px; height: 40px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(170deg, color-mix(in srgb, var(--crate) 70%, #fff 0%) 0 48%, color-mix(in srgb, var(--crate) 60%, #000) 48%);
  border: 2px solid color-mix(in srgb, var(--crate) 50%, #000); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25); }
.crate-art .lid { position: absolute; left: -3px; right: -3px; top: -3px; height: 11px; border-radius: 4px; background: color-mix(in srgb, var(--crate) 80%, #fff); border: 2px solid color-mix(in srgb, var(--crate) 50%, #000); }
.crate-art .band { position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: rgba(0, 0, 0, .28); }
.crate-art .gi { position: relative; width: 18px; height: 18px; color: #fff; opacity: .9; }
.crate-art.mini { width: 26px; height: 22px; border-width: 1px; }
.crate-art.mini .lid { height: 7px; border-width: 1px; }
.crate-art.mini .gi { width: 12px; height: 12px; }
.crate .btn-row .chest-gain { margin-left: 4px; }
.odds-sheet { margin: 8px 0 2px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #1c2427; }
.odds-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid #2b3538; }
.odds-row:last-of-type { border-bottom: 0; }
.odds-name { width: 6.5em; flex: none; font-size: 12px; color: var(--dim); }
.odds-pct { width: 5.2em; flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }
.odds-pool { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.odds-face { position: relative; display: inline-flex; }
.odds-face .face { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--r); }
.odds-face .gi { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; background: #14181a; border-radius: 50%; color: var(--self); }
/* the pity bar: a fill out of 24, three marks; full = glow + a pulse that ENDS (8 beats), then a still glow (ECO) */
.pity-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pity-row .why-text { flex: 1 1 100%; margin: 0; }
button.pity { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; background: #1a2124; border: 1px solid var(--line); border-bottom-width: 3px; }
button.pity .pity-ico { width: 20px; height: 20px; color: var(--leg, var(--gold)); flex: none; }
.pity-track { position: relative; flex: 1; height: 12px; border-radius: 6px; background: #0f1416; border: 1px solid #33403f; overflow: hidden; }
.pity-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, #6a4c1a, var(--leg, var(--gold))); transition: width .35s ease-out; }
.pity-track b { position: absolute; top: 2px; bottom: 2px; width: 1px; background: rgba(255, 255, 255, .18); }
.pity-n { flex: none; min-width: 3.4em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--leg, var(--gold)); }
.pity-kept { flex: none; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--leg, var(--gold)); }
.pity-kept[hidden] { display: none; }
button.pity.full .pity-kept { color: #2a1a00; }
.pity-epic { font-size: 12px; font-variant-numeric: tabular-nums; }
.pity-epic .gi { width: 12px; height: 12px; }
button.pity.full { color: #1d1603; border-color: #fff0b8; background: linear-gradient(100deg, #f6d27a, var(--leg, var(--gold)) 45%, #ff9f43 70%, #f6d27a);
  box-shadow: 0 0 0 2px rgba(255, 220, 140, .55), 0 0 22px rgba(232, 162, 58, .75); animation: pity-pulse 1.1s ease-in-out 8; }
button.pity.full .pity-ico, button.pity.full .pity-n { color: #2a1a00; }
button.pity.full .pity-track { background: rgba(60, 35, 0, .35); border-color: rgba(60, 35, 0, .45); }
button.pity.full .pity-track i { background: linear-gradient(90deg, #fff6d6, #fff); }
@keyframes pity-pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 230, 160, .85), 0 0 34px rgba(255, 170, 60, .95); transform: scale(1.015); } }
button.pity.still, button.pity.full.still { animation: none; }
.card.crates-pity.profile { margin-top: 10px; }
/* reveal: the cards turn one by one; a rarity burst behind each, legendary gold glow; nothing loops */
.reveal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 40%, rgba(34, 45, 50, .97), rgba(6, 9, 10, .98)); }
.rv-box { width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 8px; }
.rv-head { display: flex; align-items: center; gap: 8px; }
.rv-head strong { font-size: 18px; color: var(--gold); }
.rv-head strong .gi { width: 22px; height: 22px; }
.rv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; overflow-y: auto; padding: 14px; margin: 0 -14px; perspective: 900px; }
.reveal.many .rv-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
/* rows as tall as their cards: a squeezed grid (short screen) scrolls instead of laying the cards over each other */
.rv-grid { grid-auto-rows: max-content; flex: 1 1 auto; min-height: 0; align-content: start; }
/* phone landscape / short screens: one row of six, cards sized to fit the height */
@media (max-height: 560px) and (orientation: landscape) {
  .rv-box { width: min(820px, 100%); gap: 4px; }
  .rv-grid { grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 10px; margin: 0 -10px; }
  .reveal.many .rv-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
}
.rv-card { position: relative; min-height: 0; min-width: 0; height: auto; aspect-ratio: 3 / 4; padding: 0; border: 0; background: none; box-shadow: none; }
.rv-card:not(:disabled):active { translate: none; margin: 0; }
.rv-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.rv-card.open .rv-inner { transform: rotateY(180deg); }
.rv-back, .rv-face { position: absolute; inset: 0; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.rv-back { background: repeating-linear-gradient(45deg, #2a3438 0 8px, #222b2f 8px 16px); border: 2px solid #4b5a5c; }
/* WebKit (Safari, iPhone) can paint a back face through backface-visibility (seen 11/11: results shown mirrored before
   the turn, the sure legendary visible from the first frame). The faces are therefore ALSO switched by visibility when
   the card passes 90 degrees: with the flip curve below that is at 12.5 % of .5 s = 62 ms. Works in every engine. */
.rv-face { visibility: hidden; transition: visibility 0s linear 62ms; }
.rv-card.open .rv-face { visibility: visible; }
.rv-back { transition: visibility 0s linear 62ms; }
.rv-card.open .rv-back { visibility: hidden; }
.rv-back .gi { width: 34%; height: 34%; color: #8fa3a3; }
.rv-face { transform: rotateY(180deg); background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--r) 45%, #1b2225), #161c1e 72%); border: 2px solid var(--r); }
.rv-face::before { content: ''; position: absolute; inset: -40%; background: radial-gradient(circle, var(--r), transparent 55%); opacity: 0; transform: scale(.2); }
.rv-card.open .rv-face::before { animation: rv-burst .9s ease-out 1 .25s; }
@keyframes rv-burst { 0% { opacity: .9; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.4); } }
.rv-gem { position: absolute; top: 5px; left: 6px; }
.rv-gem .gi { width: 14px; height: 14px; }
.rv-pic { position: relative; width: 62%; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--r); object-fit: cover; }
.rv-pic.small { width: 34%; opacity: .75; }
.rv-name { position: relative; font-size: 12px; font-weight: 700; color: #fff; text-align: center; padding: 0 3px; }
.rv-new { position: absolute; top: 4px; right: 5px; display: inline-flex; color: var(--self); }
.rv-new .gi { width: 13px; height: 13px; }
.rv-medal { position: relative; display: inline-flex; align-items: center; gap: 2px; font-size: 16px; font-weight: 700; }
.rv-medal .gi { width: 30px; height: 30px; }
.reveal.many .rv-medal { font-size: 12px; } .reveal.many .rv-medal .gi { width: 18px; height: 18px; } .reveal.many .rv-name { display: none; }
.rv-card.r-legendary.open .rv-face { box-shadow: 0 0 0 2px #fff0b8, 0 0 26px 6px rgba(232, 162, 58, .85); }
.rv-card.r-legendary.open { z-index: 1; animation: rv-gold 1.2s ease-out 1 .2s; }
@keyframes rv-gold { 30% { transform: scale(1.08); } 100% { transform: scale(1); } }
.rv-card.r-epic.open .rv-face { box-shadow: 0 0 14px 2px color-mix(in srgb, var(--r) 70%, transparent); }
.reveal.pack .rv-card.sure .rv-back { border-color: var(--gold); background: repeating-linear-gradient(45deg, #4a3a14 0 8px, #3a2e10 8px 16px); }
.rv-pity { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: #1a2124; }
.rv-pity .gi { width: 18px; height: 18px; color: var(--gold); }
.rv-pity.full { border-color: var(--gold); box-shadow: 0 0 14px rgba(232, 162, 58, .6); }
@media (prefers-reduced-motion: reduce) {
  .rv-inner, .pity-track i, .rv-back, .rv-face { transition: none; }
  .rv-card.open .rv-face::before, .rv-card.r-legendary.open, button.pity.full { animation: none; }
}
.reveal.quick .rv-inner { transition-duration: .01s; }
.reveal.quick .rv-back, .reveal.quick .rv-face { transition-delay: 0s; }

/* ---- player menu on the profile + ONE city/world switch at the top right (owner 11/11 19:45) */
.who-btn { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; min-height: 44px; padding: 2px 10px 2px 2px; background: none; border: 1px solid transparent; text-align: left; box-shadow: none; }
.who-btn[aria-expanded="true"] { border-color: var(--self); background: #232c30; }
.who-btn > .badge { position: absolute; left: 24px; right: auto; top: -3px; }   /* right: auto: with the .badge's own right: 2px it was stretched over the whole name (seen 12/11 on the pin captures) */
.shop-btn { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-color: var(--self); font-weight: 700; }
.shop-btn .tab-ico { width: 22px; height: 22px; }
.pmenu { position: fixed; z-index: 37; left: 8px; top: var(--menu-top, 90px); width: min(340px, calc(100vw - 16px)); max-height: calc(100vh - var(--menu-top, 90px) - 12px); overflow: auto;
  background: var(--panel); border: 1px solid var(--self); border-radius: 12px; padding: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); animation: pm-in .16s ease-out; transform-origin: 24px 0; }
@keyframes pm-in { from { opacity: 0; transform: scale(.94) translateY(-6px); } }
.pm-id { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.pm-sub { font-size: 13px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pm-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.pm-row { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; min-width: 0; padding: 6px 4px; font-size: 12px; }
.pm-row svg { width: 22px; height: 22px; }
.pm-row .badge { position: absolute; right: 4px; top: 4px; }
.pm-out { flex-direction: row; gap: 8px; width: 100%; margin-top: 8px; min-height: 44px; }
/* the word under a tab glyph is drawn from its label where the tabs are a menu (phone portrait) or a side column (phone landscape) */
@media (orientation: portrait) and (max-width: 560px), (orientation: landscape) and (max-height: 520px) { #tabs button::after { content: attr(aria-label); font-size: 11px; line-height: 1.1; } }
@media (orientation: portrait) and (max-width: 560px) {
  /* the areas open as one row under the header, the player's tools right below: one tap, no scrolling */
  #tabs { left: 8px; right: 8px; top: var(--menu-top, 90px); bottom: auto; width: auto; flex-direction: row; padding: 0; overflow: hidden; z-index: 38; }
  #tabs button { flex: 1 1 0; min-width: 0; border-left: 0; border-bottom: 3px solid transparent; }
  #tabs button[aria-current="page"] { border-left-color: transparent; border-bottom-color: var(--self); }
  .pmenu { top: calc(var(--menu-top, 90px) + 62px); width: auto; right: 8px; max-height: calc(100vh - var(--menu-top, 90px) - 74px); }
  .pm-row[data-testid="pm-troops"], .pm-row[data-testid="pm-alliance"], .pm-row[data-testid="pm-reports"], .pm-row[data-testid="pm-shop"] { display: none; }
  .shop-btn { padding: 0 9px; } .who-btn { padding-right: 4px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .pmenu { animation: none; } }
/* home pane fits the panel: commander = one line, tap = its own pane; tighter cards on short screens */
.hero-line { display: flex; align-items: center; gap: 10px; cursor: pointer; border-color: var(--gold); }
.hero-line > svg { width: 20px; height: 20px; flex: none; opacity: .8; }
.hero-line:active { transform: translateY(1px); }
@media (max-height: 760px) {
  #panel .card { padding-top: 7px; padding-bottom: 7px; margin-bottom: 6px; }
  #panel .city-head { margin-bottom: 2px; }
}
@media (orientation: portrait) and (max-width: 560px) {
  /* zoom buttons ride on the scene instead of taking a row: the row's height goes to the panel */
  #city-pane .map-btns, #map-pane .map-btns { position: absolute; right: 6px; bottom: 6px; padding: 0; background: none; z-index: 2; }
  #city-pane .map-btns button, #map-pane .map-btns button { width: 44px; min-height: 44px; background: rgba(27, 34, 37, .9); }
  #city-pane { height: min(42vh, calc(64vw + 16px)); height: min(42dvh, calc(64vw + 16px)); min-height: 200px; }
  #panel { padding-bottom: 8px; }
  #panel .card { padding-top: 7px; padding-bottom: 7px; margin-bottom: 6px; }
}
/* phone on its side (CITY-A finish 13/11): the city pane takes the full height of its grid column (the base 48dvh above
   came after the landscape block and won, leaving a 220 px strip), and the zoom buttons ride on the scene instead of a row under it */
@media (orientation: landscape) and (max-height: 520px) {
  #city-pane { height: auto; min-height: 0; }
  #city-pane .map-btns { position: absolute; right: 6px; bottom: 6px; padding: 0; background: none; z-index: 2; flex-direction: column; }
  #city-pane .map-btns button { width: 44px; min-height: 44px; background: rgba(27, 34, 37, .9); }
}
@media (orientation: portrait) and (max-width: 560px) { #panel { padding-top: 4px; } #panel [data-testid="queue-build-idle"] { margin: 0 0 4px; } #panel .city-head { margin-bottom: 0; } }
/* ---- world finder (owner 11/11): name / TAG / x:y + one-tap filters, results nearest first */
.finder { margin-bottom: 6px; }
/* BEAST-FINDER-REDS 24/11: with the sixth filter (river rocks, 22/11) the field was 48 px wide on a phone, typed letters unseen.
   Two whole lines: the field, then the six filters in equal shares (44 px at least each) */
.find-row-top { gap: 6px; align-items: center; flex-wrap: wrap; }
@media (max-width: 430px) { .find-row-top { gap: 6px 4px; } }
/* FIND-FIELD-CUT (21/11): the field sits in .find-wrap with a magnifier; the placeholder is one word (the full hint is its title) */
.find-wrap { flex: 1 0 100%; min-width: 0; position: relative; display: flex; }
.find-wrap .find-gi { position: absolute; left: 9px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); opacity: .7; pointer-events: none; }
.find-in { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 44px; padding: 0 8px 0 32px; -webkit-appearance: none; appearance: none; background: #10151a; color: var(--text); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.find-in:focus { outline: none; border-color: var(--self); }
.find-row-top .find-f { flex: 1 1 0; min-width: 44px; min-height: 44px; padding: 0; }
.find-hit { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.find-hit:active { background: #232c30; }
.find-hit .dim { font-size: 13px; white-space: nowrap; }
.find-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pm-row .badge, .who-btn > .badge { font-size: 11px; }
/* wide screens keep the glyph-only tab row (name in the tip); the word shows where the tabs are a menu or a side column */

/* R1 12/11 - the roster: 16 commanders, one row per rarity (highest first), each face framed in its rarity colour */
.skill-tabs.roster { display: grid; grid-template-columns: repeat(auto-fit, minmax(292px, 1fr)); gap: 4px 12px; }
.roster-row { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; position: relative; padding-left: 40px; }
.roster-row > .roster-tag { position: absolute; left: 0; top: 0; height: 52px; }
.roster-row button.skill-tab { position: relative; flex: 0 0 calc((100% - 24px) / 5) !important; max-width: calc((100% - 24px) / 5) !important; }
/* 13/11 23:50: 76 commanders (every UNBREAKABLE AGE character): a rarity row of 29 wraps instead of running off the screen */
.roster-tag { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 34px; flex: none; font-size: 11px; font-weight: 700; line-height: 1.1; }
.roster-tag svg { width: 16px; height: 16px; }
.roster-row button.skill-tab { flex: 1 1 0; max-width: 72px; min-width: 48px; padding: 3px 4px; opacity: 1; }
.roster-row button.skill-tab .face { width: 40px; height: 40px; border: 2px solid var(--r); }
.roster-row button.skill-tab.on { box-shadow: inset 0 -3px 0 var(--r); }
.roster-row button.skill-tab.locked { opacity: .5; }
.roster-row button.skill-tab.locked .face { border-style: dashed; }
/* the leader picker: same grouping, compact tiles (face, name, level or lock, main bonus) */
.cmd-pick { grid-template-columns: minmax(0, 1fr); gap: 6px; }
/* 13/11 23:50, 76 commanders: --n is capped at 5 in city.js, a big rarity WRAPS onto more rows (the picker scrolls) */
/* --n = the rarity's count, 4 at least (13/11: 5 legendaries with Torstein wrapped Magni onto a 5th row and pushed the commons
   under the dock at 390 px): one row per rarity, the picker stays one screen */
.cmd-group { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; }
.cmd-group.wide { gap: 4px; }
.cmd-group.wide button.cmd-opt { padding: 0; }
.cmd-group.wide button.cmd-opt .stats { gap: 0 2px; flex-wrap: wrap; }
.cmd-group.wide button.cmd-opt .stat { gap: 0; }
button.cmd-opt { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 0; min-height: 0; text-align: center; border-width: 2px; }
button.cmd-opt span { align-items: center; }
button.cmd-opt strong { font-size: 12px; }
button.cmd-opt .stats { flex-direction: row; gap: 6px; font-size: 11px; flex-wrap: wrap; justify-content: center; }
.sq-cand .face { border: 2px solid var(--r, #55666a); }
.roster-face { position: relative; display: block; line-height: 0; }
.roster-face .stat.lvl { position: absolute; right: -6px; bottom: -3px; padding: 0 3px; border-radius: 3px; background: #10151a; font-size: 11px; white-space: nowrap; line-height: 15px; gap: 1px; }
.roster-face .stat.lvl svg { width: 11px; height: 11px; }
.roster-name { font-size: 11px; font-weight: 600; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-row button.skill-tab { max-width: none; gap: 3px; }
.roster-row button.skill-tab.on { background: #1c262b; }
button.cmd-opt .stats, button.cmd-opt .stat { flex-direction: row; align-items: center; }

.cmd-pick { scroll-margin-top: 4px; }
button.cmd-opt { overflow: hidden; }
button.cmd-opt .stats { flex-wrap: nowrap; gap: 4px; font-size: 11px; }
button.cmd-opt .stat { padding: 0; background: none; gap: 1px; white-space: nowrap; }
button.cmd-opt .stat svg { width: 11px; height: 11px; }
button.cmd-opt strong { line-height: 1.2; }
/* 13/11: with a 5th rarity row (the 7 Viral influencers) the picker did not fit the phone panel (8 commons and rares under the dock at
   390 px): five rows, one line of figures each, smaller faces */
@media (max-width: 560px) {
  .cmd-pick:has(> .cmd-group:nth-of-type(5)) button.cmd-opt strong { font-size: 11px; }
  .cmd-pick:has(> .cmd-group:nth-of-type(5)) .cmd-group.wide button.cmd-opt strong { font-size: 10px; letter-spacing: -.02em; }
  .cmd-pick:has(> .cmd-group:nth-of-type(5)) button.cmd-opt .stats { flex-wrap: nowrap; font-size: 10px; gap: 0 2px; }
  .cmd-pick:has(> .cmd-group:nth-of-type(5)) .cmd-group.wide button.cmd-opt .stats { flex-wrap: wrap; font-size: 10px; gap: 0 2px; }
  .cmd-pick:has(> .cmd-group:nth-of-type(5)) .cmd-group.wide button.cmd-opt { position: relative; }
  .cmd-pick:has(> .cmd-group:nth-of-type(5)) .cmd-group.wide button.cmd-opt [data-testid^="cmd-locked-"] { position: absolute; top: 2px; right: 2px; }   /* the lock rides on the corner: no second line */
  .cmd-pick:has(> .cmd-group:nth-of-type(5)) .cmd-group.wide button.cmd-opt strong { white-space: nowrap; }
  .cmd-pick:has(> .cmd-group:nth-of-type(5)) .cmd-group { gap: 4px; }
  .cmd-pick:has(> .cmd-group:nth-of-type(5)) { gap: 4px; }
}
.sq-pick .sq-cand { width: calc((100% - 30px) / 6); min-width: 48px; padding: 4px 2px; overflow: hidden; }
.sq-pick .sq-cand .face { width: 36px; height: 36px; }
.sq-pick .sq-cand-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-pick { gap: 4px; }
.sq-pick .sq-cand { width: calc((100% - 24px) / 7); min-width: 44px; font-size: 11px; }

/* ==== Shop = buy only (12/11 10:15): STAGE with the big art of the selected banner + RAIL of banners + buy bar.
   Nothing opens here. The crate part is exactly one screen of the panel (--ph, set by crates.js). ==== */
#view-shop { margin: -8px -12px 0 -42px; }
.shop-rest { padding: 0 12px 0 42px; }
.shop-crates { margin: 0; display: flex; flex-direction: column; height: var(--ph, 80vh); min-height: 430px; background: #0f1416; }
.stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 8%, color-mix(in srgb, var(--crate) 34%, #141a1d) 0, #12181b 58%, #0b0f11 100%); }
.stage::before { content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 46px); }
/* the bar is a HEADER (--bar high), the art starts under it: title + dots, the two steps, the stock. No step on a face (12/11) */
.stage { --bar: 52px; }
.stage-body { position: absolute; inset: var(--bar) 0 0; }
.stage-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; height: var(--bar); display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: linear-gradient(180deg, rgba(8, 11, 12, .94), rgba(8, 11, 12, .78)); border-bottom: 1px solid rgba(224, 178, 58, .22); }
.stage-head { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.stage-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 17px; line-height: 1.1; color: #fff; text-shadow: 0 1px 0 #000; white-space: nowrap; }
.stage-title-t { min-width: 0; }
.stage-title .box-cards { font-size: 12px; color: #d6dcd8; }
button.inv-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 0; font-size: 12px; font-weight: 700;
  background: rgba(16, 20, 22, .88); border: 1px solid var(--line); color: var(--text); box-shadow: none; }
button.inv-chip:disabled { opacity: 1; color: var(--dim); }
button.inv-chip.has { border-color: var(--gold); color: #ffe9ae;
  background-image: linear-gradient(var(--gold), var(--gold)), linear-gradient(var(--gold), var(--gold)), linear-gradient(var(--gold), var(--gold)), linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat; background-size: 10px 3px, 3px 10px, 10px 3px, 3px 10px; background-position: 0 0, 0 0, 100% 100%, 100% 100%; }
button.inv-chip .gi { width: 14px; height: 14px; }
.inv-chip.new { animation: chip-lock .6s cubic-bezier(.2, 1.5, .4, 1) 1; }
@keyframes chip-lock { from { transform: translateY(26px) scale(1.18); box-shadow: 0 0 0 3px rgba(224, 178, 58, .7), 0 0 26px rgba(224, 178, 58, .9); } to { transform: none; box-shadow: none; } }
/* SHOP-CATEGORIES-1119: the category bar of the stage header. Symbols only (the words live in the tips), one row that slides
   sideways and snaps on a symbol; the edges fade when there is more to slide. Selected = the corner brackets of the selected banner. */
.shop-cats { flex: 0 1 auto; min-width: 88px; max-width: min(60%, 340px); display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain; scrollbar-width: none; touch-action: pan-x; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%); }
.shop-cats::-webkit-scrollbar { display: none; }
.shop-cats.drag { cursor: grabbing; scroll-snap-type: none; }
button.cat-b { position: relative; flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; scroll-snap-align: center; border-radius: 0;
  color: rgba(255, 255, 255, .62); background: transparent; border: 0; box-shadow: none; transition: color .2s, transform .2s; }
button.cat-b .gi { width: 22px; height: 22px; }
button.cat-b:hover { color: #fff; }
button.cat-b.on { color: var(--gold); outline: none; }
button.cat-b:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
button.cat-b.on::after { content: ""; position: absolute; inset: 3px; pointer-events: none; --bk: var(--gold);
  background-image: linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk));
  background-repeat: no-repeat; background-size: 9px 2px, 2px 9px, 9px 2px, 2px 9px, 9px 2px, 2px 9px, 9px 2px, 2px 9px;
  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%; animation: rail-lock .3s ease-out 1; }
button.cat-b.go { color: #9fd3ff; }
button.cat-b:not(:disabled):active { transform: scale(.88); margin: 0; }
@media (prefers-reduced-motion: reduce) { button.cat-b.on::after { animation: none; } }
@media (min-width: 900px) and (min-height: 521px) { button.cat-b { flex-basis: 52px; width: 52px; height: 52px; } button.cat-b .gi { width: 26px; height: 26px; } }
button.chev { flex: none; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 0; color: var(--gold); background: rgba(12, 16, 18, .62); border: 1px solid rgba(224, 178, 58, .45); box-shadow: none; }
button.chev .gi { width: 22px; height: 22px; }
/* return (owner 12/11 13:08): the glyph alone, floating on the art in the top right corner of the stage. No ground, no border,
   no frame of its own: a soft shadow makes it read on a light or a dark picture. 48 px to the finger. */
button.stage-return { position: absolute; z-index: 3; top: var(--bar); right: 0; width: 48px; min-width: 48px; height: 48px; min-height: 48px; padding: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .95)) drop-shadow(0 0 7px rgba(0, 0, 0, .7)); }
button.stage-return .gi { width: 26px; height: 26px; }
button.stage-return:not(:disabled):active { transform: scale(.88); margin: 0; }
/* the finger on the stage: sideways is ours (commanders); up / down is ours only where nothing scrolls under it (crates.js) */
.stage { touch-action: pan-y; }
.stage[data-vswipe="1"] { touch-action: none; }
button.inv-chip { flex: none; }
.stage-dots { display: flex; gap: 5px; padding-left: 2px; }
.stage-dots i { width: 7px; height: 7px; background: rgba(255, 255, 255, .28); }
.stage-dots i.on { background: var(--gold); }
.stage-info { position: absolute; z-index: 3; right: 6px; bottom: 6px; display: flex; gap: 6px; }
.stage-info button { min-height: 44px; border-radius: 0; background: rgba(16, 20, 22, .9); }
/* the bust at ONE scale for everybody: as tall as its frame (wider frames: as wide), only the sides cut around the face (--fx) */
.bust { position: absolute; left: 0; top: 0; --w: 100cqw; width: max(75cqh, var(--w)); height: auto; aspect-ratio: 3 / 4; max-width: none;
  transform: translateX(clamp(calc(var(--w) - 100%), calc(var(--w) / 2 - var(--fx, .5) * 100%), 0px)); }
.hero-in { position: absolute; inset: 0; display: block; }
/* group view: the top rarity LARGE, leaning slices that overlap; the next rarity small under them */
.stage-group { position: absolute; inset: 0; display: flex; flex-direction: column; }
.group-big { flex: 1 1 auto; min-height: 0; display: flex; margin: 0 -1.5% 0 0; }   /* 14/11 accordion: no left overhang, the open first slice starts on the screen */
.group-big .pack-hero { transform: skewX(-6deg); margin-left: -2px; border-width: 0 2px; }
.group-big .hero-in { inset: 0 -18%; transform: skewX(6deg); }
.group-big .bust { --w: 136cqw; }
/* owner 12/11 14:41 ("the commander still is not half body, from the head to the top of the knees"): a WIDE slice (desktop)
   enlarged the picture to its width and cut it at the chest. The large slices now draw the cut-out commander at the height of
   the frame, whatever its width (head to knees always), centred on the face, over one slate ground. */
.group-big .pack-hero { background: var(--biome, radial-gradient(90% 70% at 50% 32%, #33363f, #1b1d23 78%)); }
.group-big .bust[data-cut="1"] { width: 75cqh; transform: translateX(calc(68cqw - var(--fx, .5) * 100%)); }
.group-small { flex: 0 0 40%; min-height: 76px; display: flex; gap: 0; padding: 4px 56px 6px 8px; background: linear-gradient(180deg, rgba(8, 11, 12, .35), rgba(8, 11, 12, .9)); }   /* 40 %: its open commander stands whole too (14/11); 56 px: the "?" and details buttons stand one above the other at its right */
.group-small .pack-hero { flex: 0 1 84px; padding: 0; }   /* its class "small" met button.small (padding 0 10px): the picture was 20 px narrower than its frame */
.stage .pack-hero:hover .bust, .stage .pack-hero:focus-visible .bust { filter: brightness(1.14); }
.stage .pack-plate { padding: 16px 2px 4px; }
.stage .pack-own { position: static; padding: 1px; flex: none; }
/* a small frame: the mark in its corner, the whole width for the name */
.stage .group-small .pack-own { position: absolute; top: 3px; right: 3px; z-index: 1; }
.group-big .pack-plate { font-size: 13px; padding-bottom: 8px; }
/* THE ACCORDION (owner 14/11 13:12, his Commander box capture: 8 legendaries at 51 px and 20 epics at 10 px, nobody readable:
   "the 1st commander full larger body, same for the 1st row and the 2nd row; each time the user clicks the next commander the 1st
   goes reduce size: only the full body commander 1 by 1"). Each row of the group view (.acc, crates.js row()) shows ONE commander
   whole, .open: the cut-out figure at the row's full height, both sides inside the slice, centred on the figure (--bx, balance.json
   body); the others are slices that give it the room, face in their middle, darker, no name (it is in their tip). The row is the
   container (cq = the row): the open width = the figure (--bw) at the row height + the lean of a large slice (tan 6deg = 10.5cqh)
   + 6 px, never more than the row minus --sl for each of the others. The room passes in ONE move (the same buttons stay, crates.js
   openHero): the new one grows where it stands while the old one folds, the picture slides from its face to its figure. */
.stage-group .acc { container-type: size; user-select: none; -webkit-user-select: none; }
.group-big.acc { --sl: 18px; } .group-small.acc { --sl: 8px; }
.stage-group .acc > .pack-hero { flex: 1 1 0; min-width: 0; transition: flex .34s cubic-bezier(.2, .7, .2, 1), border-color .34s; }
/* Phil 17/11 09:54 ("the size maximum it can go is this even it have only 1 or 2 ... let the space empty"; "when it expand too much it
   become too much blur and zoom only the face"): 09:55 he changed it to the Unnr capture: a closed large slice is never wider than a third of the row, the 3-across size;
   with fewer commanders the rest of the row stays empty instead of stretching the face at x1.3 */
.stage-group .group-big.acc > .pack-hero:not(.open) { max-width: min(33.34cqw, 90cqh); }   /* 90cqh: on a wide short desktop row a third of the width was still a face-only crop */
.stage-group .group-big.acc > .pack-hero.open { flex: 0 0 min(max(calc(var(--bw, 1) * 75cqh + 10.5cqh + 6px), min(33.34cqw, 90cqh)), calc(100cqw - (var(--n) - 1) * var(--sl))); }   /* SHOP-OPEN-NOT-THINNEST 17/11: never narrower than a folded slice */
.stage-group .group-small.acc > .pack-hero.open { flex: 0 0 min(max(calc(var(--bw, 1) * 75cqh + 4px), calc(100cqw / var(--n))), calc(100cqw - (var(--n) - 1) * var(--sl))); }   /* SHOP-OPEN-NOT-THINNEST 17/11: at least an equal share of the row */
.stage-group .group-small.acc > .pack-hero:not(.open) { border-width: 0 1px; }   /* 2 px of frame on a 10 px slice is a fifth of it */
/* "the 1st will go reduce size": a closed commander is also drawn SMALLER (--rs of the row height), standing on the same ground
   line, face in the middle of its slice; the open one is the only one at full height. The size passes in the same move. */
.acc { --rs: 1.3; }   /* Phil 17/11 00:04: .68 left the top third of every closed slice empty; closed slices now fill their height and zoom on the face */
/* scale() AFTER translateX in the same transform, about the point under the face (or the figure) on the ground line: the picture
   shrinks where it stands, then the face is laid in the middle of the slice (the separate `scale` property applies after the
   translation and pushed the faces out of the narrow slices) */
.acc .bust[data-cut="1"] { width: 75cqh; transform-origin: calc(var(--fx, .5) * 100%) 0%;
  transition: transform .34s cubic-bezier(.2, .7, .2, 1), transform-origin .34s cubic-bezier(.2, .7, .2, 1), filter .34s; }
.acc .pack-hero.open .bust[data-cut="1"] { transform-origin: calc(var(--bx, .5) * 100%) 100%; transition: filter .34s; }   /* SHOP-FLIP-1117: the opened figure is at its size at once (no zoom then back), its window widens; the folding one still eases into its face */
.group-big.acc .bust[data-cut="1"] { transform: translateX(calc(68cqw - var(--fx, .5) * 100%)) scale(var(--rs)); }
.group-big.acc .pack-hero.open .bust[data-cut="1"] { transform: translateX(calc(68cqw - var(--bx, .5) * 100%)) scale(1); }
.group-small.acc .bust[data-cut="1"] { transform: translateX(calc(50cqw - var(--fx, .5) * 100%)) scale(var(--rs)); }
.group-small.acc .pack-hero.open .bust[data-cut="1"] { transform: translateX(calc(50cqw - var(--bx, .5) * 100%)) scale(1); }
.acc > .pack-hero:not(.open) .bust { filter: saturate(.6) brightness(.68); }
/* Phil 17/11 00:05 (Magni, Yiva: "2 background different with tiny commander"): a commander without a cut-out file (data-cut="0")
   shows its full picture, which carries its own ground: it covers the whole slice, centred on the face, never a small box on the biome */
.acc .bust[data-cut="0"], .acc .bust[data-opaque="1"], .group-big.acc .bust[data-opaque="1"], .group-small.acc .bust[data-opaque="1"], .acc .pack-hero.open .bust[data-opaque="1"] { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: calc(var(--fx, .5) * 100%) 12%; transform: none; }
/* STAGE-KNEES-1119 (Phil 19/11: "without see her knees ... a better zoom ... every hero in the shop"): the OPEN slice draws its
   commander 1 / --sc taller (crates.js stageCut, balance.json stage_cut), top kept, so the slice ends at mid-thigh. The slice keeps
   its width (a wider open slice left 20 px closed slices a finger missed on a phone): a zoomed figure loses the edge of its cloak. A cut-out grows its width (its height follows, 3:4); an opaque picture
   grows its box height and covers it from the top. No --sc = 1 = as before. */
.acc .pack-hero.open .bust[data-cut="1"]:not([data-opaque="1"]) { width: calc(75cqh / var(--sc, 1)); }
.acc .pack-hero.open .bust[data-opaque="1"], .acc .pack-hero.open .bust[data-cut="0"] { height: calc(100% / var(--sc, 1)); object-position: calc(var(--fx, .5) * 100%) 0%; }
/* LEAN-GAP-1119 (Phil 19/11 09:57, capture of the Vagabond pack: "i see the black part on the top right of the image"): a large slice
   leans 6 deg, so its top edge stands tan(6deg) x half its height (5.26 cqh) right of its box; the picture (counter-leaned in
   .hero-in, 18 % wider than the slice a side) did not reach that corner on a TALL narrow slice (a 90 px slice 710 px high: 16 px
   against 37 px) and the empty corner showed black. An opaque picture now spans the lean on both sides too (centre unchanged). */
.stage-group .group-big.acc .pack-hero .bust[data-opaque="1"], .stage-group .group-big.acc .pack-hero .bust[data-cut="0"] { --lg: min(0px, calc(13.2% - 5.3cqh - 2px)); left: var(--lg); width: calc(100% - 2 * var(--lg)); }
.stage .acc > .pack-hero:not(.open):hover .bust, .stage .acc > .pack-hero:not(.open):focus-visible .bust { filter: saturate(.85) brightness(.95); }
.acc > .pack-hero:not(.open) .pack-plate, .acc > .pack-hero:not(.open) .pack-own { opacity: 0; visibility: hidden; }
.acc > .pack-hero .pack-plate { transition: opacity .2s .14s; }
/* the open slice's name: the slice leans (skewX -6deg about its middle), at its BOTTOM its window sits tan(6deg) x half its height
   left of the middle ('Torste|' 13/11): the plate moves left by that much (0.105 x (50cqh - the name row)) */
.group-big.acc .pack-plate { font-size: 15px; padding-left: 12%; padding-right: 12%; gap: 4px; translate: -4.8cqh 0; }
.group-small.acc .pack-plate { font-size: 12px; }
/* the "?" and details buttons: one above the other at the right of the small row (it keeps its width for the slices) */
.stage:has(.group-small) .stage-info { flex-direction: column; }
@media (prefers-reduced-motion: reduce) { .stage-group .acc > .pack-hero, .acc .bust, .acc > .pack-hero .pack-plate { transition: none; } }
/* a banner with no small row: its names stand above the "?" and details buttons (the last name was under them) */
.stage-group:not(:has(.group-small)) .group-big .pack-plate { padding-bottom: 56px; }
/* one commander alone: the art fills the stage on a phone, a tall framed picture on a wide screen */
.stage-solo { position: absolute; inset: 0; }
.solo-art { position: absolute; inset: 0; container-type: size; overflow: hidden; }
.solo-plate { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 46px 112px 14px 12px;
  background: linear-gradient(180deg, rgba(8, 11, 12, 0), rgba(8, 11, 12, .93) 60%); }
.rar-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--r); border: 1px solid var(--r); background: rgba(10, 14, 16, .82); }
.rar-badge .gi { width: 12px; height: 12px; }
/* STORY 13/11: the faction a commander swears to, beside its rarity on the card plate: a small shield split in the
   faction's two colours, edged in its accent (the portraits predate the factions; this costs no picture) */
.cc-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fac-mark { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 4px; font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--fa); background: rgba(10, 14, 16, .82); border: 1px solid color-mix(in srgb, var(--fa) 55%, transparent); }
.fac-shield { width: 13px; height: 15px; flex: none; background: linear-gradient(135deg, var(--fm) 0 50%, var(--fs) 50% 100%);
  clip-path: polygon(0 0, 100% 0, 100% 58%, 50% 100%, 0 58%); box-shadow: inset 0 0 0 1px var(--fa); }
.solo-name { font-size: 32px; line-height: 1; color: #fff; text-shadow: 0 2px 0 #000; }
.solo-title { font-size: 13px; color: var(--r); font-weight: 700; }
.solo-own { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dim); }
.solo-own.mine { color: var(--self); }
.solo-own .gi { width: 13px; height: 13px; }
.stage-medals { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6%; margin: 0; }
.stage-medals .box-medal { flex-direction: column; gap: 2px; font-size: 16px; }
.stage-medals .box-medal .gi { width: min(16vw, 84px); height: min(16vw, 84px); filter: drop-shadow(0 0 14px color-mix(in srgb, var(--r) 60%, transparent)); }
.stage-medals .box-medal small { font-size: 12px; font-weight: 400; color: var(--dim); }
/* the move says which way you went: banners follow the rail, commanders follow the chevron */
.stage-body[class*="-fwd"] { animation: stage-in .26s cubic-bezier(.2, .7, .2, 1) 1; --dx: 46px; }
.stage-body[class*="-back"] { animation: stage-in .26s cubic-bezier(.2, .7, .2, 1) 1; --dx: -46px; }
@keyframes stage-in { from { transform: translate(var(--dx, 0), var(--dy, 0)); opacity: .15; } to { transform: none; opacity: 1; } }
/* a banner reached by a finger going up / down comes from below / above, on every screen */
.stage .stage-body[class*="in-vbanner-fwd"] { --dx: 0px; --dy: 46px; }
.stage .stage-body[class*="in-vbanner-back"] { --dx: 0px; --dy: -46px; }
.stage.still .stage-body, .stage.still .inv-chip { animation: none; }
/* rail: one swipe strip of banners under the stage (phone); the selected one wears the corner brackets */
.rail { flex: none; display: flex; gap: 6px; padding: 6px 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; background: #141a1d; border-top: 1px solid var(--line); }
.rail::-webkit-scrollbar { display: none; }
button.rail-b { --rh: 76px; position: relative; flex: 0 0 148px; height: var(--rh); min-height: 0; padding: 0; overflow: hidden; border-radius: 0; background: #10151a; border: 1px solid #36434a; box-shadow: none; opacity: .78; }
.rail-art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--crate) 40%, #12181b), #12181b 70%); }
.rail-cell { position: relative; flex: 0 1 calc(var(--rh) * .56); height: 100%; overflow: visible; container-type: size; }
/* a banner with crates in stock wears its count top right: the three stand on the left, the count never lies on a head */
button.rail-b:not([data-n="0"]) .rail-art { justify-content: flex-start; padding-left: 4px; }
/* owner 12/11 15:35: in the rail no rarity colour, on the slate of the stage, the rarity gem under each commander.
   owner 12/11 16:30 (replaces "smaller"): "the image should be close, it is too far; the 3 personnages can also touch each other".
   The picture is drawn LARGER than the cell (1.1 of its height) and its box is a window on the top of it, head to waist
   (object-fit: cover, from the top); the cells are narrower than that window, so the three stand shoulder to shoulder and overlap. */
.rail-art:has(.rail-cell) { background: radial-gradient(90% 70% at 50% 32%, #33363f, #1b1d23 78%); }
.rail-cell .bust { left: 50%; top: 0; width: 80cqh; height: 62cqh; aspect-ratio: auto; object-fit: cover; object-position: 50% 0; transform: translateX(calc(var(--fx, .5) * -100%));
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent); mask-image: linear-gradient(180deg, #000 78%, transparent); }
/* Phil 15/11 (replaces the head-to-waist window above for the rail): "a ton of empty gaps ... fill the frame ... show their face".
   The three cells share the WHOLE width of the banner (no empty sides), each draws the head-and-shoulders cut-out filling the
   cell from its top down to the gem row (no empty band), the gem under it, the name under the gem. */
.rail-art:has(.rail-cell) { justify-content: stretch; gap: 0; padding: 0 2px; }
.rail-art .rail-cell { flex: 1 1 0; min-width: 0; }
/* a pack with ONE featured face (Secret pack, 23/11): the cell keeps a face's width in the middle, it does not stretch into a strip of hair */
.rail-art:has(.rail-cell:only-child) { justify-content: center; }
.rail-art .rail-cell:only-child { flex: 0 0 calc(var(--rh, 64px) * .8); }
.rail-cell .bust.face-in { left: 0; top: 0; width: 100%; height: calc(100% - var(--rail-low, 27px)); transform: none; object-fit: cover; object-position: 50% 0;
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent); }
.rail-cell:has(.face-in) .rail-rar { top: auto; bottom: calc(var(--rail-low, 27px) - 12px); width: 10px; height: 10px; }
.rail-rar { position: absolute; left: 50%; top: 63cqh; width: clamp(8px, 13cqh, 14px); height: clamp(8px, 13cqh, 14px); transform: translateX(-50%); display: block; line-height: 0; z-index: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .8)); }
.rail-rar .gi { display: block; width: 100%; height: 100%; fill: currentColor; fill-opacity: .45; }
.rail-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 4px 3px; font-size: 11px; font-weight: 700; line-height: 1.1; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, rgba(8, 11, 12, 0), rgba(8, 11, 12, .95) 62%); }
.rail-n { position: absolute; top: 2px; right: 2px; display: inline-flex; align-items: center; gap: 2px; padding: 0 4px; font-size: 11px; font-weight: 700; color: #ffe9ae; background: rgba(8, 11, 12, .85); }
.rail-n .gi { width: 11px; height: 11px; }
button.rail-b.on { opacity: 1; border-color: var(--crate); }
button.rail-b.on::after { content: ""; position: absolute; inset: 0; pointer-events: none; --bk: #fff;
  background-image: linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk));
  background-repeat: no-repeat; background-size: 12px 2px, 2px 12px, 12px 2px, 2px 12px, 12px 2px, 2px 12px, 12px 2px, 2px 12px;
  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%; animation: rail-lock .3s ease-out 1; }
@keyframes rail-lock { from { inset: -8px; opacity: 0; } to { inset: 0; opacity: 1; } }
button.stage-strip { flex: none; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 4px 10px; text-align: left; font-size: 12px; font-weight: 400; line-height: 1.25;
  color: var(--dim); background: #141a1d; border: 0; border-top: 1px solid #263034; border-radius: 0; box-shadow: none; }
button.stage-strip .gi { flex: none; width: 16px; height: 16px; color: var(--leg, var(--gold)); }
/* the chat handle docks at the left of this line while the Shop shows it (crates.js dockTalk): the line keeps its gutter */
.shop-crates > button.stage-strip { min-height: 58px; padding-left: 44px; }
body[data-tab="shop"][data-talk-dock] .talk-btn { top: var(--talk-y, calc(50% - 28px)); }
.shop-crates > .why-text { margin: 0; padding: 2px 10px; background: #141a1d; }
.buyzone { flex: none; padding: 6px 8px 8px; background: #141a1d; }
.buybar { display: flex; gap: 8px; }
.buybar button.buy { flex: 1 1 0; min-height: 52px; justify-content: center; gap: 10px; font-size: 16px; border-radius: 0; }
.buy-k { font-size: 19px; }
.buyzone .why-text { margin: 4px 0 0; }
/* Touch screen (12/11 14:46): the stage + rail + buy row are ONE first screen that does not scroll (a finger up / down on the
   stage then changes banner); the rest of the Shop is behind the "more" entry of the buy row. With a mouse: both in the page. */
.shop-more, .shop-back { display: none; }
@media (pointer: coarse) {
  body[data-tab="shop"][data-shop-face="stage"] #panel { overflow-y: hidden; padding-bottom: 0; }
  #view-shop[data-face="stage"] .shop-rest, #view-shop[data-face="rest"] .shop-crates { display: none; }
  .buybar button.shop-more { display: flex; flex: none; align-items: center; justify-content: center; gap: 4px; min-width: 76px; min-height: 52px; padding: 0 10px; font-size: 13px; border-radius: 0;
    background: transparent; border: 1px solid var(--line); color: var(--text); }
  .shop-more .gi { width: 16px; height: 16px; }
  /* the "more" entry takes its width from the two buy buttons: their count and price stay on ONE line (seen 15:34: "×10" broke into "×1 / 0") */
  .buybar button.buy { gap: 6px; padding: 0 6px; } .buy-k { white-space: nowrap; } .buybar button.shop-more { min-width: 62px; padding: 0 6px; }
  button.shop-back { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 8px 0 2px; padding: 0 12px 0 8px; font-size: 13px; border-radius: 0; background: transparent; border: 1px solid var(--line); color: var(--text); }
  .shop-back .gi { width: 18px; height: 18px; }
}
/* ---- popups over the game: the Inventory (everything that opens) and the "?" / details sheet */
.dlg { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(6, 9, 10, .74); }
#crate-dlg { z-index: 64; }
#crate-dlg.card-dlg { z-index: 74; }   /* a commander card can be opened from a turned card of the reveal (z 70): it sits over it */
.dlg-box { position: relative; width: min(540px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); animation: dlg-in .2s ease-out 1; }
@keyframes dlg-in { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.dlg-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); color: var(--gold); }
.dlg-head strong { font-size: 18px; color: var(--text); }
.dlg-head > .gi { width: 20px; height: 20px; }
.dlg-box > .odds-sheet { margin: 0; border: 0; border-radius: 0; overflow-y: auto; padding: 8px 12px 12px; }
.inv-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 12px 12px; -webkit-overflow-scrolling: touch; }
.card.crate.inv-row { display: flex; align-items: center; gap: 8px; }
.inv-name { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.inv-row button { min-height: 44px; flex: none; white-space: nowrap; }
.inv-row button.primary { padding: 0 10px; }
.inv-empty { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.inv-empty .why-text { flex: 1; margin: 0; }
/* invite codes (14/11): my code + copy, the box to type a friend's code */
.card.invite { border-color: var(--crate); }
.card.invite .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invite-code { font: 700 18px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 2px; color: var(--crate); user-select: all; min-width: 0; }
.card.invite button { min-height: 44px; flex: none; white-space: nowrap; }
.invite-form { margin-top: 6px; }
.invite-form .invite-input { flex: 1 1 120px; min-width: 0; min-height: 44px; text-transform: uppercase; letter-spacing: 1px; }
.card.invite .why-text { margin: 4px 0 0; }
.sure-chip { font-size: 12px; }
.details-list { display: flex; flex-direction: column; margin: 6px 0; }
.details-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid #2b3538; }
.details-row strong { display: block; }
.details-sub { font-size: 12px; color: var(--r); }
.gift-chip .pill.zero { color: var(--dim); background: #1b2225; border-color: var(--line); }
@media (orientation: portrait) and (max-width: 560px) {
  #view-shop { margin-top: -4px; }
  .dlg.inv { padding: 0; align-items: stretch; }
  .inv .dlg-box { width: 100%; height: 100%; border: 0; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
  .card.crate.inv-row { gap: 6px; } .inv-row button.primary { padding: 0 8px; }   /* 390 px: with "?", "1" and "x10" the name column was 88 px and "Commander" (90 px) broke in two */
}
/* wide screen: the Shop takes the whole view (the map is hidden while it is open); stage left, rail on the right */
@media (min-width: 900px) and (min-height: 521px) {
  body[data-tab="shop"] #app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "notices" "tabs" "panel" "dock"; }
  body[data-tab="shop"] #app #map-pane { display: none; }
  .shop-rest { max-width: 780px; margin: 0 auto; padding-top: 10px; }
  .shop-crates { display: grid; grid-template-columns: minmax(0, 1fr) 264px; grid-template-rows: minmax(0, 1fr) auto auto auto; }
  .shop-crates > .stage { grid-column: 1; grid-row: 1; }
  .shop-crates > .rail { grid-column: 2; grid-row: 1 / -1; flex-direction: column; overflow-x: hidden; overflow-y: auto; border-top: 0; border-left: 1px solid var(--line); padding: 10px; gap: 8px; }
  .shop-crates > .stage-strip, .shop-crates > .why-text, .shop-crates > .buyzone { grid-column: 1; }
  button.rail-b { --rh: 104px; flex: 0 0 var(--rh); width: 100%; }
  button.rail-b:not([data-n="0"]) .rail-art { justify-content: center; padding-left: 0; }
  .rail-name { font-size: 13px; padding-bottom: 5px; }
  button.rail-b { --rail-low: 34px; }
  .rail-cell:has(.face-in) .rail-rar { width: 12px; height: 12px; bottom: calc(var(--rail-low) - 14px); }
  .shop-crates[data-dir] .stage-body[class*="in-banner-fwd"] { --dx: 0px; --dy: 46px; }
  .shop-crates .stage-body[class*="in-banner-back"] { --dx: 0px; --dy: -46px; }
  .stage { --bar: 64px; } .stage-title { font-size: 30px; } .stage-top { padding: 0 16px; gap: 10px; }
  .group-big .pack-plate, .group-big.acc .pack-plate { font-size: 17px; padding-bottom: 12px; }
  .group-small { padding-left: 16px; } .group-small.acc .pack-plate { font-size: 14px; }
  .buybar { max-width: 560px; } .buybar button.buy { min-height: 58px; font-size: 18px; }
  .solo-art { inset: 0 auto 0 50%; height: 100%; aspect-ratio: 3 / 4; transform: translateX(-20%); border: 0 solid var(--r); border-width: 0 2px; }
  .solo-plate { right: auto; bottom: 22%; padding: 0 0 0 64px; background: none; max-width: 42%; gap: 8px; }
  .solo-name { font-size: 58px; } .solo-title { font-size: 18px; } .rar-badge, .fac-mark { font-size: 14px; } .solo-own { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .stage-body, .inv-chip.new, .dlg-box, button.rail-b.on::after { animation: none !important; } }
/* phone landscape (844x390, 12/11): the panel is about 278 px high. Stage on the left, as high as the panel; rail, sentence
   and buy bar in one column on the right: nothing scrolls. The stage keeps the panel gutter, where the chat handle stands. */
@media (orientation: landscape) and (max-height: 520px) {
  #view-shop { margin-left: 0; } .shop-rest { padding-left: 0; }
  .shop-crates { display: grid; grid-template-columns: minmax(0, 1fr) 276px; grid-template-rows: auto auto auto minmax(0, 1fr); min-height: 0; }
  .shop-crates > .stage { grid-column: 1; grid-row: 1 / -1; }
  .shop-crates > .rail { grid-column: 2; grid-row: 1; border-top: 0; border-left: 1px solid var(--line); }

  .shop-crates > button.stage-strip { grid-column: 2; grid-row: 2; min-height: 44px; padding-left: 10px; border-left: 1px solid var(--line); }
  .shop-crates > .why-text { grid-column: 2; grid-row: 3; border-left: 1px solid var(--line); }
  .shop-crates > .buyzone { grid-column: 2; grid-row: 4; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; border-left: 1px solid var(--line); }
  .buybar { gap: 6px; } .buybar button.buy { min-height: 48px; gap: 6px; font-size: 14px; padding: 0 4px; } .buy-k { font-size: 16px; }
  @media (pointer: coarse) { .buybar button.buy > svg { display: none; } .buybar button.shop-more { min-width: 56px; padding: 0 4px; } }
  .stage { --bar: 48px; } .group-small { min-height: 66px; padding-right: 108px; } .stage:has(.group-small) .stage-info { flex-direction: row; }   /* a 90 px row: the two buttons side by side */
  /* one commander alone: a framed picture as high as the stage, the words beside it (the art over the whole stage showed a forehead) */
  .solo-art { inset: 0 54px 0 auto; height: 100%; aspect-ratio: 3 / 4; border: 0 solid var(--r); border-width: 0 2px; }   /* 54 px: the 'return' glyph stands beside the picture, not on the face */
  .solo-plate { right: auto; bottom: 0; padding: 0 0 8px 12px; background: none; max-width: 52%; gap: 2px; }
  .solo-name { font-size: 26px; }
}
/* the commander's card (12/11 10:50): big art, then one button per thing to read */
button.solo-art { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; min-height: 0; cursor: pointer; }
button.solo-art:not(:disabled):active { translate: none; margin: 0; }
button.card-btn { min-height: 44px; padding: 0 12px; border-radius: 0; margin-top: 4px; }
button.details-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #2b3538; border-radius: 0; box-shadow: none; min-height: 48px; font-weight: 400; }
/* the commander card (owner 12/11 11:55): the art is the whole card; name plate, detail and symbols lie OVER it on a fade */
.dlg-box.cc { width: min(460px, 100%); height: min(820px, 100%); border-color: #2b3538; overflow: hidden; background: #10151a; touch-action: pan-y; }
.dlg-box.cc.still { animation: none; }
.cc-art { position: absolute; inset: 0; overflow: hidden; container-type: size; background: #222025; }
/* (before ART-L) the card's picture (owner's ART-C C box 12/11 20:45): as tall as the card, unless that cuts the figure at the sides (Sif's hand and
   hilt, Dagny's hilt); then as wide as the figure needs (--bw, its share of the bust + a margin), standing on the bottom edge and
   centred on the figure (--bx). Above it the card shows the picture's own slate (#222025), the top of the picture fades into it. */
/* ART-L 13/11 (Phil: the phone cover crop cut Astrid's axe blade and Ylva's axe head; the 64cqh floor forced it): no floor any more.
   The picture is as large as the card allows WITHOUT cutting the figure (--bw = its width share + 6 % margin, never taller than
   the card), centred on the figure; wider than the card it still covers it, narrower it stays inside it (the slate of the
   picture meets the card's #222025: Ylva's bright corner was normalised for this, tools/art/process.py SLATE_LIKE). */
/* --plate (crates.js, measured): the picture stands on the top of the name plate + symbols and fades out over its last 5 %, so
   a low weapon (Ylva's axe head) is above the name, never under it. */
/* ART-M 13/11 (supervisor, Dagny box 13:55): the two sizes are taken on the FIGURE, not on the picture frame — the picture is
   as large as the figure's HEIGHT filling the space above the plate (--bh) or as its WIDTH filling the card (--bw), whichever
   is smaller, so nothing is ever cut. --bbot: her lowest pixel stands ON the plate, not the picture's edge, so the figure is
   as big and as high as the card allows. What is still left over a very wide pose (Dagny at 390x844: her figure is wider than
   the space above the plate, 0.69 against 0.55) is the owner's call — closing it would cut her elbow and her sword hilt by
   about 49 px a side. 3 cqh of headroom is kept over the tallest figure (Sif's head was touching the card's edge). Top fade:
   never deeper than the figure's own top margin (--bt), so Sif's hair top is not washed out. */
/* CARD-ZOOM-3 17/11 (Phil 07:09: Bodil still leaves empty gaps, "zoom more around 2-3%", "every image at the same time"): every
   commander's card picture is 3 % larger than the no-cut fit (--cz), grown from its bottom, centred on the figure; one value for all. */
.cc-art .bust { top: auto;
  --picw: calc(var(--cz, 1.03) * min(calc((100cqh - var(--plate, 0px) - 3cqh) * .75 / var(--bh, 1)), calc(100cqw / var(--bw, .75))));
  --pich: calc(var(--picw) * 4 / 3);
  width: var(--picw); bottom: calc(var(--plate, 0px) - (1 - var(--bbot, 1)) * var(--pich));
  --mtop: min(7%, calc(var(--bt, .07) * 100%));
  transform: translateX(clamp(min(0px, calc(100cqw - 100%)), calc(50cqw - var(--bx, .5) * 100%), max(0px, calc(100cqw - 100%))));
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 var(--mtop), #000 95%, transparent); mask-image: linear-gradient(180deg, transparent, #000 var(--mtop), #000 95%, transparent); }
.cc-close { position: absolute; z-index: 3; top: calc(6px + env(safe-area-inset-top)); right: 6px; background: rgba(12, 16, 18, .8); }
.cc-over { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; max-height: 100%; display: flex; flex-direction: column; padding-top: 56px; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 11, 12, 0), rgba(8, 11, 12, .5) 64px, rgba(8, 11, 12, .68)); }
.cc-over > * { pointer-events: auto; }
.cc-plate { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 0 12px 6px; pointer-events: none; text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, .8); }
/* the detail: shut = no height (0fr), open = its own height, never more than about half the card; the plate above it rides up */
.cc-drawer { display: grid; grid-template-rows: 0fr; min-height: 0; visibility: hidden; transition: grid-template-rows .28s cubic-bezier(.2, .7, .2, 1), visibility 0s .28s; }
.cc[data-open="1"] .cc-drawer { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s, 0s; }
.cc-panel { min-height: 0; max-height: min(46cqh, 380px); overflow: hidden; padding: 0 12px; text-shadow: 0 1px 2px #000, 0 0 8px rgba(0, 0, 0, .85); }
.cc[data-open="1"] .cc-panel { overflow-y: auto; }
.dlg-box.cc { container-type: size; }
.cc-skill, .cc-line { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid rgba(255, 255, 255, .16); }
.cc-skill strong { display: block; }
.cc-skill .details-sub { color: #e6d9b8; }
/* HIDDEN-SKILLS-1123: a locked hidden slot reads as a sealed one (no name, no numbers); an open one keeps the blood red of the Secret pack */
.cc-skill.cc-hidden:not(.open) strong, .cc-skill.cc-hidden:not(.open) .details-sub { color: #b9a9a3; font-style: normal; }
.cc-skill.cc-hidden.open strong { color: #ff8a8a; }
/* 14/11 skill values: what each story skill does in numbers, under its line */
.cc-fx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.cc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; font-size: 12px; color: #f3ead2; background: rgba(8, 11, 12, .55); border: 1px solid rgba(255, 255, 255, .18); }
.cc-chip b { color: var(--rl, var(--r)); }
.cc-chip.up { border-color: rgba(120, 200, 120, .55); } .cc-chip.up b { color: #9fe39a; }
.cc-chip.down { border-color: rgba(230, 120, 100, .55); } .cc-chip.down b { color: #f0a090; }
.cc-chip svg { width: 12px; height: 12px; }
/* SKILL-VERBS 14/11: the shouted signature leads its skill's chips */
.cc-chip.cc-shout { border-color: var(--r); font-weight: 800; letter-spacing: .04em; }
/* battle report: one line per verb that fired, in round order */
.verb-lines { margin: 6px 0; padding: 6px 8px; border-left: 3px solid var(--accent, #d9a441); background: rgba(255, 255, 255, .04); }
.verb-lines p { margin: 2px 0; } .verb-lines .off { opacity: .7; }
.cc-n { flex: none; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--r); border: 1px solid var(--r); background: rgba(8, 11, 12, .45); text-shadow: none; }
.cc-line { justify-content: space-between; } .cc-line span { color: #cfd6d6; font-size: 13px; }
.cc-quote { font-size: 16px; font-style: normal; color: #fff; margin: 10px 0 14px; }
.cc-power { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--r); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.cc-power .gi { width: 16px; height: 16px; }
.cc-story { font-size: 14px; line-height: 1.45; color: #dfe6e6; margin: 0 0 10px; }
.cc-fight { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; color: var(--r); margin: 0 0 12px; }
.cc-fight .gi { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.cc-fight span { color: #dfe6e6; }
/* the symbols: no word, no ground, set in the bottom edge of the frame; the one that is open takes the colour of the rarity
   and a mark that merges with the frame line */
.cc-tabs { flex: none; display: flex; align-items: stretch; padding: 0 4px env(safe-area-inset-bottom); }
button.cc-tab { position: relative; flex: none; width: 52px; min-width: 44px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 0; border: 0;
  background: none; box-shadow: none; color: #fff; opacity: .86; filter: drop-shadow(0 1px 2px #000) drop-shadow(0 0 6px rgba(0, 0, 0, .7)); }
button.cc-tab .gi { width: 22px; height: 22px; }
button.cc-tab:hover, button.cc-tab:focus-visible { opacity: 1; background: none; }
button.cc-tab.on { color: var(--r); opacity: 1; outline: none; }
button.cc-tab.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; background: var(--r); }
button.cc-arrow { margin-left: auto; }
.cc[data-open="0"] button.cc-arrow .gi { animation: cc-nudge 1.2s ease-in-out .6s 2; }
@keyframes cc-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .cc-drawer { transition: none; } .cc[data-open="0"] button.cc-arrow .gi { animation: none; } }
/* SHOP-SWIPE 14/11 (owner 17:22: "on mobile it shouldn't be full full screen, let the player tap around the card to quit it instead of
   only the x"): the card leaves a band of the game all round; a tap on that band closes it (crates.js renderSheet, e.target === d) */
@media (orientation: portrait) and (max-width: 560px) {
  .dlg.card-dlg { padding: max(54px, calc(env(safe-area-inset-top) + 40px)) 20px max(46px, calc(env(safe-area-inset-bottom) + 30px)); }
  .dlg.card-dlg .dlg-box.cc { width: 100%; height: min(100%, 720px); } }
/* R3-H (owner 12/11 12:09: "the background of the profile, better to show its rarity colour tone") + 14:29 ("too much: the
   colour should be BEHIND the profile, the head at the first layer, the colour maybe -50 %"): every face tile stands on a
   ground in the tone of its rarity. ONE rule for every screen; --tone comes from balance.json (assets.js setRarities writes
   [data-rar="epic"] { --tone: ... }). The ground is a flat field at 42 % of the tone (it was a ring at 82 % laid OVER the
   picture) and the commander is drawn over it from its cut-out file (<name>-cut.webp, tools/art/process.py --cut). */
[data-rar] { --ground: radial-gradient(120% 120% at 50% 35%, color-mix(in srgb, var(--tone, #55666a) 42%, transparent), color-mix(in srgb, var(--tone, #55666a) 30%, transparent)); }
img[data-rar] { object-fit: cover; background: var(--ground) #10151a; border-color: color-mix(in srgb, var(--tone, #55666a) 70%, #10151a); }
.group-small .pack-hero[data-biome] .hero-in::before { content: ""; position: absolute; inset: 0; background: var(--biome, #10151a); pointer-events: none; }
.group-small .pack-plate { z-index: 1; }
/* a commander not yet yours: the FACE loses its colours (its picture keeps only its light, in the tone of the ground), the ground keeps the tone of its rarity
   (the whole button was greyed: a locked legendary and a locked common looked the same) */
.cmd-opt.locked, .skill-tab.locked, .roster-row button.skill-tab.locked { filter: none; opacity: .72; }
.cmd-opt.locked img[data-rar], .skill-tab.locked img[data-rar] { object-position: 0 -300vh; background: var(--art) center / cover no-repeat, var(--ground) #10151a; background-blend-mode: luminosity, normal; }
/* R3-H: phone landscape - the card is wide, the art is a column on the left and the name plate, the detail and the symbols
   stand in a column BESIDE the face (open, they lay across the commander's eyes) */
@media (orientation: landscape) and (max-height: 560px) {
  .dlg.card-dlg { padding: 10px 56px; }   /* SHOP-SWIPE: a band left and right to tap out */
  .dlg-box.cc { width: min(760px, 100%); height: 100%; }   /* ART-L tried 75vh + 340 px (less empty navy): the open detail then wrapped and cut its 3rd skill; kept 760 */
  .cc-art { right: auto; width: 75cqh; }
  .cc-art .bust { --picw: calc(var(--cz, 1.03) * min(calc(97cqh * .75 / var(--bh, 1)), calc(100cqw / var(--bw, .75))));   /* the plate is BESIDE the art here: full height, no drop */
    width: var(--picw); bottom: calc(0px - (1 - var(--bbot, 1)) * var(--pich));
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 var(--mtop, 7%)); mask-image: linear-gradient(180deg, transparent, #000 var(--mtop, 7%)); }
  .cc-over { left: 75cqh; top: 0; padding-top: 52px; justify-content: flex-end; background: linear-gradient(180deg, rgba(8, 11, 12, .2), rgba(8, 11, 12, .5)); }
  .cc-plate .solo-name { font-size: 28px; }
}

/* ---- MAP FIRST (owner 12/11 16:03, Last Shelter captures): coordinates of the centre + arrow back to my own city on the map (every screen);
   on a phone held upright the map takes the whole World screen and the lists of the view are one sheet behind the march glyph */
/* GROUND-1115: the two ways of a march on the sheet of a place (round the hard ground / straight across) */
.way-row { display: flex; gap: 6px; margin: 6px 0; }
.way-row[hidden] { display: none; }
.way-row .way-opt { flex: 1 1 0; min-height: 44px; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 4px; background: rgba(27, 34, 37, .9); color: var(--text); }
.way-row .way-opt.on { border-color: #e0b23a; box-shadow: inset 0 0 0 1px #e0b23a; }
/* WORLD-1115: the overview map, top-left of the map pane (bottom-left = list and X / Y, right = zoom buttons) */
.map-mini { position: absolute; left: 6px; top: 6px; z-index: 2; width: 96px; height: 96px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 4px; box-shadow: 0 1px 6px rgba(0, 0, 0, .55); background: #1d4d7c; touch-action: none; cursor: pointer; }
@media (max-width: 720px) { .map-mini { width: 84px; height: 84px; } }
@media (min-width: 1100px) { .map-mini { width: 132px; height: 132px; } }
.map-hud { position: absolute; left: 6px; bottom: 6px; z-index: 2; display: flex; gap: 6px; align-items: stretch; }
button.map-list, button.map-xy { min-height: 44px; margin: 0; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; background: rgba(27, 34, 37, .9); border: 1px solid var(--line); border-radius: 4px; color: var(--text); font-variant-numeric: tabular-nums; }
button.map-list { display: none; position: relative; width: 44px; padding: 0; justify-content: center; }
button.map-list .badge { position: absolute; top: -5px; right: -5px; }
button.map-xy { background: rgba(16, 21, 26, .72); border-color: transparent; font-size: 14px; }
button.map-xy b { min-width: 2ch; text-align: left; color: #8fd0e8; font-weight: 600; margin-right: 4px; }
button.map-home { position: absolute; z-index: 2; width: 56px; height: 56px; min-height: 0; min-width: 0; margin: -28px 0 0 -28px; padding: 0; border: 0; border-radius: 50%; background: none; color: #fff; }
button.map-home[hidden] { display: none; }
.mh-in { position: absolute; inset: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border-radius: 50%; background: rgba(16, 21, 26, .86); box-shadow: 0 0 0 2px var(--self); line-height: 1; }
.mh-in svg { width: 15px; height: 15px; }
.mh-d { font-size: 11px; font-variant-numeric: tabular-nums; }
.mh-arrow { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; color: var(--self); pointer-events: none; }
.mh-arrow svg { display: block; width: 22px; height: 22px; stroke-width: 3.2; filter: drop-shadow(0 0 2px #000); }
button.wl-close { display: none; }
@media (orientation: portrait) and (max-width: 560px) {
  body[data-tab="world"] #app { grid-template-rows: auto auto minmax(0, 1fr) 0 auto auto; }
  body[data-tab="world"] #app #map-pane { height: auto; min-height: 0; border-bottom: 0; }
  body[data-tab="world"] #map-pane .map-btns { flex-direction: column; }
  button.map-list { display: inline-flex; }
  body[data-tab="world"] #panel { position: fixed; z-index: 28; left: 0; right: 0; bottom: 0; max-height: 68vh; max-height: 68dvh; padding: 0 12px 16px 42px; background: var(--panel); border-top: 2px solid var(--gold);
    transform: translateY(104%); visibility: hidden; }
  body[data-tab="world"].world-moved #panel { transition: transform .22s ease-out, visibility 0s .22s; }
  body[data-tab="world"].world-open #panel { transform: none; visibility: visible; }
  body[data-tab="world"].world-open.world-moved #panel { transition: transform .22s ease-out; }
  body[data-tab="world"] button.wl-close { display: flex; position: sticky; top: 0; z-index: 3; width: 100%; min-height: 44px; margin: 0 0 4px; justify-content: center; background: var(--panel); border: 0; border-radius: 0; }
}
/* phone on its side (12/11 16:28): the same map-first World. The map takes the panel's place, the lists slide in from the left */
@media (orientation: landscape) and (max-height: 520px) {
  body[data-tab="world"] #app { grid-template-areas: "tabs top top" "tabs notices notices" "tabs map map" "tabs dock dock"; }
  button.map-list { display: inline-flex; }
  #map-pane .map-btns { position: absolute; right: 6px; bottom: 6px; z-index: 2; flex-direction: column; padding: 0; background: none; }
  #map-pane .map-btns button { width: 44px; min-height: 44px; }
  body[data-tab="world"] #panel { position: fixed; z-index: 28; left: 84px; top: 0; bottom: 0; width: min(430px, 52vw); padding: 0 12px 16px; overflow-y: auto; background: var(--panel); border-right: 2px solid var(--gold);
    transform: translateX(-130%); visibility: hidden; }
  body[data-tab="world"].world-moved #panel { transition: transform .22s ease-out, visibility 0s .22s; }
  body[data-tab="world"].world-open #panel { transform: none; visibility: visible; }
  body[data-tab="world"].world-open.world-moved #panel { transition: transform .22s ease-out; }
  body[data-tab="world"] button.wl-close { display: flex; position: sticky; top: 0; z-index: 3; width: 100%; min-height: 44px; margin: 0 0 4px; justify-content: center; background: var(--panel); border: 0; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { body[data-tab="world"] #panel { transition: none; } }

/* ---- "?" every commander (owner 13/11): a grid of every profile of the game, a tap opens the full card over it */
button.roster-btn { flex: none; display: inline-flex; align-items: center; gap: 3px; min-height: 44px; min-width: 44px; padding: 0 9px; border-radius: 0;
  background: rgba(16, 20, 22, .88); border: 1px solid rgba(224, 178, 58, .45); color: var(--gold); box-shadow: none; }
button.roster-btn .gi { width: 17px; height: 17px; }
button.roster-btn b { font-size: 18px; font-weight: 800; line-height: 1; }
.roster .dlg-box.roster-box { width: min(640px, 100%); height: min(900px, 100%); }
.roster-have { font-size: 12px; font-weight: 700; color: var(--dim); }
.roster-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 12px 14px; -webkit-overflow-scrolling: touch; }
.roster-rar { display: flex; align-items: center; gap: 6px; margin: 12px 0 7px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--r); }
.roster-rar .gi { width: 15px; height: 15px; fill: currentColor; fill-opacity: .45; }
.roster-rar small { color: var(--dim); font-weight: 700; }
/* 4 a row: every rarity has 4 commanders today (3 left one alone on a 2nd row at 390 px); more wrap by 4. 12 tracks so a rarity
   with MAIN heroes (13/11: Sif + Torstein, legendary) shows them 2 a row, large, and its others 3 a row (5 = 2 + 3, none alone) */
.roster-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 7px; }
.roster-grid > .roster-cell { grid-column: span 3; }
.roster-grid.has-main > .roster-cell { grid-column: span 4; }
.roster-grid.three > .roster-cell { grid-column: span 4; }
.roster-grid.has-main > .roster-cell.main { grid-column: span 6; aspect-ratio: 1 / 1; border-top-width: 3px; }
.roster-main { position: absolute; top: 5px; left: 5px; padding: 2px 6px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: #15110a; background: var(--r); }
.roster-cell.main .roster-name strong { font-size: 16px; }
.roster-cell.main .roster-name small { font-size: 12px; }
button.roster-cell { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; min-height: 0; padding: 0; overflow: hidden; border-radius: 0;
  border: 1px solid #2b3538; border-top: 2px solid var(--r); box-shadow: none; background: radial-gradient(90% 70% at 50% 32%, #33363f, #1b1d23 78%); }
.roster-art { position: absolute; inset: 0; container-type: size; overflow: hidden; }
.roster-art .bust { left: 50%; top: 2cqh; width: auto; height: 84cqh; transform: translateX(calc(var(--fx, .5) * -100%)); transition: transform .25s ease-out, filter .25s; }
button.roster-cell:not(.owned) .bust { filter: saturate(.7) brightness(.86); }
button.roster-cell:hover .bust, button.roster-cell:focus-visible .bust { filter: brightness(1.12); transform: translateX(calc(var(--fx, .5) * -100%)) scale(1.04); }
button.roster-cell:not(:disabled):active { transform: scale(.96); margin: 0; }
.roster-own { position: absolute; top: 4px; right: 4px; display: flex; padding: 2px; color: var(--ok, #7fd08a); background: rgba(8, 11, 12, .85); }
.roster-own .gi { width: 13px; height: 13px; }
.roster-name { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; padding: 16px 5px 4px; text-align: left; line-height: 1.15;
  background: linear-gradient(180deg, rgba(8, 11, 12, 0), rgba(8, 11, 12, .95) 55%); }
.roster-name strong { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-name small { font-size: 10px; color: #b9c2bd; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (orientation: portrait) and (max-width: 560px) { .dlg.roster { padding: 0; } .roster .dlg-box.roster-box { width: 100%; height: 100%; border: 0; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); } .roster-grid { gap: 5px; } .roster-scroll { padding: 2px 8px 12px; } .roster-name strong { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .roster-art .bust { transition: none; } }

/* zoom buttons: bare icons on the scene, no ground and no frame (owner 12/11 16:28, Last Shelter); the finger target stays 44 px */
#app .map-btns button, #app .map-btns button:hover, #app .map-btns button:active { width: 44px; min-width: 0; min-height: 44px; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; color: #fff; }
#app .map-btns button svg { width: 26px; height: 26px; stroke-width: 2.4; filter: drop-shadow(0 0 2px #000) drop-shadow(0 1px 3px rgba(0, 0, 0, .9)); transition: transform .12s ease-out; }
#app .map-btns button:active svg { transform: scale(.84); }

/* ---- my march, opened by a tap on it on the map (12/11): leader, route, time left, Speed up */
.march-head { gap: 10px; align-items: center; }
.march-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.march-who strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.march-route { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.march-route > .gi { width: 20px; height: 20px; opacity: .7; flex: none; }
.march-place { display: inline-flex; flex-direction: column; gap: 1px; min-width: 0; }
.march-place b { font-size: 14px; }
.march-place .coord { font-size: 12px; opacity: .75; }
.march-left { font-size: 17px; margin-left: auto; color: #ffe9a8; }
.march-btns { flex-wrap: nowrap; }
.march-btns [data-testid="march-speedup"] { flex: 1 1 auto; min-height: 48px; justify-content: center; gap: 8px; font-size: 15px; }
.march-btns [data-testid="march-speedup"] .su-off { font-weight: 800; }
.march-btns [data-testid="march-speedup"] .su-pay { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 4px; background: rgba(0, 0, 0, .28); font-weight: 800; }
.march-btns [data-testid="march-recall"] { min-width: 48px; min-height: 48px; flex: none; }

/* ---- THE PIN (owner 12/11 19:13): on every row, card or sheet that names a place of the World map; one tap flies the map there.
   A bare glyph, no ground, no frame; the finger target is 44 px whatever the size of the row (the ::after box takes the tap). */
.pin { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.pin::after { content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }
.pin > svg, .stat.pin .ico { width: 18px; height: 18px; color: var(--gold); flex: none; }
.pin.bare > svg { width: 22px; height: 22px; }
.pin:active > svg { transform: scale(.82); }
.pin:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.msg .pin { display: inline-flex; vertical-align: -3px; margin: 0 2px; }
.find-hit .pin { margin-left: 4px; }
.march-head .pin.bare { margin: 0 8px; }
@media (prefers-reduced-motion: reduce) { .pin:active > svg { transform: none; } }

/* ---- GO TO X / Y (owner 12/11 18:2x): long hold / right click on the map, or a tap on the X / Y bar. Sits above that bar. */
.goto { position: absolute; z-index: 3; left: 6px; bottom: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: calc(100% - 68px); margin: 0; padding: 6px 8px; background: rgba(16, 21, 26, .95); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.goto[hidden] { display: none; }
.goto-f { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; }
.goto input.goto-in { width: 3.6em; min-height: 44px; padding: 0 4px; text-align: center; font-size: 16px; font-variant-numeric: tabular-nums; }
.goto button.goto-ok { min-height: 44px; min-width: 56px; margin: 0; }
.goto button.small { min-width: 44px; min-height: 44px; margin: 0; }
.goto-err { flex-basis: 100%; margin: 0; max-width: 250px; }

/* ---- 13/11 23:15 (owner): commanders shown at HALF BODY wherever they lead something, troops as picture cards */
.hb { position: relative; display: block; overflow: hidden; aspect-ratio: 5 / 4; flex: none; border-radius: 6px;
  background: var(--ground, none) #10151a; border: 2px solid color-mix(in srgb, var(--tone, #55666a) 75%, #10151a); }
.hb .hb-img { position: absolute; left: 0; top: 0; width: 100%; height: auto; max-width: none; aspect-ratio: 3 / 4;
  margin-top: calc(var(--bt, .03) * -133.3%); object-fit: cover; }
.hb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 22%; background: linear-gradient(180deg, transparent, rgba(10, 13, 15, .75)); pointer-events: none; }
.march-body { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.march-body > .stats { flex-basis: 100%; }
.march-hb { width: 132px; }
.march-deputy { display: flex; align-items: center; gap: 6px; min-width: 0; }   /* MARCH-DEPUTY 17/11: the sub-commander under the route */
.march-deputy .face.tiny { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.march-deputy-tag { font-size: 11px; font-weight: 700; padding: 1px 5px; border: 1px solid rgba(255, 255, 255, .35); color: #e8d9b0; }
.march-deputy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.march-side { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
/* MARCH-STATS-1117: the march's totals, symbol + number floating, no frame, no background (Phil's rule for every stat line) */
.march-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.march-stats .stat { background: none; border: 0; padding: 0; gap: 3px; white-space: nowrap; }
.march-stats .stat b { font-variant-numeric: tabular-nums; }
.march-stats .ms-cmd small { font-size: 11px; color: #e8d9b0; margin-right: 2px; }
.march-stats .ms-power b { color: #ffd479; }
.sq-stats { min-height: 22px; padding: 2px 6px 0; font-size: 12.5px; }   /* MARCH-STATS-ROW-AND-SQUAD: the squad's totals before Send (min-height: no jump when it fills) */
/* FORECAST-1118: the enemy side and the chance to win from the real battle (squad popup, attack only) */
.sq-vs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 3px 6px 2px; font-size: 12.5px; min-height: 0; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.sq-vs .stat { background: none; border: 0; padding: 0; gap: 3px; white-space: nowrap; }
.sq-vs b { font-variant-numeric: tabular-nums; }
.sq-vs-them { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px 1px 2px; border-radius: 999px; background: rgba(192,86,59,.18); border: 1px solid rgba(192,86,59,.55); }
.sq-vs-tag { font-weight: 800; font-size: 11px; letter-spacing: .06em; color: #ff8a6b; padding: 0 2px 0 4px; }
.sq-vs-t { display: inline-flex; align-items: center; gap: 2px; }
.sq-vs-pic { width: 22px; height: 22px; object-fit: cover; border-radius: 50%; background: #1b1f25; }
.sq-vs-pw b { color: #ffd479; }
.sq-win { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; font-weight: 700; border: 1px solid currentColor; }
.sq-win.good { color: #6fdc8c; } .sq-win.mid { color: #ffd479; } .sq-win.bad { color: #ff6b5b; }
.sq-loss { display: inline-flex; gap: 8px; color: #e9b4a8; }
.sq-ctr, .sq-best { display: inline-flex; align-items: center; gap: 1px; padding: 0 4px; border-radius: 999px; }
.sq-ctr.up, .sq-best { background: rgba(111,220,140,.16); color: #6fdc8c; }
.sq-ctr.down { background: rgba(255,107,91,.16); color: #ff6b5b; }
.sq-ctr-pic { width: 18px; height: 18px; object-fit: cover; border-radius: 50%; background: #1b1f25; }
.sq-verb { color: #9fd0ff; } .sq-verb.off { opacity: .45; }
.sq-ground { color: #b9d98c; }
.march-head { min-height: 0; }
/* 14/11 11:25 (Phil, phone capture: "gaps everywhere, the profile is really tiny, nothing aligned"): the commander stands WHOLE on
   the left (3:4 picture, its empty top cut by --bt so the box ends at the picture's bottom), as tall as the column beside it:
   route (one line per place, arrow down), troops, then load and time on the last line. No band of empty scene under the face. */
.sheet[data-kind="march"] .march-body { flex-wrap: nowrap; align-items: stretch; gap: 12px; }
.sheet[data-kind="march"] .march-hb { --mw: clamp(112px, min(35vw, 26vh), 176px); width: var(--mw); aspect-ratio: auto;
  height: calc(var(--mw) * 1.3333 * (1 - var(--bt, .03))); }
.sheet[data-kind="march"] .march-side { justify-content: space-between; gap: 8px; }
.sheet[data-kind="march"] .sheet-info > .march-side, .sheet[data-kind="march"] .march-side > div { margin: 0; }
.sheet[data-kind="march"] .march-route { display: grid; grid-template-columns: minmax(0, max-content) max-content; column-gap: 10px; row-gap: 2px;
  align-items: baseline; justify-content: start; }
.sheet[data-kind="march"] .march-route > .gi { grid-column: 1 / -1; transform: rotate(90deg); margin-left: 4px; width: 16px; height: 16px; }
/* both coordinates in one column (subgrid; without it a place falls back to name over coordinates) */
.sheet[data-kind="march"] .march-place { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; }
.sheet[data-kind="march"] .march-place b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet[data-kind="march"] .march-place b { font-size: 15px; }
.sheet[data-kind="march"] .march-side > .stats { align-items: center; }
.sq-menu-head .sq-menu-hb { width: 64px; }
/* troop cards: Last-Shelter-like tabs, the unit standing on its card, the count on a strip */
.tcards { display: flex; gap: 6px; flex-wrap: wrap; }
.tcard { position: relative; width: 58px; height: 84px; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  background: radial-gradient(90% 70% at 50% 40%, #33413f, #161c1f 80%); border: 1px solid #4d5c5f; }
.tcard img { position: absolute; left: 50%; top: 2px; height: calc(100% - 22px); width: auto; transform: translateX(-50%); }
.tcard-n { position: relative; display: flex; gap: 3px; align-items: center; justify-content: center; height: 20px; font-size: 12px; font-weight: 700;
  background: rgba(8, 11, 12, .85); border-top: 1px solid var(--gold); }
.tcard-n .glyph { width: 9px; height: 9px; }
.tcard.empty { width: auto; height: auto; padding: 4px 10px; justify-content: center; }
/* the formation editor: the chosen commander large, the others as half-body tiles on one sliding row */
.sq-hero-row { display: flex; gap: 8px; align-items: stretch; }
.sq-hero { flex: none; width: 128px; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.sq-hero-hb { width: 128px; }
.sq-hero-name { font-size: 14px; }
.sq-hero-row .sq-pick { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; align-content: flex-start; scrollbar-width: thin; }
.sq-pick .sq-cand, .sq-hero-row .sq-pick .sq-cand { flex: none; width: 64px; min-width: 0; padding: 3px; }
.sq-cand .sq-cand-hb { width: 100%; }
.sq-cand.on .sq-cand-hb { border-color: var(--gold); }
.sq-choose .sq-cand.small { width: 64px; }
@media (orientation: portrait) and (max-width: 560px) {
  .march-hb { width: 112px; }
  .sq-hero, .sq-hero-hb { width: 104px; }
  .tcard { width: 52px; height: 76px; }
}
.sq-hero-row .sq-pick { align-items: flex-start; }
.list-hb { width: 64px; }
.tcards.small .tcard { width: 44px; height: 62px; }
.tcards.small .tcard img { height: calc(100% - 18px); }
.tcards.small .tcard-n { height: 16px; font-size: 11px; }
@media (min-width: 900px) and (min-height: 600px) { .sheet .march-hb { width: 168px; } }
.pick-troop { height: 40px; width: auto; flex: none; margin-right: 2px; }
.sq-hero { position: relative; }
.sq-hero-name { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; text-shadow: 0 1px 3px #000, 0 0 6px #000; z-index: 1; }
@media (orientation: portrait) and (max-width: 560px) {
  .pick-troop { height: 30px; }
  #squad-sheet .pick-row { margin: 3px 0; }
  #squad-sheet .sq-sec { margin-top: 4px; }
}
#squad-sheet .pick-name:has(.pick-troop) > .glyph { display: none; } #squad-sheet .pick-name { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* 13/11 INFLUENCERS: a rarity with a `gradient` in balance.json (Viral, the rainbow tier) is painted by the rules assets.js rainbow()
   writes for its id; glyphs and figures in its colour turn through the rainbow with this one animation (only without reduced motion) */
@keyframes rfx-hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

/* ---- 14/11 FACE PROFILES + FILM SCENES (owner 02:2x: "the profile of the commander is still too tiny ... the half body on the
   profile is a bad idea, better the face profile, and the half body on the bg frame with random scene, like we see that commander
   inside the film action"). The tiles show the FACE (assets.js headshot: the bust laid so its face box fills the frame width); the
   card and the Shop stage show a FILM SCENE on the whole frame (assets.js scenePic, balance.json commanders.*.scenes), cropped on
   the face point (--sx/--sy) so a narrow phone never cuts the face away; a commander without a scene keeps its bust. */
/* PORTRAIT-TILES-1118: a tile = the bust --pw wide (face box = --tz of it, never narrower than the tile or shorter than it), the face
   centre (--fx, --fy) at the tile's middle across and 57 % down, clamped so no picture edge comes inside the tile (needs container-type size) */
.headshot { --pw: max(100cqw / var(--tz, .5), 75cqh, 100cqw); position: absolute; max-width: none; height: auto; aspect-ratio: 3 / 4; width: var(--pw);
  left: clamp(100cqw - var(--pw), 50cqw - var(--fx, .5) * var(--pw), 0px); top: clamp(100cqh - var(--pw) * 4 / 3, 57cqh - var(--fy, .24) * var(--pw) * 4 / 3, 0px); }
.roster-art .headshot { transform-origin: 50% 35%; transition: transform .25s ease-out, filter .25s; }
button.roster-cell:not(.owned) .headshot { filter: saturate(.7) brightness(.86); }
button.roster-cell:hover .headshot, button.roster-cell:focus-visible .headshot { filter: brightness(1.12); transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .roster-art .headshot { transition: none; } }
/* the city profile: the face in its column, the commander's scene as the ground of the block (dimmed and soft behind the words) */
.hero-face { position: relative; z-index: 1; display: block; width: 100%; height: 100%; min-height: 156px; overflow: hidden; container-type: size; }
/* PORTRAIT-TALL-FRAME (18/11, Phil 14/11 "the half body on the profile is a bad idea"): the frame no longer stretches to the text's
   height (160 x ~310 on a phone = down to the waist); it keeps a head-and-shoulders 4:5 at the top of the card */
.hero > .hero-face { align-self: start; height: auto; aspect-ratio: 4 / 5; min-height: 0; }
/* CARD-GAP-1119 (Phil 19/11 08:18, capture: an empty block under the 4:5 picture in the fixed-height commander card): the frame now
   runs the card's full height and shows MORE of the figure below; the face keeps the place it had in the 4:5 frame (40 % of a 5/4
   width frame) so the head is not zoomed or pushed down, the body fills the rest */
[data-testid="commander"] .hero > .hero-face { align-self: stretch; height: 100%; aspect-ratio: auto; width: 134%; grid-column: 1; grid-row: 1;
  -webkit-mask-image: linear-gradient(90deg, #000 68%, transparent 98%); mask-image: linear-gradient(90deg, #000 68%, transparent 98%); }
[data-testid="commander"] .hero > .hero-text { grid-column: 2; grid-row: 1; position: relative; z-index: 2; }
[data-testid="commander"] .hero-face .headshot.hero-portrait { top: clamp(100cqh - var(--pw) * 4 / 3, 50cqw - var(--fy, .2) * var(--pw) * 4 / 3, 0px); }
/* PORTRAIT-FRAME-1118: the picture is --pw wide (wide enough to show --bz of the bust across AND to cover the frame's height), laid so
   the face centre (--fx, --fy) sits at the frame's middle, 40 % down; clamped so no edge of the picture comes inside the frame */
.hero-face .headshot.hero-portrait { --pw: max(100cqw / var(--bz, .7), 75cqh, 100cqw); width: var(--pw); height: auto; min-height: 0; object-fit: fill; object-position: 0 0;
  left: clamp(100cqw - var(--pw), 50cqw - var(--fx, .5) * var(--pw), 0px); top: clamp(100cqh - var(--pw) * 4 / 3, 40cqh - var(--fy, .2) * var(--pw) * 4 / 3, 0px); }
.hero-stars { margin: 2px 0 4px; align-items: center; }
.star-pips { display: inline-flex; gap: 1px; } .star-pips i { display: inline-flex; color: #46505a; } .star-pips i.on { color: #f2c94c; } .star-pips svg { width: 15px; height: 15px; }
.star-pips i.on svg { fill: currentColor; }
.stat.lvl small { font-weight: 400; } .next-gain svg { width: 13px; height: 13px; }
.hero.has-scene { background: #141a1c; isolation: isolate; }
.hero.has-scene::before { content: ""; position: absolute; inset: -8px; z-index: -1; background: var(--hero-bg) 50% calc(var(--sy, .3) * 100%) / cover no-repeat;
  filter: blur(2px) brightness(.62) saturate(1.05); }
.hero.has-scene::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10, 13, 15, .2) var(--hero-w), rgba(10, 13, 15, .55) 62%, rgba(10, 13, 15, .82)); }
.hero.has-scene .hero-text { position: relative; z-index: 1; text-shadow: 0 1px 2px #000; }
/* the card / the stage: the scene fills the frame */
/* across: centred (the prompt centres the figure; a 390 px phone keeps 82 % of the width, so a face at x >= .12 stays in, and the
   weapon at the far side is not the part cut: Torstein's axe blade was, framed on his face); down: on the face (phone landscape
   keeps 75 % of the height) */
.cc-art .cc-scene, .solo-art .solo-scene { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  object-position: 50% calc(var(--sy, .3) * 100%); }
.dlg-box.cc.has-scene .cc-art { background: #0c0f11; }
/* UX-SCENE-CARD 14/11: the veil stays see-through (R3-G: nothing opaque over the art, < .8); the name and the symbols keep their
   own shadows, measured on every scene by tests/scene_card_test.py */
.dlg-box.cc.has-scene .cc-over { background: linear-gradient(180deg, rgba(8, 11, 12, 0), rgba(8, 11, 12, .6) 72px, rgba(8, 11, 12, .78)); }
.cc-scene-ground { display: none; }
/* a shot can be bright where the bust's slate never was (Harald's title measured 2.4 on his sky): on a scene card the small texts in
   the rarity colour take that colour lit by half (--rl; the badge and the frame keep the pure one), the dim ones go light, the
   skill number gets a deeper chip, and every text of the plate and of the detail a tighter shadow */
.dlg-box.cc.has-scene { --rl: color-mix(in srgb, var(--r) 50%, #fff); }
.dlg-box.cc.has-scene .solo-title, .dlg-box.cc.has-scene .cc-n, .dlg-box.cc.has-scene .cc-power, .dlg-box.cc.has-scene .cc-fight { color: var(--rl); }
.dlg-box.cc.has-scene .cc-n { background: rgba(8, 11, 12, .66); }
.dlg-box.cc.has-scene .cc-panel .stat.dim { color: #dfe6e6; }
.cc-line strong { color: var(--c, inherit); }   /* Status: the rarity's and the faction's own colour (crates.js --c), lit by half on a scene */
.dlg-box.cc.has-scene .cc-line strong { color: color-mix(in srgb, var(--c, #fff) 50%, #fff); }
.dlg-box.cc.has-scene .cc-plate, .dlg-box.cc.has-scene .cc-panel { text-shadow: 0 0 2px #000, 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, .9); }
/* the shot moves like a film: a slow push toward the face, with a drift drawn at each opening (crates.js cardScene: --dx/--dy, and
   --t0 continues it when the card is rebuilt); reduced motion = the still frame.
   The push turns round the face, but never round a point closer than 18 % / 14 % to an edge: the margin the scale adds on that
   side (.1 x that share) then always exceeds the drift (1.6 % / 1.2 % x 1.1), so the shot covers the card at every moment. */
.cc-scene { transform-origin: clamp(18%, calc(var(--sx, .5) * 100%), 82%) clamp(14%, calc(var(--sy, .3) * 100%), 86%); }
@media (prefers-reduced-motion: no-preference) {
  .cc-scene { animation: scene-push 18s cubic-bezier(.22, .61, .36, 1) var(--t0, 0ms) both; }
}
@keyframes scene-push { from { transform: scale(1.02); } to { transform: scale(1.1) translate(calc(var(--dx, 0) * 100%), calc(var(--dy, 0) * 100%)); } }

/* K6: narrow cards keep the full shot width, including hands at the edges.
   The portrait still occupies >= 75% of this phone card; its lower margin
   sits behind the name plate. Vertical drift cannot clip either side. */
@container (max-aspect-ratio: 9/16) {
  /* UX-SCENE-CARD 14/11: the card is taller than the 9:16 shot. What is left below it is the shot's own soft copy (never a
     black band with a hard edge); the shot fades into it over its last 48 px, behind the name plate. The frame is 6 px taller
     than the card, the length of the drift, so the drift never lifts its bottom edge into the card. */
  .cc-art .cc-scene { object-fit: contain; object-position: 50% 0; bottom: -6px; height: calc(100% + 6px);
    -webkit-mask-image: linear-gradient(180deg, #000 calc(177.78cqw - 48px), transparent 177.78cqw); mask-image: linear-gradient(180deg, #000 calc(177.78cqw - 48px), transparent 177.78cqw); }
  .cc-art .cc-scene-ground { display: block; position: absolute; left: -48px; right: -48px; bottom: -48px; top: calc(177.78cqw - 96px);
    background: 50% 100% / 100% auto no-repeat; filter: blur(16px) brightness(.8); }
  @media (prefers-reduced-motion: no-preference) {
    .cc-art .cc-scene { animation-name: scene-drift; }
  }
}
@keyframes scene-drift { from { transform: translateY(0); } to { transform: translateY(-6px); } }

/* A6: the picker reserves one name row for the level; long names yield with an ellipsis. */
.cmd-pick button.cmd-opt > span { display: grid; width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; column-gap: 2px; }
.cmd-pick button.cmd-opt > span > strong { grid-column: 1; grid-row: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-pick button.cmd-opt > span > .stats { display: contents; }
.cmd-pick button.cmd-opt .stats > .lvl { grid-column: 2; grid-row: 1; justify-self: end; white-space: nowrap; }
.cmd-pick button.cmd-opt .stats > :not(.lvl) { grid-column: 1 / -1; justify-content: center; }

/* ---- 14/11 10:12 (owner, four phone captures): the picker tile's top is the FACE edge to edge (no gap between the frame corners
   and the picture, the whole face shown, nothing laid on it); name and figures under it */
button.cmd-opt .cmd-art { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; container-type: size;
  background: radial-gradient(circle at 50% 40%, #2c363a, #12181a 78%); }
button.cmd-opt.locked .cmd-art img { filter: saturate(.6) brightness(.72); }
button.cmd-opt .cmd-info { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 2px 1px 3px; }
button.cmd-opt .cmd-info strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* the City line, the march card and the march sheet stand on the commander's film scene (assets.js sceneGround): the picture crosses
   the whole frame at the face height, a dark veil on the side of the words */
.scene-ground, .sheet[data-kind="march"] {
  background: var(--scrim, linear-gradient(90deg, rgba(10, 13, 15, .5), rgba(10, 13, 15, .8))), var(--scene-bg, none) 50% calc(var(--sy, .4) * 100%) / cover no-repeat, #182024; }
.card.hero-line.scene-ground { --scrim: linear-gradient(90deg, rgba(10, 13, 15, .82), rgba(10, 13, 15, .5) 55%, rgba(10, 13, 15, .12)); min-height: 84px; }
.hero-line .face.big { width: 64px; height: 64px; }
.card.march.scene-ground { --scrim: linear-gradient(90deg, rgba(10, 13, 15, .22), rgba(10, 13, 15, .6) 42%, rgba(10, 13, 15, .72)); }
.sheet[data-kind="march"] { --scrim: linear-gradient(180deg, rgba(18, 24, 27, .38), rgba(18, 24, 27, .8) 72%); }
.scene-ground strong, .scene-ground .stats, .sheet[data-kind="march"] .march-side, .sheet[data-kind="march"] .march-who { text-shadow: 0 1px 2px #000; }
.list-hb { width: 84px; }

/* ---- SQUAD POPUP (owner 14/11 14:05, "like Last Shelter"): a popup with a gap all around (a tap there closes it, no X),
   the gear top right widens it to the whole screen. The gap on top is where the notice bubbles land while it is open. */
.sq-dlg { position: fixed; inset: 0; z-index: 37; display: flex; align-items: center; justify-content: center;
  padding: calc(52px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); background: rgba(6, 9, 10, .62); }
.sq-dlg[hidden] { display: none; }
.sq-box { position: relative; width: min(460px, 100%); max-height: 100%; overflow-y: auto; overscroll-behavior: contain; background: #20282c;
  border: 2px solid var(--gold); border-radius: 14px; padding: 6px 8px 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.sq-box.in { animation: dlg-in .18s ease-out 1; }   /* the opening draw only (squads.js drawSquad) */
.sq-dlg.full { padding: calc(10px + env(safe-area-inset-top)) 8px calc(10px + env(safe-area-inset-bottom)); }
.sq-dlg.full .sq-box { width: min(1100px, 100%); height: 100%; }
/* SQUAD-POP-MARCH (Phil 15/11: "remove the frame that s useless and gaps and the unless space ... 'done' buttom juste remove it
   and move it front of the setup symbol with a check symbol ... a taps for multi march"): ONE top line = a tab per squad, the
   total of its troops, the check, the gear. No title line, no "Troops" line, no Done bar under the sliders. */
.sq-head { flex-wrap: nowrap; gap: 6px; align-items: center; }
button.sq-gear, button.sq-ok { flex: none; min-width: 44px; min-height: 44px; }
button.sq-gear svg, button.sq-ok svg { width: 24px; height: 24px; }
.sq-total { flex: none; color: var(--gold); }
.sq-tabs { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 3px 3px 5px 4px; }
.sq-tabs::-webkit-scrollbar { display: none; }
button.sq-tab { position: relative; flex: none; width: 44px; height: 44px; min-width: 0; min-height: 0; padding: 0; border-radius: 10px;
  border: 2px solid var(--rar, #55666a); background: #10151a; color: var(--gold); opacity: .55; display: inline-flex; align-items: center; justify-content: center; }
button.sq-tab.on { opacity: 1; box-shadow: 0 0 0 2px #fff; }
button.sq-tab:disabled { opacity: .3; }
.sq-tab-img { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; pointer-events: none; }
.sq-tab-n { position: absolute; left: -4px; bottom: -4px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: #10151a;
  border: 1px solid var(--gold); color: var(--gold); font-size: 11px; font-weight: 700; text-align: center; }   /* 11 px: Phil's floor (UX-AUDIT-NEW-REDS-1120, was 10) */
/* opened to march: where the squad goes (left) and what leaves (right), one line, glyphs and figures */
.sq-march { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; padding: 2px 2px 4px; font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 4px; }
.sq-march .sq-est { margin-left: auto; color: var(--gold); }
.sq-march .way-row { flex: 1 1 100%; margin: 2px 0 0; }
/* PACE-RUN-SLOW: the word never breaks, the hint takes what is left */
.sq-march .march-extra { flex: 1 1 100%; min-width: 0; }
.pace-row .way-opt { justify-content: flex-start; padding: 0 8px; gap: 6px; }
.pace-row .way-opt > span:not(.small-text) { white-space: nowrap; font-weight: 600; flex: 0 0 auto; }
.pace-row .way-opt > .small-text { line-height: 1.15; text-align: left; min-width: 0; }   /* GROUND-1115: the two ways, under the line of the place */
.sq-disband { margin-top: 10px; }
.sq-cols { display: flex; flex-direction: column; gap: 4px; }
.sq-dlg.full .sq-cols { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px), (orientation: landscape) and (max-height: 560px) {
  .sq-dlg.full .sq-cols { grid-template-columns: minmax(260px, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
  .sq-dlg.full .sq-box { height: auto; }   /* wide screen: the box is as tall as what it holds, no empty half under Done */
  .sq-dlg.full .sq-leads { grid-template-columns: 1fr; justify-items: center; } .sq-dlg.full .sq-slide { width: 100%; }
  .sq-dlg.full .sq-slide.lead .sq-slide-row { max-width: 360px; } .sq-dlg.full .sq-slide.deputy .sq-slide-row { max-width: 260px; }
}
/* commander + sub-commander, side by side; the lead is the bigger one */
.sq-leads { display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; align-items: end; margin-top: 2px; }
.sq-slide { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.sq-slide-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.sq-slide-row { display: flex; align-items: center; gap: 2px; width: 100%; }
button.sq-arrow { flex: none; min-width: 26px; width: 26px; min-height: 44px; padding: 0; background: transparent; border: 0; color: var(--gold); }
button.sq-arrow:disabled { opacity: .25; }
.sq-slide-art { flex: 1 1 auto; min-width: 0; touch-action: pan-y; cursor: grab; border-radius: 8px; outline-offset: 2px;
  transform: translateX(var(--dx, 0)); transition: transform .18s ease-out; user-select: none; -webkit-user-select: none; }
.sq-slide-art.drag { transition: none; cursor: grabbing; opacity: .85; }
.sq-slide-art .hb { width: 100%; border: 2px solid var(--r, #55666a); }
.sq-slide-none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 5 / 4; width: 100%;
  border: 2px dashed var(--gold); border-radius: 6px; color: var(--gold); font-size: 12px; text-align: center; padding: 4px; }
.sq-slide-none svg { width: 26px; height: 26px; }
.sq-slide-name { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-slide.deputy .sq-slide-name { font-size: 13px; }
.sq-slide-tag { font-size: 11px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* the strip of faces a tap on the picture opens: one row, slid sideways */
.sq-strip { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding: 6px 2px; margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, .08); scrollbar-width: thin; }
.sq-strip-face { flex: none; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 62px; min-height: 0; padding: 3px; font-size: 11px; }
.sq-strip-face .face { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--r, #55666a); }
.sq-strip-face.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.sq-strip-face .sq-cand-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-none-face { display: flex; align-items: center; justify-content: center; color: var(--dim); }
/* troop sliders */
.sq-sum { color: var(--gold); font-size: 14px; letter-spacing: 0; text-transform: none; }
.sq-troops { display: flex; flex-direction: column; gap: 0; }
/* Phil 14/11: the troop's picture stands over both lines of its row (name + free above, slider + number below); no -, + and "all" buttons */
.sq-trow2 { display: grid; grid-template-columns: auto minmax(0, 1fr) 64px; grid-template-areas: "img name name" "img range num";
  align-items: center; gap: 0 8px; padding: 1px 0; }
.sq-trow2 > .pick-troop { grid-area: img; width: 50px; height: 58px; object-fit: contain; margin: 0; align-self: center; }   /* one width for every troop, so names and sliders line up (a rider is wider than a footman) */
.sq-tname { grid-area: name; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.sq-trow2 input[type=number] { grid-area: num; width: 64px; min-height: 34px; padding: 2px 4px; text-align: center; }
/* no frame round the slider (the page's `input` rule gave it a border, a ground and 10 px of padding each side) */
.sq-range { grid-area: range; width: 100%; min-width: 0; min-height: 0; height: 34px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.sq-range::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--gold) var(--p, 0%), #10151a var(--p, 0%)); border: 1px solid #55666a; }
.sq-range::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--gold) var(--p, 0%), #10151a var(--p, 0%)); border: 1px solid #55666a; }
.sq-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #f3d27a; border: 2px solid #7a5a12; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.sq-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #f3d27a; border: 2px solid #7a5a12; }
.sq-range:disabled { opacity: .35; }
.sq-grid { flex-wrap: wrap; }
.sq-dlg.full .sq-grid .sq-cand { width: 76px; }
.sq-cand.dep { border-color: #8fb3c9; box-shadow: 0 0 0 2px #8fb3c9 inset; }
#squad-sheet select { width: 100%; }
@media (prefers-reduced-motion: reduce) { .sq-box.in { animation: none; } .sq-slide-art { transition: none; } }

/* ---- COMMANDER CARD as a POPUP on phones (owner 14/11 14:05, again 17:22): ONE rule, the SHOP-SWIPE band (search "SHOP-SWIPE 14/11
   (owner 17:22"). The SQ-POP copy that stood here (12 px gap + a ring in the rarity colour all round) was cut at the REL-1114 merge:
   it came later in the file and won, and the ring broke the 17:22 rule "rarity on the corners only". */
/* phone, whole-screen squad: the two slides share the width equally so the faces grid, the post and Done fit one screen (7 faces) */
@media (max-width: 559px) and (orientation: portrait) {
  .sq-dlg.full .sq-leads { grid-template-columns: 1fr 1fr; }
  .sq-dlg.full .sq-trow2 { padding: 2px 0; }
}
@media (max-width: 559px) and (orientation: portrait) {
  .sq-dlg.full .sq-sec { margin: 6px 0 2px; }
  .sq-dlg.full .sq-slide-tag { display: none; }   /* rarity is the frame colour; the labels Commander / Sub-commander stay */
}
/* phone landscape: the squad popup is centred now; its notice bubbles go back to the top gap (52 px) above it, not to the right half */
@media (orientation: landscape) and (max-height: 520px) {
  body:has(#squad-sheet:not([hidden])) #toasts { left: 50%; right: auto; transform: translateX(-50%); width: min(60vw, 420px); top: calc(6px + env(safe-area-inset-top)); bottom: auto; }
}
/* phone landscape: the small popup is wide and in two columns (slides | troops), so the sliders are seen without scrolling */
@media (orientation: landscape) and (max-height: 520px) {
  .sq-dlg { padding: calc(44px + env(safe-area-inset-top)) 14px 10px calc(14px + env(safe-area-inset-left)); }
  .sq-box { width: min(760px, 100%); }
  .sq-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 12px; align-items: start; }
  .sq-slide-label { font-size: 11px; } .sq-slide-name { font-size: 13px; }
  .sq-trow2 { padding: 1px 0; } .sq-tname { font-size: 12px; }
}
/* SQUAD-POOL: beside the troop name, how many of it this squad may take (owned minus the other squads) */
#squad-sheet .sq-free { margin-left: auto; color: var(--dim); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
/* WORLD-BAR: a held face is our menu, never the system callout or a text selection */
.sq-face { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* WORLD-BAR-DESK-ALIGN: on the wide World screen the small popup stands in the middle of the MAP, clear of the 460 px side panel
   (474 = panel + the 14 px gap of the other side, so the box centre is the map centre); the whole-screen view keeps the whole screen */
@media (min-width: 900px) and (min-height: 521px) {
  body[data-tab="world"] .sq-dlg:not(.full) { padding-left: 474px; }
}
/* 14/11 17:00 YOUR commanders only (owner: "you mixed up the commander that the player have already obtained ... with all the no obtained").
   One row of the faces this account owns, leader first; it scrolls sideways when it outgrows the panel. The ones not found yet are ONE
   tile at the end ("+77 To find") that opens the catalogue of every commander. */
.skill-tabs.mine { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 2px 4px; scroll-snap-type: x proximity; }
.skill-tabs.mine::-webkit-scrollbar { display: none; }
.skill-tabs.mine button.skill-tab { flex: 0 0 60px; width: 60px; padding: 4px 2px 3px; opacity: 1; position: relative; scroll-snap-align: start; border-radius: 6px; }
.skill-tabs.mine button.skill-tab .face { width: 44px; height: 44px; border: 2px solid var(--r, #5a6a70); border-radius: 50%; }
.skill-tabs.mine button.skill-tab.on { background: #1c262b; box-shadow: inset 0 -3px 0 var(--r, currentColor); }
.skill-tabs.mine .roster-name { position: static; display: block; padding: 0; width: 100%; text-align: center; font-size: 11px; color: inherit; }
.skill-tabs.mine button.skill-tab.more { color: #9aa6a2; }
.more-n { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border: 2px dashed #4b585c; border-radius: 50%; font-size: 12px; line-height: 1; gap: 1px; }
.more-n svg { width: 15px; height: 15px; }
.cmd-pick .cmd-group { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.cmd-pick button.cmd-opt.more { justify-content: center; align-items: center; gap: 4px; padding: 8px 2px; color: #9aa6a2; border-style: dashed; }
.cmd-pick button.cmd-opt.more .roster-name { position: static; padding: 0; text-align: center; color: inherit; }
.cmd-pick button.cmd-opt.more > span.more-n { display: flex; flex-direction: column; grid-template-columns: none; width: 52px; height: 52px; margin: 6px auto 2px; }
.cmd-pick button.cmd-opt.more > span.roster-name { display: block; width: 100%; }

/* ---- SHOP-SWIPE 14/11 (owner 17:22: "remove the rarity colour that is on the bg, let the rarity colour only show on the corner of
   the frame; the profile that shows only the head keeps the rarity colour on its background, the others better a background
   according to their plot, their story, their biome").
   1) RARITY = CORNERS. A half-body card (shop slices, the commander card) has a dark frame and four L corners in its rarity colour
   (--r), drawn over the picture by ::after; no rarity colour behind the commander any more. Head-only tiles (img[data-rar], the
   faces) keep their rarity ground (the R3-H rule above, untouched).
   2) BIOME GROUND. Behind the cut-out commander: the land of its faction (balance.json factions.*.biome, cm.faction = data-biome),
   drawn in CSS: Frostmark snow and tundra, Ashen Reach burnt mountains, Deepwood forest and marsh, Tidehold coast and sea, the
   vagabonds' road. Painted biome plates (art) are a later pass: A-FAIRE SHOP-SWIPE-BIOME-ART. */
.pack-hero::after, .dlg-box.cc::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; --cl: clamp(8px, 14%, 18px); --cw: 3px;
  background:
    var(--rc, linear-gradient(var(--r), var(--r))) left top / var(--cl) var(--cw) no-repeat, var(--rc, linear-gradient(var(--r), var(--r))) left top / var(--cw) var(--cl) no-repeat,
    var(--rc, linear-gradient(var(--r), var(--r))) right top / var(--cl) var(--cw) no-repeat, var(--rc, linear-gradient(var(--r), var(--r))) right top / var(--cw) var(--cl) no-repeat,
    var(--rc, linear-gradient(var(--r), var(--r))) left bottom / var(--cl) var(--cw) no-repeat, var(--rc, linear-gradient(var(--r), var(--r))) left bottom / var(--cw) var(--cl) no-repeat,
    var(--rc, linear-gradient(var(--r), var(--r))) right bottom / var(--cl) var(--cw) no-repeat, var(--rc, linear-gradient(var(--r), var(--r))) right bottom / var(--cw) var(--cl) no-repeat; }
.dlg-box.cc::after { --cl: 26px; --cw: 3px; z-index: 5; }
/* a closed slice is a sliver: four hooks on each made a comb of teeth along the row (seen 17:4x, phone-1-group.png); it keeps ONE
   thin line of its rarity along its top, dimmed like its picture, and only the open commander has the four corners */
.acc > .pack-hero:not(.open)::after { opacity: .6; background: var(--rc, linear-gradient(var(--r), var(--r))) left top / 100% 2px no-repeat; }
.acc > .pack-hero.open::after { --cl: clamp(12px, 18%, 26px); }
.cc-art.biome { background: var(--biome, #222025); }
/* the commander card without a scene: the hd picture under the alpha of its -cut file (crates.js cardBust), so the biome shows round it */
.cc-art.biome .bust { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
/* CARD-SHOWCASE-FULL-1123 (Phil 23/11 22:08: "this image is not full screen"): an opaque showcase (crates.js cardBust marks it) covers
   the whole card, centred on the face, under the name plate like a scene; no figure window, no fade, no mask */
.cc-art .bust[data-opaque="1"] { top: 0; bottom: auto; height: 100%; width: max(100cqw, 75cqh); aspect-ratio: auto; object-fit: cover; object-position: 50% 0%;
  transform: translateX(clamp(calc(100cqw - 100%), calc(50cqw - var(--bx, .5) * 100%), 0px));   /* centred on the FIGURE (--bx), never a gap at a side */
  -webkit-mask-image: none; mask-image: none; }
/* CARD-SHOWCASE-PHONE-CROP-1124 (js/cardspan.js): hands and weapon wider than a phone card: the picture is only as wide as it takes to
   show them (--sw of its width fits the card), and its foot fades into its own soft copy, which fills the card */
.cc-art .bust[data-opaque="1"][data-span] { width: max(100cqw, min(75cqh, calc(100cqw / var(--sw, 1)))); height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
@container (max-aspect-ratio: 74 / 100) { .cc-art .bust[data-opaque="1"][data-span] { -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent); } }
.cc-paint-ground { --pw: max(100cqw, min(75cqh, calc(100cqw / var(--sw, 1)))); position: absolute; left: 0; width: var(--pw); top: calc(var(--pw) * 1.05); bottom: -30px;
  background-size: 100% 2400%; background-position: 50% 100%; filter: blur(20px) brightness(.8);   /* the last rows of the picture, drawn down: its own colours go on under its foot */
  transform: translateX(clamp(calc(100cqw - 100%), calc(50cqw - var(--bx, .5) * 100%), 0px)) scaleX(1.18); }
.cc-paint-ground::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 22%, rgba(8, 11, 12, .82) 78%); }
[data-biome="frostmark"] { --biome:
  radial-gradient(1.5px 1.5px at 20% 30%, rgba(230, 236, 240, .55), transparent 70%) 0 0 / 37px 43px,
  radial-gradient(1px 1px at 60% 70%, rgba(230, 236, 240, .45), transparent 70%) 0 0 / 53px 61px,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V150l50-22 40 14 60-30 50 22 46-26 54 28 48-18 52 20v62z' fill='%230d1822'/%3E%3C/svg%3E") left bottom / 100% 34% no-repeat,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V118l38-36 30 22 52-62 44 48 34-30 58 58 46-44 40 30 58-50v146z' fill='%2324394d'/%3E%3Cpath d='M38 82l14 13-9 2-9-5zM120 42l20 23-12-2-11 6-9-8zM198 74l12 11-10 1zM302 70l13 12-9-1-8 4zM342 54l10 9-8 2z' fill='%23a9bccb' fill-opacity='.55'/%3E%3C/svg%3E") left bottom / 100% 58% no-repeat,
  radial-gradient(120% 55% at 50% 72%, rgba(120, 160, 190, .32), transparent 70%),
  linear-gradient(180deg, #0c141c, #1b2b3a 62%, #101b25); }
[data-biome="ashen"] { --biome:
  radial-gradient(1.5px 1.5px at 30% 40%, rgba(255, 140, 70, .6), transparent 70%) 0 0 / 41px 47px,
  radial-gradient(1px 1px at 70% 20%, rgba(200, 190, 180, .35), transparent 70%) 0 0 / 29px 53px,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V140l60-18 40 16 70-26 60 20 50-16 60 22 60-12v74z' fill='%23110c0b'/%3E%3C/svg%3E") left bottom / 100% 32% no-repeat,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V112l30-30 20 16 44-74 30 46 22-20 50 68 30-38 44 26 40-60 36 44 24-18 30 34v94z' fill='%23241a17'/%3E%3C/svg%3E") left bottom / 100% 60% no-repeat,
  radial-gradient(110% 50% at 50% 70%, rgba(190, 70, 30, .45), transparent 72%),
  linear-gradient(180deg, #120b0a, #2a1410 60%, #170d0b); }
[data-biome="deepwood"] { --biome:
  radial-gradient(1.5px 1.5px at 40% 50%, rgba(200, 146, 58, .45), transparent 70%) 0 0 / 47px 59px,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V120l14-50 14 50h6l18-70 18 70h8l12-44 12 44h10l20-80 20 80h6l14-52 14 52h10l18-66 18 66h8l12-40 12 40h10l20-74 20 74h6l14-48 14 48h8l16-60 16 60v80z' fill='%23090f0a'/%3E%3C/svg%3E") left bottom / 100% 46% no-repeat,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V110l20-60 20 60h10l16-48 16 48h14l22-70 22 70h12l14-40 14 40h16l20-62 20 62h10l18-56 18 56h14l16-44 16 44h12l22-66 22 66v90z' fill='%23172417'/%3E%3C/svg%3E") left bottom / 100% 68% no-repeat,
  radial-gradient(120% 40% at 50% 66%, rgba(140, 170, 120, .22), transparent 72%),
  linear-gradient(180deg, #0a110b, #1a2a1a 60%, #0c140d); }
[data-biome="tidehold"] { --biome:
  repeating-linear-gradient(176deg, transparent 0 9px, rgba(216, 206, 182, .07) 9px 10px) left bottom / 100% 30% no-repeat,
  linear-gradient(180deg, #123a40, #0a1b1e) left bottom / 100% 30% no-repeat,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V150l30-30 40 10 30-24 30 20 40 6 40 18 50-4 60-26 40 8 40 24v48z' fill='%230f2629'/%3E%3C/svg%3E") left bottom / 100% 48% no-repeat,
  radial-gradient(120% 45% at 50% 70%, rgba(201, 166, 70, .22), transparent 70%),
  linear-gradient(180deg, #0a1517, #173a40 62%, #0c1f22); }
[data-biome="vagabond"] { --biome:
  radial-gradient(1px 1px at 30% 60%, rgba(183, 176, 162, .4), transparent 70%) 0 0 / 31px 37px,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V132c40-16 90-22 140-10s110 10 150-6 80-8 110 2v82z' fill='%23140f0b'/%3E%3Cpath d='M182 200l12-66h12l12 66z' fill='%23302419'/%3E%3C/svg%3E") left bottom / 100% 40% no-repeat,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V110c50-30 100-34 150-18s90 4 130-14 90-14 120 6v116z' fill='%23261d15'/%3E%3C/svg%3E") left bottom / 100% 56% no-repeat,
  radial-gradient(120% 50% at 50% 68%, rgba(183, 130, 80, .28), transparent 72%),
  linear-gradient(180deg, #110f0c, #2b2118 60%, #14100c); }
/* the card that turns: it comes in from the side the finger sent it (next from the right, previous from the left); at the end of the
   list it leans and comes back */
.dlg-box.cc.in-next { animation: cc-in-next .26s cubic-bezier(.2, .7, .2, 1) 1; }
.dlg-box.cc.in-prev { animation: cc-in-prev .26s cubic-bezier(.2, .7, .2, 1) 1; }
@keyframes cc-in-next { from { transform: translateX(42px); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes cc-in-prev { from { transform: translateX(-42px); opacity: .2; } to { transform: none; opacity: 1; } }
/* the card that OPENS (Phil 17/11 10:00 "flip the card, more playful"): it turns over from its edge like a card dealt on the table,
   passes the face a little too far, swings back and settles with a small pop; one flash of light as the face comes round */
.dlg-box.cc.in-open { animation: cc-in-open .62s cubic-bezier(.25, .8, .3, 1) 1 both; transform-origin: 50% 55%; backface-visibility: hidden; }
@keyframes cc-in-open {
  0% { transform: perspective(1100px) rotateY(-100deg) scale(.62) rotateZ(-5deg); opacity: 0; filter: brightness(.5); }
  38% { transform: perspective(1100px) rotateY(16deg) scale(1.05) rotateZ(1.5deg); opacity: 1; filter: brightness(1.45); }
  62% { transform: perspective(1100px) rotateY(-7deg) scale(.985) rotateZ(-.6deg); filter: brightness(1.08); }
  80% { transform: perspective(1100px) rotateY(3deg) scale(1.01); filter: none; }
  100% { transform: none; opacity: 1; filter: none; } }
@media (prefers-reduced-motion: reduce) { .dlg-box.cc.in-open { animation: none; } }
/* CARD-FLIP-REAL-1117: the back of a commander card, seen while a tap turns it right round (crates.js cardFlip). The card box clips,
   so the back is a plain layer switched on between the two edge-on instants and drawn mirrored (the box is then past 90 degrees);
   deaf, so a tap during the turn still reaches the picture. .cc-glint: the streak of light of the landing (moved by cardFlip). */
.cc-back { position: absolute; inset: 0; z-index: 6; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5cqh; pointer-events: none; transform: scaleX(-1);
  background: radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--r) 46%, transparent) 0, transparent 58%),
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--r) 16%, #1b2226) 0 12px, color-mix(in srgb, var(--r) 7%, #141a1d) 12px 24px);
  box-shadow: inset 0 0 0 3px var(--r), inset 0 0 0 9px #10151a, inset 0 0 0 10px color-mix(in srgb, var(--r) 60%, transparent), inset 0 0 90px rgba(0, 0, 0, .6); }
.dlg-box.cc[data-face="back"] .cc-back { display: flex; }
/* the card that flipped IN keeps .in-open and its hidden back face: past 90 degrees the whole card was not painted (seen on the first
   capture of the turn: the roster, no card). While a tap turns it, its back face is painted. */
.dlg-box.cc[data-flip="turn"] { backface-visibility: visible; -webkit-backface-visibility: visible; }
.cc-back-mark { width: 34cqmin; height: 34cqmin; display: grid; place-items: center; border-radius: 50%; color: color-mix(in srgb, var(--r) 70%, #fff);
  border: 2px solid var(--r); box-shadow: 0 0 0 7px rgba(16, 21, 26, .7), 0 0 0 8px color-mix(in srgb, var(--r) 55%, transparent), 0 0 44px color-mix(in srgb, var(--r) 60%, transparent); }
.cc-back-mark .gi { width: 52%; height: 52%; }
.cc-back .fac-shield { width: 7cqmin; height: 8cqmin; }
.cc-glint { position: absolute; inset: 0 -10%; z-index: 7; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255, 255, 255, .5) 48%, color-mix(in srgb, var(--r) 60%, #fff) 52%, transparent 70%); mix-blend-mode: screen; }
/* SHOP-FLIP-1117 (Phil 17/11 "between the image from the list to the card image it should animation fliping"): a card opened from a
   Shop slice is dealt out of it (crates.js flipFrom, Web Animations): no CSS entrance; .cc-from = the copy of the tapped picture
   that turns away on the way, above the card's dialog (z 74) */
.dlg-box.cc.in-from { animation: none; }
.cc-from { position: fixed; z-index: 80; overflow: hidden; pointer-events: none; border: 2px solid; box-sizing: border-box; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
@media (prefers-reduced-motion: reduce) { .cc-from { display: none; } }
.dlg-box.cc.cc-end-r { animation: cc-end-r .3s ease-out 1; } .dlg-box.cc.cc-end-l { animation: cc-end-l .3s ease-out 1; }
@keyframes cc-end-r { 40% { transform: translateX(-12px); } }
@keyframes cc-end-l { 40% { transform: translateX(12px); } }
.cc-nav { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.cc-nav + button.cc-arrow { margin-left: 4px; }
.cc-nav button.cc-go { width: 44px; height: 44px; min-height: 44px; padding: 0; background: rgba(8, 11, 12, .55); border: 0; }
.cc-nav button.cc-go:disabled { opacity: .3; }
.cc-pos { min-width: 4.2ch; text-align: center; font-size: 13px; font-weight: 700; color: #d7ddd9; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
@media (prefers-reduced-motion: reduce) { .dlg-box.cc.in-next, .dlg-box.cc.in-prev, .dlg-box.cc.cc-end-r, .dlg-box.cc.cc-end-l { animation: none; } }

/* ---- ECO-1115: six resources, the stores, the Market, the node map ---- */
.res-glyph { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.res-glyph.res-timber { color: #c79a5a; } .res-glyph.res-stone { color: #c6c8c0; } .res-glyph.res-silver { color: #e3e9f0; } .res-glyph.res-runestone { color: #a995ff; }
/* six resources + credits in the strip: a chip never cuts its number, the strip takes a second row when the first is full */
.res-bar { flex-wrap: wrap; gap: 3px; }
.res-chip { flex: 1 0 auto; padding: 3px 5px; gap: 3px; font-size: 13px; overflow: visible; }
.res-chip b { margin-left: auto; overflow: visible; }
.res-chip .ico, .res-chip .res-glyph { width: 15px; height: 15px; }
.res-chip[hidden] { display: none; }
/* PHONE: ONE row, as before ECO-1115 (a second row took 27 px from every screen: the Shop stage and the commander card are laid
   out to the pixel on a 390 x 844 phone, game_city_e2e "card G" / "shop D (h)" went red). Smaller chips, numbers from 10 000 up
   written 35k (main.js); if the row still runs short the number is the part that yields, never the icon. */
@media (max-width: 560px) {
  .res-bar { flex-wrap: nowrap; gap: 2px; }
  #res .chip { flex: 1 1 auto; min-width: 0; min-height: 28px; padding: 3px 3px; gap: 2px; font-size: 11.5px; overflow: hidden; }   /* 28 px = the chip of before: the header keeps its height to the pixel */
  #res .chip b { overflow: hidden; text-overflow: ellipsis; }
  #res .chip .ico, #res .chip .res-glyph { width: 13px; height: 13px; }
}
.stat.biome .gi, .biome-chip .gi { width: 15px; height: 15px; }
.biome-chip { color: #b9d39a; font-size: 13px; white-space: nowrap; }
.store-row { align-items: center; gap: 6px; }
.res-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.res-btn { min-width: 40px; min-height: 40px; }
.res-btn.on { outline: 2px solid var(--accent, #e0b040); background: #2a3138; }
.res-btn:disabled { opacity: .35; }
.noart.lumber_camp { background: linear-gradient(160deg, #a9814a 0 50%, #8a6a3c 50%); }
.noart.quarry { background: linear-gradient(160deg, #c3c3bc 0 50%, #a3a39c 50%); }
.noart.fishery { background: linear-gradient(160deg, #5aaab5 0 50%, #3f8f9a 50%); }
.noart.trading_post { background: linear-gradient(160deg, #e0c066 0 50%, #c9a646 50%); }
.noart.smithy { background: linear-gradient(160deg, #8a5a50 0 50%, #6a4038 50%); }
.noart.watchtower { background: linear-gradient(160deg, #a8adb6 0 50%, #8a8f98 50%); }
.noart.market { background: linear-gradient(160deg, #d49456 0 50%, #b8763a 50%); }
.noart.stables { background: linear-gradient(160deg, #a89866 0 50%, #8a7a4a 50%); }
.noart.rune_circle { background: linear-gradient(160deg, #8a7aee 0 50%, #6a5acd 50%); }
.noart.steward_hall { background: linear-gradient(160deg, #ecd070 0 50%, #d4b24a 50%); }
.tree { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 6px 2px 10px; }
.tree-progression { padding: 8px 0 12px; }
.tree-level-info .cost { flex-wrap: wrap; max-width: 100%; }
.tree-level-info .need-thumb { width: 24px; height: 24px; }
.tree-links { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.tree-links path { fill: none; stroke-width: 2; }
.tree-links path.met { stroke: #6fbf8a; }
.tree-links path.unmet { stroke: #6b747c; stroke-dasharray: 4 4; }
.tree-row { position: relative; display: flex; align-items: flex-start; gap: 6px; }
.tree-tier { flex: none; width: 34px; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--dim, #8b949e); padding-top: 8px; }
.tree-tier.on { color: #e0b040; }
.tree-tier .gi { width: 14px; height: 14px; }
.tree-nodes { display: flex; flex-wrap: wrap; gap: 14px 8px; flex: 1 1 auto; }
.tree-node { position: relative; z-index: 1; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 86px; min-height: 76px; padding: 4px 3px; border-radius: 8px;
  border: 1px solid #2c343b; background: #161c21; color: inherit; font: inherit; font-size: 11px; cursor: pointer; }
.tree-node.built { border-color: #6fbf8a; }
.tree-node.open { border-color: #e0b040; }
.tree-node.locked { border-color: var(--line); background: #191e20; color: var(--dim); }
.tree-node.locked .need-thumb { opacity: .55; }
.tree-node .tree-name { line-height: 1.15; text-align: center; font-weight: 600; }
.tree-node .tree-meta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; }
.tree-node .tree-meta .gi, .tree-node .tree-meta .ico { width: 13px; height: 13px; }
.tree-site, .tree-unlock { font-size: 11px; line-height: 1.15; text-align: center; }
.tree-site { color: var(--dim); }
.tree-unlock { color: #efc684; }

/* Long-press game actions must not start browser text selection. Chat stays copyable. */
body #app, body #app * { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
body #app input, body #app textarea, body #app [contenteditable="true"],
body #app .chat-log, body #app .chat-log *, body #app .chat-form, body #app .chat-form *,
body #app .talk-log, body #app .talk-log * { -webkit-user-select:text; user-select:text; -webkit-touch-callout:default; }
/* TILE-MENU-UGLY-DISC (16/11, Phil: "no frame to save space ... more fun and animated and more smaller with only a symbol"): no disc,
   no border, no shade. A transparent layer over the map (a tap on it closes the menu), a small dot on the held tile and 46 px icon
   buttons fanned around it (world.js openTileMenu places them, --fx / --fy = the way back to the tile for the pop-in). */
.tile-menu { position:absolute; inset:0; z-index:45; background:transparent; }
.tile-menu-dot { position:absolute; width:12px; height:12px; margin:-6px 0 0 -6px; border-radius:50%; background:var(--gold,#d6a84a);
  box-shadow:0 0 0 4px rgba(214,168,74,.28); pointer-events:none; animation:tile-dot .32s ease-out both; }
.tile-action { position:absolute; width:46px; height:46px; margin:0; padding:0; border-radius:50%; display:grid; place-items:center;
  background:rgba(14,19,22,.9); color:var(--gold,#d6a84a); border:1px solid rgba(214,168,74,.6); box-shadow:0 3px 10px rgba(0,0,0,.45);
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; touch-action:manipulation; cursor:pointer;
  animation:tile-pop .46s cubic-bezier(.24,1.7,.45,1) both; animation-delay:var(--d,0s); }
.tile-action .gi { width:24px; height:24px; }
.tile-action:hover { background:rgba(30,38,42,.95); }
.tile-action:focus-visible { outline:2px solid #fff; outline-offset:2px; }
@keyframes tile-pop { from { opacity:0; transform:translate(var(--fx,0), var(--fy,0)) scale(.2) rotate(-50deg); } 55% { opacity:1; } to { opacity:1; transform:none; } }
@keyframes tile-dot { from { transform:scale(0); } 70% { transform:scale(1.5); } to { transform:none; } }
@media (prefers-reduced-motion: reduce) { .tile-action, .tile-menu-dot { animation:none; } }

/* CHAT-COMPACT-1116: one row of small symbol tabs with the close on it; the frame is ~1 cm taller (downwards) and ~6 mm wider on a phone */
.talk-box { width: min(87vw, 396px); height: calc(min(52vh, 440px) + 60px); height: calc(min(52dvh, 440px) + 60px); top: calc(50% + 30px); max-height: calc(100dvh - 16px); }
.talk-head { gap: 4px; align-items: center; }
.talk-tabs { flex-wrap: nowrap; gap: 4px; flex: 1 1 auto; min-width: 0; }
.talk-box .talk-tab, .talk-box .talk-head > button.ib, .talk-box button.talk-mini { min-width: 0; min-height: 0; width: 34px; height: 32px; padding: 0; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.talk-box .talk-tab svg, .talk-box .talk-head > button.ib svg, .talk-box button.talk-mini svg { width: 17px; height: 17px; }
.talk-wait { display: inline-flex; width: 34px; justify-content: center; } .talk-wait svg { width: 16px; height: 16px; }
.friend-row { display:flex; gap:6px; align-items:center; padding:5px 0; border-bottom:1px solid #66746855; }
.friend-row > span:first-child { flex:1; min-width:80px; overflow-wrap:anywhere; }
.friend-add { display:flex; gap:6px; align-items:center; }
.friend-add input { flex:1; min-width:0; min-height:32px; height:32px; padding:0 8px; }

/* FLOAT-BAR-1116 (Phil 16/11: "should be like rotatae buttom, stop wasting space with a dumb empty space frame"): the bar of a
   mode has no frame. With a preview (placing / moving) it is a cluster of round symbols the scene puts under the preview
   (cityscene placeBar); with none (edit idle, roads, wall) a frameless row in the top-left corner. The selectors are tripled
   to pass the phone rules of city-phone.css. */
#city-pane .city-bar.float.float.float:not([hidden]) { position: relative; left: auto; top: auto; right: auto; width: auto; max-width: calc(100% - 80px); display: flex; flex-wrap: nowrap; align-items: center; gap: 10px;
  padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; pointer-events: none; z-index: 5; text-shadow: 0 1px 3px #000, 0 0 6px #000; font-weight: 700; }
#city-pane .city-bar.float.float.float:not(.at-ghost) > *, #city-pane .city-bar.float.float.float button, #city-pane .city-bar.float.float.float .road-off:not(.off) { pointer-events: auto; }
@media (min-width: 561px) {
  #city-pane .city-bar.float:not(.at-ghost) { align-self: flex-start; margin-left: 8px; }
}
#city-pane .city-bar.float.float.float.at-ghost .city-bar-text { pointer-events: none; }
#city-pane .city-bar.float.float.float .city-bar-text { flex: 0 1 auto; min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
#city-pane .city-bar.float.float.float .btn-row { margin: 0; flex: none; flex-wrap: nowrap; gap: 10px; }
#city-pane .city-bar.float.float.float .btn-row button { flex: none; width: 46px; min-width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 23px; box-shadow: 0 3px 12px rgba(0, 0, 0, .55); text-shadow: none; }
#city-pane .city-bar.float.float.float .btn-row button.with-text { width: auto; padding: 0 12px 0 10px; gap: 4px; }
#city-pane .city-bar.float.float.float.at-ghost:not([hidden]) { position: absolute; flex-direction: column; gap: 4px; max-width: none; }
/* the name, the "x,y" of a good spot and the off-road sentence stay for a screen reader (and the tests), clipped out of sight */
#city-pane .city-bar.float.at-ghost [data-testid="bar-title"], #city-pane .city-bar.float.at-ghost [data-testid="ghost-status"][data-valid="1"],
#city-pane .city-bar.float.at-ghost .road-off .why-text { position: absolute; width: 1px; height: 1px; min-width: 0; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; flex: none; }
#city-pane .city-bar.float.float.float.at-ghost .city-bar-text { justify-content: center; font-size: 12px; max-width: 220px; text-align: center; }
#city-pane .city-bar.float.float.float.at-ghost .road-off { position: absolute; left: 50%; right: auto; top: 100%; transform: translateX(-50%); margin: 4px 0 0; pointer-events: auto; }

/* TAP-POP-1116 (Phil 16/11: "i dont want them inside the frame, i want them popup when i click or tap of any building"):
   the round symbols over a tapped building on EVERY screen (they were a phone rule of city-phone.css). */
.city-ctx.bubbles { width: auto; flex-direction: row; align-items: center; gap: 6px; padding: 0; background: none; border: 0; box-shadow: none; }
.city-ctx.bubbles button { flex: none; width: 46px; min-width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 23px; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.city-ctx.bubbles button.with-text { width: auto; padding: 0 12px 0 10px; gap: 4px; font-weight: 700; }
.city-ctx.bubbles button.off { opacity: .72; filter: saturate(.4); }
#city-pane .city-bar.float.float.float.deaf, #city-pane .city-bar.float.float.float.deaf * { pointer-events: none !important; }

/* COLLECT-FLY-1116: what was just won flies from where it was won to its counter in the top strip (js/fly.js) */
#fly-layer { position: fixed; inset: 0; z-index: 65; pointer-events: none; overflow: hidden; }   /* MISSIONS-FLY-1118: above a window (.dlg 60) a reward flies out of */
.fly-coin { position: absolute; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 13px; background: #2f7d5b; color: #f0fff6; box-shadow: 0 2px 6px rgba(0, 0, 0, .55), inset 0 0 0 1.5px rgba(255, 255, 255, .35); will-change: transform, opacity; }
.fly-coin .ico, .fly-coin .res-glyph { width: 17px; height: 17px; }
.fly-coin .fly-food { width: 18px; height: 18px; object-fit: contain; } .fly-coin img.fly-food { image-rendering: pixelated; }   /* FLY-FOOD-ICON: the egg, the pail, the berries... */
.fly-plus { position: absolute; z-index: 1; font-size: 17px; font-weight: 800; color: #eaffd8; text-shadow: 0 1px 0 #0b1a10, 0 0 6px rgba(0, 0, 0, .9); white-space: nowrap; will-change: transform, opacity; }
/* GATHER-LIVE-1116: what a gathering march holds so far, counted live; each unit jumps off the figure (js/fly.js popPlus) */
.gather-live b { display: inline-block; font-variant-numeric: tabular-nums; color: #eaffd8; }
.fly-plus.pop { font-size: 15px; color: #b9f27a; }
/* GEM-MOMENT-1118: a gem reward is its own moment (fly.js flyGems): turning gem, rays, ring, sparkles, arc + trail, counter hit */
.gem-rays { position: absolute; width: 168px; height: 168px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(196, 150, 255, .55) 0deg 7deg, rgba(196, 150, 255, 0) 7deg 22deg, rgba(255, 214, 120, .45) 22deg 27deg, rgba(255, 214, 120, 0) 27deg 45deg);
  -webkit-mask: radial-gradient(circle, #000 18%, rgba(0, 0, 0, .55) 42%, transparent 70%); mask: radial-gradient(circle, #000 18%, rgba(0, 0, 0, .55) 42%, transparent 70%); will-change: transform, opacity; }
.gem-ring { position: absolute; width: 60px; height: 60px; border-radius: 50%; border: 2px solid rgba(232, 208, 255, .9); box-shadow: 0 0 14px rgba(170, 120, 255, .8), inset 0 0 10px rgba(255, 220, 140, .5); will-change: transform, opacity; }
.gem-big { position: absolute; z-index: 2; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; perspective: 300px;
  filter: drop-shadow(0 0 10px rgba(178, 120, 255, .95)) drop-shadow(0 0 3px rgba(255, 230, 160, .9)); will-change: transform, opacity; }
.gem-big img, .gem-big .ico { width: 52px; height: 52px; }
.gem-fly { position: absolute; z-index: 2; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 0 6px rgba(178, 120, 255, .95)); will-change: transform, opacity; }
.gem-fly img, .gem-fly .ico { width: 26px; height: 26px; }
.gem-spark { position: absolute; z-index: 1; pointer-events: none; background: radial-gradient(circle, #fff 0 22%, #e9d6ff 40%, rgba(190, 140, 255, 0) 72%);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); will-change: transform, opacity; }
.gem-plus { position: absolute; z-index: 3; font-size: 24px; font-weight: 900; white-space: nowrap; letter-spacing: .5px;
  background: linear-gradient(180deg, #fff6d8 0%, #f3c96a 45%, #c79bff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 #1a0f2a) drop-shadow(0 0 6px rgba(140, 90, 255, .8)); will-change: transform, opacity; }
@keyframes gemHit { 0% { box-shadow: 0 0 0 0 rgba(200, 150, 255, .9); transform: scale(1); } 30% { box-shadow: 0 0 0 7px rgba(200, 150, 255, .35), 0 0 18px rgba(255, 215, 130, .8); transform: scale(1.12); filter: brightness(1.5); } 100% { box-shadow: 0 0 0 14px rgba(200, 150, 255, 0); transform: scale(1); filter: brightness(1); } }
.chip.gem-hit { animation: gemHit .85s cubic-bezier(.2, .8, .3, 1); }

/* SETTINGS-1116 (Phil 16/11: "a settings section ... audio volumn or no sound/graphique"): the player menu box turns into the
   Settings panel. Sound switch + three sliders filled up to their value, Graphics and Animations as segmented choices. */
.set-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.set-head > svg { width: 20px; height: 20px; color: var(--self); }
.set-back { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.set-back svg { width: 20px; height: 20px; }
.set-sec { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; display: grid; gap: 6px; }
.set-title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); min-height: 24px; }
.set-line { display: grid; grid-template-columns: 20px 74px 1fr 40px; align-items: center; gap: 8px; min-height: 40px; font-size: 13px; transition: opacity .2s; }
.set-line.off { opacity: .45; }
.set-line > svg { width: 18px; height: 18px; color: var(--dim); }
.set-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text); }
.set-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; min-height: 0; padding: 0; border: 0; border-radius: 3px; margin: 0; cursor: pointer; align-self: center;
  background: linear-gradient(90deg, var(--self) 0 var(--p, 50%), #0e1213 var(--p, 50%) 100%); }
.set-range:focus-visible { outline-offset: 6px; }
.set-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--text); border: 3px solid var(--self); box-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.set-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 3px solid var(--self); }
.set-toggle { position: relative; display: flex; align-items: center; gap: 6px; width: 74px; height: 34px; padding: 0 8px; border-radius: 17px; background: #0e1213; border: 1px solid var(--line); }
.set-toggle svg { width: 18px; height: 18px; color: var(--dim); }
.set-toggle i { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--dim); transition: transform .18s ease-out, background .18s; transform: translateX(-30px); }
.set-toggle.on { background: rgba(43, 181, 160, .22); border-color: var(--self); }
.set-toggle.on svg { color: var(--self); margin-left: 0; }
.set-toggle.on i { background: var(--self); transform: none; }
.set-toggle:not(.on) svg { margin-left: auto; }
.set-seg { display: flex; gap: 4px; background: #0e1213; border-radius: 9px; padding: 3px; }
.set-opt { flex: 1 1 0; min-height: 36px; padding: 0 6px; border-radius: 7px; border: 0; background: transparent; color: var(--dim); font-size: 13px; }
.set-opt.on { background: var(--self); color: #071311; font-weight: 700; }
.set-full { flex-direction: row; gap: 8px; width: 100%; min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .set-toggle i, .set-line { transition: none; } }

/* RES-CHIP-SHOP 16/11: a counter of the top strip is a way into the Shop; the packs it leads to glow once */
#res .chip-buy { cursor: pointer; }
#res .chip-buy:focus-visible { outline: 2px solid var(--gold, #e8c46a); outline-offset: 1px; }
.pack-glow { animation: pack-glow 1.4s ease-in-out infinite; }
@keyframes pack-glow { 0%, 100% { box-shadow: 0 0 0 2px rgba(232, 196, 106, .95), 0 0 18px rgba(232, 196, 106, .55); } 50% { box-shadow: 0 0 0 2px rgba(232, 196, 106, .55), 0 0 6px rgba(232, 196, 106, .2); } }
@media (prefers-reduced-motion: reduce) { .pack-glow { animation: none; box-shadow: 0 0 0 2px rgba(232, 196, 106, .9); } }
/* SQUAD-CARPENTERS-V2 (17/11): the squad sliders inline in the Build fence sheet read like the editor (free on the right) */
.boundary-form .sq-tname .sq-free { margin-left: auto; color: var(--dim); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
/* REPORT-LR-1117 (Phil 17/11 16:14-16:18): battle report = verdict band (attacker LEFT, defender RIGHT, big round profiles, the
   winner lit with a trophy, the loser dimmed under a skull) over two columns side by side, one row per troop type: its picture,
   then sent / survivors / dead / wounded as glyph + big number. Symbols and numbers; the words live in aria-label. */
.rl-top { align-items: center; gap: 8px; }
.rl-meta { margin: 0; gap: 4px 10px; min-width: 0; }
.rl-band { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 6px; margin: 8px 0;
  padding: 12px 6px 10px; background: linear-gradient(180deg, #1f282c, #192024); border: 1px solid #2f3b3f; border-radius: 6px; }
.rl-band.victory { border-color: #1f7f70; } .rl-band.defeat { border-color: #9a4f38; }
.rl-who { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; text-align: center; }
.rl-pf { position: relative; width: 84px; height: 84px; }
.rl-face { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center;
  border: 3px solid #55666a; background: #10151a; box-sizing: border-box; }
img.rl-face[data-rar] { border-radius: 50%; }
.rl-face.rl-beast { object-fit: contain; padding: 6px; background: radial-gradient(circle at 50% 40%, #3b2a22, #10151a 75%); }
.rl-noface .gi { width: 40px; height: 40px; color: var(--dim); }
.rl-who.won .rl-face { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(224, 178, 58, .35), 0 0 22px rgba(224, 178, 58, .35); }
.rl-who.lost .rl-face { filter: grayscale(.85) brightness(.6); border-color: #5a3a32; }
.rl-who.lost .rl-name { color: var(--dim); }
.rl-badge { position: absolute; right: -4px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid #10151a; }
.rl-badge .gi { width: 19px; height: 19px; }
.rl-badge.win { background: var(--gold); color: #1d1603; }
.rl-badge.lose { background: #6b2b20; color: #ffb6a3; }
.rl-you { position: absolute; left: -4px; top: -2px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--self); color: #06221d; border: 2px solid #10151a; }
.rl-you .gi { width: 15px; height: 15px; }
.rl-name { font-size: 15px; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; margin-top: 4px; }
.rl-more, .rl-tag { font-size: 12px; }
.rl-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 14px; }
.rl-verdict { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rl-verdict > .gi { width: 44px; height: 44px; stroke-width: 1.8; }
.rl-verdict.victory { color: var(--gold); } .rl-verdict.defeat { color: #ff7a66; }
.rl-verdict .stat { color: var(--dim); } .rl-verdict .stat .gi { width: 18px; height: 18px; }
.rl-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; }
.rl-col { container-type: inline-size; min-width: 0; background: var(--card); border: 1px solid #2f3b3f; border-radius: 6px; padding: 6px; }
.rl-col.won { border-color: #6d5a26; } .rl-col.lost { opacity: .92; }
.rl-part + .rl-part { border-top: 1px solid #323d40; margin-top: 6px; padding-top: 6px; }
.rl-phead { margin: 0 0 4px; gap: 4px 8px; font-size: 12px; }
.rl-pname { font-size: 13px; flex-basis: 100%; overflow-wrap: anywhere; }
.rl-mult { color: var(--dim); }
.rl-skills { margin: 0 0 4px; gap: 4px 8px; }
.rl-trow { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 6px; align-items: center; padding: 5px 0; }
.rl-trow + .rl-trow { border-top: 1px solid #2c3639; }
.rl-trow.empty { display: flex; gap: 4px; }
.rl-tpic { width: 34px; height: 34px; border-radius: 4px; background: #10151a; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.rl-tpic img { width: 32px; height: 32px; object-fit: contain; }
.rl-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; min-width: 0; }
@container (min-width: 330px) { .rl-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rl-n { display: inline-flex; align-items: center; gap: 3px; min-width: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rl-n .gi { width: 14px; height: 14px; color: var(--dim); }
.rl-n b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.rl-n.n-surv b { color: var(--self); } .rl-n.n-surv .gi { color: var(--self); }
.rl-n.n-dead b, .rl-n.n-dead .gi { color: #ff6b57; }
.rl-n.n-wound b, .rl-n.n-wound .gi { color: #f2a93b; }
.rl-n.zero b { color: #6c7774; font-weight: 600; } .rl-n.zero .gi { color: #55605d; }
.rl-noroom { margin: 2px 0; color: #ff9d7c; }
.rl-loot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; padding-top: 6px; border-top: 1px solid #3b3a2a; }
.rl-loot-k { color: var(--gold); display: inline-flex; } .rl-loot-k .gi { width: 18px; height: 18px; }
.rl-loot-n { display: inline-flex; align-items: center; gap: 3px; } .rl-loot-n b { font-size: 16px; font-weight: 800; color: var(--gold); }
/* BODIL-STEAL-MECHANIC: what Bodil took, under the loot: her face, the amounts in red */
img.rl-bodil-face, .rl-bodil .rl-bodil-face { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.rl-bodil .rl-loot-n b { color: #e0705a; }
/* BODIL-STEAL-NUMBERS: her face stays on the left, what she took wraps beside it (never under her) */
.rl-bodil { flex-wrap: nowrap; align-items: flex-start; }
.rl-bodil-n { display: flex; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.rl-bodil .rl-loot-n b { font-size: 14px; }
/* BODIL-HUNT: the three hunters' faces in her sheet */
.face-xs { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-right: -4px; border: 1px solid var(--line); }
@media (max-width: 420px) {
  .rl-pf, .rl-face { width: 72px; height: 72px; }
  .rl-verdict > .gi { width: 38px; height: 38px; }
  .rl-n b { font-size: 15px; }
}

/* POST-BADGE (Phil 17/11 16:47): a commander posted in a building wears a small round watchtower on its face, everywhere */
.post-badge { position: absolute; right: -4px; top: -4px; z-index: 2; width: 20px; height: 20px; border-radius: 50%; background: var(--ally); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .6); pointer-events: none; }
.post-badge svg { width: 14px; height: 14px; }
.sq-slide-art, .sq-strip-face, .face-wrap { position: relative; }
.face-wrap { display: inline-block; line-height: 0; flex: none; }
.sq-slide-art > .post-badge { right: 4px; top: 4px; width: 26px; height: 26px; }
.sq-slide-art > .post-badge svg { width: 18px; height: 18px; }
.sq-strip-face > .post-badge { right: 2px; top: 0; }
.sq-strip-face > .sq-from { left: 4px; bottom: auto; top: 34px; }   /* TAKEN-MARK: leads another squad at home */
/* TAKEN-NUM: grey on the face + name only, the squad chip stays full strength (at home = .62, out on a march = .4) */
.sq-strip-face.taken > :not(.sq-from) { filter: grayscale(1); opacity: .62; }
.sq-strip-face.out > :not(.sq-from) { filter: grayscale(1); opacity: .4; }
.sq-strip-face.out > .sq-from { box-shadow: 0 0 0 1px #000; }
button.sq-strip-face:disabled { opacity: 1; }   /* the grey lives on the face, not on the whole button (chip readable) */
/* ASSIGN-TOGGLE (17/11 16:47): the top button of the squad popup says what it does, and the popup stays open */
button.sq-assign { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; font-weight: 800; font-size: 14px; white-space: nowrap; }
button.sq-assign svg { width: 20px; height: 20px; }
button.sq-assign.unassign { background: #3a2a2a; color: #ffd9d4; border-color: #8a4b44; }
@media (max-width: 420px) { button.sq-assign { padding: 0 9px; font-size: 13px; gap: 4px; } }

/* FIGHT-SCENE (Phil 17/11: the Lanternwake idea in our style): the battle report plays the fight. js/views/fightscene.js */
.fs { position: relative; margin: 10px 0 14px; padding: 12px 6px 34px; border-radius: 12px; background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .05), rgba(0, 0, 0, .35)); overflow: hidden; }
.fs-stage { display: grid; grid-template-columns: 1fr 26px 1fr; align-items: start; gap: 4px; }
.fs-vs { align-self: center; justify-self: center; opacity: .5; }
.fs-vs svg { width: 20px; height: 20px; }
.fs-side { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.fs-lead { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fs-face { display: block; width: 66px; height: 66px; border-radius: 50%; object-fit: cover; background: #1d1614; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 4px 10px rgba(0, 0, 0, .6); }
.fs-side.defender .fs-face { box-shadow: 0 0 0 2px #b8291f, 0 4px 10px rgba(0, 0, 0, .6); }
.fs-noface { display: flex; align-items: center; justify-content: center; }
.fs-atks { display: flex; gap: 6px; }
.fs-atk { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; }
.fs-atk.fs-item { width: 38px; height: 38px; }   /* ITEM-ART-REPORT-WEAPON: the painted weapon carried */
.fs-item-art { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.fs-g { width: 22px; height: 22px; fill: none; stroke: #ffe3a8; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px #000); }
.fs-atk.beast .fs-g, .fs-shot.beast { stroke: #ff6a5a; }
.fs-hp { display: flex; align-items: center; gap: 5px; width: 100%; max-width: 150px; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.fs-hp > svg { width: 15px; height: 15px; flex: none; color: #ff5a4e; fill: #ff5a4e; }
.fs-bar { flex: 1; height: 7px; border-radius: 4px; background: rgba(0, 0, 0, .55); overflow: hidden; }
.fs-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #2e9d48, #7ed36b); transition: width .45s ease-out; }
.fs-side.defender .fs-bar i { background: linear-gradient(90deg, #b8291f, #ff6a5a); }
.fs-troops { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fs-troop { position: relative; display: flex; flex-direction: column; align-items: center; width: 40px; transition: opacity .4s, filter .4s; }
.fs-troop img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: rgba(0, 0, 0, .35); }
.fs-tg { position: absolute; top: 20px; right: -4px; }
.fs-tg .fs-g { width: 14px; height: 14px; stroke-width: 2.6; }
.fs-n { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fs-troop.out { opacity: .35; filter: grayscale(1); }
.fs-troop.hit img, .fs-lead.hit .fs-face { animation: fs-hit .28s; }
@keyframes fs-hit { 40% { transform: translateX(3px) scale(.9); filter: brightness(2) sepia(1) hue-rotate(-40deg); } }
.fs-fx { position: absolute; inset: 0; pointer-events: none; }
.fs-shot { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; }
.fs-shot.big { width: 30px; height: 30px; left: -15px; top: -15px; stroke-width: 2.6; }
.fs-shot.troop { stroke: #e8dcc0; }
.fs-again { position: absolute; right: 6px; bottom: 4px; min-height: 0; width: 30px; height: 30px; padding: 0; border: 0; background: none; box-shadow: none; opacity: .75; }
.fs-again svg { width: 20px; height: 20px; }
/* BATTLE-P1 (20/11): x1 / x2 + skip beside the replay button */
.fs-ctl { position: absolute; right: 6px; bottom: 4px; display: flex; gap: 2px; align-items: center; }
.fs-ctl .fs-again { position: static; width: 40px; height: 40px; }   /* thumb-size on a phone */
.fs-speed { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; color: inherit; }
.fs.done .fs-skip { opacity: .3; }
html[data-motion="calm"] .fs-troop.hit img, html[data-motion="calm"] .fs-lead.hit .fs-face { animation: none; }

/* CMD-HOLD (Phil 17/11 18:18): hold any commander face = everything about that commander. js/cmdsheet.js */
.cs-back { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(0, 0, 0, .62); }
.cs { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 24px); overflow: auto; padding: 16px 14px 14px; border-radius: 14px; background: #171c1f; box-shadow: 0 12px 40px rgba(0, 0, 0, .7); }
.cs-x { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: none; box-shadow: none; }
.cs-top { display: flex; gap: 12px; align-items: flex-start; padding-right: 36px; }
.cs-face { width: 92px; height: 92px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, .45); }
.cs-id h3 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 20px; }
.cs-tags { flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 13px; }
.cs-line { margin: 6px 0 0; font-style: normal; opacity: .85; }
.cs-bonus { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 8px; }
.cs-skills { display: flex; flex-direction: column; gap: 8px; }
.cs-skill { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.cs-skill.off { opacity: .7; }
.cs-skill.cs-hidden strong { color: #ff8a8a; }   /* an open hidden skill: the blood red of the Secret pack, as on the card */
.cs-skh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.cs-skill p { margin: 3px 0 0; }
.cs-story { margin: 10px 0 0; opacity: .8; }

/* POWER + TROOP-DETAIL (17/11 18:18) */
.fs-pw { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; opacity: .9; font-variant-numeric: tabular-nums; }
.fs-pw img, .fs-pw svg, .fs-power img, .fs-power svg { width: 12px; height: 12px; }
.fs-power { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fs-troop { width: 46px; }
.rl-trow { flex-wrap: wrap; }
button.rl-tpic { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer; }
.rl-n.rl-pw { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 3px; }
.rl-n.rl-pw img, .rl-n.rl-pw svg { width: 13px; height: 13px; }
.rl-unit { flex-basis: 100%; flex-wrap: wrap; gap: 3px 10px; padding: 4px 0 0; font-size: 13px; }
.rl-unit[hidden] { display: none; }
.rl-unit img, .rl-unit svg { width: 14px; height: 14px; }
.rl-vs { width: 18px !important; height: 18px !important; border-radius: 50%; }

/* BEAST-ROWS (17/11 18:32) */
.rl-tpic.beast img { border-radius: 50%; object-fit: cover; background: #1d1614; box-shadow: 0 0 0 2px #b8291f; }

/* FRAME-NO-GOLD (Phil 17/11 18:35 on the world tile sheet: "every frame like this I want to see no color on the corner of the
   frame"): the bottom sheet, the world side panel and the squad popup lose their gold edge; the dark box and its shadow hold it */
.sheet, #sheet { border: 0 !important; }
body[data-tab="world"] #panel { border-top: 0 !important; border-right: 0 !important; }
.sq-box { border: 0 !important; }
/* COMMANDER-DAMAGE (17/11): the commander's own attack + health under its face in the fight scene; fallen = greyed */
.fs-cmd { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.fs-cmd .glyph, .fs-cmd svg { width: 12px; height: 12px; }
.fs-catk, .fs-chp { display: inline-flex; align-items: center; gap: 2px; }
.fs-cbar { display: inline-block; width: 34px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.fs-cbar i { display: block; height: 100%; width: 100%; background: #e04b3c; transition: width .5s; }
.fs-lead.out .fs-face { filter: grayscale(1) brightness(.45); }
.fs-dmg { position: absolute; left: 0; top: 0; pointer-events: none; font-weight: 800; font-size: 15px; color: #ffd27a; text-shadow: 0 1px 3px #000; }
.cs-fight { margin: 6px 0 2px; }
.rl-phead { flex-wrap: wrap; }
.rl-cfight { flex-basis: 100%; gap: 8px; }

/* HUNT-1118: the sheet of a beast out of its camp (map.js drawHunter) */
.hunter-face { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid #f2f4ee; box-shadow: 0 0 0 2px #c2452d; background: #20150f; flex: none; }
.hunter-line { gap: 6px; }
.hunter-mine { color: #ff8a70; font-weight: 700; }

/* MISSIONS-BTN-1118: the missions window (the inventory's popup frame) */
.missions-box .missions-list { display: grid; gap: 10px; padding: 10px 12px 8px; overflow-y: auto; }
.missions-box > .small-text { padding: 0 12px 12px; }
.missions-box .mission { display: grid; gap: 6px; padding: 10px; background: #1b2225; border: 1px solid var(--line); border-radius: 6px; }
.missions-box .mission.ready { border-color: rgba(232, 162, 58, .8); box-shadow: 0 0 10px rgba(232, 162, 58, .35); }
.missions-box .mission.claimed { opacity: .6; }
.missions-box .mission-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.missions-box .mission-top small { color: var(--dim); }
.missions-box .mission-bar { height: 6px; background: #0e1315; border-radius: 3px; overflow: hidden; }
.missions-box .mission-bar i { display: block; height: 100%; background: #e8a23a; }
/* MISSIONS-FLY-1118: the Missions window stands under the top strip (top set by missions.js underTop) */
#missions.under-top { padding-top: 6px; }
@media (orientation: portrait) and (max-width: 560px) { #missions.under-top .dlg-box { padding-top: 0; } }
/* DAILY-MISSIONS-1118: Daily / Weekly tabs, points track with 5 chests, mission cards (tag colour on the badge, corner brackets
   when ready: never a coloured left stripe). Cards come in one after the other; a claim flashes the card and the chest. */
.missions-box { width: min(560px, 96vw); }
.dm-tabs { display: flex; gap: 6px; padding: 8px 12px 0; }
.dm-tab { flex: 1; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #1b2225; color: var(--dim); }
.dm-tab.on { background: linear-gradient(160deg, #3d3423 0 55%, #342c1e 55%); color: var(--text); border-color: rgba(232, 162, 58, .7); }
.dm-dot { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e8a23a; color: #1a1408; font-size: 12px; font-weight: 800; line-height: 20px; }
.dm { display: grid; gap: 10px; padding: 10px 12px 12px; overflow-y: auto; min-height: 0; }
.dm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.dm-score strong { font: 600 32px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; color: #f0c069; text-shadow: 0 0 12px rgba(232, 162, 58, .3); }
.dm-score small { margin-left: 4px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.dm-meta { display: grid; justify-items: end; gap: 2px; color: var(--dim); font-size: 13px; }
.dm-reset { display: inline-flex; align-items: center; gap: 4px; }
.dm-reset .gi { width: 14px; height: 14px; }
.dm-track { position: relative; height: 64px; margin: 0 22px 4px; }
.dm-rail { position: absolute; left: 0; right: 0; top: 20px; height: 8px; border-radius: 4px; background: #0e1315; box-shadow: inset 0 1px 2px #000; overflow: hidden; }
.dm-rail i { display: block; height: 100%; background: linear-gradient(90deg, #8a5a1c, #e8a23a 70%, #ffd27a); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.dm-chest { position: absolute; top: 0; translate: -50% 0; min-width: 44px; min-height: 44px; width: 44px; height: 60px; padding: 0; border: 0; background: none; display: grid; justify-items: center; align-content: start; gap: 2px; }
.dm-chest:not(:disabled):active { translate: -50% 2px; margin-bottom: 0; }
.dm-chest-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #1b2225; border: 2px solid var(--line); }
.dm-chest-ico .gi { width: 22px; height: 22px; }
.dm-chest b { font-size: 12px; color: var(--dim); }
.dm-chest.ready .dm-chest-ico { background: radial-gradient(circle at 50% 35%, #ffd27a, #c47a1e 70%); border-color: #ffd27a; color: #1a1408; animation: dm-call 1.4s ease-in-out infinite; }
.dm-chest.ready b { color: #f0c069; }
.dm-chest.claimed .dm-chest-ico { background: #2a3324; border-color: #6fae7a; color: #8fd19a; }
.dm-chest .dm-stock-marker { position: relative; width: 46px; border-radius: 10px; }
.dm-marker-icons { width: 42px; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 1px 0; }
.dm-chest .dm-marker-icons .ico { width: 14px; height: 14px; object-fit: contain; }
.dm-chest.ready .dm-stock-marker { background: #352b1e; }
.dm-marker-claimed { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; background: #27402d; color: #b9efc2; }
.dm-marker-claimed .gi { width: 10px; height: 10px; }
.dm-chest.burst .dm-chest-ico, .dm-card.burst { animation: dm-burst .7s ease-out; }
.dm-chest[aria-current="true"] b { color: #f0c069; text-decoration: underline; text-underline-offset: 3px; }
.dm-loot { display: grid; gap: 6px; min-width: 0; padding: 8px 0 10px; border-block: 1px solid var(--line); }
.dm-loot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dm-loot-head span, .dm-loot > small { font-size: 12px; }
.dm-stock { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px 8px; }
.dm-stock-item { display: flex; align-items: center; gap: 6px; line-height: 1.15; }
.dm-stock-item .ico { width: 21px; height: 21px; flex: none; }
.dm-stock-item span { display: grid; }
.dm-stock-item small { color: var(--dim); font-size: 11px; }
.dm-stock-item b { font-size: 14px; font-variant-numeric: tabular-nums; }
.dm-extras { padding-top: 2px; }
@keyframes dm-call { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 200, 100, .55); } 50% { box-shadow: 0 0 0 7px rgba(255, 200, 100, 0); } }
@keyframes dm-burst { 0% { filter: brightness(2.2); scale: 1.06; } 100% { filter: none; scale: 1; } }
.dm-list { display: grid; gap: 8px; }
.dm-card { --tc: #e8a23a; position: relative; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 10px;
  background: linear-gradient(135deg, #1f272a, #171d1f); border: 1px solid #2c3637; border-radius: 4px; animation: dm-in .35s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 25ms); }
.dm-card.tag-army { --tc: #d36b4f; } .dm-card.tag-world { --tc: #79b884; } .dm-card.tag-war { --tc: #e2524f; } .dm-card.tag-kin { --tc: #6a9de0; }
.dm-badge { width: 44px; height: 44px; display: grid; place-items: center; color: var(--tc); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tc) 22%, #1b2225), #12171a 75%);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.dm-badge .gi { width: 22px; height: 22px; }
.dm-body { display: grid; gap: 4px; min-width: 0; }
.dm-body strong { font-family: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .04em; font-size: 15px; }
.dm-text { color: var(--dim); font-size: 13px; }
.dm-bar { height: 5px; background: #0e1315; border-radius: 3px; overflow: hidden; }
.dm-bar i { display: block; height: 100%; background: var(--tc); }
.rws { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.rw { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: #d9dcd4; }
.rw .gi, .rw .ico { width: 15px; height: 15px; }
.rw-pts { color: #f0c069; }
.rw-crate { color: #e0a0ff; }
.dm-claim { min-width: 76px; padding: 0 10px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.dm-claim .gi { width: 15px; height: 15px; }
.dm-card.ready { border-color: rgba(232, 162, 58, .55);
  background: linear-gradient(#e8a23a, #e8a23a) 0 0 / 14px 2px no-repeat, linear-gradient(#e8a23a, #e8a23a) 0 0 / 2px 14px no-repeat,
    linear-gradient(#e8a23a, #e8a23a) 100% 0 / 14px 2px no-repeat, linear-gradient(#e8a23a, #e8a23a) 100% 0 / 2px 14px no-repeat,
    linear-gradient(#e8a23a, #e8a23a) 0 100% / 14px 2px no-repeat, linear-gradient(#e8a23a, #e8a23a) 0 100% / 2px 14px no-repeat,
    linear-gradient(#e8a23a, #e8a23a) 100% 100% / 14px 2px no-repeat, linear-gradient(#e8a23a, #e8a23a) 100% 100% / 2px 14px no-repeat,
    linear-gradient(135deg, #2c2618, #1a1a14); }
.dm-card.claimed { opacity: .55; }
.dm-card.claimed .dm-badge { filter: grayscale(.8); }
@keyframes dm-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 420px) { .dm-card { grid-template-columns: 36px 1fr auto; gap: 8px; } .dm-badge { width: 36px; height: 36px; } .dm-claim { min-width: 54px; padding: 0 6px; font-size: 12px; } .dm-card.ready .dm-claim { grid-column: 1 / -1; width: 100%; } .dm-track { margin: 0 20px 4px; } }
@media (prefers-reduced-motion: reduce) { .dm-card, .dm-chest.ready .dm-chest-ico, .dm-chest.burst .dm-chest-ico, .dm-card.burst { animation: none; } .dm-rail i { transition: none; } }


/* CMD-SCREEN-1118: the commander card shows the face tapped under it; its applied stats, its action card, "Lead" */
.cmd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; padding: 8px; }
.cmd-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 4px; border-radius: 8px; background: rgba(255, 255, 255, .04); min-width: 0; }
.cmd-stat .ico { width: 20px; height: 20px; opacity: .85; }
.cmd-stat b { font-size: 16px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cmd-stat::after, .cmd-card::after { content: attr(data-l); font-size: 11px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cmd-stat.none b { opacity: .45; }
.cmd-cards { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.cmd-card { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 88px; min-height: 64px; padding: 6px 8px; border-radius: 8px; }
.cmd-card.on { outline: 2px solid var(--self); background: rgba(80, 200, 160, .12); }
.cmd-card.innate { background: rgba(255, 255, 255, .04); opacity: .9; }
.cmd-card.locked { background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); opacity: .62; }
.cmd-card.locked small { font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.cmd-card .face.tiny { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; }
.hero-heading { display: flex; align-items: center; gap: 8px; width: 100%; flex-shrink: 0; }
.hero-heading .hero-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hero-heading .lead-btn, .hero-heading .lead-on { flex-shrink: 0; margin: 0; }
.hero-heading .lead-btn { flex-direction: column; gap: 2px; }
.hero-heading [data-testid="commander-lead-ready"] { font-size: 10px; line-height: 1; }
.hero .lead-on { color: #f2c94c; }
.pm-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pm-name .pm-edit { min-height: 32px; min-width: 32px; padding: 4px; }
/* SHOP-SHINE-1118: a resource picture with a beam of light masked to the object and a star blooming on its corner (shine.js) */
.shine-art { position: relative; display: inline-block; flex: none; width: 64px; height: 64px; isolation: isolate; }
.shine-art.shine-s { width: 54px; height: 54px; }   /* SHOP-ART-TIERS: the sack picture already says small (40 px read as a speck) */ .shine-art.shine-l { width: 76px; height: 76px; }
.shine-piece { position: absolute; inset: 0; translate: var(--x, 0) var(--y, 0); scale: var(--s, 1); }
.shine-piece img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .55)); }
.shine-beam { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center;
  background: linear-gradient(var(--angle, 115deg), transparent 0 38%, rgba(255, 246, 214, .15) 44%, rgba(255, 255, 255, .95) 50%, rgba(255, 246, 214, .15) 56%, transparent 62% 100%) no-repeat;
  background-size: 250% 100%; background-position: 100% 0; animation: shine-sweep var(--period, 4s) var(--delay, 0s) infinite ease-in-out; }
.shine-star { position: absolute; z-index: 9; width: 22px; height: 22px; translate: -50% -50%; pointer-events: none; opacity: 0; scale: .2;
  background: radial-gradient(circle, #fff 0 9%, rgba(255, 244, 205, .9) 14%, transparent 24%),
    conic-gradient(from 0deg, transparent 0 40deg, rgba(255,255,255,.95) 45deg, transparent 50deg 130deg, rgba(255,255,255,.95) 135deg, transparent 140deg 220deg, rgba(255,255,255,.95) 225deg, transparent 230deg 310deg, rgba(255,255,255,.95) 315deg, transparent 320deg);
  -webkit-mask: radial-gradient(circle, #000 0 22%, transparent 70%); mask: radial-gradient(circle, #000 0 22%, transparent 70%);
  filter: drop-shadow(0 0 4px rgba(255, 236, 170, .9)); animation: shine-star var(--period, 4s) var(--delay, 0s) infinite ease-out; }
/* (250 % wide: the band is over the object for the WHOLE move, 100 % -> 0 %; it was a 0.25 s flash at 300 % / 130 -> -30) */
@keyframes shine-sweep { 0% { background-position: 100% 0; } 45%, 100% { background-position: 0% 0; } }
@keyframes shine-star { 0%, 40% { opacity: 0; scale: .2; rotate: 0deg; } 48% { opacity: 1; scale: 1.15; rotate: 45deg; } 58% { opacity: .85; scale: .8; rotate: 70deg; } 70%, 100% { opacity: 0; scale: .2; rotate: 90deg; } }
@media (prefers-reduced-motion: reduce) { .shine-beam, .shine-star { animation: none; opacity: 0; } }
.card.has-art { display: grid; grid-template-columns: 84px 1fr; column-gap: 12px; align-items: center; }
.card.has-art > .shop-art { grid-row: 1 / span 4; justify-self: center; display: flex; align-items: center; justify-content: center; width: 84px; height: 84px;
  border-radius: 6px; background: radial-gradient(circle at 50% 45%, rgba(255, 220, 150, .14), rgba(0, 0, 0, .25) 70%); }
.card.has-art > .shop-art.trio { gap: 0; } .card.has-art > .shop-art.trio .shine-art { margin: 0 -9px; }
.card.has-art > :not(.shop-art) { grid-column: 2; min-width: 0; }
.store-row > button.has-art { min-height: 64px; }
.store-row > button.has-art .shine-art { margin: -4px 2px -4px -4px; }
/* CMD-SLOTS-1118: one action-card slot + one weapon slot per commander */
.cmd-cards { flex-direction: column; align-items: stretch; }
.cmd-slots, .cmd-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.cmd-slot { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 84px; height: 72px; border-radius: 10px; padding: 4px; }
.cmd-slot::after { content: attr(data-l); font-size: 11px; opacity: .7; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-slot .ico { width: 24px; height: 24px; }
.cmd-slot.empty { border-style: dashed; opacity: .8; }
.cmd-slot.open { outline: 2px solid var(--self); }
.cmd-choices { padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .08); }

/* MISSION-GEMS-1118: the gem count a daily chest pays, a small tag on the chest's corner */
.dm-chest .dm-gem { position: absolute; left: 50%; translate: -50% 0; top: -11px; display: inline-flex; align-items: center; gap: 1px; padding: 0 4px; border-radius: 8px; background: #1a1230; border: 1px solid #7a5bd0; font-style: normal; font-size: 11px; line-height: 15px; font-weight: 700; color: #d9c4ff; white-space: nowrap; z-index: 2; }
.dm-chest .dm-gem svg, .dm-chest .dm-gem img { width: 12px; height: 12px; }   /* MISSION-GEMS-ICON: the painted gem (resIco), not the glyph */
.dm-chest.claimed .dm-gem { opacity: .45; }

/* DAILY-DEEP-1118: layer tabs of the chest bar + the stage pips of a mission */
.dm-layers { display: flex; gap: 6px; margin: 2px 0 14px; }
.dm-layer { flex: 1; min-height: 30px; padding: 2px 6px; border: 1px solid var(--line); background: #151b1e; color: var(--dim); display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; }
.dm-layer.on { border-color: #f0c069; color: #f0c069; background: #2a2114; }
.dm-layer.done { color: #8fd19a; } .dm-layer.far:not(.on) { opacity: .55; }
.dm-layer .gi, .dm-layer svg { width: 12px; height: 12px; }
.dm-stages { display: inline-flex; gap: 3px; margin-left: 8px; vertical-align: middle; }
.dm-stages i { width: 9px; height: 9px; transform: rotate(45deg); border: 1px solid #5a646b; background: transparent; }
.dm-stages i.on { background: #f0c069; border-color: #f0c069; } .dm-stages i.cur { border-color: #f0c069; }

/* ARMY-FRAME-1118: the Troops tab in the Commander tab's frame (same .hero card, face row, .cmd-stats grid, .cmd-slot actions);
   the troop picture stands whole in the card's left column (cut-out art, not a bust) */
.troop-hero .troop-art { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 156px; padding: 6px 0 2px;
  background: radial-gradient(70% 60% at 50% 62%, rgba(255, 255, 255, .10), transparent 70%); }
.troop-hero .troop-big { width: auto; max-width: 100%; height: 150px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6)); }
.troop-hero .eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.troop-counts { margin-top: 6px; }
.troop-tabs button.skill-tab .face { object-fit: contain; background: #1c262b; }
.troop-acts .cmd-slots { display: flex; gap: 8px; }
/* ARMY-FRAME-1118: the Commander tab starts at the Army tabs, like Troops (no City head, carpenter line or Back row above them) */
body[data-army] #view-city .city-headbox, body[data-army] #view-city .city-queuebox, body[data-army] #view-city .commander-backrow { display: none; }

/* SCREEN-GATE-1118: off the game screen (boot, login), no game piece parked on <body> shows, whatever opened it */
body:not([data-screen="app"]) > #switch-btn, body:not([data-screen="app"]) > #fly-layer, body:not([data-screen="app"]) > #missions,
body:not([data-screen="app"]) > #crate-dlg, body:not([data-screen="app"]) > #cc-from, body:not([data-screen="app"]) > #roster-dlg,
body:not([data-screen="app"]) > #inventory, body:not([data-screen="app"]) > #reveal, body:not([data-screen="app"]) > #legend-reveal,
body:not([data-screen="app"]) > #skill-reveal, body:not([data-screen="app"]) > #raid-alert, body:not([data-screen="app"]) > .cs-back, body:not([data-screen="app"]) > .cfm { display: none !important; }

/* CMD-CARD-FIXED-1118 (Phil 19/11 00:16: "each time i switch the commander the big image change its size, make it always the same
   size"): the 4:5 picture frame was already fixed, but the CARD followed its text (296 / 306 / 323 px at 497 px wide), so the block
   and everything under it jumped. The commander card now has one height, sized on the tallest text measured (desktop 323 at 1280,
   phone 386 at 390); the text sits in the middle of that height. */
[data-testid="commander"] .hero { height: 336px; min-height: 0; }
[data-testid="commander"] .hero > .hero-text { overflow: hidden; }
/* CARD-GAP-TROOPS + ARMY-TAB-HEIGHTS (Phil 19/11 08:48 "finish them all"; 18/11 "2 frame different between commander and troops"):
   the Troops card takes the Commander card's height, and the standing troop fills that height instead of a 150 px figure in a
   160 px card, so switching Commander <-> Troops moves nothing under the card. */
.troop-hero { height: 336px; min-height: 0; }
.troop-hero > .hero-text { overflow: hidden; }
.troop-hero .troop-art { align-self: stretch; height: 100%; min-height: 0; box-sizing: border-box; padding: 10px 0 6px; width: 100%; grid-column: 1; grid-row: 1; }
.troop-hero > .hero-text { grid-column: 2; grid-row: 1; position: relative; z-index: 2; }
/* the troop picture is a square cut-out: it grows to the art column's full width (NOT under the text: 134 % put the shield over
   "Strong against" on desktop, capture 19/11),
   stands on the card's floor; taller cards show more of the painted scene above it, never an empty block under it */
.troop-hero .troop-big { height: auto; width: 100%; max-height: 100%; }

/* SPIRE-LOOK-1119 (Phil 19/11 11:15 "The Spire ... should look like our 1st page ... more elegance"): the title screen's plate framed on
   the black tower, the name in the title screen's sticker lettering (UA Sticker, sun yellow, ink stroke, cream die-cut edge). The plate
   settles once when the sheet opens (no loop: anti-heat rule); reduced motion = no move. */
.spire-banner { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; justify-content: center;
  height: 176px; margin: -10px -14px 8px; padding-bottom: 14px; border-radius: 12px 12px 0 0; }
.spire-banner::before { content: ''; position: absolute; inset: 0; z-index: -2; background: #07090a url(assets/backdrop-rag.webp) 50% 22% / 150% auto no-repeat;
  transform-origin: 50% 30%; animation: spire-settle 1.4s cubic-bezier(.2, .7, .2, 1) both; }
.spire-banner::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 90% at 50% 28%, transparent 45%, rgba(4, 6, 7, .55)), linear-gradient(180deg, rgba(4, 6, 7, .35), transparent 22%, transparent 48%, rgba(32, 40, 44, .9) 86%, #20282c); }
@keyframes spire-settle { from { transform: scale(1.14); filter: brightness(.55) saturate(.8); } to { transform: scale(1); filter: none; } }
.spire-name { position: relative; z-index: 0; padding: .12em .12em 0; transform: rotate(-2deg);
  font: 400 36px/.92 "UA Sticker", "Avenir Next Condensed", "Arial Narrow", Impact, sans-serif; letter-spacing: .03em; text-transform: uppercase;
  color: #ffd23f; -webkit-text-stroke: 5px #17110c; paint-order: stroke fill; animation: spire-slap .55s .35s cubic-bezier(.2, 1.5, .4, 1) both; }
.spire-name::before { content: attr(data-t); position: absolute; inset: 0; padding: inherit; z-index: -1; color: #faf7f0; -webkit-text-stroke: 14px #faf7f0;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55)); }
@keyframes spire-slap { from { opacity: 0; transform: rotate(8deg) scale(1.5); } to { opacity: 1; transform: rotate(-2deg); } }
/* the map sheet: the name lives in the plate, the head row keeps only the close button over its corner */
.sheet[data-kind="objective"] { padding-top: 10px; }
.sheet[data-kind="objective"] .sheet-head { position: absolute; top: 10px; right: 12px; z-index: 3; }
.sheet[data-kind="objective"] .sheet-head [data-testid="sheet-title"], .spire-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sheet[data-kind="objective"] .sheet-head button { background: rgba(7, 9, 10, .55); border-color: rgba(250, 247, 240, .35); backdrop-filter: blur(3px); }
.sheet[data-kind="objective"] .sheet-info { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sheet[data-kind="objective"] .sheet-info > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; }
.sheet[data-kind="objective"] .sheet-info .stat { padding: 5px 10px; border-radius: 6px; background: rgba(255, 210, 63, .07); border: 1px solid rgba(224, 178, 58, .38); }
.sheet[data-kind="objective"] .btn-row { justify-content: center; }
/* the panel card: a shorter plate, the card's own frame takes the plate's gold */
.card.objective { padding-top: 0; overflow: hidden; border-color: #8a6f22; }
.spire-banner.sm { height: 104px; margin: 0 -12px 8px; padding-bottom: 8px; border-radius: 0; }
.spire-banner.sm::before { background-size: 130% auto; background-position: 50% 24%; }
.spire-banner.sm .spire-name { font-size: 26px; -webkit-text-stroke-width: 4px; }
.spire-banner.sm .spire-name::before { -webkit-text-stroke-width: 10px; }
@media (min-width: 900px) and (min-height: 600px) { .spire-banner { height: 196px; } .spire-name { font-size: 40px; } }
@media (prefers-reduced-motion: reduce) { .spire-banner::before, .spire-name { animation: none; } }
/* SWITCH-COVERS-ZOOM-1119 (ux_audit, phone held sideways 844x390): the City / World glyph docks in the bottom-right corner of the scene
   (body.sw-dock, main.js placeSwitch); a zoom column anchored to the bottom (city or map) now stands above it instead of under it */
body.sw-dock #city-pane .map-btns, body.sw-dock #map-pane .map-btns { bottom: 64px; }
/* OPEN-OPAQUE-SHIFT-1119 (Phil 19/11 11:16, Vagabond capture "it still have a gaps", after LEAN-GAP-1119): a picture with its own
   ground (data-opaque, the painted bodies) covers the slice and must not move; the open slice's shift rule
   (.group-big.acc .pack-hero.open .bust[data-cut="1"], 6 parts) out-ranked the opaque rule (5 parts), so Hrafn's covering picture was still
   pushed 73 px left and its right edge stopped 42 px short of the slice: the black strip. Higher rank here, no shift. */
.stage-group .group-big.acc .pack-hero.open .bust[data-opaque="1"], .stage-group .group-small.acc .pack-hero.open .bust[data-opaque="1"],
.stage-group .group-big.acc .pack-hero.open .bust[data-cut="0"], .stage-group .group-small.acc .pack-hero.open .bust[data-cut="0"] { transform: none; }

/* DAILY-GO-BUTTON 19/11: under the progress count, a Go that takes the player where the mission is done */
.dm-acts { display: grid; gap: 4px; justify-items: stretch; }
.dm-go { min-height: 34px; min-width: 76px; padding: 0 8px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  background: linear-gradient(160deg, #3d3423 0 55%, #342c1e 55%); border-color: rgba(232, 162, 58, .55); color: #f0c069; }
.dm-go .gi { width: 13px; height: 13px; }
@media (max-width: 420px) { .dm-acts .dm-claim, .dm-go { min-width: 54px; } }
/* BIOME-COINS-1119: the biome x rarity coin (ui.js coinIco) beside a count, inside the star button, in the wallet */
.coin-ico { display: inline-block; width: 22px; height: 22px; flex: none; vertical-align: -6px; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .6)); }
.coin-ico svg, .coin-ico img { display: block; width: 100%; height: 100%; object-fit: contain; }
.coin-ico.in-btn { width: 22px; height: 22px; margin-left: 2px; }
.coin-ico[data-rarity="iconic"] { filter: drop-shadow(0 0 3px rgba(255, 79, 168, .6)); }
.star-up.short { opacity: .55; }
/* ITEM-GRID-1119 (Phil 19/11 13:10: "a real items apparence ... the items grid with not buttom corner juste like in inventory of any game"):
   the card / weapon slots and their choices are square inventory tiles, no rounded corner, no button gradient or press move: the
   painted item fills the tile, its name sits on a dark strip at the foot; selected = four corner brackets (no coloured edge) */
.cmd-slots, .cmd-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 4px; }
.item-tile { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; width: auto; height: auto; min-width: 0; min-height: 0;
  padding: 6px 6px 18px; border-radius: 0; border: 1px solid rgba(255, 255, 255, .07); box-shadow: inset 0 0 18px rgba(0, 0, 0, .55);
  background: radial-gradient(75% 70% at 50% 42%, #2a3337, #141a1d 78%); overflow: hidden; translate: none; }
button.item-tile:not(:disabled):active { translate: none; filter: brightness(1.15); }
button.item-tile:not(.on):not(.open):hover { background: radial-gradient(75% 70% at 50% 42%, #34403f, #161d20 78%); }
.item-tile .item-art { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); pointer-events: none; }
.item-tile > .ico { width: 26px; height: 26px; opacity: .8; }
.item-tile::after { content: attr(data-l); position: absolute; left: 2px; right: 2px; bottom: 2px; padding: 2px 3px; font-size: 10.5px; line-height: 14px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(6, 9, 10, .78); color: #d9dfe1; opacity: 1; max-width: none; }
/* ITEM-BRACKETS-1120: the FIRST background layer is drawn on top: the brackets come first, the tile's glow last (it was first
   and covered them: the chosen tile never showed its corners) */
.item-tile.on, .item-tile.open { background:
  linear-gradient(var(--self), var(--self)) 0 0 / 12px 2px no-repeat, linear-gradient(var(--self), var(--self)) 0 0 / 2px 12px no-repeat,
  linear-gradient(var(--self), var(--self)) 100% 0 / 12px 2px no-repeat, linear-gradient(var(--self), var(--self)) 100% 0 / 2px 12px no-repeat,
  linear-gradient(var(--self), var(--self)) 0 100% / 12px 2px no-repeat, linear-gradient(var(--self), var(--self)) 0 100% / 2px 12px no-repeat,
  linear-gradient(var(--self), var(--self)) 100% 100% / 12px 2px no-repeat, linear-gradient(var(--self), var(--self)) 100% 100% / 2px 12px no-repeat,
  radial-gradient(75% 70% at 50% 42%, #2c3d3a, #121a1b 78%);
  background-origin: border-box; outline: none; }
.item-tile.on { background-size: 12px 2px, 2px 12px, 12px 2px, 2px 12px, 12px 2px, 2px 12px, 12px 2px, 2px 12px, auto; }
.item-tile.empty { border-style: dashed; }
.item-tile.empty:not(.open):not(.on) { background: #12171a; }
.item-tile.open, .item-tile.on { opacity: 1; }   /* ITEM-BRACKETS-1120: .cmd-slot.empty dims to .8, an open slot's brackets stay full; the name strip is inset 2 px so the bottom brackets show */   /* ITEM-BRACKETS-1120: an open empty slot keeps its brackets */
.item-tile.locked .item-art { filter: grayscale(1) brightness(.45); }
.item-tile .item-lock { position: absolute; inset: 0 0 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #e6e9ea; text-shadow: 0 1px 2px #000; }
.item-tile.innate .item-lock { inset: auto 3px 20px auto; }
.item-tile .face.tiny { position: absolute; top: 3px; right: 3px; }
/* ITEM-ART-OTHER-PLACES 20/11: the action cards of the camp / scan sheet (field.js), same tiles, smaller (the sheet holds troops too) */
.field-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; }
.field-cards .item-tile { padding: 4px 4px 16px; }
.field-cards .item-tile::after { font-size: 10px; line-height: 13px; }
/* ITEM-TILES-SHEET-WORDS 20/11: skills / hidden / rules = round symbols, no words (the words live in the tips) */
.field-row { display: flex; align-items: center; gap: 6px; min-height: 34px; }
.field-skills { display: flex; gap: 6px; flex: 1; min-width: 0; }
.field-sym { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .06); color: #8d989c; flex: none; }
.field-sym .ico { width: 18px; height: 18px; }
.field-sym.on { background: rgba(43, 181, 160, .22); color: var(--self); box-shadow: 0 0 0 1px rgba(43, 181, 160, .55); }
.field-sym.innate::after { content: ''; position: absolute; right: 1px; bottom: 1px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.field-hide input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.field-row { justify-content: flex-end; }
.field-sym .field-lock { display: none; position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: #1b2225; align-items: center; justify-content: center; }
.field-sym .field-lock .ico { width: 10px; height: 10px; }
.field-sym:not(.has):not(.field-help) .field-lock { display: inline-flex; }
/* COIN-WALLET-VIEW 20/11: the coins held, as inventory tiles in the Inventory (count on the foot strip) */
.inv-coins { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; }
.inv-coin .inv-coin-ico { width: 78%; height: 78%; }
.inv-coin .inv-coin-ico img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); }
.inv-coin::after { font-weight: 700; color: #f1d27a; }

/* COIN-WALLET-OPEN-BY-CODE (20/11): the commander card's coin chip is a tap into the Inventory; the coin it lands on glows a moment */
button.stat.coin-link { background: none; border: 0; padding: 0 2px; min-height: 0; font: inherit; color: inherit; cursor: pointer; }
button.stat.coin-link:hover { filter: brightness(1.25); }
.inv-coin.focus { animation: coinFocus 1.6s ease-out; }
@keyframes coinFocus { 0%, 40% { box-shadow: 0 0 0 2px #f0c060, 0 0 18px rgba(240, 192, 96, .7); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .inv-coin.focus { animation: none; outline: 2px solid #f0c060; } }
/* FENCE-SIDE-FORM-FOLD (20/11): on a phone the crew form (squad, sliders, price, Send) fits the screen: while it is open the
   sheet's own lines and symbols step aside (they come back when the sheet is drawn again) */
@media (max-width: 560px) {
  #sheet:has(.boundary-form) > .sheet-info, #sheet:has(.boundary-form) > .btn-row, .boundary-form > [data-testid=boundary-line] { display: none; }
}

/* Rune Circle: prices and consequences stay readable on a narrow city sheet. */
.rune-workshop label { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.rune-workshop select { width: 100%; min-width: 0; }
.rune-workshop p { margin: 10px 0; }
.rune-workshop button { max-width: 100%; white-space: normal; }
.rune-steward { border-top: 1px solid var(--line, #3b4744); padding-top: 14px; margin-top: 18px; }

/* Equipment inventory: artwork is out of grid sizing, so rows stay square and compact. */
.cmd-cards { flex-wrap: nowrap; justify-content: flex-start; }
.cmd-slots, .cmd-choices, .inv-item-grid { align-items: start; align-content: start; grid-auto-rows: min-content; }
.item-tile .item-art { position: absolute; inset: 6px 6px 20px; width: calc(100% - 12px); height: calc(100% - 26px); }
.cmd-slots > .item-tile, .cmd-choices > .item-tile { width: 100%; height: auto; aspect-ratio: 1; }
.inv-tabs { display: flex; gap: 3px; padding: 4px 10px 8px; flex: none; }
.inv-tabs button { flex: 1; min-width: 0; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; min-height: 48px; }
.inv-tabs button { justify-content: center; }
.inv-tabs button .gi { width: 22px; height: 22px; }   /* INV-TABS-GLYPHS 23/11: the word went to the tip, the glyph carries the tab */
.inv-tabs button.on { color: var(--self); border-color: var(--self); background: #203c38; }
.inv-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.inv-item-detail { margin-top: 10px; padding: 10px; background: #172125; border-top: 1px solid #40534e; }
.inv-item-detail p { margin: 6px 0; }
.inv-equip-controls { display: flex; gap: 6px; margin: 10px 0; }
.inv-equip-controls select { flex: 1; min-width: 0; }
.inv-holder { font-size: 12px; color: var(--dim); }
.rune-workshop { padding: 10px; }
.rune-workshop .rune-selectors { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.rune-workshop label { margin: 6px 0; font-size: 12px; }
.rune-workshop p { margin: 6px 0; font-size: 12px; }
.rune-flow, .rune-price { display: flex; align-items: center; gap: 5px; margin: 6px 0; color: var(--dim); }
.rune-flow > .gi { width: 16px; height: 16px; }
.rune-preview { display: flex; gap: 12px; align-items: center; margin: 10px 0; background: #142124; border: 1px solid #3a504a; padding: 8px; }
.rune-portrait { width: 80px; height: 90px; flex: none; position: relative; overflow: hidden; container-type: size; background: #101719; }
.rune-item-art { width: 100%; height: 100%; object-fit: contain; }
.rune-summary { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rune-summary > strong { font-size: 16px; }
.rune-coin-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.rune-coin-row small { display: block; font-size: 11px; color: var(--dim); }
.rune-coin-art { width: 42px; height: 42px; }
.rune-coin-row progress { width: 62px; height: 8px; margin-left: auto; accent-color: #d9b85d; }
.rune-gear-coin { position: relative; width: 42px; height: 42px; flex: none; border-radius: 50%; border: 2px solid #c5a55a; background: #3d3220; }
.rune-gear-coin img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.rune-gear-coin .gi { position: absolute; bottom: -2px; right: -4px; width: 16px; height: 16px; color: #f1d27a; }
.rune-workshop .rune-steward { padding-top: 8px; margin-top: 10px; }

.inv-box:not(.inv-opening) { animation: none; }
.gear-upgrade-art { width: 28px; height: 28px; object-fit: contain; }
.gear-inventory-link { align-self: flex-end; }
.gear-stars { gap: 5px 8px; padding-top: 6px; border-top: 1px solid #3b4744; }

/* Manual meals: one bounded prompt, no perpetual animation. */
.city-meal-prompt { display:flex; align-items:center; gap:8px; max-width:calc(100% - 104px); padding:9px 12px; text-align:left; color:#fff0cf; background:#25352ef2; border:1px solid #ab8b4d; border-radius:4px; box-shadow:0 3px 12px #0005; pointer-events:auto; }
.city-meal-prompt[hidden] { display:none; }
.city-meal-prompt span { display:grid; gap:2px; }
.city-meal-prompt strong { font-size:13px; }
.city-meal-prompt small { font-size:11px; color:#d4d7bc; }
.meal-status { display:grid; gap:5px; margin:9px 0; padding:8px 0; border-top:1px solid #ffffff20; border-bottom:1px solid #ffffff20; font-size:12px; }
.meal-feed { display:inline-flex; align-items:center; justify-content:center; gap:5px; min-height:44px; white-space:nowrap; padding:7px 10px; }
#city-ctx.bubbles .meal-feed { width:auto; min-width:90px; border-radius:4px; }
#city-ctx.bubbles { max-width: calc(100% - 8px); flex-wrap: wrap; justify-content: center; }

/* The clock always hangs from the scene edge. Transient controls take their own rows below it. */
.scene-hud { position: absolute; inset: 0 0 auto; z-index: 6; display: flex; flex-direction: column;
  align-items: center; gap: 5px; pointer-events: none; }
.sky-clock { --dial-ink: #ffce70; position: relative; width: 170px; height: 63px; overflow: hidden;
  color: var(--dial-ink); pointer-events: none; text-align: center; font: 600 11px/1.15 system-ui; }
.sky-clock[hidden] { display: none; }
.sky-dial { position: absolute; width: 144px; height: 144px; left: 13px; top: -108px; border-radius: 50%;
  box-sizing: border-box; border: 3px double var(--dial-ink); background: #182422eb;
  box-shadow: 0 1px 3px #0009; }
.sky-dial::before { content: ''; position: absolute; inset: 1px; border-radius: 50%;
  background: repeating-conic-gradient(from var(--orbit), var(--dial-ink) 0deg 1deg, transparent 1deg 10deg);
  mask: radial-gradient(closest-side, transparent calc(100% - 5px), black calc(100% - 4px)); }
.sky-dial i { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px;
  display: grid; place-items: center; font: 24px/1 system-ui; transform: translate(-50%, -50%) rotate(var(--orbit)) translateY(84px) rotate(calc(-1 * var(--orbit)));
  text-shadow: 0 1px 3px #111, 0 0 3px #111; }
.sky-legend { position: relative; display: inline-block; margin-top: 1px; color: #fff2ce; }
.sky-clock small { display: block; font-size: 10px; }
.sky-clock[data-phase=night] { --dial-ink: #c7d9ff; }
.sky-clock[data-phase=blood] { --dial-ink: #ff8b7f; }
.sky-clock[data-phase=blood] .sky-dial { background: #491a21ef; }
#city-pane:has(.sky-clock[data-phase=night]:not([hidden])) #city { filter: brightness(.78) saturate(.83); }
#city-pane:has(.sky-clock[data-phase=blood]:not([hidden])) #city { filter: brightness(.78) sepia(.23) saturate(.84); }

/* Horse Run: keep controls readable beside the paid skip on narrow march sheets. */
.horse-run { flex: none; white-space: nowrap; overflow-wrap: normal; min-height: 44px; }
.march-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.march-actions .horse-run { flex-direction: column; gap: 2px; font-size: 12px; }
.march-btns:has(.horse-run) { flex-wrap: wrap; }
.march-btns:has(.horse-run) [data-testid="march-speedup"] { flex: 1 0 100%; order: 2; white-space: nowrap; overflow-wrap: normal; }
/* RUSH-ON-SITE-1118: the gem rush on a building / fence site, right of its hammer + time (views/city.js rushSites places it on every draw) */
#city-pane .city-rush { position: absolute; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 1px; transform: translate(0, -18px); pointer-events: none; }
#city-pane .city-rush button { pointer-events: auto; flex: none; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; margin: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); touch-action: manipulation; }
#city-pane .city-rush button svg { width: 20px; height: 20px; }
#city-pane .city-rush button[data-armed] { outline: 2px solid #ffe08a; outline-offset: 1px; }
#city-pane .city-rush .rush-price { display: flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; white-space: nowrap; }
#city-pane .city-rush .rush-price svg, #city-pane .city-rush .rush-price img { width: 12px; height: 12px; }

.kitchen-menu { display:grid; gap:6px; width:100%; min-width:0; }
.kitchen-recipe { display:grid; gap:4px; padding:7px 0; border-bottom:1px solid currentColor; }
.kitchen-recipe button,.meal-choice { min-height:44px; }
.meal-choice { display:grid; text-align:start; white-space:normal; gap:2px; }
.meal-status > .row:has(.kitchen-menu) { flex-direction:column; align-items:stretch; }
.with-thumb:has(> .kitchen-menu) > .thumb,
.with-thumb:has(.meal-choice) > .thumb { grid-row:1; height:42px; }
.with-thumb > .kitchen-menu,
.with-thumb > .meal-status:has(.meal-choice) { grid-column:1 / -1; }
.kitchen-recipe { border-bottom-color:color-mix(in srgb,currentColor 22%,transparent); }
/* RANCH-LIST-PICTURES (Phil 23/11: "why i dont see the image"): the animal's own sprite (first frame of its idle strip) left of its row */
.kitchen-recipe.ranch-row { grid-template-columns:70px minmax(0,1fr); column-gap:8px; align-items:center; }
.kitchen-recipe.ranch-row > :not(.ranch-pic) { grid-column:2; }
.ranch-pic { grid-row:1 / span 3; grid-column:1; justify-self:center; background-repeat:no-repeat; background-position:0 0; image-rendering:pixelated; }
.ranch-pic.cow { width:68px; height:44px; background-image:url(assets/livestock/cow-idle.webp); background-size:270px 44px; image-rendering:auto; }
.ranch-pic.sheep { width:62px; height:41px; background-image:url(assets/livestock/sheep-idle.webp); background-size:248px 41px; }
.ranch-pic.pig { width:64px; height:32px; background-image:url(assets/livestock/pig-idle.webp); background-size:320px 32px; }
.ranch-pic.chick { width:58px; height:50px; background-image:url(assets/livestock/chick-idle.webp); background-size:464px 50px; }
/* RANCH-PRODUCE-1123: what one animal leaves on the grass: its picture, the food it is worth, how often */
.ranch-gives { gap:4px; align-items:center; font-size:12px; }
.ranch-item { display:inline-block; background-repeat:no-repeat; background-size:contain; background-position:center; image-rendering:pixelated; }
.ranch-item.milk { width:14px; height:18px; background-image:url(assets/livestock/milk.webp); }
.ranch-item.truffle { width:14px; height:11px; background-image:url(assets/livestock/truffle.webp); }
.ranch-item.egg { width:12px; height:12px; background-image:url(assets/livestock/egg.webp); }
body.busy .kitchen-recipe button { pointer-events:none; opacity:.65; }

.quarry-rank { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .2rem .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.rank-builds { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:4px; }
.rank-builds img { width:30px; height:30px; object-fit:contain; }
/* STONE-CATALOGUE-1124: one stone build = its picture, its symbols, its price, the lock */
.card.stone-build { display:flex; gap:10px; align-items:flex-start; }
.stone-build .stone-pic { width:64px; height:72px; flex:none; object-fit:contain; }
.stone-build.locked .stone-pic { filter:brightness(.62) saturate(.7); }
.stone-build .stone-body { flex:1 1 auto; min-width:0; }
.stone-build .stone-head { display:flex; justify-content:space-between; gap:8px; }
.stone-build .stone-count { font-variant-numeric:tabular-nums; }
.stone-build .stats { margin:3px 0 0; }
.stone-build .stone-fx { color:#8fe08a; font-weight:700; }
.stone-build .why-text .gi { width:13px; height:13px; margin-right:4px; vertical-align:-2px; }
.stone-build .btn-row { margin-top:6px; flex-wrap:wrap; }
.worker-name { display:flex; align-items:center; gap:.45rem; }
.worker-portrait { width:2.8rem; height:2.8rem; object-fit:contain; flex:none; }
.quarry-rank > button { grid-column: 2; grid-row: 1 / 3; min-width: 44px; min-height: 44px; }
.quarry-rank > .stats { grid-column: 1; margin: 0; }

.village-combos { position:absolute; top:5px; left:5px; right:calc(50% + 90px);
  display:flex; flex-direction:column; align-items:flex-start; gap:4px; color:#f6f2df; pointer-events:none; }
.village-combos[hidden], .village-spark[hidden] { display:none; }
.village-chain, .village-buff, .village-receipt { position:relative; display:inline-flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:5px;
  max-width:100%; padding:5px 9px; overflow:hidden; border:1px solid #9aaf9c80; border-radius:4px; background:#162b26ed;
  box-shadow:0 2px 8px #101a1599; font-size:12px; font-weight:650; line-height:1.2; font-variant-numeric:tabular-nums; }
.village-chain { --combo-ink:#b0f1dc; padding-bottom:7px; color:var(--combo-ink); }
.village-chain.feed, .village-buff { --combo-ink:#ffdb8a; color:var(--combo-ink); border-color:#c49c5380; background:#332c1bed; }
.village-chain b { color:white; font-size:14px; }
.village-chain .gi, .village-buff .gi, .village-receipt .gi { width:15px; height:15px; }
.village-buff .cd { color:#f5efdc; font-size:11px; }
.village-window { position:absolute; inset:auto 0 0; height:3px; background:var(--combo-ink); transform-origin:left; animation:village-window var(--remaining) linear forwards; }
@keyframes village-window { from { transform:scaleX(var(--fraction)); } to { transform:scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .village-window { animation-timing-function:steps(3,end); }
}
.village-receipt b { display:inline-flex; align-items:center; gap:2px; color:#b0f1dc; }
.village-receipt b img { height:14px; width:14px; object-fit:contain; }
button.village-spark { position:absolute; z-index:5; width:46px; height:46px; min-width:46px; min-height:46px; padding:0; margin:0;
  transform:translate(-50%,-50%); display:grid; align-content:center; justify-items:center; gap:0; border:0; background:none; box-shadow:none;
  touch-action:manipulation; }
.village-spark i { display:block; width:31px; height:31px; border-radius:50%; background:radial-gradient(circle,#faffdb 1%,#b3f7c9 12%,#31977f 43%,#132f2b 63%,#9ae2bc 66%,#123b2d 75%);
  box-shadow:0 0 0 1px #183e32,0 0 9px #a1faab; }
.village-spark i::after { content:''; display:block; width:100%; height:100%; background:#fff9d7;
  clip-path:polygon(50% 4%,58% 37%,88% 50%,58% 60%,50% 96%,41% 61%,12% 50%,41% 39%); }
.village-spark small { padding:1px 4px; margin-top:-3px; color:#fff8d9; background:#183c30; border-radius:3px; font-size:10px; font-weight:bold; line-height:1.1; }
@media (prefers-reduced-motion: no-preference) {
  .village-spark i { animation:village-spark-in .19s ease-out; }
  @keyframes village-spark-in { from { opacity:.4; transform:scale(.58); } to { opacity:1; transform:scale(1); } }
}

.server-picker { display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin:.45rem 0; }
.server-picker select { min-height:44px; padding:0 .65rem; font:inherit; color:inherit; background:var(--panel, #233036); border:1px solid currentColor; border-radius:4px; }
#login-server select { color:#241c15; background:#fffaf1; border:2px solid #241c15; }
/* STATUE-INFO-1122: a tapped statue / stone structure shows its name and bonus over its symbols */
.city-ctx.bubbles.stone-card { flex-direction: column; align-items: center; gap: 8px; }
.city-ctx .stone-info { min-width: 170px; max-width: 240px; padding: 8px 12px; background: rgba(22, 28, 30, .94); border: 2px solid var(--gold); border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, .55); text-align: center; }
.city-ctx .stone-title { font-weight: 800; font-size: 15px; color: #ffe194; }
.city-ctx .stone-mat { font-size: 12px; opacity: .75; margin-bottom: 4px; }
.city-ctx .stone-fx { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; }
.city-ctx .stone-fx b { color: #8fe08a; white-space: nowrap; flex: none; }
.city-ctx .stone-fx svg { width: 16px; height: 16px; flex: none; }
.city-ctx .stone-fx.none { opacity: .7; }
.city-ctx .stone-btns { display: flex; gap: 6px; }
/* WORK-DOCK-1122 (Phil: "a ton of progression bar ... regroupe them ... at buttome left ... x10 miner/woodcutter ... arrow down
   to see track each personne"): zoomed out, the workers' countdowns fold into this dock; zoomed in they stand over the workers */
#city-pane .work-dock { position: absolute; left: 8px; bottom: 8px; z-index: 5; display: flex; flex-direction: column-reverse; gap: 4px; max-height: 60%; pointer-events: none; }
#city-pane .work-dock[hidden] { display: none; }
#city-pane .work-dock .wd-row { pointer-events: auto; display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px 0 8px; border: 1px solid rgba(224, 178, 58, .6); border-radius: 18px; background: rgba(16, 20, 19, .86); color: #ffe194; font-weight: 800; font-size: 14px; }
#city-pane .work-dock .wd-row svg { width: 18px; height: 18px; flex: none; }
#city-pane .work-dock .wd-row .wd-next { font-weight: 600; font-size: 12px; color: #f2f4ee; opacity: .8; }
#city-pane .work-dock .wd-row .wd-arrow { transition: transform .15s; }
#city-pane .work-dock .wd-row[aria-expanded="true"] .wd-arrow { transform: rotate(180deg); }
#city-pane .work-dock .wd-list { pointer-events: auto; display: flex; flex-direction: column; gap: 2px; max-height: 210px; overflow-y: auto; padding: 4px; border-radius: 10px; background: rgba(16, 20, 19, .86); }
#city-pane .work-dock .wd-list[hidden] { display: none; }
#city-pane .work-dock .wd-item { display: grid; grid-template-columns: 18px 44px 70px; align-items: center; gap: 6px; min-height: 30px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: #f2f4ee; font-size: 12px; font-weight: 700; text-align: left; }
#city-pane .work-dock .wd-item:active { background: #3a3220; }
#city-pane .work-dock .wd-item svg { width: 15px; height: 15px; color: #ffe194; }
#city-pane .work-dock .wd-bar { height: 4px; border-radius: 2px; background: #525953; overflow: hidden; }
#city-pane .work-dock .wd-bar i { display: block; height: 100%; background: #e0b23a; }

/* HIDDEN-SKILLS-REVEAL-1124 (js/views/skill-reveal.js): a hidden skill wakes. Full screen, the commander's own card picture out of the dark */
.skill-reveal { position: fixed; inset: 0; z-index: 120; overflow: hidden; background: #060305; cursor: pointer; outline: 0; touch-action: none; }
.sr-pic, .sr-pic img, .sr-glow, .sr-shade, .sr-embers { position: absolute; inset: 0; width: 100%; height: 100%; }
.sr-embers, .sr-glow, .sr-shade { pointer-events: none; }
.sr-pic img { object-fit: cover; animation: sr-wake 2.6s cubic-bezier(.2, .6, .2, 1) both; }
.sr-glow { background: radial-gradient(75% 46% at 50% 74%, rgba(255, 32, 56, .5), rgba(160, 0, 26, .22) 46%, transparent 72%); mix-blend-mode: screen; animation: sr-glow 2.6s ease-out both; }
.sr-shade { background: linear-gradient(180deg, rgba(6, 3, 5, .62), transparent 22%, transparent 50%, rgba(6, 3, 5, .78) 76%, #060305 98%); }
.sr-low { position: absolute; left: 0; right: 0; bottom: calc(7vh + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 18px; text-align: center; color: #ffe9e4; text-shadow: 0 2px 4px #000, 0 0 18px rgba(255, 30, 60, .8); }
.sr-sign { width: 96px; height: 96px; display: grid; place-items: center; color: #ffd9d2; filter: drop-shadow(0 0 6px #ff2c48) drop-shadow(0 0 22px rgba(255, 20, 50, .9)); animation: sr-sign .9s 1.1s cubic-bezier(.2, 1.4, .4, 1) both; }
.sr-sign svg, .sr-sign img { width: 84px; height: 84px; }
.sr-name { font-family: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; font-size: clamp(30px, 8.6vw, 52px); line-height: 1.02; animation: sr-name .8s 1.6s ease-out both; }
.sr-fx { display: flex; gap: 14px; font-size: 20px; font-weight: 800; animation: sr-name .7s 2s ease-out both; }
.sr-fx svg { width: 22px; height: 22px; }
.skill-reveal.still * { animation: none; }
@keyframes sr-wake { 0% { transform: scale(1.16); filter: brightness(0) saturate(.2); } 45% { filter: brightness(.45) saturate(.5); } 100% { transform: none; filter: none; } }
@keyframes sr-glow { 0% { opacity: 0; } 55% { opacity: 1; } 100% { opacity: .62; } }
@keyframes sr-sign { 0% { opacity: 0; transform: scale(2.4) rotate(-14deg); } 100% { opacity: 1; transform: none; } }
@keyframes sr-name { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }
.sr-back { display: none; }
@media (min-width: 700px) {   /* a wide screen: her whole height, its sides melting into its own dark blurred copy */
  .sr-back { display: block; position: absolute; inset: -60px; background-size: cover; background-position: 50% 30%; filter: blur(44px) brightness(.34); animation: sr-glow 2.6s ease-out both; }
  .sr-pic img { width: auto; aspect-ratio: 9 / 16; left: 0; right: 0; margin: 0 auto; -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); }
}
/* GUEST-PLAY-1124: the Save panel of an unsaved city (inside the player menu box) */
.pm-save { border-color: var(--self); }
.pm-save .badge { position: static; }
.save-form { display: grid; gap: 8px; }
.save-form input { min-height: 44px; width: 100%; box-sizing: border-box; }
.save-form button { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.save-form button svg { width: 20px; height: 20px; }
.save-form .err-text:empty { display: none; }
.save-why { margin: 0; }
.save-google { display: flex; justify-content: center; min-height: 44px; }
/* AVATAR-1124: profile picture */
.pm-face { position: relative; padding: 0; border: 0; background: none; min-width: 52px; min-height: 52px; flex: none; }
.pm-face .face { display: block; }
.pm-face > :not(.face) { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; border-radius: 4px; background: #10151a; }
.pm-faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 50dvh; overflow-y: auto; padding: 4px; }
.pm-pick { padding: 0; border: 2px solid transparent; background: none; aspect-ratio: 1; min-height: 64px; }
.pm-pick .face { width: 100%; height: 100%; }
.pm-pick.on { border-color: #ffd23c; }
#title-server { margin-top: 10px; }
#title-server .server-picker > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#title-server select { color: #241c15; background: #fffaf1; border: 2px solid #241c15; }
