/* Kenjō shared map marks (docs/design/MARKS_SPEC.md). Faith = round seal on a stem, economy = square cartouche.
   Shape = layer family, glyph = category, fill = category colour, ring = importance, state = ruin/reduced/boom/decline.
   Palette: validated with the dataviz validator against the map's land and sea in Day and Dusk (see FAITH_MAP_LOG
   "Marks"); identity never rests on colour alone (glyph + shape). Every mark carries a parchment rim so even the
   ink-dark fills separate from the dark relief. Sizes here must match SZ in marks.mjs (the boxes are not measured). */
:root {
  /* faith */
  --mk-shrine: #bc634d; --mk-shrine-ink: #f6eee0;
  --mk-temple: #42494a; --mk-temple-ink: #e6d6a8;
  --mk-mountain: #aba05c; --mk-mountain-ink: #1d2321;
  --mk-church: #ebe4d2; --mk-church-ink: #222827;
  /* economy */
  --mk-coin: #b88a3b; --mk-coin-ink: #1e211d;
  --mk-arms: #5b7c9f; --mk-arms-ink: #f1ece0;
  --mk-timber: #63794c; --mk-timber-ink: #f1ece0;
  --mk-koku: #ece6a6; --mk-koku-ink: #262a24;
  --mk-treasures: #7e4a63; --mk-treasures-ink: #f4ebe4;
  --mk-hulls: #61a6a3; --mk-hulls-ink: #172321;
  --mk-trait: #9a7f7a; --mk-trait-ink: #1c1b1a;
  --mk-goods: #d2c4ae; --mk-goods-ink: #222422;   /* crafts and crops (ceramics, lacquer, paper, sake, tea, cotton, hemp, medicines) */
  /* glyph tints over their category (coin = precious metals only): gold / silver / copper; indigo over goods */
  --mk-gold: #c9a046; --mk-silver: #aeb9c2; --mk-copper: #b07150; --mk-indigo: #34507f; --mk-indigo-ink: #ece7dc;
  /* the frame */
  --mk-rim: rgba(238,230,210,.92); --mk-gilt: #dcbc6a; --mk-gilt-hi: #f0d68e; --mk-ring-ink: #10161a; --mk-halo: rgba(10,14,13,.55);
  --mk-pip: #e9d38a; --mk-stem: rgba(232,226,210,.82); --mk-glow: rgba(240,196,110,.55);
}
body[data-look=dusk] {
  --mk-shrine: #a95842; --mk-temple: #3d4140; --mk-mountain: #9c8f55; --mk-church: #ddd2bb;
  --mk-coin: #a87d38; --mk-arms: #52708f; --mk-timber: #5c6e47; --mk-koku: #dcd697; --mk-treasures: #73455b; --mk-hulls: #5a9592; --mk-trait: #8a716d; --mk-goods: #c0b29c; --mk-indigo: #2f466f;
  --mk-gold: #b8913f; --mk-silver: #9ea8b0; --mk-copper: #a06848;
  --mk-rim: rgba(226,210,174,.88); --mk-gilt: #d8b16a; --mk-stem: rgba(222,208,176,.78); --mk-pip: #e8c97e;
}

/* root + one container per layer (z from opts.z; castles' and towns' tags, later in the DOM, paint above) */
.mk-root { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.mk-layer { position: absolute; inset: 0; transition: opacity .3s; --dim: 0; }
.mk-layer.off { opacity: 0; }

/* one mark: the anchor is the element's origin (seal: the stem's foot; cartouche: the centre) */
.mk { position: absolute; left: 0; top: 0; width: 1px; height: 1px; will-change: transform; --d: 17px; --e: 0;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; color: var(--g, #1d2321); }
.mk.on { opacity: calc(1 - var(--dim) * (1 - var(--e)) * .72); visibility: visible; transition: opacity .3s; }
.mk.t1 { --d: 18px; } .mk.t3 { --d: 16px; }
.mk-root.phone .mk { --d: 21px; } .mk-root.phone .mk.t1 { --d: 22px; } .mk-root.phone .mk.t3 { --d: 20px; }
.mk .b { position: absolute; width: calc(var(--d) * 1.36); height: calc(var(--d) * 1.36); overflow: visible;
  filter: drop-shadow(0 .6px 1.1px var(--mk-halo)); transition: transform .18s var(--ease, ease-out); }
.mk.seal .b { left: calc(var(--d) * -.68); bottom: calc(var(--d) * .34); }    /* the roundel sits on its stem */
.mk.cart .b { left: calc(var(--d) * -.68); top: calc(var(--d) * -.68); }
.mk .fl { fill: var(--c, #888); stroke: var(--mk-rim); stroke-width: 1.15; }
.mk .gl { stroke-width: 2.3; }
.mk .rg { fill: none; stroke: none; stroke-width: 1.35; }
.mk.t1 .rg { stroke: var(--mk-gilt); stroke-width: 2.1; }   /* landmarks: a firm gilt band, national vs regional at a glance */
.mk.t2 .rg { stroke: var(--mk-ring-ink); stroke-width: 1.1; opacity: .85; }
.mk.rgold .rg { stroke: var(--mk-gilt); stroke-width: 1.8; opacity: 1; }
/* the stem: a hairline from the roundel to a small foot dot on the place */
.mk.seal::before { content: ''; position: absolute; left: -.5px; bottom: 1px; width: 1px; height: calc(var(--d) * .36 - 1px); background: var(--mk-stem); }
.mk.seal::after { content: ''; position: absolute; left: -1.5px; bottom: -1.5px; width: 3px; height: 3px; border-radius: 50%; background: var(--mk-stem); box-shadow: 0 0 1.5px var(--mk-halo); }
/* event pip: a small gilt dot at the upper right */
.mk .pip { display: none; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--mk-pip); box-shadow: 0 0 0 1px rgba(16,20,19,.85); }
.mk.pp .pip { display: block; }
.mk.seal .pip { left: calc(var(--d) * .36); bottom: calc(var(--d) * 1.22); }
.mk.cart .pip { left: calc(var(--d) * .36); top: calc(var(--d) * -.6); }
/* minor-mineral sub-pip: tiny tinted dot at the lower right (mercury, tin, sulphur, lead) */
.mk .sub { display: none; position: absolute; width: 5px; height: 5px; border-radius: 1px; box-shadow: 0 0 0 1px rgba(16,20,19,.85); left: calc(var(--d) * .36); top: calc(var(--d) * .26); }
.mk[data-sub] .sub { display: block; }
.mk[data-sub=mercury] .sub { background: #c9c9cf; } .mk[data-sub=tin] .sub { background: #9aa3a6; }
.mk[data-sub=sulphur] .sub { background: #d9c24e; } .mk[data-sub=lead] .sub { background: #6c7378; }
/* states */
.mk.s-ruin .b, .mk.s-decline .b { filter: drop-shadow(0 .6px 1.1px var(--mk-halo)) saturate(.18) brightness(.86); }
.mk.s-ruin .rg, .mk.s-decline .rg { stroke-dasharray: 3.2 2.4; }
.mk.s-ruin.t3 .fl, .mk.s-decline.t3 .fl { stroke-dasharray: 3 2.2; }
.mk.s-reduced .b { filter: drop-shadow(0 .6px 1.1px var(--mk-halo)) saturate(.55) brightness(.92); }
.mk.s-reduced .fl { opacity: .82; }
.mk.s-boom .b { filter: drop-shadow(0 0 3px var(--mk-glow)) drop-shadow(0 .6px 1px var(--mk-halo)); }
/* hover / selection: lift + gilt ring (kept while selected) */
.mk.hl .b, .mk.sel .b { transform: translateY(-2px); }
.mk.hl .rg, .mk.sel .rg { stroke: var(--mk-gilt-hi, var(--mk-gilt)); stroke-width: 2.1; opacity: 1; stroke-dasharray: none; }
.mk.hl { z-index: 2; } .mk.sel { z-index: 1; }
/* group badge (+N): a small ink plate right of the row */
.mk-badge { position: absolute; left: 0; top: 0; will-change: transform; font: 600 9.5px/1 var(--f-latin, serif); letter-spacing: .04em; color: #e8e2d2;
  background: rgba(20,26,25,.86); border: 1px solid var(--mk-rim); border-radius: 3px; padding: 2px 3px 2px; opacity: 0; transition: opacity .3s; white-space: nowrap; }
.mk-badge.on { opacity: 1; }
.mk-root.phone .mk-badge { font-size: 11px; }
